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

namespace M3UA__Types {

/* Literal string constants */

const unsigned char os_21_octets[] = { 0, 0 },
os_22_octets[] = { 0, 1 },
os_6_octets[] = { 0, 4 },
os_1_octets[] = { 0, 6 },
os_4_octets[] = { 0, 7 },
os_12_octets[] = { 0, 9 },
os_13_octets[] = { 0, 11 },
os_0_octets[] = { 0, 12 },
os_15_octets[] = { 0, 11 },
os_5_octets[] = { 0, 17 },
os_2_octets[] = { 0, 18 },
os_8_octets[] = { 0, 19 },
os_23_octets[] = { 1, 1 },
os_3_octets[] = { 2, 0 },
os_24_octets[] = { 2, 1 },
os_25_octets[] = { 2, 2 },
os_26_octets[] = { 2, 3 },
os_11_octets[] = { 2, 4 },
os_10_octets[] = { 2, 5 },
os_9_octets[] = { 2, 6 },
os_14_octets[] = { 2, 10 },
os_16_octets[] = { 2, 11 },
os_17_octets[] = { 2, 12 },
os_18_octets[] = { 2, 14 },
os_7_octets[] = { 2, 16 },
os_19_octets[] = { 2, 18 },
os_20_octets[] = { 2, 19 },
os_27_octets[] = { 3, 1 },
os_28_octets[] = { 3, 2 },
os_29_octets[] = { 3, 3 },
os_30_octets[] = { 3, 4 },
os_31_octets[] = { 3, 5 },
os_32_octets[] = { 3, 6 },
os_33_octets[] = { 4, 1 },
os_34_octets[] = { 4, 2 },
os_35_octets[] = { 4, 3 },
os_36_octets[] = { 4, 4 },
os_37_octets[] = { 9, 1 },
os_38_octets[] = { 9, 2 },
os_39_octets[] = { 9, 3 },
os_40_octets[] = { 9, 4 };
extern const OCTETSTRING os_21(2, os_21_octets),
os_22(2, os_22_octets),
os_6(2, os_6_octets),
os_1(2, os_1_octets),
os_4(2, os_4_octets),
os_12(2, os_12_octets),
os_13(2, os_13_octets),
os_0(2, os_0_octets),
os_15(2, os_15_octets),
os_5(2, os_5_octets),
os_2(2, os_2_octets),
os_8(2, os_8_octets),
os_23(2, os_23_octets),
os_3(2, os_3_octets),
os_24(2, os_24_octets),
os_25(2, os_25_octets),
os_26(2, os_26_octets),
os_11(2, os_11_octets),
os_10(2, os_10_octets),
os_9(2, os_9_octets),
os_14(2, os_14_octets),
os_16(2, os_16_octets),
os_17(2, os_17_octets),
os_18(2, os_18_octets),
os_7(2, os_7_octets),
os_19(2, os_19_octets),
os_20(2, os_20_octets),
os_27(2, os_27_octets),
os_28(2, os_28_octets),
os_29(2, os_29_octets),
os_30(2, os_30_octets),
os_31(2, os_31_octets),
os_32(2, os_32_octets),
os_33(2, os_33_octets),
os_34(2, os_34_octets),
os_35(2, os_35_octets),
os_36(2, os_36_octets),
os_37(2, os_37_octets),
os_38(2, os_38_octets),
os_39(2, os_39_octets),
os_40(2, os_40_octets);
const unsigned char module_checksum[] = { 0x69, 0xfa, 0x7c, 0x7b, 0xaa, 0xe1, 0xbd, 0xef, 0xee, 0x82, 0xd9, 0x07, 0x6d, 0x1f, 0xe3, 0x78 };

/* Global variable definitions */

const XERdescriptor_t       M3UA__OCT0__255_xer_ = { {"M3UA_OCT0_255>\n", "M3UA_OCT0_255>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__OCT0__255_oer_ext_arr_[0] = {};
const int M3UA__OCT0__255_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__OCT0__255_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__OCT0__255_oer_ext_arr_, 0, M3UA__OCT0__255_oer_p_};
const TTCN_Typedescriptor_t M3UA__OCT0__255_descr_ = { "@M3UA_Types.M3UA_OCT0_255", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__OCT0__255_xer_, &OCTETSTRING_json_, &M3UA__OCT0__255_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__OCT0__255_default_coding("RAW");
const XERdescriptor_t       M3UA__Point__Code_mask_xer_ = { {"mask>\n", "mask>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Point__Code_mask_oer_ext_arr_[0] = {};
const int M3UA__Point__Code_mask_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Point__Code_mask_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__Point__Code_mask_oer_ext_arr_, 0, M3UA__Point__Code_mask_oer_p_};
const TTCN_Typedescriptor_t M3UA__Point__Code_mask_descr_ = { "@M3UA_Types.M3UA_Point_Code.mask", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__Point__Code_mask_xer_, &OCTETSTRING_json_, &M3UA__Point__Code_mask_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Point__Code_mask_default_coding("RAW");
const XERdescriptor_t       M3UA__Point__Code_affected__Point__Code_xer_ = { {"affected_Point_Code>\n", "affected_Point_Code>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Point__Code_affected__Point__Code_oer_ext_arr_[0] = {};
const int M3UA__Point__Code_affected__Point__Code_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Point__Code_affected__Point__Code_oer_ = { -1, TRUE, 3, FALSE, 0, 0, M3UA__Point__Code_affected__Point__Code_oer_ext_arr_, 0, M3UA__Point__Code_affected__Point__Code_oer_p_};
const TTCN_Typedescriptor_t M3UA__Point__Code_affected__Point__Code_descr_ = { "@M3UA_Types.M3UA_Point_Code.affected_Point_Code", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &M3UA__Point__Code_affected__Point__Code_xer_, &OCTETSTRING_json_, &M3UA__Point__Code_affected__Point__Code_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Point__Code_affected__Point__Code_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Point__Code_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 M3UA__Point__Code
const TTCN_Typedescriptor_t M3UA__Point__Code_descr_ = { "@M3UA_Types.M3UA_Point_Code", NULL, &M3UA__Point__Code_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Point__Code_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Point__Codes_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 M3UA__Point__Codes
const TTCN_Typedescriptor_t M3UA__Point__Codes_descr_ = { "@M3UA_Types.M3UA_Point_Codes", NULL, &M3UA__Point__Codes_raw_, NULL, NULL, NULL, NULL, NULL, &M3UA__Point__Code_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Point__Codes_0_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Point__Codes_default_coding("RAW");
const XERdescriptor_t       M3UA__Error__Code_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Error__Code_tag_oer_ext_arr_[0] = {};
const int M3UA__Error__Code_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Error__Code_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Error__Code_tag_oer_ext_arr_, 0, M3UA__Error__Code_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Error__Code_tag_descr_ = { "@M3UA_Types.M3UA_Error_Code.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Error__Code_tag_xer_, &OCTETSTRING_json_, &M3UA__Error__Code_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Error__Code_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Error__Code_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Error__Code_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Error__Code_lengthInd_descr_ = { "@M3UA_Types.M3UA_Error_Code.lengthInd", &INTEGER_ber_, &M3UA__Error__Code_lengthInd_raw_, &INTEGER_text_, &M3UA__Error__Code_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Error__Code_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Error__Code_errorCode_xer_ = { {"errorCode>\n", "errorCode>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Error__Code_errorCode_oer_ext_arr_[0] = {};
const int M3UA__Error__Code_errorCode_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Error__Code_errorCode_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Error__Code_errorCode_oer_ext_arr_, 0, M3UA__Error__Code_errorCode_oer_p_};
const TTCN_Typedescriptor_t M3UA__Error__Code_errorCode_descr_ = { "@M3UA_Types.M3UA_Error_Code.errorCode", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Error__Code_errorCode_xer_, &OCTETSTRING_json_, &M3UA__Error__Code_errorCode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Error__Code_errorCode_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Error__Code_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 M3UA__Error__Code
const TTCN_Typedescriptor_t M3UA__Error__Code_descr_ = { "@M3UA_Types.M3UA_Error_Code", NULL, &M3UA__Error__Code_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Error__Code_default_coding("RAW");
const XERdescriptor_t       M3UA__Routing__Context_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Routing__Context_tag_oer_ext_arr_[0] = {};
const int M3UA__Routing__Context_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Routing__Context_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Routing__Context_tag_oer_ext_arr_, 0, M3UA__Routing__Context_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Routing__Context_tag_descr_ = { "@M3UA_Types.M3UA_Routing_Context.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Routing__Context_tag_xer_, &OCTETSTRING_json_, &M3UA__Routing__Context_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Context_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Routing__Context_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Routing__Context_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Routing__Context_lengthInd_descr_ = { "@M3UA_Types.M3UA_Routing_Context.lengthInd", &INTEGER_ber_, &M3UA__Routing__Context_lengthInd_raw_, &INTEGER_text_, &M3UA__Routing__Context_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Context_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Routing__Context_routingContext_xer_ = { {"routingContext>\n", "routingContext>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Routing__Context_routingContext_oer_ext_arr_[0] = {};
const int M3UA__Routing__Context_routingContext_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Routing__Context_routingContext_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__Routing__Context_routingContext_oer_ext_arr_, 0, M3UA__Routing__Context_routingContext_oer_p_};
const TTCN_Typedescriptor_t M3UA__Routing__Context_routingContext_descr_ = { "@M3UA_Types.M3UA_Routing_Context.routingContext", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__Routing__Context_routingContext_xer_, &OCTETSTRING_json_, &M3UA__Routing__Context_routingContext_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Context_routingContext_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Routing__Context_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,32,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__Routing__Context
const TTCN_Typedescriptor_t M3UA__Routing__Context_descr_ = { "@M3UA_Types.M3UA_Routing_Context", NULL, &M3UA__Routing__Context_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Context_default_coding("RAW");
const XERdescriptor_t       M3UA__Affected__Point__Codes_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Affected__Point__Codes_tag_oer_ext_arr_[0] = {};
const int M3UA__Affected__Point__Codes_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Affected__Point__Codes_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Affected__Point__Codes_tag_oer_ext_arr_, 0, M3UA__Affected__Point__Codes_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Affected__Point__Codes_tag_descr_ = { "@M3UA_Types.M3UA_Affected_Point_Codes.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Affected__Point__Codes_tag_xer_, &OCTETSTRING_json_, &M3UA__Affected__Point__Codes_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Affected__Point__Codes_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Affected__Point__Codes_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Affected__Point__Codes_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Affected__Point__Codes_lengthInd_descr_ = { "@M3UA_Types.M3UA_Affected_Point_Codes.lengthInd", &INTEGER_ber_, &M3UA__Affected__Point__Codes_lengthInd_raw_, &INTEGER_text_, &M3UA__Affected__Point__Codes_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Affected__Point__Codes_lengthInd_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Affected__Point__Codes_pointCodes_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Affected__Point__Codes_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 M3UA__Affected__Point__Codes
const TTCN_Typedescriptor_t M3UA__Affected__Point__Codes_descr_ = { "@M3UA_Types.M3UA_Affected_Point_Codes", NULL, &M3UA__Affected__Point__Codes_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Affected__Point__Codes_default_coding("RAW");
const XERdescriptor_t       M3UA__Network__Appearance_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Network__Appearance_tag_oer_ext_arr_[0] = {};
const int M3UA__Network__Appearance_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Network__Appearance_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Network__Appearance_tag_oer_ext_arr_, 0, M3UA__Network__Appearance_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Network__Appearance_tag_descr_ = { "@M3UA_Types.M3UA_Network_Appearance.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Network__Appearance_tag_xer_, &OCTETSTRING_json_, &M3UA__Network__Appearance_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Network__Appearance_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Network__Appearance_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Network__Appearance_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Network__Appearance_lengthInd_descr_ = { "@M3UA_Types.M3UA_Network_Appearance.lengthInd", &INTEGER_ber_, &M3UA__Network__Appearance_lengthInd_raw_, &INTEGER_text_, &M3UA__Network__Appearance_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Network__Appearance_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Network__Appearance_networkAppearance_xer_ = { {"networkAppearance>\n", "networkAppearance>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Network__Appearance_networkAppearance_oer_ext_arr_[0] = {};
const int M3UA__Network__Appearance_networkAppearance_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Network__Appearance_networkAppearance_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Network__Appearance_networkAppearance_oer_ext_arr_, 0, M3UA__Network__Appearance_networkAppearance_oer_p_};
const TTCN_Typedescriptor_t M3UA__Network__Appearance_networkAppearance_descr_ = { "@M3UA_Types.M3UA_Network_Appearance.networkAppearance", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Network__Appearance_networkAppearance_xer_, &OCTETSTRING_json_, &M3UA__Network__Appearance_networkAppearance_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Network__Appearance_networkAppearance_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Network__Appearance_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 M3UA__Network__Appearance
const TTCN_Typedescriptor_t M3UA__Network__Appearance_descr_ = { "@M3UA_Types.M3UA_Network_Appearance", NULL, &M3UA__Network__Appearance_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Network__Appearance_default_coding("RAW");
const XERdescriptor_t       M3UA__Diagnostic__information_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Diagnostic__information_tag_oer_ext_arr_[0] = {};
const int M3UA__Diagnostic__information_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Diagnostic__information_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Diagnostic__information_tag_oer_ext_arr_, 0, M3UA__Diagnostic__information_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Diagnostic__information_tag_descr_ = { "@M3UA_Types.M3UA_Diagnostic_information.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Diagnostic__information_tag_xer_, &OCTETSTRING_json_, &M3UA__Diagnostic__information_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Diagnostic__information_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Diagnostic__information_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Diagnostic__information_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Diagnostic__information_lengthInd_descr_ = { "@M3UA_Types.M3UA_Diagnostic_information.lengthInd", &INTEGER_ber_, &M3UA__Diagnostic__information_lengthInd_raw_, &INTEGER_text_, &M3UA__Diagnostic__information_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Diagnostic__information_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Diagnostic__information_diagnosticInformation_xer_ = { {"diagnosticInformation>\n", "diagnosticInformation>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Diagnostic__information_diagnosticInformation_oer_ext_arr_[0] = {};
const int M3UA__Diagnostic__information_diagnosticInformation_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Diagnostic__information_diagnosticInformation_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__Diagnostic__information_diagnosticInformation_oer_ext_arr_, 0, M3UA__Diagnostic__information_diagnosticInformation_oer_p_};
const TTCN_Typedescriptor_t M3UA__Diagnostic__information_diagnosticInformation_descr_ = { "@M3UA_Types.M3UA_Diagnostic_information.diagnosticInformation", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__Diagnostic__information_diagnosticInformation_xer_, &OCTETSTRING_json_, &M3UA__Diagnostic__information_diagnosticInformation_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Diagnostic__information_diagnosticInformation_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Diagnostic__information_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,32,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__Diagnostic__information
const TTCN_Typedescriptor_t M3UA__Diagnostic__information_descr_ = { "@M3UA_Types.M3UA_Diagnostic_information", NULL, &M3UA__Diagnostic__information_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Diagnostic__information_default_coding("RAW");
const XERdescriptor_t       M3UA__Correlation__ID_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Correlation__ID_tag_oer_ext_arr_[0] = {};
const int M3UA__Correlation__ID_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Correlation__ID_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Correlation__ID_tag_oer_ext_arr_, 0, M3UA__Correlation__ID_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Correlation__ID_tag_descr_ = { "@M3UA_Types.M3UA_Correlation_ID.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Correlation__ID_tag_xer_, &OCTETSTRING_json_, &M3UA__Correlation__ID_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Correlation__ID_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Correlation__ID_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Correlation__ID_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Correlation__ID_lengthInd_descr_ = { "@M3UA_Types.M3UA_Correlation_ID.lengthInd", &INTEGER_ber_, &M3UA__Correlation__ID_lengthInd_raw_, &INTEGER_text_, &M3UA__Correlation__ID_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Correlation__ID_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Correlation__ID_correlationID_xer_ = { {"correlationID>\n", "correlationID>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Correlation__ID_correlationID_oer_ext_arr_[0] = {};
const int M3UA__Correlation__ID_correlationID_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Correlation__ID_correlationID_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Correlation__ID_correlationID_oer_ext_arr_, 0, M3UA__Correlation__ID_correlationID_oer_p_};
const TTCN_Typedescriptor_t M3UA__Correlation__ID_correlationID_descr_ = { "@M3UA_Types.M3UA_Correlation_ID.correlationID", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Correlation__ID_correlationID_xer_, &OCTETSTRING_json_, &M3UA__Correlation__ID_correlationID_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Correlation__ID_correlationID_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Correlation__ID_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 M3UA__Correlation__ID
const TTCN_Typedescriptor_t M3UA__Correlation__ID_descr_ = { "@M3UA_Types.M3UA_Correlation_ID", NULL, &M3UA__Correlation__ID_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Correlation__ID_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_tag_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Protocol__Data_tag_oer_ext_arr_, 0, M3UA__Protocol__Data_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_tag_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_tag_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Protocol__Data_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Protocol__Data_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Protocol__Data_lengthInd_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.lengthInd", &INTEGER_ber_, &M3UA__Protocol__Data_lengthInd_raw_, &INTEGER_text_, &M3UA__Protocol__Data_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_oPC_xer_ = { {"oPC>\n", "oPC>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_oPC_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_oPC_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_oPC_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Protocol__Data_oPC_oer_ext_arr_, 0, M3UA__Protocol__Data_oPC_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_oPC_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.oPC", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_oPC_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_oPC_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_oPC_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_dPC_xer_ = { {"dPC>\n", "dPC>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_dPC_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_dPC_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_dPC_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Protocol__Data_dPC_oer_ext_arr_, 0, M3UA__Protocol__Data_dPC_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_dPC_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.dPC", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_dPC_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_dPC_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_dPC_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_sI_xer_ = { {"sI>\n", "sI>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_sI_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_sI_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_sI_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__Protocol__Data_sI_oer_ext_arr_, 0, M3UA__Protocol__Data_sI_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_sI_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.sI", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_sI_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_sI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_sI_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_nI_xer_ = { {"nI>\n", "nI>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_nI_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_nI_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_nI_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__Protocol__Data_nI_oer_ext_arr_, 0, M3UA__Protocol__Data_nI_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_nI_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.nI", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_nI_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_nI_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_nI_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_mP_xer_ = { {"mP>\n", "mP>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_mP_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_mP_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_mP_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__Protocol__Data_mP_oer_ext_arr_, 0, M3UA__Protocol__Data_mP_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_mP_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.mP", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_mP_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_mP_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_mP_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_sLS_xer_ = { {"sLS>\n", "sLS>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_sLS_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_sLS_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_sLS_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__Protocol__Data_sLS_oer_ext_arr_, 0, M3UA__Protocol__Data_sLS_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_sLS_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.sLS", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_sLS_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_sLS_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_sLS_default_coding("RAW");
const XERdescriptor_t       M3UA__Protocol__Data_userProtocolData_xer_ = { {"userProtocolData>\n", "userProtocolData>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Protocol__Data_userProtocolData_oer_ext_arr_[0] = {};
const int M3UA__Protocol__Data_userProtocolData_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Protocol__Data_userProtocolData_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__Protocol__Data_userProtocolData_oer_ext_arr_, 0, M3UA__Protocol__Data_userProtocolData_oer_p_};
const TTCN_Typedescriptor_t M3UA__Protocol__Data_userProtocolData_descr_ = { "@M3UA_Types.M3UA_Protocol_Data.userProtocolData", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__Protocol__Data_userProtocolData_xer_, &OCTETSTRING_json_, &M3UA__Protocol__Data_userProtocolData_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_userProtocolData_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Protocol__Data_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,32,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__Protocol__Data
const TTCN_Typedescriptor_t M3UA__Protocol__Data_descr_ = { "@M3UA_Types.M3UA_Protocol_Data", NULL, &M3UA__Protocol__Data_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Protocol__Data_default_coding("RAW");
const XERdescriptor_t       M3UA__Info__String_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Info__String_tag_oer_ext_arr_[0] = {};
const int M3UA__Info__String_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Info__String_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Info__String_tag_oer_ext_arr_, 0, M3UA__Info__String_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Info__String_tag_descr_ = { "@M3UA_Types.M3UA_Info_String.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Info__String_tag_xer_, &OCTETSTRING_json_, &M3UA__Info__String_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Info__String_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Info__String_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Info__String_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Info__String_lengthInd_descr_ = { "@M3UA_Types.M3UA_Info_String.lengthInd", &INTEGER_ber_, &M3UA__Info__String_lengthInd_raw_, &INTEGER_text_, &M3UA__Info__String_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Info__String_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Info__String_infoString_xer_ = { {"infoString>\n", "infoString>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Info__String_infoString_oer_ext_arr_[0] = {};
const int M3UA__Info__String_infoString_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Info__String_infoString_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__Info__String_infoString_oer_ext_arr_, 0, M3UA__Info__String_infoString_oer_p_};
const TTCN_Typedescriptor_t M3UA__Info__String_infoString_descr_ = { "@M3UA_Types.M3UA_Info_String.infoString", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__Info__String_infoString_xer_, &OCTETSTRING_json_, &M3UA__Info__String_infoString_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Info__String_infoString_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Info__String_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,32,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__Info__String
const TTCN_Typedescriptor_t M3UA__Info__String_descr_ = { "@M3UA_Types.M3UA_Info_String", NULL, &M3UA__Info__String_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Info__String_default_coding("RAW");
const XERdescriptor_t       M3UA__Concerned__Destination_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Concerned__Destination_tag_oer_ext_arr_[0] = {};
const int M3UA__Concerned__Destination_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Concerned__Destination_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Concerned__Destination_tag_oer_ext_arr_, 0, M3UA__Concerned__Destination_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Concerned__Destination_tag_descr_ = { "@M3UA_Types.M3UA_Concerned_Destination.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Concerned__Destination_tag_xer_, &OCTETSTRING_json_, &M3UA__Concerned__Destination_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Concerned__Destination_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Concerned__Destination_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Concerned__Destination_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Concerned__Destination_lengthInd_descr_ = { "@M3UA_Types.M3UA_Concerned_Destination.lengthInd", &INTEGER_ber_, &M3UA__Concerned__Destination_lengthInd_raw_, &INTEGER_text_, &M3UA__Concerned__Destination_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Concerned__Destination_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Concerned__Destination_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Concerned__Destination_reserved_oer_ext_arr_[0] = {};
const int M3UA__Concerned__Destination_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Concerned__Destination_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__Concerned__Destination_reserved_oer_ext_arr_, 0, M3UA__Concerned__Destination_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__Concerned__Destination_reserved_descr_ = { "@M3UA_Types.M3UA_Concerned_Destination.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__Concerned__Destination_reserved_xer_, &OCTETSTRING_json_, &M3UA__Concerned__Destination_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Concerned__Destination_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__Concerned__Destination_concernedDestination_xer_ = { {"concernedDestination>\n", "concernedDestination>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Concerned__Destination_concernedDestination_oer_ext_arr_[0] = {};
const int M3UA__Concerned__Destination_concernedDestination_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Concerned__Destination_concernedDestination_oer_ = { -1, TRUE, 3, FALSE, 0, 0, M3UA__Concerned__Destination_concernedDestination_oer_ext_arr_, 0, M3UA__Concerned__Destination_concernedDestination_oer_p_};
const TTCN_Typedescriptor_t M3UA__Concerned__Destination_concernedDestination_descr_ = { "@M3UA_Types.M3UA_Concerned_Destination.concernedDestination", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &M3UA__Concerned__Destination_concernedDestination_xer_, &OCTETSTRING_json_, &M3UA__Concerned__Destination_concernedDestination_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Concerned__Destination_concernedDestination_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Concerned__Destination_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 M3UA__Concerned__Destination
const TTCN_Typedescriptor_t M3UA__Concerned__Destination_descr_ = { "@M3UA_Types.M3UA_Concerned_Destination", NULL, &M3UA__Concerned__Destination_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Concerned__Destination_default_coding("RAW");
const XERdescriptor_t       M3UA__Congestion__Indicators_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Congestion__Indicators_tag_oer_ext_arr_[0] = {};
const int M3UA__Congestion__Indicators_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Congestion__Indicators_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Congestion__Indicators_tag_oer_ext_arr_, 0, M3UA__Congestion__Indicators_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Congestion__Indicators_tag_descr_ = { "@M3UA_Types.M3UA_Congestion_Indicators.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Congestion__Indicators_tag_xer_, &OCTETSTRING_json_, &M3UA__Congestion__Indicators_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Congestion__Indicators_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Congestion__Indicators_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Congestion__Indicators_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Congestion__Indicators_lengthInd_descr_ = { "@M3UA_Types.M3UA_Congestion_Indicators.lengthInd", &INTEGER_ber_, &M3UA__Congestion__Indicators_lengthInd_raw_, &INTEGER_text_, &M3UA__Congestion__Indicators_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Congestion__Indicators_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Congestion__Indicators_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Congestion__Indicators_reserved_oer_ext_arr_[0] = {};
const int M3UA__Congestion__Indicators_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Congestion__Indicators_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__Congestion__Indicators_reserved_oer_ext_arr_, 0, M3UA__Congestion__Indicators_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__Congestion__Indicators_reserved_descr_ = { "@M3UA_Types.M3UA_Congestion_Indicators.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__Congestion__Indicators_reserved_xer_, &OCTETSTRING_json_, &M3UA__Congestion__Indicators_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Congestion__Indicators_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__Congestion__Indicators_congestionLevel_xer_ = { {"congestionLevel>\n", "congestionLevel>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Congestion__Indicators_congestionLevel_oer_ext_arr_[0] = {};
const int M3UA__Congestion__Indicators_congestionLevel_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Congestion__Indicators_congestionLevel_oer_ = { -1, TRUE, 3, FALSE, 0, 0, M3UA__Congestion__Indicators_congestionLevel_oer_ext_arr_, 0, M3UA__Congestion__Indicators_congestionLevel_oer_p_};
const TTCN_Typedescriptor_t M3UA__Congestion__Indicators_congestionLevel_descr_ = { "@M3UA_Types.M3UA_Congestion_Indicators.congestionLevel", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &M3UA__Congestion__Indicators_congestionLevel_xer_, &OCTETSTRING_json_, &M3UA__Congestion__Indicators_congestionLevel_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Congestion__Indicators_congestionLevel_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Congestion__Indicators_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 M3UA__Congestion__Indicators
const TTCN_Typedescriptor_t M3UA__Congestion__Indicators_descr_ = { "@M3UA_Types.M3UA_Congestion_Indicators", NULL, &M3UA__Congestion__Indicators_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Congestion__Indicators_default_coding("RAW");
const XERdescriptor_t       M3UA__User__Cause_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__User__Cause_tag_oer_ext_arr_[0] = {};
const int M3UA__User__Cause_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__User__Cause_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__User__Cause_tag_oer_ext_arr_, 0, M3UA__User__Cause_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__User__Cause_tag_descr_ = { "@M3UA_Types.M3UA_User_Cause.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__User__Cause_tag_xer_, &OCTETSTRING_json_, &M3UA__User__Cause_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__User__Cause_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__User__Cause_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__User__Cause_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__User__Cause_lengthInd_descr_ = { "@M3UA_Types.M3UA_User_Cause.lengthInd", &INTEGER_ber_, &M3UA__User__Cause_lengthInd_raw_, &INTEGER_text_, &M3UA__User__Cause_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__User__Cause_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__User__Cause_cause_xer_ = { {"cause>\n", "cause>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__User__Cause_cause_oer_ext_arr_[0] = {};
const int M3UA__User__Cause_cause_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__User__Cause_cause_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__User__Cause_cause_oer_ext_arr_, 0, M3UA__User__Cause_cause_oer_p_};
const TTCN_Typedescriptor_t M3UA__User__Cause_cause_descr_ = { "@M3UA_Types.M3UA_User_Cause.cause", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__User__Cause_cause_xer_, &OCTETSTRING_json_, &M3UA__User__Cause_cause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__User__Cause_cause_default_coding("RAW");
const XERdescriptor_t       M3UA__User__Cause_user_xer_ = { {"user>\n", "user>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__User__Cause_user_oer_ext_arr_[0] = {};
const int M3UA__User__Cause_user_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__User__Cause_user_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__User__Cause_user_oer_ext_arr_, 0, M3UA__User__Cause_user_oer_p_};
const TTCN_Typedescriptor_t M3UA__User__Cause_user_descr_ = { "@M3UA_Types.M3UA_User_Cause.user", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__User__Cause_user_xer_, &OCTETSTRING_json_, &M3UA__User__Cause_user_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__User__Cause_user_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__User__Cause_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 M3UA__User__Cause
const TTCN_Typedescriptor_t M3UA__User__Cause_descr_ = { "@M3UA_Types.M3UA_User_Cause", NULL, &M3UA__User__Cause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__User__Cause_default_coding("RAW");
const XERdescriptor_t       M3UA__ASP__Identifier_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASP__Identifier_tag_oer_ext_arr_[0] = {};
const int M3UA__ASP__Identifier_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASP__Identifier_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASP__Identifier_tag_oer_ext_arr_, 0, M3UA__ASP__Identifier_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASP__Identifier_tag_descr_ = { "@M3UA_Types.M3UA_ASP_Identifier.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASP__Identifier_tag_xer_, &OCTETSTRING_json_, &M3UA__ASP__Identifier_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASP__Identifier_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASP__Identifier_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__ASP__Identifier_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASP__Identifier_lengthInd_descr_ = { "@M3UA_Types.M3UA_ASP_Identifier.lengthInd", &INTEGER_ber_, &M3UA__ASP__Identifier_lengthInd_raw_, &INTEGER_text_, &M3UA__ASP__Identifier_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASP__Identifier_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__ASP__Identifier_aSPIdentifier_xer_ = { {"aSPIdentifier>\n", "aSPIdentifier>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASP__Identifier_aSPIdentifier_oer_ext_arr_[0] = {};
const int M3UA__ASP__Identifier_aSPIdentifier_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASP__Identifier_aSPIdentifier_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__ASP__Identifier_aSPIdentifier_oer_ext_arr_, 0, M3UA__ASP__Identifier_aSPIdentifier_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASP__Identifier_aSPIdentifier_descr_ = { "@M3UA_Types.M3UA_ASP_Identifier.aSPIdentifier", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__ASP__Identifier_aSPIdentifier_xer_, &OCTETSTRING_json_, &M3UA__ASP__Identifier_aSPIdentifier_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASP__Identifier_aSPIdentifier_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASP__Identifier_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 M3UA__ASP__Identifier
const TTCN_Typedescriptor_t M3UA__ASP__Identifier_descr_ = { "@M3UA_Types.M3UA_ASP_Identifier", NULL, &M3UA__ASP__Identifier_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASP__Identifier_default_coding("RAW");
const XERdescriptor_t       M3UA__Heartbeat__Data_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Heartbeat__Data_tag_oer_ext_arr_[0] = {};
const int M3UA__Heartbeat__Data_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Heartbeat__Data_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Heartbeat__Data_tag_oer_ext_arr_, 0, M3UA__Heartbeat__Data_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Heartbeat__Data_tag_descr_ = { "@M3UA_Types.M3UA_Heartbeat_Data.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Heartbeat__Data_tag_xer_, &OCTETSTRING_json_, &M3UA__Heartbeat__Data_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Heartbeat__Data_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Heartbeat__Data_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Heartbeat__Data_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Heartbeat__Data_lengthInd_descr_ = { "@M3UA_Types.M3UA_Heartbeat_Data.lengthInd", &INTEGER_ber_, &M3UA__Heartbeat__Data_lengthInd_raw_, &INTEGER_text_, &M3UA__Heartbeat__Data_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Heartbeat__Data_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Heartbeat__Data_heartbeat__Data_xer_ = { {"heartbeat_Data>\n", "heartbeat_Data>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Heartbeat__Data_heartbeat__Data_oer_ext_arr_[0] = {};
const int M3UA__Heartbeat__Data_heartbeat__Data_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Heartbeat__Data_heartbeat__Data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__Heartbeat__Data_heartbeat__Data_oer_ext_arr_, 0, M3UA__Heartbeat__Data_heartbeat__Data_oer_p_};
const TTCN_Typedescriptor_t M3UA__Heartbeat__Data_heartbeat__Data_descr_ = { "@M3UA_Types.M3UA_Heartbeat_Data.heartbeat_Data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__Heartbeat__Data_heartbeat__Data_xer_, &OCTETSTRING_json_, &M3UA__Heartbeat__Data_heartbeat__Data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Heartbeat__Data_heartbeat__Data_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Heartbeat__Data_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,32,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__Heartbeat__Data
const TTCN_Typedescriptor_t M3UA__Heartbeat__Data_descr_ = { "@M3UA_Types.M3UA_Heartbeat_Data", NULL, &M3UA__Heartbeat__Data_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Heartbeat__Data_default_coding("RAW");
const XERdescriptor_t       M3UA__Traffic__Mode__Type_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Traffic__Mode__Type_tag_oer_ext_arr_[0] = {};
const int M3UA__Traffic__Mode__Type_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Traffic__Mode__Type_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Traffic__Mode__Type_tag_oer_ext_arr_, 0, M3UA__Traffic__Mode__Type_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Traffic__Mode__Type_tag_descr_ = { "@M3UA_Types.M3UA_Traffic_Mode_Type.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Traffic__Mode__Type_tag_xer_, &OCTETSTRING_json_, &M3UA__Traffic__Mode__Type_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Traffic__Mode__Type_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Traffic__Mode__Type_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Traffic__Mode__Type_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Traffic__Mode__Type_lengthInd_descr_ = { "@M3UA_Types.M3UA_Traffic_Mode_Type.lengthInd", &INTEGER_ber_, &M3UA__Traffic__Mode__Type_lengthInd_raw_, &INTEGER_text_, &M3UA__Traffic__Mode__Type_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Traffic__Mode__Type_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Traffic__Mode__Type_trafficModeType_xer_ = { {"trafficModeType>\n", "trafficModeType>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Traffic__Mode__Type_trafficModeType_oer_ext_arr_[0] = {};
const int M3UA__Traffic__Mode__Type_trafficModeType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Traffic__Mode__Type_trafficModeType_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Traffic__Mode__Type_trafficModeType_oer_ext_arr_, 0, M3UA__Traffic__Mode__Type_trafficModeType_oer_p_};
const TTCN_Typedescriptor_t M3UA__Traffic__Mode__Type_trafficModeType_descr_ = { "@M3UA_Types.M3UA_Traffic_Mode_Type.trafficModeType", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Traffic__Mode__Type_trafficModeType_xer_, &OCTETSTRING_json_, &M3UA__Traffic__Mode__Type_trafficModeType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Traffic__Mode__Type_trafficModeType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Traffic__Mode__Type_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 M3UA__Traffic__Mode__Type
const TTCN_Typedescriptor_t M3UA__Traffic__Mode__Type_descr_ = { "@M3UA_Types.M3UA_Traffic_Mode_Type", NULL, &M3UA__Traffic__Mode__Type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Traffic__Mode__Type_default_coding("RAW");
const XERdescriptor_t       M3UA__Status_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Status_tag_oer_ext_arr_[0] = {};
const int M3UA__Status_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Status_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Status_tag_oer_ext_arr_, 0, M3UA__Status_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Status_tag_descr_ = { "@M3UA_Types.M3UA_Status.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Status_tag_xer_, &OCTETSTRING_json_, &M3UA__Status_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Status_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Status_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Status_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Status_lengthInd_descr_ = { "@M3UA_Types.M3UA_Status.lengthInd", &INTEGER_ber_, &M3UA__Status_lengthInd_raw_, &INTEGER_text_, &M3UA__Status_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Status_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Status_statusType_xer_ = { {"statusType>\n", "statusType>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Status_statusType_oer_ext_arr_[0] = {};
const int M3UA__Status_statusType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Status_statusType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Status_statusType_oer_ext_arr_, 0, M3UA__Status_statusType_oer_p_};
const TTCN_Typedescriptor_t M3UA__Status_statusType_descr_ = { "@M3UA_Types.M3UA_Status.statusType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Status_statusType_xer_, &OCTETSTRING_json_, &M3UA__Status_statusType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Status_statusType_default_coding("RAW");
const XERdescriptor_t       M3UA__Status_statusInfo_xer_ = { {"statusInfo>\n", "statusInfo>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Status_statusInfo_oer_ext_arr_[0] = {};
const int M3UA__Status_statusInfo_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Status_statusInfo_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Status_statusInfo_oer_ext_arr_, 0, M3UA__Status_statusInfo_oer_p_};
const TTCN_Typedescriptor_t M3UA__Status_statusInfo_descr_ = { "@M3UA_Types.M3UA_Status.statusInfo", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Status_statusInfo_xer_, &OCTETSTRING_json_, &M3UA__Status_statusInfo_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Status_statusInfo_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Status_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 M3UA__Status
const TTCN_Typedescriptor_t M3UA__Status_descr_ = { "@M3UA_Types.M3UA_Status", NULL, &M3UA__Status_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Status_default_coding("RAW");
const XERdescriptor_t       M3UA__Local__Routing__Key__Id_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Local__Routing__Key__Id_tag_oer_ext_arr_[0] = {};
const int M3UA__Local__Routing__Key__Id_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Local__Routing__Key__Id_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Local__Routing__Key__Id_tag_oer_ext_arr_, 0, M3UA__Local__Routing__Key__Id_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Local__Routing__Key__Id_tag_descr_ = { "@M3UA_Types.M3UA_Local_Routing_Key_Id.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Local__Routing__Key__Id_tag_xer_, &OCTETSTRING_json_, &M3UA__Local__Routing__Key__Id_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Local__Routing__Key__Id_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Local__Routing__Key__Id_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Local__Routing__Key__Id_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Local__Routing__Key__Id_lengthInd_descr_ = { "@M3UA_Types.M3UA_Local_Routing_Key_Id.lengthInd", &INTEGER_ber_, &M3UA__Local__Routing__Key__Id_lengthInd_raw_, &INTEGER_text_, &M3UA__Local__Routing__Key__Id_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Local__Routing__Key__Id_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Local__Routing__Key__Id_localRkId_xer_ = { {"localRkId>\n", "localRkId>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Local__Routing__Key__Id_localRkId_oer_ext_arr_[0] = {};
const int M3UA__Local__Routing__Key__Id_localRkId_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Local__Routing__Key__Id_localRkId_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Local__Routing__Key__Id_localRkId_oer_ext_arr_, 0, M3UA__Local__Routing__Key__Id_localRkId_oer_p_};
const TTCN_Typedescriptor_t M3UA__Local__Routing__Key__Id_localRkId_descr_ = { "@M3UA_Types.M3UA_Local_Routing_Key_Id.localRkId", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Local__Routing__Key__Id_localRkId_xer_, &OCTETSTRING_json_, &M3UA__Local__Routing__Key__Id_localRkId_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Local__Routing__Key__Id_localRkId_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Local__Routing__Key__Id_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 M3UA__Local__Routing__Key__Id
const TTCN_Typedescriptor_t M3UA__Local__Routing__Key__Id_descr_ = { "@M3UA_Types.M3UA_Local_Routing_Key_Id", NULL, &M3UA__Local__Routing__Key__Id_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Local__Routing__Key__Id_default_coding("RAW");
const XERdescriptor_t       M3UA__Destination__PointCode_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Destination__PointCode_tag_oer_ext_arr_[0] = {};
const int M3UA__Destination__PointCode_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Destination__PointCode_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Destination__PointCode_tag_oer_ext_arr_, 0, M3UA__Destination__PointCode_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Destination__PointCode_tag_descr_ = { "@M3UA_Types.M3UA_Destination_PointCode.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Destination__PointCode_tag_xer_, &OCTETSTRING_json_, &M3UA__Destination__PointCode_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Destination__PointCode_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Destination__PointCode_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Destination__PointCode_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Destination__PointCode_lengthInd_descr_ = { "@M3UA_Types.M3UA_Destination_PointCode.lengthInd", &INTEGER_ber_, &M3UA__Destination__PointCode_lengthInd_raw_, &INTEGER_text_, &M3UA__Destination__PointCode_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Destination__PointCode_lengthInd_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Destination__PointCode_pointCode_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Destination__PointCode_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 M3UA__Destination__PointCode
const TTCN_Typedescriptor_t M3UA__Destination__PointCode_descr_ = { "@M3UA_Types.M3UA_Destination_PointCode", NULL, &M3UA__Destination__PointCode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Destination__PointCode_default_coding("RAW");
const XERdescriptor_t       M3UA__Service__Indicators_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Service__Indicators_tag_oer_ext_arr_[0] = {};
const int M3UA__Service__Indicators_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Service__Indicators_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Service__Indicators_tag_oer_ext_arr_, 0, M3UA__Service__Indicators_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Service__Indicators_tag_descr_ = { "@M3UA_Types.M3UA_Service_Indicators.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Service__Indicators_tag_xer_, &OCTETSTRING_json_, &M3UA__Service__Indicators_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Service__Indicators_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Service__Indicators_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Service__Indicators_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Service__Indicators_lengthInd_descr_ = { "@M3UA_Types.M3UA_Service_Indicators.lengthInd", &INTEGER_ber_, &M3UA__Service__Indicators_lengthInd_raw_, &INTEGER_text_, &M3UA__Service__Indicators_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Service__Indicators_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Service__Indicators_serviceIndicators_xer_ = { {"serviceIndicators>\n", "serviceIndicators>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Service__Indicators_serviceIndicators_oer_ext_arr_[0] = {};
const int M3UA__Service__Indicators_serviceIndicators_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Service__Indicators_serviceIndicators_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__Service__Indicators_serviceIndicators_oer_ext_arr_, 0, M3UA__Service__Indicators_serviceIndicators_oer_p_};
const TTCN_Typedescriptor_t M3UA__Service__Indicators_serviceIndicators_descr_ = { "@M3UA_Types.M3UA_Service_Indicators.serviceIndicators", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__Service__Indicators_serviceIndicators_xer_, &OCTETSTRING_json_, &M3UA__Service__Indicators_serviceIndicators_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Service__Indicators_serviceIndicators_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Service__Indicators_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 M3UA__Service__Indicators
const TTCN_Typedescriptor_t M3UA__Service__Indicators_descr_ = { "@M3UA_Types.M3UA_Service_Indicators", NULL, &M3UA__Service__Indicators_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Service__Indicators_default_coding("RAW");
const XERdescriptor_t       M3UA__OPC__List_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__OPC__List_tag_oer_ext_arr_[0] = {};
const int M3UA__OPC__List_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__OPC__List_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__OPC__List_tag_oer_ext_arr_, 0, M3UA__OPC__List_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__OPC__List_tag_descr_ = { "@M3UA_Types.M3UA_OPC_List.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__OPC__List_tag_xer_, &OCTETSTRING_json_, &M3UA__OPC__List_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__OPC__List_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__OPC__List_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__OPC__List_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__OPC__List_lengthInd_descr_ = { "@M3UA_Types.M3UA_OPC_List.lengthInd", &INTEGER_ber_, &M3UA__OPC__List_lengthInd_raw_, &INTEGER_text_, &M3UA__OPC__List_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__OPC__List_lengthInd_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__OPC__List_pointCodes_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__OPC__List_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 M3UA__OPC__List
const TTCN_Typedescriptor_t M3UA__OPC__List_descr_ = { "@M3UA_Types.M3UA_OPC_List", NULL, &M3UA__OPC__List_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__OPC__List_default_coding("RAW");
const XERdescriptor_t       M3UA__Routing__Key_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Routing__Key_tag_oer_ext_arr_[0] = {};
const int M3UA__Routing__Key_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Routing__Key_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Routing__Key_tag_oer_ext_arr_, 0, M3UA__Routing__Key_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Routing__Key_tag_descr_ = { "@M3UA_Types.M3UA_Routing_Key.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Routing__Key_tag_xer_, &OCTETSTRING_json_, &M3UA__Routing__Key_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Key_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Routing__Key_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Routing__Key_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Routing__Key_lengthInd_descr_ = { "@M3UA_Types.M3UA_Routing_Key.lengthInd", &INTEGER_ber_, &M3UA__Routing__Key_lengthInd_raw_, &INTEGER_text_, &M3UA__Routing__Key_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Key_lengthInd_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_local__Routing__Key__Id_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_destination__Point__Code_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Routing__Key__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 M3UA__Routing__Key__Parameters
const TTCN_Typedescriptor_t M3UA__Routing__Key__Parameters_descr_ = { "@M3UA_Types.M3UA_Routing_Key_Parameters", NULL, &M3UA__Routing__Key__Parameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_traffic__Mode__Type_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_service__Indicators_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_opc__List_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key__Parameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Key_routingKey_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Routing__Key_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 M3UA__Routing__Key
const TTCN_Typedescriptor_t M3UA__Routing__Key_descr_ = { "@M3UA_Types.M3UA_Routing_Key", NULL, &M3UA__Routing__Key_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Key_default_coding("RAW");
const XERdescriptor_t       M3UA__Registration__Status_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Registration__Status_tag_oer_ext_arr_[0] = {};
const int M3UA__Registration__Status_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Registration__Status_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Registration__Status_tag_oer_ext_arr_, 0, M3UA__Registration__Status_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Registration__Status_tag_descr_ = { "@M3UA_Types.M3UA_Registration_Status.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Registration__Status_tag_xer_, &OCTETSTRING_json_, &M3UA__Registration__Status_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Status_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Registration__Status_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Registration__Status_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Registration__Status_lengthInd_descr_ = { "@M3UA_Types.M3UA_Registration_Status.lengthInd", &INTEGER_ber_, &M3UA__Registration__Status_lengthInd_raw_, &INTEGER_text_, &M3UA__Registration__Status_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Status_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Registration__Status_registrationStatus_xer_ = { {"registrationStatus>\n", "registrationStatus>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Registration__Status_registrationStatus_oer_ext_arr_[0] = {};
const int M3UA__Registration__Status_registrationStatus_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Registration__Status_registrationStatus_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Registration__Status_registrationStatus_oer_ext_arr_, 0, M3UA__Registration__Status_registrationStatus_oer_p_};
const TTCN_Typedescriptor_t M3UA__Registration__Status_registrationStatus_descr_ = { "@M3UA_Types.M3UA_Registration_Status.registrationStatus", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Registration__Status_registrationStatus_xer_, &OCTETSTRING_json_, &M3UA__Registration__Status_registrationStatus_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Status_registrationStatus_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Registration__Status_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 M3UA__Registration__Status
const TTCN_Typedescriptor_t M3UA__Registration__Status_descr_ = { "@M3UA_Types.M3UA_Registration_Status", NULL, &M3UA__Registration__Status_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Status_default_coding("RAW");
const XERdescriptor_t       M3UA__Deregistration__Status_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Deregistration__Status_tag_oer_ext_arr_[0] = {};
const int M3UA__Deregistration__Status_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Deregistration__Status_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Deregistration__Status_tag_oer_ext_arr_, 0, M3UA__Deregistration__Status_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Deregistration__Status_tag_descr_ = { "@M3UA_Types.M3UA_Deregistration_Status.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Deregistration__Status_tag_xer_, &OCTETSTRING_json_, &M3UA__Deregistration__Status_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Status_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Deregistration__Status_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Deregistration__Status_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Deregistration__Status_lengthInd_descr_ = { "@M3UA_Types.M3UA_Deregistration_Status.lengthInd", &INTEGER_ber_, &M3UA__Deregistration__Status_lengthInd_raw_, &INTEGER_text_, &M3UA__Deregistration__Status_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Status_lengthInd_default_coding("RAW");
const XERdescriptor_t       M3UA__Deregistration__Status_deregistrationStatus_xer_ = { {"deregistrationStatus>\n", "deregistrationStatus>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Deregistration__Status_deregistrationStatus_oer_ext_arr_[0] = {};
const int M3UA__Deregistration__Status_deregistrationStatus_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Deregistration__Status_deregistrationStatus_oer_ = { -1, TRUE, 4, FALSE, 0, 0, M3UA__Deregistration__Status_deregistrationStatus_oer_ext_arr_, 0, M3UA__Deregistration__Status_deregistrationStatus_oer_p_};
const TTCN_Typedescriptor_t M3UA__Deregistration__Status_deregistrationStatus_descr_ = { "@M3UA_Types.M3UA_Deregistration_Status.deregistrationStatus", &OCTETSTRING_ber_, &General__Types::OCT4_raw_, &OCTETSTRING_text_, &M3UA__Deregistration__Status_deregistrationStatus_xer_, &OCTETSTRING_json_, &M3UA__Deregistration__Status_deregistrationStatus_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Status_deregistrationStatus_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Deregistration__Status_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 M3UA__Deregistration__Status
const TTCN_Typedescriptor_t M3UA__Deregistration__Status_descr_ = { "@M3UA_Types.M3UA_Deregistration_Status", NULL, &M3UA__Deregistration__Status_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Status_default_coding("RAW");
const XERdescriptor_t       M3UA__Registration__Result_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Registration__Result_tag_oer_ext_arr_[0] = {};
const int M3UA__Registration__Result_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Registration__Result_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Registration__Result_tag_oer_ext_arr_, 0, M3UA__Registration__Result_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Registration__Result_tag_descr_ = { "@M3UA_Types.M3UA_Registration_Result.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Registration__Result_tag_xer_, &OCTETSTRING_json_, &M3UA__Registration__Result_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Result_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Registration__Result_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Registration__Result_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Registration__Result_lengthInd_descr_ = { "@M3UA_Types.M3UA_Registration_Result.lengthInd", &INTEGER_ber_, &M3UA__Registration__Result_lengthInd_raw_, &INTEGER_text_, &M3UA__Registration__Result_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Result_lengthInd_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Registration__Result__Parameters_local__Routing__Key__Id_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Registration__Result__Parameters_registration__Status_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Registration__Result__Parameters_routing__Context_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Registration__Result__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 M3UA__Registration__Result__Parameters
const TTCN_Typedescriptor_t M3UA__Registration__Result__Parameters_descr_ = { "@M3UA_Types.M3UA_Registration_Result_Parameters", NULL, &M3UA__Registration__Result__Parameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Result__Parameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Registration__Result_registrationResult_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Registration__Result_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 M3UA__Registration__Result
const TTCN_Typedescriptor_t M3UA__Registration__Result_descr_ = { "@M3UA_Types.M3UA_Registration_Result", NULL, &M3UA__Registration__Result_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Result_default_coding("RAW");
const XERdescriptor_t       M3UA__Deregistration__Result_tag_xer_ = { {"tag>\n", "tag>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__Deregistration__Result_tag_oer_ext_arr_[0] = {};
const int M3UA__Deregistration__Result_tag_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__Deregistration__Result_tag_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__Deregistration__Result_tag_oer_ext_arr_, 0, M3UA__Deregistration__Result_tag_oer_p_};
const TTCN_Typedescriptor_t M3UA__Deregistration__Result_tag_descr_ = { "@M3UA_Types.M3UA_Deregistration_Result.tag", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__Deregistration__Result_tag_xer_, &OCTETSTRING_json_, &M3UA__Deregistration__Result_tag_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Result_tag_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Deregistration__Result_lengthInd_raw_ = {16,SG_NO,ORDER_MSB,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       M3UA__Deregistration__Result_lengthInd_xer_ = { {"lengthInd>\n", "lengthInd>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__Deregistration__Result_lengthInd_descr_ = { "@M3UA_Types.M3UA_Deregistration_Result.lengthInd", &INTEGER_ber_, &M3UA__Deregistration__Result_lengthInd_raw_, &INTEGER_text_, &M3UA__Deregistration__Result_lengthInd_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Result_lengthInd_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Deregistration__Result__Parameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Deregistration__Result__Parameters_deregistration__Status_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Deregistration__Result__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 M3UA__Deregistration__Result__Parameters
const TTCN_Typedescriptor_t M3UA__Deregistration__Result__Parameters_descr_ = { "@M3UA_Types.M3UA_Deregistration_Result_Parameters", NULL, &M3UA__Deregistration__Result__Parameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Result__Parameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Deregistration__Result_deregistrationResult_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Deregistration__Result_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 M3UA__Deregistration__Result
const TTCN_Typedescriptor_t M3UA__Deregistration__Result_descr_ = { "@M3UA_Types.M3UA_Deregistration_Result", NULL, &M3UA__Deregistration__Result_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Result_default_coding("RAW");
const XERdescriptor_t       M3UA__ERR_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ERR_version_oer_ext_arr_[0] = {};
const int M3UA__ERR_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ERR_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ERR_version_oer_ext_arr_, 0, M3UA__ERR_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ERR_version_descr_ = { "@M3UA_Types.M3UA_ERR.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ERR_version_xer_, &OCTETSTRING_json_, &M3UA__ERR_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ERR_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ERR_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ERR_reserved_oer_ext_arr_[0] = {};
const int M3UA__ERR_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ERR_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ERR_reserved_oer_ext_arr_, 0, M3UA__ERR_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ERR_reserved_descr_ = { "@M3UA_Types.M3UA_ERR.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ERR_reserved_xer_, &OCTETSTRING_json_, &M3UA__ERR_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ERR_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ERR_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ERR_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ERR_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ERR_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ERR_messageClassAndType_oer_ext_arr_, 0, M3UA__ERR_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ERR_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ERR.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ERR_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ERR_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ERR_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ERR_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ERR_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ERR_messageLength_descr_ = { "@M3UA_Types.M3UA_ERR.messageLength", &INTEGER_ber_, &M3UA__ERR_messageLength_raw_, &INTEGER_text_, &M3UA__ERR_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ERR_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ERR__MessageParameters_error__Code_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ERR__MessageParameters_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 M3UA__ERR__MessageParameters
const TTCN_Typedescriptor_t M3UA__ERR__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ERR_MessageParameters", NULL, &M3UA__ERR__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ERR__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ERR__MessageParameters_affected__Point__Codes_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ERR__MessageParameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ERR__MessageParameters_diagnostic__information_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ERR__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ERR_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ERR_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 M3UA__ERR
const TTCN_Typedescriptor_t M3UA__ERR_descr_ = { "@M3UA_Types.M3UA_ERR", NULL, &M3UA__ERR_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ERR_default_coding("RAW");
const XERdescriptor_t       M3UA__NOTIFY_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__NOTIFY_version_oer_ext_arr_[0] = {};
const int M3UA__NOTIFY_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__NOTIFY_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__NOTIFY_version_oer_ext_arr_, 0, M3UA__NOTIFY_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__NOTIFY_version_descr_ = { "@M3UA_Types.M3UA_NOTIFY.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__NOTIFY_version_xer_, &OCTETSTRING_json_, &M3UA__NOTIFY_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__NOTIFY_version_default_coding("RAW");
const XERdescriptor_t       M3UA__NOTIFY_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__NOTIFY_reserved_oer_ext_arr_[0] = {};
const int M3UA__NOTIFY_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__NOTIFY_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__NOTIFY_reserved_oer_ext_arr_, 0, M3UA__NOTIFY_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__NOTIFY_reserved_descr_ = { "@M3UA_Types.M3UA_NOTIFY.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__NOTIFY_reserved_xer_, &OCTETSTRING_json_, &M3UA__NOTIFY_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__NOTIFY_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__NOTIFY_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__NOTIFY_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__NOTIFY_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__NOTIFY_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__NOTIFY_messageClassAndType_oer_ext_arr_, 0, M3UA__NOTIFY_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__NOTIFY_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_NOTIFY.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__NOTIFY_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__NOTIFY_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__NOTIFY_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__NOTIFY_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__NOTIFY_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__NOTIFY_messageLength_descr_ = { "@M3UA_Types.M3UA_NOTIFY.messageLength", &INTEGER_ber_, &M3UA__NOTIFY_messageLength_raw_, &INTEGER_text_, &M3UA__NOTIFY_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__NOTIFY_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__NOTIFY__MessageParameters_status_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__NOTIFY__MessageParameters_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 M3UA__NOTIFY__MessageParameters
const TTCN_Typedescriptor_t M3UA__NOTIFY__MessageParameters_descr_ = { "@M3UA_Types.M3UA_NOTIFY_MessageParameters", NULL, &M3UA__NOTIFY__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__NOTIFY__MessageParameters_aSP__Identifier_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__NOTIFY__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__NOTIFY__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__NOTIFY__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__NOTIFY_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__NOTIFY_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 M3UA__NOTIFY
const TTCN_Typedescriptor_t M3UA__NOTIFY_descr_ = { "@M3UA_Types.M3UA_NOTIFY", NULL, &M3UA__NOTIFY_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__NOTIFY_default_coding("RAW");
const XERdescriptor_t       M3UA__DATA_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DATA_version_oer_ext_arr_[0] = {};
const int M3UA__DATA_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DATA_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DATA_version_oer_ext_arr_, 0, M3UA__DATA_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DATA_version_descr_ = { "@M3UA_Types.M3UA_DATA.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DATA_version_xer_, &OCTETSTRING_json_, &M3UA__DATA_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DATA_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DATA_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DATA_reserved_oer_ext_arr_[0] = {};
const int M3UA__DATA_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DATA_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DATA_reserved_oer_ext_arr_, 0, M3UA__DATA_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DATA_reserved_descr_ = { "@M3UA_Types.M3UA_DATA.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DATA_reserved_xer_, &OCTETSTRING_json_, &M3UA__DATA_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DATA_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DATA_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DATA_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DATA_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DATA_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DATA_messageClassAndType_oer_ext_arr_, 0, M3UA__DATA_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DATA_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DATA.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DATA_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DATA_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DATA_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DATA_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DATA_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DATA_messageLength_descr_ = { "@M3UA_Types.M3UA_DATA.messageLength", &INTEGER_ber_, &M3UA__DATA_messageLength_raw_, &INTEGER_text_, &M3UA__DATA_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DATA_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DATA__MessageParameters_protocol__Data_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DATA__MessageParameters_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 M3UA__DATA__MessageParameters
const TTCN_Typedescriptor_t M3UA__DATA__MessageParameters_descr_ = { "@M3UA_Types.M3UA_DATA_MessageParameters", NULL, &M3UA__DATA__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DATA__MessageParameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DATA__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DATA__MessageParameters_correlation__ID_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DATA__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DATA_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DATA_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 M3UA__DATA
const TTCN_Typedescriptor_t M3UA__DATA_descr_ = { "@M3UA_Types.M3UA_DATA", NULL, &M3UA__DATA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DATA_default_coding("RAW");
const XERdescriptor_t       M3UA__DUNA_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DUNA_version_oer_ext_arr_[0] = {};
const int M3UA__DUNA_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DUNA_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DUNA_version_oer_ext_arr_, 0, M3UA__DUNA_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DUNA_version_descr_ = { "@M3UA_Types.M3UA_DUNA.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DUNA_version_xer_, &OCTETSTRING_json_, &M3UA__DUNA_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUNA_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DUNA_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DUNA_reserved_oer_ext_arr_[0] = {};
const int M3UA__DUNA_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DUNA_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DUNA_reserved_oer_ext_arr_, 0, M3UA__DUNA_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DUNA_reserved_descr_ = { "@M3UA_Types.M3UA_DUNA.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DUNA_reserved_xer_, &OCTETSTRING_json_, &M3UA__DUNA_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUNA_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DUNA_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DUNA_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DUNA_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DUNA_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DUNA_messageClassAndType_oer_ext_arr_, 0, M3UA__DUNA_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DUNA_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DUNA.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DUNA_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DUNA_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUNA_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DUNA_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DUNA_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DUNA_messageLength_descr_ = { "@M3UA_Types.M3UA_DUNA.messageLength", &INTEGER_ber_, &M3UA__DUNA_messageLength_raw_, &INTEGER_text_, &M3UA__DUNA_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUNA_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUNA__MessageParameters_affected__Point__Codes_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DUNA__MessageParameters_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 M3UA__DUNA__MessageParameters
const TTCN_Typedescriptor_t M3UA__DUNA__MessageParameters_descr_ = { "@M3UA_Types.M3UA_DUNA_MessageParameters", NULL, &M3UA__DUNA__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUNA__MessageParameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUNA__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUNA__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUNA__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUNA_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DUNA_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 M3UA__DUNA
const TTCN_Typedescriptor_t M3UA__DUNA_descr_ = { "@M3UA_Types.M3UA_DUNA", NULL, &M3UA__DUNA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUNA_default_coding("RAW");
const XERdescriptor_t       M3UA__DAVA_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DAVA_version_oer_ext_arr_[0] = {};
const int M3UA__DAVA_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DAVA_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DAVA_version_oer_ext_arr_, 0, M3UA__DAVA_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DAVA_version_descr_ = { "@M3UA_Types.M3UA_DAVA.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DAVA_version_xer_, &OCTETSTRING_json_, &M3UA__DAVA_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAVA_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DAVA_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DAVA_reserved_oer_ext_arr_[0] = {};
const int M3UA__DAVA_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DAVA_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DAVA_reserved_oer_ext_arr_, 0, M3UA__DAVA_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DAVA_reserved_descr_ = { "@M3UA_Types.M3UA_DAVA.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DAVA_reserved_xer_, &OCTETSTRING_json_, &M3UA__DAVA_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAVA_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DAVA_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DAVA_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DAVA_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DAVA_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DAVA_messageClassAndType_oer_ext_arr_, 0, M3UA__DAVA_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DAVA_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DAVA.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DAVA_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DAVA_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAVA_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DAVA_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DAVA_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DAVA_messageLength_descr_ = { "@M3UA_Types.M3UA_DAVA.messageLength", &INTEGER_ber_, &M3UA__DAVA_messageLength_raw_, &INTEGER_text_, &M3UA__DAVA_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAVA_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAVA__MessageParameters_affected__Point__Codes_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DAVA__MessageParameters_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 M3UA__DAVA__MessageParameters
const TTCN_Typedescriptor_t M3UA__DAVA__MessageParameters_descr_ = { "@M3UA_Types.M3UA_DAVA_MessageParameters", NULL, &M3UA__DAVA__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAVA__MessageParameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAVA__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAVA__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAVA__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAVA_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DAVA_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 M3UA__DAVA
const TTCN_Typedescriptor_t M3UA__DAVA_descr_ = { "@M3UA_Types.M3UA_DAVA", NULL, &M3UA__DAVA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAVA_default_coding("RAW");
const XERdescriptor_t       M3UA__DAUD_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DAUD_version_oer_ext_arr_[0] = {};
const int M3UA__DAUD_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DAUD_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DAUD_version_oer_ext_arr_, 0, M3UA__DAUD_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DAUD_version_descr_ = { "@M3UA_Types.M3UA_DAUD.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DAUD_version_xer_, &OCTETSTRING_json_, &M3UA__DAUD_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAUD_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DAUD_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DAUD_reserved_oer_ext_arr_[0] = {};
const int M3UA__DAUD_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DAUD_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DAUD_reserved_oer_ext_arr_, 0, M3UA__DAUD_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DAUD_reserved_descr_ = { "@M3UA_Types.M3UA_DAUD.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DAUD_reserved_xer_, &OCTETSTRING_json_, &M3UA__DAUD_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAUD_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DAUD_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DAUD_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DAUD_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DAUD_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DAUD_messageClassAndType_oer_ext_arr_, 0, M3UA__DAUD_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DAUD_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DAUD.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DAUD_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DAUD_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAUD_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DAUD_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DAUD_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DAUD_messageLength_descr_ = { "@M3UA_Types.M3UA_DAUD.messageLength", &INTEGER_ber_, &M3UA__DAUD_messageLength_raw_, &INTEGER_text_, &M3UA__DAUD_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAUD_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAUD__MessageParameters_affected__Point__Codes_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DAUD__MessageParameters_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 M3UA__DAUD__MessageParameters
const TTCN_Typedescriptor_t M3UA__DAUD__MessageParameters_descr_ = { "@M3UA_Types.M3UA_DAUD_MessageParameters", NULL, &M3UA__DAUD__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAUD__MessageParameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAUD__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAUD__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAUD__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DAUD_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DAUD_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 M3UA__DAUD
const TTCN_Typedescriptor_t M3UA__DAUD_descr_ = { "@M3UA_Types.M3UA_DAUD", NULL, &M3UA__DAUD_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DAUD_default_coding("RAW");
const XERdescriptor_t       M3UA__SCON_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__SCON_version_oer_ext_arr_[0] = {};
const int M3UA__SCON_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__SCON_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__SCON_version_oer_ext_arr_, 0, M3UA__SCON_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__SCON_version_descr_ = { "@M3UA_Types.M3UA_SCON.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__SCON_version_xer_, &OCTETSTRING_json_, &M3UA__SCON_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__SCON_version_default_coding("RAW");
const XERdescriptor_t       M3UA__SCON_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__SCON_reserved_oer_ext_arr_[0] = {};
const int M3UA__SCON_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__SCON_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__SCON_reserved_oer_ext_arr_, 0, M3UA__SCON_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__SCON_reserved_descr_ = { "@M3UA_Types.M3UA_SCON.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__SCON_reserved_xer_, &OCTETSTRING_json_, &M3UA__SCON_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__SCON_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__SCON_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__SCON_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__SCON_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__SCON_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__SCON_messageClassAndType_oer_ext_arr_, 0, M3UA__SCON_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__SCON_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_SCON.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__SCON_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__SCON_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__SCON_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__SCON_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__SCON_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__SCON_messageLength_descr_ = { "@M3UA_Types.M3UA_SCON.messageLength", &INTEGER_ber_, &M3UA__SCON_messageLength_raw_, &INTEGER_text_, &M3UA__SCON_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__SCON_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__SCON__MessageParameters_affected__Point__Codes_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__SCON__MessageParameters_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 M3UA__SCON__MessageParameters
const TTCN_Typedescriptor_t M3UA__SCON__MessageParameters_descr_ = { "@M3UA_Types.M3UA_SCON_MessageParameters", NULL, &M3UA__SCON__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__SCON__MessageParameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__SCON__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__SCON__MessageParameters_concerned__Destination_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__SCON__MessageParameters_congestion__Indicators_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__SCON__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__SCON__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__SCON_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__SCON_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 M3UA__SCON
const TTCN_Typedescriptor_t M3UA__SCON_descr_ = { "@M3UA_Types.M3UA_SCON", NULL, &M3UA__SCON_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__SCON_default_coding("RAW");
const XERdescriptor_t       M3UA__DUPU_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DUPU_version_oer_ext_arr_[0] = {};
const int M3UA__DUPU_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DUPU_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DUPU_version_oer_ext_arr_, 0, M3UA__DUPU_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DUPU_version_descr_ = { "@M3UA_Types.M3UA_DUPU.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DUPU_version_xer_, &OCTETSTRING_json_, &M3UA__DUPU_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUPU_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DUPU_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DUPU_reserved_oer_ext_arr_[0] = {};
const int M3UA__DUPU_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DUPU_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DUPU_reserved_oer_ext_arr_, 0, M3UA__DUPU_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DUPU_reserved_descr_ = { "@M3UA_Types.M3UA_DUPU.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DUPU_reserved_xer_, &OCTETSTRING_json_, &M3UA__DUPU_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUPU_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DUPU_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DUPU_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DUPU_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DUPU_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DUPU_messageClassAndType_oer_ext_arr_, 0, M3UA__DUPU_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DUPU_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DUPU.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DUPU_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DUPU_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUPU_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DUPU_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DUPU_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DUPU_messageLength_descr_ = { "@M3UA_Types.M3UA_DUPU.messageLength", &INTEGER_ber_, &M3UA__DUPU_messageLength_raw_, &INTEGER_text_, &M3UA__DUPU_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUPU_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUPU__MessageParameters_affected__Point__Codes_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUPU__MessageParameters_user__Cause_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DUPU__MessageParameters_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 M3UA__DUPU__MessageParameters
const TTCN_Typedescriptor_t M3UA__DUPU__MessageParameters_descr_ = { "@M3UA_Types.M3UA_DUPU_MessageParameters", NULL, &M3UA__DUPU__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUPU__MessageParameters_network__Appearance_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUPU__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUPU__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUPU__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DUPU_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DUPU_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 M3UA__DUPU
const TTCN_Typedescriptor_t M3UA__DUPU_descr_ = { "@M3UA_Types.M3UA_DUPU", NULL, &M3UA__DUPU_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DUPU_default_coding("RAW");
const XERdescriptor_t       M3UA__DRST_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DRST_version_oer_ext_arr_[0] = {};
const int M3UA__DRST_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DRST_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DRST_version_oer_ext_arr_, 0, M3UA__DRST_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DRST_version_descr_ = { "@M3UA_Types.M3UA_DRST.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DRST_version_xer_, &OCTETSTRING_json_, &M3UA__DRST_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DRST_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DRST_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DRST_reserved_oer_ext_arr_[0] = {};
const int M3UA__DRST_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DRST_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DRST_reserved_oer_ext_arr_, 0, M3UA__DRST_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DRST_reserved_descr_ = { "@M3UA_Types.M3UA_DRST.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DRST_reserved_xer_, &OCTETSTRING_json_, &M3UA__DRST_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DRST_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DRST_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DRST_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DRST_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DRST_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DRST_messageClassAndType_oer_ext_arr_, 0, M3UA__DRST_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DRST_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DRST.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DRST_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DRST_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DRST_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DRST_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DRST_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DRST_messageLength_descr_ = { "@M3UA_Types.M3UA_DRST.messageLength", &INTEGER_ber_, &M3UA__DRST_messageLength_raw_, &INTEGER_text_, &M3UA__DRST_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DRST_messageLength_default_coding("RAW");
const XERdescriptor_t       M3UA__DRST_messageParameters_xer_ = { {"messageParameters>\n", "messageParameters>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DRST_messageParameters_oer_ext_arr_[0] = {};
const int M3UA__DRST_messageParameters_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DRST_messageParameters_oer_ = { -1, TRUE, -1, FALSE, 0, 0, M3UA__DRST_messageParameters_oer_ext_arr_, 0, M3UA__DRST_messageParameters_oer_p_};
const TTCN_Typedescriptor_t M3UA__DRST_messageParameters_descr_ = { "@M3UA_Types.M3UA_DRST.messageParameters", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &M3UA__DRST_messageParameters_xer_, &OCTETSTRING_json_, &M3UA__DRST_messageParameters_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DRST_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DRST_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 M3UA__DRST
const TTCN_Typedescriptor_t M3UA__DRST_descr_ = { "@M3UA_Types.M3UA_DRST", NULL, &M3UA__DRST_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DRST_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPUP_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPUP_version_oer_ext_arr_[0] = {};
const int M3UA__ASPUP_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPUP_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPUP_version_oer_ext_arr_, 0, M3UA__ASPUP_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPUP_version_descr_ = { "@M3UA_Types.M3UA_ASPUP.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPUP_version_xer_, &OCTETSTRING_json_, &M3UA__ASPUP_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPUP_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPUP_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPUP_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPUP_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPUP_reserved_oer_ext_arr_, 0, M3UA__ASPUP_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPUP_reserved_descr_ = { "@M3UA_Types.M3UA_ASPUP.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPUP_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPUP_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPUP_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPUP_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPUP_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPUP_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPUP_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPUP_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPUP_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPUP.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPUP_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPUP_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPUP_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPUP_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPUP_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPUP.messageLength", &INTEGER_ber_, &M3UA__ASPUP_messageLength_raw_, &INTEGER_text_, &M3UA__ASPUP_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPUP__MessageParameters_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 M3UA__ASPUP__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPUP__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPUP_MessageParameters", NULL, &M3UA__ASPUP__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP__MessageParameters_aSP__Identifier_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPUP__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPUP__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPUP_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPUP_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 M3UA__ASPUP
const TTCN_Typedescriptor_t M3UA__ASPUP_descr_ = { "@M3UA_Types.M3UA_ASPUP", NULL, &M3UA__ASPUP_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPUP__Ack_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPUP__Ack_version_oer_ext_arr_[0] = {};
const int M3UA__ASPUP__Ack_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPUP__Ack_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPUP__Ack_version_oer_ext_arr_, 0, M3UA__ASPUP__Ack_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPUP__Ack_version_descr_ = { "@M3UA_Types.M3UA_ASPUP_Ack.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPUP__Ack_version_xer_, &OCTETSTRING_json_, &M3UA__ASPUP__Ack_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPUP__Ack_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPUP__Ack_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPUP__Ack_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPUP__Ack_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPUP__Ack_reserved_oer_ext_arr_, 0, M3UA__ASPUP__Ack_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPUP__Ack_reserved_descr_ = { "@M3UA_Types.M3UA_ASPUP_Ack.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPUP__Ack_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPUP__Ack_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPUP__Ack_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPUP__Ack_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPUP__Ack_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPUP__Ack_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPUP__Ack_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPUP__Ack_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPUP__Ack_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPUP_Ack.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPUP__Ack_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPUP__Ack_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPUP__Ack_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPUP__Ack_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPUP__Ack_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPUP_Ack.messageLength", &INTEGER_ber_, &M3UA__ASPUP__Ack_messageLength_raw_, &INTEGER_text_, &M3UA__ASPUP__Ack_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPUP__Ack__MessageParameters_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 M3UA__ASPUP__Ack__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPUP__Ack__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPUP_Ack_MessageParameters", NULL, &M3UA__ASPUP__Ack__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPUP__Ack_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__ASPUP__Ack
const TTCN_Typedescriptor_t M3UA__ASPUP__Ack_descr_ = { "@M3UA_Types.M3UA_ASPUP_Ack", NULL, &M3UA__ASPUP__Ack_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPUP__Ack_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPDN_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPDN_version_oer_ext_arr_[0] = {};
const int M3UA__ASPDN_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPDN_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPDN_version_oer_ext_arr_, 0, M3UA__ASPDN_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPDN_version_descr_ = { "@M3UA_Types.M3UA_ASPDN.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPDN_version_xer_, &OCTETSTRING_json_, &M3UA__ASPDN_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPDN_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPDN_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPDN_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPDN_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPDN_reserved_oer_ext_arr_, 0, M3UA__ASPDN_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPDN_reserved_descr_ = { "@M3UA_Types.M3UA_ASPDN.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPDN_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPDN_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPDN_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPDN_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPDN_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPDN_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPDN_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPDN_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPDN_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPDN.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPDN_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPDN_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPDN_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPDN_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPDN_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPDN.messageLength", &INTEGER_ber_, &M3UA__ASPDN_messageLength_raw_, &INTEGER_text_, &M3UA__ASPDN_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPDN__MessageParameters_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 M3UA__ASPDN__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPDN__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPDN_MessageParameters", NULL, &M3UA__ASPDN__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPDN__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPDN_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPDN_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 M3UA__ASPDN
const TTCN_Typedescriptor_t M3UA__ASPDN_descr_ = { "@M3UA_Types.M3UA_ASPDN", NULL, &M3UA__ASPDN_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPDN__Ack_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPDN__Ack_version_oer_ext_arr_[0] = {};
const int M3UA__ASPDN__Ack_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPDN__Ack_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPDN__Ack_version_oer_ext_arr_, 0, M3UA__ASPDN__Ack_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPDN__Ack_version_descr_ = { "@M3UA_Types.M3UA_ASPDN_Ack.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPDN__Ack_version_xer_, &OCTETSTRING_json_, &M3UA__ASPDN__Ack_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPDN__Ack_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPDN__Ack_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPDN__Ack_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPDN__Ack_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPDN__Ack_reserved_oer_ext_arr_, 0, M3UA__ASPDN__Ack_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPDN__Ack_reserved_descr_ = { "@M3UA_Types.M3UA_ASPDN_Ack.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPDN__Ack_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPDN__Ack_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPDN__Ack_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPDN__Ack_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPDN__Ack_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPDN__Ack_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPDN__Ack_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPDN__Ack_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPDN__Ack_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPDN_Ack.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPDN__Ack_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPDN__Ack_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPDN__Ack_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPDN__Ack_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPDN__Ack_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPDN_Ack.messageLength", &INTEGER_ber_, &M3UA__ASPDN__Ack_messageLength_raw_, &INTEGER_text_, &M3UA__ASPDN__Ack_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPDN__Ack__MessageParameters_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 M3UA__ASPDN__Ack__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPDN__Ack__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPDN_Ack_MessageParameters", NULL, &M3UA__ASPDN__Ack__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPDN__Ack_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__ASPDN__Ack
const TTCN_Typedescriptor_t M3UA__ASPDN__Ack_descr_ = { "@M3UA_Types.M3UA_ASPDN_Ack", NULL, &M3UA__ASPDN__Ack_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPDN__Ack_default_coding("RAW");
const XERdescriptor_t       M3UA__BEAT_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__BEAT_version_oer_ext_arr_[0] = {};
const int M3UA__BEAT_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__BEAT_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__BEAT_version_oer_ext_arr_, 0, M3UA__BEAT_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__BEAT_version_descr_ = { "@M3UA_Types.M3UA_BEAT.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__BEAT_version_xer_, &OCTETSTRING_json_, &M3UA__BEAT_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT_version_default_coding("RAW");
const XERdescriptor_t       M3UA__BEAT_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__BEAT_reserved_oer_ext_arr_[0] = {};
const int M3UA__BEAT_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__BEAT_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__BEAT_reserved_oer_ext_arr_, 0, M3UA__BEAT_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__BEAT_reserved_descr_ = { "@M3UA_Types.M3UA_BEAT.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__BEAT_reserved_xer_, &OCTETSTRING_json_, &M3UA__BEAT_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__BEAT_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__BEAT_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__BEAT_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__BEAT_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__BEAT_messageClassAndType_oer_ext_arr_, 0, M3UA__BEAT_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__BEAT_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_BEAT.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__BEAT_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__BEAT_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__BEAT_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__BEAT_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__BEAT_messageLength_descr_ = { "@M3UA_Types.M3UA_BEAT.messageLength", &INTEGER_ber_, &M3UA__BEAT_messageLength_raw_, &INTEGER_text_, &M3UA__BEAT_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__BEAT__MessageParameters_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 M3UA__BEAT__MessageParameters
const TTCN_Typedescriptor_t M3UA__BEAT__MessageParameters_descr_ = { "@M3UA_Types.M3UA_BEAT_MessageParameters", NULL, &M3UA__BEAT__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT__MessageParameters_heartbeat__Data_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__BEAT__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__BEAT_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__BEAT_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 M3UA__BEAT
const TTCN_Typedescriptor_t M3UA__BEAT_descr_ = { "@M3UA_Types.M3UA_BEAT", NULL, &M3UA__BEAT_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT_default_coding("RAW");
const XERdescriptor_t       M3UA__BEAT__Ack_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__BEAT__Ack_version_oer_ext_arr_[0] = {};
const int M3UA__BEAT__Ack_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__BEAT__Ack_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__BEAT__Ack_version_oer_ext_arr_, 0, M3UA__BEAT__Ack_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__BEAT__Ack_version_descr_ = { "@M3UA_Types.M3UA_BEAT_Ack.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__BEAT__Ack_version_xer_, &OCTETSTRING_json_, &M3UA__BEAT__Ack_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack_version_default_coding("RAW");
const XERdescriptor_t       M3UA__BEAT__Ack_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__BEAT__Ack_reserved_oer_ext_arr_[0] = {};
const int M3UA__BEAT__Ack_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__BEAT__Ack_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__BEAT__Ack_reserved_oer_ext_arr_, 0, M3UA__BEAT__Ack_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__BEAT__Ack_reserved_descr_ = { "@M3UA_Types.M3UA_BEAT_Ack.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__BEAT__Ack_reserved_xer_, &OCTETSTRING_json_, &M3UA__BEAT__Ack_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__BEAT__Ack_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__BEAT__Ack_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__BEAT__Ack_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__BEAT__Ack_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__BEAT__Ack_messageClassAndType_oer_ext_arr_, 0, M3UA__BEAT__Ack_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__BEAT__Ack_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_BEAT_Ack.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__BEAT__Ack_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__BEAT__Ack_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__BEAT__Ack_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__BEAT__Ack_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__BEAT__Ack_messageLength_descr_ = { "@M3UA_Types.M3UA_BEAT_Ack.messageLength", &INTEGER_ber_, &M3UA__BEAT__Ack_messageLength_raw_, &INTEGER_text_, &M3UA__BEAT__Ack_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__BEAT__Ack__MessageParameters_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 M3UA__BEAT__Ack__MessageParameters
const TTCN_Typedescriptor_t M3UA__BEAT__Ack__MessageParameters_descr_ = { "@M3UA_Types.M3UA_BEAT_Ack_MessageParameters", NULL, &M3UA__BEAT__Ack__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack__MessageParameters_heartbeat__Data_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__BEAT__Ack_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__BEAT__Ack
const TTCN_Typedescriptor_t M3UA__BEAT__Ack_descr_ = { "@M3UA_Types.M3UA_BEAT_Ack", NULL, &M3UA__BEAT__Ack_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__BEAT__Ack_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPAC_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPAC_version_oer_ext_arr_[0] = {};
const int M3UA__ASPAC_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPAC_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPAC_version_oer_ext_arr_, 0, M3UA__ASPAC_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPAC_version_descr_ = { "@M3UA_Types.M3UA_ASPAC.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPAC_version_xer_, &OCTETSTRING_json_, &M3UA__ASPAC_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPAC_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPAC_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPAC_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPAC_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPAC_reserved_oer_ext_arr_, 0, M3UA__ASPAC_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPAC_reserved_descr_ = { "@M3UA_Types.M3UA_ASPAC.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPAC_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPAC_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPAC_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPAC_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPAC_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPAC_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPAC_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPAC_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPAC_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPAC.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPAC_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPAC_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPAC_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPAC_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPAC_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPAC.messageLength", &INTEGER_ber_, &M3UA__ASPAC_messageLength_raw_, &INTEGER_text_, &M3UA__ASPAC_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPAC__MessageParameters_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 M3UA__ASPAC__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPAC__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPAC_MessageParameters", NULL, &M3UA__ASPAC__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC__MessageParameters_traffic__Mode__Type_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPAC_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 M3UA__ASPAC
const TTCN_Typedescriptor_t M3UA__ASPAC_descr_ = { "@M3UA_Types.M3UA_ASPAC", NULL, &M3UA__ASPAC_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPAC__Ack_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPAC__Ack_version_oer_ext_arr_[0] = {};
const int M3UA__ASPAC__Ack_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPAC__Ack_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPAC__Ack_version_oer_ext_arr_, 0, M3UA__ASPAC__Ack_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPAC__Ack_version_descr_ = { "@M3UA_Types.M3UA_ASPAC_Ack.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPAC__Ack_version_xer_, &OCTETSTRING_json_, &M3UA__ASPAC__Ack_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPAC__Ack_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPAC__Ack_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPAC__Ack_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPAC__Ack_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPAC__Ack_reserved_oer_ext_arr_, 0, M3UA__ASPAC__Ack_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPAC__Ack_reserved_descr_ = { "@M3UA_Types.M3UA_ASPAC_Ack.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPAC__Ack_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPAC__Ack_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPAC__Ack_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPAC__Ack_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPAC__Ack_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPAC__Ack_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPAC__Ack_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPAC__Ack_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPAC__Ack_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPAC_Ack.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPAC__Ack_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPAC__Ack_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPAC__Ack_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPAC__Ack_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPAC__Ack_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPAC_Ack.messageLength", &INTEGER_ber_, &M3UA__ASPAC__Ack_messageLength_raw_, &INTEGER_text_, &M3UA__ASPAC__Ack_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPAC__Ack__MessageParameters_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 M3UA__ASPAC__Ack__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPAC__Ack__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPAC_Ack_MessageParameters", NULL, &M3UA__ASPAC__Ack__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack__MessageParameters_traffic__Mode__Type_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPAC__Ack_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__ASPAC__Ack
const TTCN_Typedescriptor_t M3UA__ASPAC__Ack_descr_ = { "@M3UA_Types.M3UA_ASPAC_Ack", NULL, &M3UA__ASPAC__Ack_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPAC__Ack_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPIA_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPIA_version_oer_ext_arr_[0] = {};
const int M3UA__ASPIA_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPIA_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPIA_version_oer_ext_arr_, 0, M3UA__ASPIA_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPIA_version_descr_ = { "@M3UA_Types.M3UA_ASPIA.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPIA_version_xer_, &OCTETSTRING_json_, &M3UA__ASPIA_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPIA_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPIA_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPIA_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPIA_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPIA_reserved_oer_ext_arr_, 0, M3UA__ASPIA_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPIA_reserved_descr_ = { "@M3UA_Types.M3UA_ASPIA.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPIA_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPIA_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPIA_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPIA_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPIA_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPIA_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPIA_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPIA_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPIA_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPIA.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPIA_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPIA_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPIA_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPIA_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPIA_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPIA.messageLength", &INTEGER_ber_, &M3UA__ASPIA_messageLength_raw_, &INTEGER_text_, &M3UA__ASPIA_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPIA__MessageParameters_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 M3UA__ASPIA__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPIA__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPIA_MessageParameters", NULL, &M3UA__ASPIA__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPIA__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPIA__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPIA_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPIA_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 M3UA__ASPIA
const TTCN_Typedescriptor_t M3UA__ASPIA_descr_ = { "@M3UA_Types.M3UA_ASPIA", NULL, &M3UA__ASPIA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPIA__Ack_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPIA__Ack_version_oer_ext_arr_[0] = {};
const int M3UA__ASPIA__Ack_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPIA__Ack_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPIA__Ack_version_oer_ext_arr_, 0, M3UA__ASPIA__Ack_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPIA__Ack_version_descr_ = { "@M3UA_Types.M3UA_ASPIA_Ack.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPIA__Ack_version_xer_, &OCTETSTRING_json_, &M3UA__ASPIA__Ack_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack_version_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPIA__Ack_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPIA__Ack_reserved_oer_ext_arr_[0] = {};
const int M3UA__ASPIA__Ack_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPIA__Ack_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__ASPIA__Ack_reserved_oer_ext_arr_, 0, M3UA__ASPIA__Ack_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPIA__Ack_reserved_descr_ = { "@M3UA_Types.M3UA_ASPIA_Ack.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__ASPIA__Ack_reserved_xer_, &OCTETSTRING_json_, &M3UA__ASPIA__Ack_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__ASPIA__Ack_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__ASPIA__Ack_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__ASPIA__Ack_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__ASPIA__Ack_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__ASPIA__Ack_messageClassAndType_oer_ext_arr_, 0, M3UA__ASPIA__Ack_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__ASPIA__Ack_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_ASPIA_Ack.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__ASPIA__Ack_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__ASPIA__Ack_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPIA__Ack_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__ASPIA__Ack_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__ASPIA__Ack_messageLength_descr_ = { "@M3UA_Types.M3UA_ASPIA_Ack.messageLength", &INTEGER_ber_, &M3UA__ASPIA__Ack_messageLength_raw_, &INTEGER_text_, &M3UA__ASPIA__Ack_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPIA__Ack__MessageParameters_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 M3UA__ASPIA__Ack__MessageParameters
const TTCN_Typedescriptor_t M3UA__ASPIA__Ack__MessageParameters_descr_ = { "@M3UA_Types.M3UA_ASPIA_Ack_MessageParameters", NULL, &M3UA__ASPIA__Ack__MessageParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack__MessageParameters_routing__Context_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack__MessageParameters_info__String_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack__MessageParameters_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__ASPIA__Ack_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for M3UA__ASPIA__Ack
const TTCN_Typedescriptor_t M3UA__ASPIA__Ack_descr_ = { "@M3UA_Types.M3UA_ASPIA_Ack", NULL, &M3UA__ASPIA__Ack_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__ASPIA__Ack_default_coding("RAW");
const XERdescriptor_t       M3UA__REG__REQ_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__REG__REQ_version_oer_ext_arr_[0] = {};
const int M3UA__REG__REQ_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__REG__REQ_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__REG__REQ_version_oer_ext_arr_, 0, M3UA__REG__REQ_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__REG__REQ_version_descr_ = { "@M3UA_Types.M3UA_REG_REQ.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__REG__REQ_version_xer_, &OCTETSTRING_json_, &M3UA__REG__REQ_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__REQ_version_default_coding("RAW");
const XERdescriptor_t       M3UA__REG__REQ_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__REG__REQ_reserved_oer_ext_arr_[0] = {};
const int M3UA__REG__REQ_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__REG__REQ_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__REG__REQ_reserved_oer_ext_arr_, 0, M3UA__REG__REQ_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__REG__REQ_reserved_descr_ = { "@M3UA_Types.M3UA_REG_REQ.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__REG__REQ_reserved_xer_, &OCTETSTRING_json_, &M3UA__REG__REQ_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__REQ_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__REG__REQ_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__REG__REQ_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__REG__REQ_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__REG__REQ_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__REG__REQ_messageClassAndType_oer_ext_arr_, 0, M3UA__REG__REQ_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__REG__REQ_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_REG_REQ.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__REG__REQ_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__REG__REQ_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__REQ_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__REG__REQ_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__REG__REQ_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__REG__REQ_messageLength_descr_ = { "@M3UA_Types.M3UA_REG_REQ.messageLength", &INTEGER_ber_, &M3UA__REG__REQ_messageLength_raw_, &INTEGER_text_, &M3UA__REG__REQ_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__REQ_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Routing__Keys_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 M3UA__Routing__Keys
const TTCN_Typedescriptor_t M3UA__Routing__Keys_descr_ = { "@M3UA_Types.M3UA_Routing_Keys", NULL, &M3UA__Routing__Keys_raw_, NULL, NULL, NULL, NULL, NULL, &M3UA__Routing__Key_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Routing__Keys_0_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Routing__Keys_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__REG__REQ_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__REG__REQ_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 M3UA__REG__REQ
const TTCN_Typedescriptor_t M3UA__REG__REQ_descr_ = { "@M3UA_Types.M3UA_REG_REQ", NULL, &M3UA__REG__REQ_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__REQ_default_coding("RAW");
const XERdescriptor_t       M3UA__REG__RSP_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__REG__RSP_version_oer_ext_arr_[0] = {};
const int M3UA__REG__RSP_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__REG__RSP_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__REG__RSP_version_oer_ext_arr_, 0, M3UA__REG__RSP_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__REG__RSP_version_descr_ = { "@M3UA_Types.M3UA_REG_RSP.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__REG__RSP_version_xer_, &OCTETSTRING_json_, &M3UA__REG__RSP_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__RSP_version_default_coding("RAW");
const XERdescriptor_t       M3UA__REG__RSP_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__REG__RSP_reserved_oer_ext_arr_[0] = {};
const int M3UA__REG__RSP_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__REG__RSP_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__REG__RSP_reserved_oer_ext_arr_, 0, M3UA__REG__RSP_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__REG__RSP_reserved_descr_ = { "@M3UA_Types.M3UA_REG_RSP.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__REG__RSP_reserved_xer_, &OCTETSTRING_json_, &M3UA__REG__RSP_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__RSP_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__REG__RSP_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__REG__RSP_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__REG__RSP_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__REG__RSP_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__REG__RSP_messageClassAndType_oer_ext_arr_, 0, M3UA__REG__RSP_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__REG__RSP_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_REG_RSP.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__REG__RSP_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__REG__RSP_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__RSP_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__REG__RSP_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__REG__RSP_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__REG__RSP_messageLength_descr_ = { "@M3UA_Types.M3UA_REG_RSP.messageLength", &INTEGER_ber_, &M3UA__REG__RSP_messageLength_raw_, &INTEGER_text_, &M3UA__REG__RSP_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__RSP_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Registration__Results_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 M3UA__Registration__Results
const TTCN_Typedescriptor_t M3UA__Registration__Results_descr_ = { "@M3UA_Types.M3UA_Registration_Results", NULL, &M3UA__Registration__Results_raw_, NULL, NULL, NULL, NULL, NULL, &M3UA__Registration__Result_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Registration__Results_0_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Registration__Results_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__REG__RSP_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__REG__RSP_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 M3UA__REG__RSP
const TTCN_Typedescriptor_t M3UA__REG__RSP_descr_ = { "@M3UA_Types.M3UA_REG_RSP", NULL, &M3UA__REG__RSP_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__REG__RSP_default_coding("RAW");
const XERdescriptor_t       M3UA__DEREG__REQ_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DEREG__REQ_version_oer_ext_arr_[0] = {};
const int M3UA__DEREG__REQ_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DEREG__REQ_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DEREG__REQ_version_oer_ext_arr_, 0, M3UA__DEREG__REQ_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DEREG__REQ_version_descr_ = { "@M3UA_Types.M3UA_DEREG_REQ.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DEREG__REQ_version_xer_, &OCTETSTRING_json_, &M3UA__DEREG__REQ_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DEREG__REQ_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DEREG__REQ_reserved_oer_ext_arr_[0] = {};
const int M3UA__DEREG__REQ_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DEREG__REQ_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DEREG__REQ_reserved_oer_ext_arr_, 0, M3UA__DEREG__REQ_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DEREG__REQ_reserved_descr_ = { "@M3UA_Types.M3UA_DEREG_REQ.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DEREG__REQ_reserved_xer_, &OCTETSTRING_json_, &M3UA__DEREG__REQ_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DEREG__REQ_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DEREG__REQ_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DEREG__REQ_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DEREG__REQ_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DEREG__REQ_messageClassAndType_oer_ext_arr_, 0, M3UA__DEREG__REQ_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DEREG__REQ_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DEREG_REQ.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DEREG__REQ_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DEREG__REQ_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DEREG__REQ_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DEREG__REQ_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DEREG__REQ_messageLength_descr_ = { "@M3UA_Types.M3UA_DEREG_REQ.messageLength", &INTEGER_ber_, &M3UA__DEREG__REQ_messageLength_raw_, &INTEGER_text_, &M3UA__DEREG__REQ_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ_messageLength_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ__MsgParams_routing__Context_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DEREG__REQ__MsgParams_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 M3UA__DEREG__REQ__MsgParams
const TTCN_Typedescriptor_t M3UA__DEREG__REQ__MsgParams_descr_ = { "@M3UA_Types.M3UA_DEREG_REQ_MsgParams", NULL, &M3UA__DEREG__REQ__MsgParams_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ__MsgParams_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DEREG__REQ_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 M3UA__DEREG__REQ
const TTCN_Typedescriptor_t M3UA__DEREG__REQ_descr_ = { "@M3UA_Types.M3UA_DEREG_REQ", NULL, &M3UA__DEREG__REQ_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__REQ_default_coding("RAW");
const XERdescriptor_t       M3UA__DEREG__RSP_version_xer_ = { {"version>\n", "version>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DEREG__RSP_version_oer_ext_arr_[0] = {};
const int M3UA__DEREG__RSP_version_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DEREG__RSP_version_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DEREG__RSP_version_oer_ext_arr_, 0, M3UA__DEREG__RSP_version_oer_p_};
const TTCN_Typedescriptor_t M3UA__DEREG__RSP_version_descr_ = { "@M3UA_Types.M3UA_DEREG_RSP.version", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DEREG__RSP_version_xer_, &OCTETSTRING_json_, &M3UA__DEREG__RSP_version_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__RSP_version_default_coding("RAW");
const XERdescriptor_t       M3UA__DEREG__RSP_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DEREG__RSP_reserved_oer_ext_arr_[0] = {};
const int M3UA__DEREG__RSP_reserved_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DEREG__RSP_reserved_oer_ = { -1, TRUE, 1, FALSE, 0, 0, M3UA__DEREG__RSP_reserved_oer_ext_arr_, 0, M3UA__DEREG__RSP_reserved_oer_p_};
const TTCN_Typedescriptor_t M3UA__DEREG__RSP_reserved_descr_ = { "@M3UA_Types.M3UA_DEREG_RSP.reserved", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &M3UA__DEREG__RSP_reserved_xer_, &OCTETSTRING_json_, &M3UA__DEREG__RSP_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__RSP_reserved_default_coding("RAW");
const XERdescriptor_t       M3UA__DEREG__RSP_messageClassAndType_xer_ = { {"messageClassAndType>\n", "messageClassAndType>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int M3UA__DEREG__RSP_messageClassAndType_oer_ext_arr_[0] = {};
const int M3UA__DEREG__RSP_messageClassAndType_oer_p_[0] = {};
const TTCN_OERdescriptor_t M3UA__DEREG__RSP_messageClassAndType_oer_ = { -1, TRUE, 2, FALSE, 0, 0, M3UA__DEREG__RSP_messageClassAndType_oer_ext_arr_, 0, M3UA__DEREG__RSP_messageClassAndType_oer_p_};
const TTCN_Typedescriptor_t M3UA__DEREG__RSP_messageClassAndType_descr_ = { "@M3UA_Types.M3UA_DEREG_RSP.messageClassAndType", &OCTETSTRING_ber_, &General__Types::OCT2_raw_, &OCTETSTRING_text_, &M3UA__DEREG__RSP_messageClassAndType_xer_, &OCTETSTRING_json_, &M3UA__DEREG__RSP_messageClassAndType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__RSP_messageClassAndType_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DEREG__RSP_messageLength_raw_ = {32,SG_NO,ORDER_MSB,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       M3UA__DEREG__RSP_messageLength_xer_ = { {"messageLength>\n", "messageLength>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t M3UA__DEREG__RSP_messageLength_descr_ = { "@M3UA_Types.M3UA_DEREG_RSP.messageLength", &INTEGER_ber_, &M3UA__DEREG__RSP_messageLength_raw_, &INTEGER_text_, &M3UA__DEREG__RSP_messageLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__RSP_messageLength_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__Deregistration__Results_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 M3UA__Deregistration__Results
const TTCN_Typedescriptor_t M3UA__Deregistration__Results_descr_ = { "@M3UA_Types.M3UA_Deregistration_Results", NULL, &M3UA__Deregistration__Results_raw_, NULL, NULL, NULL, NULL, NULL, &M3UA__Deregistration__Result_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__Deregistration__Results_0_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__Deregistration__Results_default_coding("RAW");
UNIVERSAL_CHARSTRING M3UA__DEREG__RSP_messageParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t M3UA__DEREG__RSP_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 M3UA__DEREG__RSP
const TTCN_Typedescriptor_t M3UA__DEREG__RSP_descr_ = { "@M3UA_Types.M3UA_DEREG_RSP", NULL, &M3UA__DEREG__RSP_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING M3UA__DEREG__RSP_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__M3UA_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for PDU__M3UA
const TTCN_Typedescriptor_t PDU__M3UA_descr_ = { "@M3UA_Types.PDU_M3UA", NULL, &PDU__M3UA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ERR_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__NOTIFY_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DATA_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DUNA_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DAVA_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DAUD_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__SCON_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DUPU_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DRST_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPUP_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPDN_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__BEAT_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__BEAT__Ack_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPUP__Ack_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPDN__Ack_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPAC_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPIA_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPAC__Ack_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__ASPIA__Ack_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__REG__REQ_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__REG__RSP_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DEREG__REQ_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_m3UA__DEREG__RSP_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__M3UA_default_coding("RAW");
TTCN_Module module_object("M3UA_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 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 */

M3UA__Point__Code::M3UA__Point__Code()
{
}

M3UA__Point__Code::M3UA__Point__Code(const OCTETSTRING& par_mask,
    const OCTETSTRING& par_affected__Point__Code)
  :   field_mask(par_mask),
  field_affected__Point__Code(par_affected__Point__Code)
{
}

M3UA__Point__Code::M3UA__Point__Code(const M3UA__Point__Code& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Point_Code.");
if (other_value.mask().is_bound()) field_mask = other_value.mask();
else field_mask.clean_up();
if (other_value.affected__Point__Code().is_bound()) field_affected__Point__Code = other_value.affected__Point__Code();
else field_affected__Point__Code.clean_up();
}

void M3UA__Point__Code::clean_up()
{
field_mask.clean_up();
field_affected__Point__Code.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Point__Code::get_descriptor() const { return &M3UA__Point__Code_descr_; }
M3UA__Point__Code& M3UA__Point__Code::operator=(const M3UA__Point__Code& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Point_Code.");
  if (other_value.mask().is_bound()) field_mask = other_value.mask();
  else field_mask.clean_up();
  if (other_value.affected__Point__Code().is_bound()) field_affected__Point__Code = other_value.affected__Point__Code();
  else field_affected__Point__Code.clean_up();
}
return *this;
}

boolean M3UA__Point__Code::operator==(const M3UA__Point__Code& other_value) const
{
return field_mask==other_value.field_mask
  && field_affected__Point__Code==other_value.field_affected__Point__Code;
}

boolean M3UA__Point__Code::is_bound() const
{
return (field_mask.is_bound())
  || (field_affected__Point__Code.is_bound());
}
boolean M3UA__Point__Code::is_value() const
{
return field_mask.is_value()
  && field_affected__Point__Code.is_value();
}
void M3UA__Point__Code::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ mask := ");
field_mask.log();
TTCN_Logger::log_event_str(", affected_Point_Code := ");
field_affected__Point__Code.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Point__Code::set_implicit_omit()
{
if (mask().is_bound()) mask().set_implicit_omit();
if (affected__Point__Code().is_bound()) affected__Point__Code().set_implicit_omit();
}

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

void M3UA__Point__Code::encode_text(Text_Buf& text_buf) const
{
field_mask.encode_text(text_buf);
field_affected__Point__Code.encode_text(text_buf);
}

void M3UA__Point__Code::decode_text(Text_Buf& text_buf)
{
field_mask.decode_text(text_buf);
field_affected__Point__Code.decode_text(text_buf);
}

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

int M3UA__Point__Code::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::OCT3_descr_.raw);
  encoded_length += field_mask.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_affected__Point__Code.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct M3UA__Point__Code_template::single_value_struct {
OCTETSTRING_template field_mask;
OCTETSTRING_template field_affected__Point__Code;
};

void M3UA__Point__Code_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_mask = ANY_VALUE;
single_value->field_affected__Point__Code = ANY_VALUE;
}
}
}

void M3UA__Point__Code_template::copy_value(const M3UA__Point__Code& other_value)
{
single_value = new single_value_struct;
if (other_value.mask().is_bound()) {
  single_value->field_mask = other_value.mask();
} else {
  single_value->field_mask.clean_up();
}
if (other_value.affected__Point__Code().is_bound()) {
  single_value->field_affected__Point__Code = other_value.affected__Point__Code();
} else {
  single_value->field_affected__Point__Code.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Point__Code_template::copy_template(const M3UA__Point__Code_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.mask().get_selection()) {
single_value->field_mask = other_value.mask();
} else {
single_value->field_mask.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.affected__Point__Code().get_selection()) {
single_value->field_affected__Point__Code = other_value.affected__Point__Code();
} else {
single_value->field_affected__Point__Code.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 M3UA__Point__Code_template[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 M3UA__Point__Code_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Point__Code_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 @M3UA_Types.M3UA_Point_Code.");
break;
}
set_selection(other_value);
}

M3UA__Point__Code_template::M3UA__Point__Code_template()
{
}

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

M3UA__Point__Code_template::M3UA__Point__Code_template(const M3UA__Point__Code& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Point__Code_template::match(const M3UA__Point__Code& 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.mask().is_bound()) return FALSE;
if(!single_value->field_mask.match(other_value.mask(), legacy))return FALSE;
if(!other_value.affected__Point__Code().is_bound()) return FALSE;
if(!single_value->field_affected__Point__Code.match(other_value.affected__Point__Code(), 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 @M3UA_Types.M3UA_Point_Code.");
}
return FALSE;
}

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

boolean M3UA__Point__Code_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_mask.is_value()
 && single_value->field_affected__Point__Code.is_value();
}

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

M3UA__Point__Code M3UA__Point__Code_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 @M3UA_Types.M3UA_Point_Code.");
M3UA__Point__Code ret_val;
if (single_value->field_mask.is_bound()) {
ret_val.mask() = single_value->field_mask.valueof();
}
if (single_value->field_affected__Point__Code.is_bound()) {
ret_val.affected__Point__Code() = single_value->field_affected__Point__Code.valueof();
}
return ret_val;
}

void M3UA__Point__Code_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 @M3UA_Types.M3UA_Point_Code.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Point__Code_template[list_length];
}

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

OCTETSTRING_template& M3UA__Point__Code_template::mask()
{
set_specific();
return single_value->field_mask;
}

const OCTETSTRING_template& M3UA__Point__Code_template::mask() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mask of a non-specific template of type @M3UA_Types.M3UA_Point_Code.");
return single_value->field_mask;
}

OCTETSTRING_template& M3UA__Point__Code_template::affected__Point__Code()
{
set_specific();
return single_value->field_affected__Point__Code;
}

const OCTETSTRING_template& M3UA__Point__Code_template::affected__Point__Code() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field affected_Point_Code of a non-specific template of type @M3UA_Types.M3UA_Point_Code.");
return single_value->field_affected__Point__Code;
}

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

void M3UA__Point__Code_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ mask := ");
single_value->field_mask.log();
TTCN_Logger::log_event_str(", affected_Point_Code := ");
single_value->field_affected__Point__Code.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 M3UA__Point__Code_template::log_match(const M3UA__Point__Code& 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_mask.match(match_value.mask(), legacy)){
TTCN_Logger::log_logmatch_info(".mask");
single_value->field_mask.log_match(match_value.mask(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_affected__Point__Code.match(match_value.affected__Point__Code(), legacy)){
TTCN_Logger::log_logmatch_info(".affected_Point_Code");
single_value->field_affected__Point__Code.log_match(match_value.affected__Point__Code(), 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("{ mask := ");
single_value->field_mask.log_match(match_value.mask(), legacy);
TTCN_Logger::log_event_str(", affected_Point_Code := ");
single_value->field_affected__Point__Code.log_match(match_value.affected__Point__Code(), 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 M3UA__Point__Code_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (mask().is_bound()) mask().set_implicit_omit();
if (affected__Point__Code().is_bound()) affected__Point__Code().set_implicit_omit();
}

void M3UA__Point__Code_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_mask.encode_text(text_buf);
single_value->field_affected__Point__Code.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 @M3UA_Types.M3UA_Point_Code.");
}
}

void M3UA__Point__Code_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_mask.decode_text(text_buf);
single_value->field_affected__Point__Code.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 M3UA__Point__Code_template[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 @M3UA_Types.M3UA_Point_Code.");
}
}

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

void M3UA__Point__Code_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_mask.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Point_Code");
single_value->field_affected__Point__Code.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Point_Code");
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 : "@M3UA_Types.M3UA_Point_Code");
}

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

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


const M3UA__Point__Code M3UA__Point__Codes::UNBOUND_ELEM;
M3UA__Point__Codes::M3UA__Point__Codes()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean M3UA__Point__Codes::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int M3UA__Point__Codes::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @M3UA_Types.M3UA_Point_Codes.");
return val_ptr->n_elements;
}

int M3UA__Point__Codes::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @M3UA_Types.M3UA_Point_Codes.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void M3UA__Point__Codes::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void M3UA__Point__Codes::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void M3UA__Point__Codes::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@M3UA_Types.M3UA_Point_Codes");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@M3UA_Types.M3UA_Point_Codes");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void M3UA__Point__Codes::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @M3UA_Types.M3UA_Point_Codes.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void M3UA__Point__Codes::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @M3UA_Types.M3UA_Point_Codes.");
val_ptr->value_elements = (M3UA__Point__Code**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new M3UA__Point__Code;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void M3UA__Point__Codes::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 M3UA__Point__Codes::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 M3UA__Point__Codes::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean /*no_err*/, int sel_field, boolean first_call, const RAW_Force_Omit*){
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int decoded_field_length=0;
  size_t start_of_field=0;
  if(first_call) {
    clean_up();
    val_ptr=new recordof_setof_struct;
    val_ptr->ref_count=1;
    val_ptr->n_elements=0;
    val_ptr->value_elements=NULL;
  }
  int start_field=val_ptr->n_elements;
  if(p_td.raw->fieldlength || sel_field!=-1){
    int a=0;
    if(sel_field==-1) sel_field=p_td.raw->fieldlength;
    start_of_field=p_buf.get_pos_bit();
    for(a=0;a<sel_field;a++){
      decoded_field_length=(*this)[a+start_field].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        while(a>=0){
          delete &(*this)[a+start_field];
          a--;
          val_ptr->n_elements--;
        }
        p_buf.set_pos_bit(start_of_field);
        return decoded_field_length;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
    }
    if(a==0) val_ptr->n_elements=0;
  } else {
    if(limit==0){
      if(!first_call) return -1;
      val_ptr->n_elements=0;
      return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
    }
    int a=start_field;
    while(limit>0){
      start_of_field=p_buf.get_pos_bit();
      decoded_field_length=(*this)[a].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        delete &(*this)[a];
        val_ptr->n_elements--;
        p_buf.set_pos_bit(start_of_field);
        if(a>start_field){
        return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
        } else return -1;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
      a++;
    }
  }
 return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
}

int M3UA__Point__Codes::RAW_encode(const TTCN_Typedescriptor_t& p_td,RAW_enc_tree& myleaf) const{
  int encoded_length=0;
  int encoded_num_of_records=p_td.raw->fieldlength?smaller(val_ptr->n_elements, p_td.raw->fieldlength):val_ptr->n_elements;
  myleaf.isleaf=FALSE;
  myleaf.rec_of=TRUE;
  myleaf.body.node.num_of_nodes=encoded_num_of_records;
  myleaf.body.node.nodes=init_nodes_of_enc_tree(encoded_num_of_records);
  for(int a=0;a<encoded_num_of_records;a++){
    myleaf.body.node.nodes[a]=new RAW_enc_tree(TRUE,&myleaf,&(myleaf.curr_pos),a,p_td.oftype_descr->raw);
    encoded_length+=(*this)[a].RAW_encode(*p_td.oftype_descr,*myleaf.body.node.nodes[a]);
  }
 return myleaf.length=encoded_length;
}

void M3UA__Point__Codes_template::copy_value(const M3UA__Point__Codes& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @M3UA_Types.M3UA_Point_Codes with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (M3UA__Point__Code_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new M3UA__Point__Code_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new M3UA__Point__Code_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Point__Codes_template::copy_template(const M3UA__Point__Codes_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (M3UA__Point__Code_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new M3UA__Point__Code_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new M3UA__Point__Code_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new M3UA__Point__Codes_template[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 M3UA__Point__Codes_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Point__Codes_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 @M3UA_Types.M3UA_Point_Codes.");
break;
}
set_selection(other_value);
}

boolean M3UA__Point__Codes_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const M3UA__Point__Codes_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const M3UA__Point__Codes*)value_ptr)[value_index], legacy);
else return ((const M3UA__Point__Codes_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

M3UA__Point__Codes_template::M3UA__Point__Codes_template()
{
}

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

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

M3UA__Point__Codes_template::M3UA__Point__Codes_template(const M3UA__Point__Codes& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void M3UA__Point__Codes_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

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

M3UA__Point__Code_template& M3UA__Point__Codes_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @M3UA_Types.M3UA_Point_Codes using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @M3UA_Types.M3UA_Point_Codes.");
    break;
}
return *single_value.value_elements[index_value];
}

M3UA__Point__Code_template& M3UA__Point__Codes_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @M3UA_Types.M3UA_Point_Codes.");
return (*this)[(int)index_value];
}

const M3UA__Point__Code_template& M3UA__Point__Codes_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @M3UA_Types.M3UA_Point_Codes using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @M3UA_Types.M3UA_Point_Codes.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @M3UA_Types.M3UA_Point_Codes: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const M3UA__Point__Code_template& M3UA__Point__Codes_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @M3UA_Types.M3UA_Point_Codes.");
return (*this)[(int)index_value];
}

void M3UA__Point__Codes_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @M3UA_Types.M3UA_Point_Codes.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (M3UA__Point__Code_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new M3UA__Point__Code_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new M3UA__Point__Code_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (M3UA__Point__Code_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int M3UA__Point__Codes_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int M3UA__Point__Codes_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @M3UA_Types.M3UA_Point_Codes which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @M3UA_Types.M3UA_Point_Codes containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @M3UA_Types.M3UA_Point_Codes containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @M3UA_Types.M3UA_Point_Codes containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @M3UA_Types.M3UA_Point_Codes containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @M3UA_Types.M3UA_Point_Codes containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @M3UA_Types.M3UA_Point_Codes.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @M3UA_Types.M3UA_Point_Codes");
}

boolean M3UA__Point__Codes_template::match(const M3UA__Point__Codes& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @M3UA_Types.M3UA_Point_Codes.");
}
return FALSE;
}

boolean M3UA__Point__Codes_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

M3UA__Point__Codes M3UA__Point__Codes_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 @M3UA_Types.M3UA_Point_Codes.");
M3UA__Point__Codes ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

M3UA__Point__Codes M3UA__Point__Codes_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

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

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

void M3UA__Point__Codes_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new M3UA__Point__Codes_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @M3UA_Types.M3UA_Point_Codes.");
}
set_selection(template_type);
}

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

void M3UA__Point__Codes_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void M3UA__Point__Codes_template::log_match(const M3UA__Point__Codes& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void M3UA__Point__Codes_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @M3UA_Types.M3UA_Point_Codes.");
single_value.value_elements = (M3UA__Point__Code_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new M3UA__Point__Code_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new M3UA__Point__Codes_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @M3UA_Types.M3UA_Point_Codes.");
}
}

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

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

void M3UA__Point__Codes_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void M3UA__Point__Codes_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    M3UA__Point__Codes_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Point__Codes_template* precondition = new M3UA__Point__Codes_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Point__Codes_template* implied_template = new M3UA__Point__Codes_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Point__Codes_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@M3UA_Types.M3UA_Point_Codes");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void M3UA__Point__Codes_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Point_Codes");
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 : "@M3UA_Types.M3UA_Point_Codes");
}

boolean M3UA__Point__Codes_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
M3UA__Error__Code::M3UA__Error__Code()
{
}

M3UA__Error__Code::M3UA__Error__Code(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_errorCode)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_errorCode(par_errorCode)
{
}

M3UA__Error__Code::M3UA__Error__Code(const M3UA__Error__Code& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Error_Code.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.errorCode().is_bound()) field_errorCode = other_value.errorCode();
else field_errorCode.clean_up();
}

void M3UA__Error__Code::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_errorCode.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Error__Code::get_descriptor() const { return &M3UA__Error__Code_descr_; }
M3UA__Error__Code& M3UA__Error__Code::operator=(const M3UA__Error__Code& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Error_Code.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.errorCode().is_bound()) field_errorCode = other_value.errorCode();
  else field_errorCode.clean_up();
}
return *this;
}

boolean M3UA__Error__Code::operator==(const M3UA__Error__Code& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_errorCode==other_value.field_errorCode;
}

boolean M3UA__Error__Code::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_errorCode.is_bound());
}
boolean M3UA__Error__Code::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_errorCode.is_value();
}
void M3UA__Error__Code::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", errorCode := ");
field_errorCode.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Error__Code::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (errorCode().is_bound()) errorCode().set_implicit_omit();
}

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

void M3UA__Error__Code::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_errorCode.encode_text(text_buf);
}

void M3UA__Error__Code::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_errorCode.decode_text(text_buf);
}

void M3UA__Error__Code::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 M3UA__Error__Code::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 M3UA__Error__Code::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Error__Code_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Error__Code_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Error__Code_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_errorCode.RAW_decode(General__Types::OCT4_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 M3UA__Error__Code::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Error__Code_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Error__Code_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_errorCode.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Error__Code_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_errorCode;
};

void M3UA__Error__Code_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_errorCode = ANY_VALUE;
}
}
}

void M3UA__Error__Code_template::copy_value(const M3UA__Error__Code& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.errorCode().is_bound()) {
  single_value->field_errorCode = other_value.errorCode();
} else {
  single_value->field_errorCode.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Error__Code_template::copy_template(const M3UA__Error__Code_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.errorCode().get_selection()) {
single_value->field_errorCode = other_value.errorCode();
} else {
single_value->field_errorCode.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 M3UA__Error__Code_template[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 M3UA__Error__Code_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Error__Code_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 @M3UA_Types.M3UA_Error_Code.");
break;
}
set_selection(other_value);
}

M3UA__Error__Code_template::M3UA__Error__Code_template()
{
}

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

M3UA__Error__Code_template::M3UA__Error__Code_template(const M3UA__Error__Code& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Error__Code_template::match(const M3UA__Error__Code& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.errorCode().is_bound()) return FALSE;
if(!single_value->field_errorCode.match(other_value.errorCode(), 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 @M3UA_Types.M3UA_Error_Code.");
}
return FALSE;
}

boolean M3UA__Error__Code_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_errorCode.is_bound();
}

boolean M3UA__Error__Code_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_errorCode.is_value();
}

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

M3UA__Error__Code M3UA__Error__Code_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 @M3UA_Types.M3UA_Error_Code.");
M3UA__Error__Code ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_errorCode.is_bound()) {
ret_val.errorCode() = single_value->field_errorCode.valueof();
}
return ret_val;
}

void M3UA__Error__Code_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 @M3UA_Types.M3UA_Error_Code.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Error__Code_template[list_length];
}

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

OCTETSTRING_template& M3UA__Error__Code_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Error__Code_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Error_Code.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Error__Code_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Error__Code_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Error_Code.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Error__Code_template::errorCode()
{
set_specific();
return single_value->field_errorCode;
}

const OCTETSTRING_template& M3UA__Error__Code_template::errorCode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field errorCode of a non-specific template of type @M3UA_Types.M3UA_Error_Code.");
return single_value->field_errorCode;
}

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

void M3UA__Error__Code_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", errorCode := ");
single_value->field_errorCode.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 M3UA__Error__Code_template::log_match(const M3UA__Error__Code& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_errorCode.match(match_value.errorCode(), legacy)){
TTCN_Logger::log_logmatch_info(".errorCode");
single_value->field_errorCode.log_match(match_value.errorCode(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", errorCode := ");
single_value->field_errorCode.log_match(match_value.errorCode(), 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 M3UA__Error__Code_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (errorCode().is_bound()) errorCode().set_implicit_omit();
}

void M3UA__Error__Code_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_errorCode.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 @M3UA_Types.M3UA_Error_Code.");
}
}

void M3UA__Error__Code_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_errorCode.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 M3UA__Error__Code_template[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 @M3UA_Types.M3UA_Error_Code.");
}
}

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

void M3UA__Error__Code_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Error_Code");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Error_Code");
single_value->field_errorCode.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Error_Code");
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 : "@M3UA_Types.M3UA_Error_Code");
}

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

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

M3UA__Routing__Context::M3UA__Routing__Context()
{
}

M3UA__Routing__Context::M3UA__Routing__Context(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_routingContext)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_routingContext(par_routingContext)
{
}

M3UA__Routing__Context::M3UA__Routing__Context(const M3UA__Routing__Context& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Routing_Context.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.routingContext().is_bound()) field_routingContext = other_value.routingContext();
else field_routingContext.clean_up();
}

void M3UA__Routing__Context::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_routingContext.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Routing__Context::get_descriptor() const { return &M3UA__Routing__Context_descr_; }
M3UA__Routing__Context& M3UA__Routing__Context::operator=(const M3UA__Routing__Context& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Routing_Context.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.routingContext().is_bound()) field_routingContext = other_value.routingContext();
  else field_routingContext.clean_up();
}
return *this;
}

boolean M3UA__Routing__Context::operator==(const M3UA__Routing__Context& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_routingContext==other_value.field_routingContext;
}

boolean M3UA__Routing__Context::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_routingContext.is_bound());
}
boolean M3UA__Routing__Context::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_routingContext.is_value();
}
void M3UA__Routing__Context::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", routingContext := ");
field_routingContext.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Routing__Context::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (routingContext().is_bound()) routingContext().set_implicit_omit();
}

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

void M3UA__Routing__Context::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_routingContext.encode_text(text_buf);
}

void M3UA__Routing__Context::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_routingContext.decode_text(text_buf);
}

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

int M3UA__Routing__Context::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Routing__Context_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_routingContext.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Routing__Context_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_routingContext;
};

void M3UA__Routing__Context_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_routingContext = ANY_VALUE;
}
}
}

void M3UA__Routing__Context_template::copy_value(const M3UA__Routing__Context& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.routingContext().is_bound()) {
  single_value->field_routingContext = other_value.routingContext();
} else {
  single_value->field_routingContext.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Routing__Context_template::copy_template(const M3UA__Routing__Context_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingContext().get_selection()) {
single_value->field_routingContext = other_value.routingContext();
} else {
single_value->field_routingContext.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 M3UA__Routing__Context_template[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 M3UA__Routing__Context_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Routing__Context_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 @M3UA_Types.M3UA_Routing_Context.");
break;
}
set_selection(other_value);
}

M3UA__Routing__Context_template::M3UA__Routing__Context_template()
{
}

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

M3UA__Routing__Context_template::M3UA__Routing__Context_template(const M3UA__Routing__Context& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Routing__Context_template::match(const M3UA__Routing__Context& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.routingContext().is_bound()) return FALSE;
if(!single_value->field_routingContext.match(other_value.routingContext(), 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 @M3UA_Types.M3UA_Routing_Context.");
}
return FALSE;
}

boolean M3UA__Routing__Context_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_routingContext.is_bound();
}

boolean M3UA__Routing__Context_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_routingContext.is_value();
}

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

M3UA__Routing__Context M3UA__Routing__Context_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 @M3UA_Types.M3UA_Routing_Context.");
M3UA__Routing__Context ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_routingContext.is_bound()) {
ret_val.routingContext() = single_value->field_routingContext.valueof();
}
return ret_val;
}

void M3UA__Routing__Context_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 @M3UA_Types.M3UA_Routing_Context.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Routing__Context_template[list_length];
}

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

OCTETSTRING_template& M3UA__Routing__Context_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Routing__Context_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Routing_Context.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Routing__Context_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Routing__Context_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Routing_Context.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Routing__Context_template::routingContext()
{
set_specific();
return single_value->field_routingContext;
}

const OCTETSTRING_template& M3UA__Routing__Context_template::routingContext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingContext of a non-specific template of type @M3UA_Types.M3UA_Routing_Context.");
return single_value->field_routingContext;
}

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

void M3UA__Routing__Context_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", routingContext := ");
single_value->field_routingContext.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 M3UA__Routing__Context_template::log_match(const M3UA__Routing__Context& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingContext.match(match_value.routingContext(), legacy)){
TTCN_Logger::log_logmatch_info(".routingContext");
single_value->field_routingContext.log_match(match_value.routingContext(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", routingContext := ");
single_value->field_routingContext.log_match(match_value.routingContext(), 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 M3UA__Routing__Context_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (routingContext().is_bound()) routingContext().set_implicit_omit();
}

void M3UA__Routing__Context_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_routingContext.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 @M3UA_Types.M3UA_Routing_Context.");
}
}

void M3UA__Routing__Context_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_routingContext.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 M3UA__Routing__Context_template[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 @M3UA_Types.M3UA_Routing_Context.");
}
}

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

void M3UA__Routing__Context_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Context");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Context");
single_value->field_routingContext.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Context");
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 : "@M3UA_Types.M3UA_Routing_Context");
}

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

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

M3UA__Affected__Point__Codes::M3UA__Affected__Point__Codes()
{
}

M3UA__Affected__Point__Codes::M3UA__Affected__Point__Codes(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const M3UA__Point__Codes& par_pointCodes)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_pointCodes(par_pointCodes)
{
}

M3UA__Affected__Point__Codes::M3UA__Affected__Point__Codes(const M3UA__Affected__Point__Codes& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Affected_Point_Codes.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.pointCodes().is_bound()) field_pointCodes = other_value.pointCodes();
else field_pointCodes.clean_up();
}

void M3UA__Affected__Point__Codes::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_pointCodes.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Affected__Point__Codes::get_descriptor() const { return &M3UA__Affected__Point__Codes_descr_; }
M3UA__Affected__Point__Codes& M3UA__Affected__Point__Codes::operator=(const M3UA__Affected__Point__Codes& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Affected_Point_Codes.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.pointCodes().is_bound()) field_pointCodes = other_value.pointCodes();
  else field_pointCodes.clean_up();
}
return *this;
}

boolean M3UA__Affected__Point__Codes::operator==(const M3UA__Affected__Point__Codes& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_pointCodes==other_value.field_pointCodes;
}

boolean M3UA__Affected__Point__Codes::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_pointCodes.is_bound());
}
boolean M3UA__Affected__Point__Codes::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_pointCodes.is_value();
}
void M3UA__Affected__Point__Codes::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", pointCodes := ");
field_pointCodes.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Affected__Point__Codes::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (pointCodes().is_bound()) pointCodes().set_implicit_omit();
}

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

void M3UA__Affected__Point__Codes::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_pointCodes.encode_text(text_buf);
}

void M3UA__Affected__Point__Codes::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_pointCodes.decode_text(text_buf);
}

void M3UA__Affected__Point__Codes::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 M3UA__Affected__Point__Codes::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 M3UA__Affected__Point__Codes::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Affected__Point__Codes_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Affected__Point__Codes_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Affected__Point__Codes_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Point__Codes_descr_.raw->forceomit);
  decoded_field_length = field_pointCodes.RAW_decode(M3UA__Point__Codes_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 M3UA__Affected__Point__Codes::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Affected__Point__Codes_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Point__Codes_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Affected__Point__Codes_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_pointCodes.RAW_encode(M3UA__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Affected__Point__Codes_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
M3UA__Point__Codes_template field_pointCodes;
};

void M3UA__Affected__Point__Codes_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_pointCodes = ANY_VALUE;
}
}
}

void M3UA__Affected__Point__Codes_template::copy_value(const M3UA__Affected__Point__Codes& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.pointCodes().is_bound()) {
  single_value->field_pointCodes = other_value.pointCodes();
} else {
  single_value->field_pointCodes.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Affected__Point__Codes_template::copy_template(const M3UA__Affected__Point__Codes_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointCodes().get_selection()) {
single_value->field_pointCodes = other_value.pointCodes();
} else {
single_value->field_pointCodes.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 M3UA__Affected__Point__Codes_template[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 M3UA__Affected__Point__Codes_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Affected__Point__Codes_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 @M3UA_Types.M3UA_Affected_Point_Codes.");
break;
}
set_selection(other_value);
}

M3UA__Affected__Point__Codes_template::M3UA__Affected__Point__Codes_template()
{
}

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

M3UA__Affected__Point__Codes_template::M3UA__Affected__Point__Codes_template(const M3UA__Affected__Point__Codes& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Affected__Point__Codes_template::match(const M3UA__Affected__Point__Codes& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.pointCodes().is_bound()) return FALSE;
if(!single_value->field_pointCodes.match(other_value.pointCodes(), 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 @M3UA_Types.M3UA_Affected_Point_Codes.");
}
return FALSE;
}

boolean M3UA__Affected__Point__Codes_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_pointCodes.is_bound();
}

boolean M3UA__Affected__Point__Codes_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_pointCodes.is_value();
}

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

M3UA__Affected__Point__Codes M3UA__Affected__Point__Codes_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 @M3UA_Types.M3UA_Affected_Point_Codes.");
M3UA__Affected__Point__Codes ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_pointCodes.is_bound()) {
ret_val.pointCodes() = single_value->field_pointCodes.valueof();
}
return ret_val;
}

void M3UA__Affected__Point__Codes_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 @M3UA_Types.M3UA_Affected_Point_Codes.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Affected__Point__Codes_template[list_length];
}

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

OCTETSTRING_template& M3UA__Affected__Point__Codes_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Affected__Point__Codes_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Affected_Point_Codes.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Affected__Point__Codes_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Affected__Point__Codes_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Affected_Point_Codes.");
return single_value->field_lengthInd;
}

M3UA__Point__Codes_template& M3UA__Affected__Point__Codes_template::pointCodes()
{
set_specific();
return single_value->field_pointCodes;
}

const M3UA__Point__Codes_template& M3UA__Affected__Point__Codes_template::pointCodes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointCodes of a non-specific template of type @M3UA_Types.M3UA_Affected_Point_Codes.");
return single_value->field_pointCodes;
}

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

void M3UA__Affected__Point__Codes_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", pointCodes := ");
single_value->field_pointCodes.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 M3UA__Affected__Point__Codes_template::log_match(const M3UA__Affected__Point__Codes& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointCodes.match(match_value.pointCodes(), legacy)){
TTCN_Logger::log_logmatch_info(".pointCodes");
single_value->field_pointCodes.log_match(match_value.pointCodes(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", pointCodes := ");
single_value->field_pointCodes.log_match(match_value.pointCodes(), 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 M3UA__Affected__Point__Codes_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (pointCodes().is_bound()) pointCodes().set_implicit_omit();
}

void M3UA__Affected__Point__Codes_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_pointCodes.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 @M3UA_Types.M3UA_Affected_Point_Codes.");
}
}

void M3UA__Affected__Point__Codes_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_pointCodes.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 M3UA__Affected__Point__Codes_template[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 @M3UA_Types.M3UA_Affected_Point_Codes.");
}
}

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

void M3UA__Affected__Point__Codes_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Affected_Point_Codes");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Affected_Point_Codes");
single_value->field_pointCodes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Affected_Point_Codes");
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 : "@M3UA_Types.M3UA_Affected_Point_Codes");
}

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

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

M3UA__Network__Appearance::M3UA__Network__Appearance()
{
}

M3UA__Network__Appearance::M3UA__Network__Appearance(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_networkAppearance)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_networkAppearance(par_networkAppearance)
{
}

M3UA__Network__Appearance::M3UA__Network__Appearance(const M3UA__Network__Appearance& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Network_Appearance.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.networkAppearance().is_bound()) field_networkAppearance = other_value.networkAppearance();
else field_networkAppearance.clean_up();
}

void M3UA__Network__Appearance::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_networkAppearance.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Network__Appearance::get_descriptor() const { return &M3UA__Network__Appearance_descr_; }
M3UA__Network__Appearance& M3UA__Network__Appearance::operator=(const M3UA__Network__Appearance& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Network_Appearance.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.networkAppearance().is_bound()) field_networkAppearance = other_value.networkAppearance();
  else field_networkAppearance.clean_up();
}
return *this;
}

boolean M3UA__Network__Appearance::operator==(const M3UA__Network__Appearance& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_networkAppearance==other_value.field_networkAppearance;
}

boolean M3UA__Network__Appearance::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_networkAppearance.is_bound());
}
boolean M3UA__Network__Appearance::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_networkAppearance.is_value();
}
void M3UA__Network__Appearance::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", networkAppearance := ");
field_networkAppearance.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Network__Appearance::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (networkAppearance().is_bound()) networkAppearance().set_implicit_omit();
}

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

void M3UA__Network__Appearance::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_networkAppearance.encode_text(text_buf);
}

void M3UA__Network__Appearance::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_networkAppearance.decode_text(text_buf);
}

void M3UA__Network__Appearance::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 M3UA__Network__Appearance::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 M3UA__Network__Appearance::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Network__Appearance_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Network__Appearance_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Network__Appearance_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_networkAppearance.RAW_decode(General__Types::OCT4_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 M3UA__Network__Appearance::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Network__Appearance_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Network__Appearance_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_networkAppearance.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Network__Appearance_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_networkAppearance;
};

void M3UA__Network__Appearance_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_networkAppearance = ANY_VALUE;
}
}
}

void M3UA__Network__Appearance_template::copy_value(const M3UA__Network__Appearance& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.networkAppearance().is_bound()) {
  single_value->field_networkAppearance = other_value.networkAppearance();
} else {
  single_value->field_networkAppearance.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Network__Appearance_template::copy_template(const M3UA__Network__Appearance_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkAppearance().get_selection()) {
single_value->field_networkAppearance = other_value.networkAppearance();
} else {
single_value->field_networkAppearance.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 M3UA__Network__Appearance_template[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 M3UA__Network__Appearance_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Network__Appearance_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 @M3UA_Types.M3UA_Network_Appearance.");
break;
}
set_selection(other_value);
}

M3UA__Network__Appearance_template::M3UA__Network__Appearance_template()
{
}

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

M3UA__Network__Appearance_template::M3UA__Network__Appearance_template(const M3UA__Network__Appearance& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Network__Appearance_template::match(const M3UA__Network__Appearance& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.networkAppearance().is_bound()) return FALSE;
if(!single_value->field_networkAppearance.match(other_value.networkAppearance(), 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 @M3UA_Types.M3UA_Network_Appearance.");
}
return FALSE;
}

boolean M3UA__Network__Appearance_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_networkAppearance.is_bound();
}

boolean M3UA__Network__Appearance_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_networkAppearance.is_value();
}

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

M3UA__Network__Appearance M3UA__Network__Appearance_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 @M3UA_Types.M3UA_Network_Appearance.");
M3UA__Network__Appearance ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_networkAppearance.is_bound()) {
ret_val.networkAppearance() = single_value->field_networkAppearance.valueof();
}
return ret_val;
}

void M3UA__Network__Appearance_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 @M3UA_Types.M3UA_Network_Appearance.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Network__Appearance_template[list_length];
}

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

OCTETSTRING_template& M3UA__Network__Appearance_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Network__Appearance_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Network_Appearance.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Network__Appearance_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Network__Appearance_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Network_Appearance.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Network__Appearance_template::networkAppearance()
{
set_specific();
return single_value->field_networkAppearance;
}

const OCTETSTRING_template& M3UA__Network__Appearance_template::networkAppearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkAppearance of a non-specific template of type @M3UA_Types.M3UA_Network_Appearance.");
return single_value->field_networkAppearance;
}

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

void M3UA__Network__Appearance_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", networkAppearance := ");
single_value->field_networkAppearance.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 M3UA__Network__Appearance_template::log_match(const M3UA__Network__Appearance& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_networkAppearance.match(match_value.networkAppearance(), legacy)){
TTCN_Logger::log_logmatch_info(".networkAppearance");
single_value->field_networkAppearance.log_match(match_value.networkAppearance(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", networkAppearance := ");
single_value->field_networkAppearance.log_match(match_value.networkAppearance(), 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 M3UA__Network__Appearance_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (networkAppearance().is_bound()) networkAppearance().set_implicit_omit();
}

void M3UA__Network__Appearance_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_networkAppearance.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 @M3UA_Types.M3UA_Network_Appearance.");
}
}

void M3UA__Network__Appearance_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_networkAppearance.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 M3UA__Network__Appearance_template[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 @M3UA_Types.M3UA_Network_Appearance.");
}
}

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

void M3UA__Network__Appearance_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Network_Appearance");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Network_Appearance");
single_value->field_networkAppearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Network_Appearance");
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 : "@M3UA_Types.M3UA_Network_Appearance");
}

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

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

M3UA__Diagnostic__information::M3UA__Diagnostic__information()
{
}

M3UA__Diagnostic__information::M3UA__Diagnostic__information(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_diagnosticInformation)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_diagnosticInformation(par_diagnosticInformation)
{
}

M3UA__Diagnostic__information::M3UA__Diagnostic__information(const M3UA__Diagnostic__information& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Diagnostic_information.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.diagnosticInformation().is_bound()) field_diagnosticInformation = other_value.diagnosticInformation();
else field_diagnosticInformation.clean_up();
}

void M3UA__Diagnostic__information::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_diagnosticInformation.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Diagnostic__information::get_descriptor() const { return &M3UA__Diagnostic__information_descr_; }
M3UA__Diagnostic__information& M3UA__Diagnostic__information::operator=(const M3UA__Diagnostic__information& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Diagnostic_information.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.diagnosticInformation().is_bound()) field_diagnosticInformation = other_value.diagnosticInformation();
  else field_diagnosticInformation.clean_up();
}
return *this;
}

boolean M3UA__Diagnostic__information::operator==(const M3UA__Diagnostic__information& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_diagnosticInformation==other_value.field_diagnosticInformation;
}

boolean M3UA__Diagnostic__information::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_diagnosticInformation.is_bound());
}
boolean M3UA__Diagnostic__information::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_diagnosticInformation.is_value();
}
void M3UA__Diagnostic__information::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", diagnosticInformation := ");
field_diagnosticInformation.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Diagnostic__information::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (diagnosticInformation().is_bound()) diagnosticInformation().set_implicit_omit();
}

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

void M3UA__Diagnostic__information::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_diagnosticInformation.encode_text(text_buf);
}

void M3UA__Diagnostic__information::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_diagnosticInformation.decode_text(text_buf);
}

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

int M3UA__Diagnostic__information::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Diagnostic__information_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Diagnostic__information_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_diagnosticInformation.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Diagnostic__information_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_diagnosticInformation;
};

void M3UA__Diagnostic__information_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_diagnosticInformation = ANY_VALUE;
}
}
}

void M3UA__Diagnostic__information_template::copy_value(const M3UA__Diagnostic__information& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.diagnosticInformation().is_bound()) {
  single_value->field_diagnosticInformation = other_value.diagnosticInformation();
} else {
  single_value->field_diagnosticInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Diagnostic__information_template::copy_template(const M3UA__Diagnostic__information_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.diagnosticInformation().get_selection()) {
single_value->field_diagnosticInformation = other_value.diagnosticInformation();
} else {
single_value->field_diagnosticInformation.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 M3UA__Diagnostic__information_template[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 M3UA__Diagnostic__information_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Diagnostic__information_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 @M3UA_Types.M3UA_Diagnostic_information.");
break;
}
set_selection(other_value);
}

M3UA__Diagnostic__information_template::M3UA__Diagnostic__information_template()
{
}

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

M3UA__Diagnostic__information_template::M3UA__Diagnostic__information_template(const M3UA__Diagnostic__information& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Diagnostic__information_template::match(const M3UA__Diagnostic__information& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.diagnosticInformation().is_bound()) return FALSE;
if(!single_value->field_diagnosticInformation.match(other_value.diagnosticInformation(), 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 @M3UA_Types.M3UA_Diagnostic_information.");
}
return FALSE;
}

boolean M3UA__Diagnostic__information_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_diagnosticInformation.is_bound();
}

boolean M3UA__Diagnostic__information_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_diagnosticInformation.is_value();
}

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

M3UA__Diagnostic__information M3UA__Diagnostic__information_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 @M3UA_Types.M3UA_Diagnostic_information.");
M3UA__Diagnostic__information ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_diagnosticInformation.is_bound()) {
ret_val.diagnosticInformation() = single_value->field_diagnosticInformation.valueof();
}
return ret_val;
}

void M3UA__Diagnostic__information_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 @M3UA_Types.M3UA_Diagnostic_information.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Diagnostic__information_template[list_length];
}

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

OCTETSTRING_template& M3UA__Diagnostic__information_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Diagnostic__information_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Diagnostic_information.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Diagnostic__information_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Diagnostic__information_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Diagnostic_information.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Diagnostic__information_template::diagnosticInformation()
{
set_specific();
return single_value->field_diagnosticInformation;
}

const OCTETSTRING_template& M3UA__Diagnostic__information_template::diagnosticInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field diagnosticInformation of a non-specific template of type @M3UA_Types.M3UA_Diagnostic_information.");
return single_value->field_diagnosticInformation;
}

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

void M3UA__Diagnostic__information_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", diagnosticInformation := ");
single_value->field_diagnosticInformation.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 M3UA__Diagnostic__information_template::log_match(const M3UA__Diagnostic__information& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_diagnosticInformation.match(match_value.diagnosticInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".diagnosticInformation");
single_value->field_diagnosticInformation.log_match(match_value.diagnosticInformation(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", diagnosticInformation := ");
single_value->field_diagnosticInformation.log_match(match_value.diagnosticInformation(), 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 M3UA__Diagnostic__information_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (diagnosticInformation().is_bound()) diagnosticInformation().set_implicit_omit();
}

void M3UA__Diagnostic__information_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_diagnosticInformation.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 @M3UA_Types.M3UA_Diagnostic_information.");
}
}

void M3UA__Diagnostic__information_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_diagnosticInformation.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 M3UA__Diagnostic__information_template[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 @M3UA_Types.M3UA_Diagnostic_information.");
}
}

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

void M3UA__Diagnostic__information_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Diagnostic_information");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Diagnostic_information");
single_value->field_diagnosticInformation.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Diagnostic_information");
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 : "@M3UA_Types.M3UA_Diagnostic_information");
}

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

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

M3UA__Correlation__ID::M3UA__Correlation__ID()
{
}

M3UA__Correlation__ID::M3UA__Correlation__ID(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_correlationID)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_correlationID(par_correlationID)
{
}

M3UA__Correlation__ID::M3UA__Correlation__ID(const M3UA__Correlation__ID& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Correlation_ID.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.correlationID().is_bound()) field_correlationID = other_value.correlationID();
else field_correlationID.clean_up();
}

void M3UA__Correlation__ID::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_correlationID.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Correlation__ID::get_descriptor() const { return &M3UA__Correlation__ID_descr_; }
M3UA__Correlation__ID& M3UA__Correlation__ID::operator=(const M3UA__Correlation__ID& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Correlation_ID.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.correlationID().is_bound()) field_correlationID = other_value.correlationID();
  else field_correlationID.clean_up();
}
return *this;
}

boolean M3UA__Correlation__ID::operator==(const M3UA__Correlation__ID& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_correlationID==other_value.field_correlationID;
}

boolean M3UA__Correlation__ID::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_correlationID.is_bound());
}
boolean M3UA__Correlation__ID::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_correlationID.is_value();
}
void M3UA__Correlation__ID::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", correlationID := ");
field_correlationID.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Correlation__ID::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (correlationID().is_bound()) correlationID().set_implicit_omit();
}

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

void M3UA__Correlation__ID::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_correlationID.encode_text(text_buf);
}

void M3UA__Correlation__ID::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_correlationID.decode_text(text_buf);
}

void M3UA__Correlation__ID::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 M3UA__Correlation__ID::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 M3UA__Correlation__ID::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Correlation__ID_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Correlation__ID_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Correlation__ID_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_correlationID.RAW_decode(General__Types::OCT4_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 M3UA__Correlation__ID::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Correlation__ID_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Correlation__ID_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_correlationID.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Correlation__ID_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_correlationID;
};

void M3UA__Correlation__ID_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_correlationID = ANY_VALUE;
}
}
}

void M3UA__Correlation__ID_template::copy_value(const M3UA__Correlation__ID& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.correlationID().is_bound()) {
  single_value->field_correlationID = other_value.correlationID();
} else {
  single_value->field_correlationID.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Correlation__ID_template::copy_template(const M3UA__Correlation__ID_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.correlationID().get_selection()) {
single_value->field_correlationID = other_value.correlationID();
} else {
single_value->field_correlationID.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 M3UA__Correlation__ID_template[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 M3UA__Correlation__ID_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Correlation__ID_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 @M3UA_Types.M3UA_Correlation_ID.");
break;
}
set_selection(other_value);
}

M3UA__Correlation__ID_template::M3UA__Correlation__ID_template()
{
}

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

M3UA__Correlation__ID_template::M3UA__Correlation__ID_template(const M3UA__Correlation__ID& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Correlation__ID_template::match(const M3UA__Correlation__ID& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.correlationID().is_bound()) return FALSE;
if(!single_value->field_correlationID.match(other_value.correlationID(), 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 @M3UA_Types.M3UA_Correlation_ID.");
}
return FALSE;
}

boolean M3UA__Correlation__ID_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_correlationID.is_bound();
}

boolean M3UA__Correlation__ID_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_correlationID.is_value();
}

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

M3UA__Correlation__ID M3UA__Correlation__ID_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 @M3UA_Types.M3UA_Correlation_ID.");
M3UA__Correlation__ID ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_correlationID.is_bound()) {
ret_val.correlationID() = single_value->field_correlationID.valueof();
}
return ret_val;
}

void M3UA__Correlation__ID_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 @M3UA_Types.M3UA_Correlation_ID.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Correlation__ID_template[list_length];
}

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

OCTETSTRING_template& M3UA__Correlation__ID_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Correlation__ID_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Correlation_ID.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Correlation__ID_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Correlation__ID_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Correlation_ID.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Correlation__ID_template::correlationID()
{
set_specific();
return single_value->field_correlationID;
}

const OCTETSTRING_template& M3UA__Correlation__ID_template::correlationID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field correlationID of a non-specific template of type @M3UA_Types.M3UA_Correlation_ID.");
return single_value->field_correlationID;
}

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

void M3UA__Correlation__ID_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", correlationID := ");
single_value->field_correlationID.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 M3UA__Correlation__ID_template::log_match(const M3UA__Correlation__ID& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_correlationID.match(match_value.correlationID(), legacy)){
TTCN_Logger::log_logmatch_info(".correlationID");
single_value->field_correlationID.log_match(match_value.correlationID(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", correlationID := ");
single_value->field_correlationID.log_match(match_value.correlationID(), 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 M3UA__Correlation__ID_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (correlationID().is_bound()) correlationID().set_implicit_omit();
}

void M3UA__Correlation__ID_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_correlationID.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 @M3UA_Types.M3UA_Correlation_ID.");
}
}

void M3UA__Correlation__ID_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_correlationID.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 M3UA__Correlation__ID_template[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 @M3UA_Types.M3UA_Correlation_ID.");
}
}

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

void M3UA__Correlation__ID_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Correlation_ID");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Correlation_ID");
single_value->field_correlationID.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Correlation_ID");
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 : "@M3UA_Types.M3UA_Correlation_ID");
}

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

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

M3UA__Protocol__Data::M3UA__Protocol__Data()
{
}

M3UA__Protocol__Data::M3UA__Protocol__Data(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_oPC,
    const OCTETSTRING& par_dPC,
    const OCTETSTRING& par_sI,
    const OCTETSTRING& par_nI,
    const OCTETSTRING& par_mP,
    const OCTETSTRING& par_sLS,
    const OCTETSTRING& par_userProtocolData)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_oPC(par_oPC),
  field_dPC(par_dPC),
  field_sI(par_sI),
  field_nI(par_nI),
  field_mP(par_mP),
  field_sLS(par_sLS),
  field_userProtocolData(par_userProtocolData)
{
}

M3UA__Protocol__Data::M3UA__Protocol__Data(const M3UA__Protocol__Data& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Protocol_Data.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.oPC().is_bound()) field_oPC = other_value.oPC();
else field_oPC.clean_up();
if (other_value.dPC().is_bound()) field_dPC = other_value.dPC();
else field_dPC.clean_up();
if (other_value.sI().is_bound()) field_sI = other_value.sI();
else field_sI.clean_up();
if (other_value.nI().is_bound()) field_nI = other_value.nI();
else field_nI.clean_up();
if (other_value.mP().is_bound()) field_mP = other_value.mP();
else field_mP.clean_up();
if (other_value.sLS().is_bound()) field_sLS = other_value.sLS();
else field_sLS.clean_up();
if (other_value.userProtocolData().is_bound()) field_userProtocolData = other_value.userProtocolData();
else field_userProtocolData.clean_up();
}

void M3UA__Protocol__Data::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_oPC.clean_up();
field_dPC.clean_up();
field_sI.clean_up();
field_nI.clean_up();
field_mP.clean_up();
field_sLS.clean_up();
field_userProtocolData.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Protocol__Data::get_descriptor() const { return &M3UA__Protocol__Data_descr_; }
M3UA__Protocol__Data& M3UA__Protocol__Data::operator=(const M3UA__Protocol__Data& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Protocol_Data.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.oPC().is_bound()) field_oPC = other_value.oPC();
  else field_oPC.clean_up();
  if (other_value.dPC().is_bound()) field_dPC = other_value.dPC();
  else field_dPC.clean_up();
  if (other_value.sI().is_bound()) field_sI = other_value.sI();
  else field_sI.clean_up();
  if (other_value.nI().is_bound()) field_nI = other_value.nI();
  else field_nI.clean_up();
  if (other_value.mP().is_bound()) field_mP = other_value.mP();
  else field_mP.clean_up();
  if (other_value.sLS().is_bound()) field_sLS = other_value.sLS();
  else field_sLS.clean_up();
  if (other_value.userProtocolData().is_bound()) field_userProtocolData = other_value.userProtocolData();
  else field_userProtocolData.clean_up();
}
return *this;
}

boolean M3UA__Protocol__Data::operator==(const M3UA__Protocol__Data& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_oPC==other_value.field_oPC
  && field_dPC==other_value.field_dPC
  && field_sI==other_value.field_sI
  && field_nI==other_value.field_nI
  && field_mP==other_value.field_mP
  && field_sLS==other_value.field_sLS
  && field_userProtocolData==other_value.field_userProtocolData;
}

boolean M3UA__Protocol__Data::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_oPC.is_bound())
  || (field_dPC.is_bound())
  || (field_sI.is_bound())
  || (field_nI.is_bound())
  || (field_mP.is_bound())
  || (field_sLS.is_bound())
  || (field_userProtocolData.is_bound());
}
boolean M3UA__Protocol__Data::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_oPC.is_value()
  && field_dPC.is_value()
  && field_sI.is_value()
  && field_nI.is_value()
  && field_mP.is_value()
  && field_sLS.is_value()
  && field_userProtocolData.is_value();
}
void M3UA__Protocol__Data::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", oPC := ");
field_oPC.log();
TTCN_Logger::log_event_str(", dPC := ");
field_dPC.log();
TTCN_Logger::log_event_str(", sI := ");
field_sI.log();
TTCN_Logger::log_event_str(", nI := ");
field_nI.log();
TTCN_Logger::log_event_str(", mP := ");
field_mP.log();
TTCN_Logger::log_event_str(", sLS := ");
field_sLS.log();
TTCN_Logger::log_event_str(", userProtocolData := ");
field_userProtocolData.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Protocol__Data::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (oPC().is_bound()) oPC().set_implicit_omit();
if (dPC().is_bound()) dPC().set_implicit_omit();
if (sI().is_bound()) sI().set_implicit_omit();
if (nI().is_bound()) nI().set_implicit_omit();
if (mP().is_bound()) mP().set_implicit_omit();
if (sLS().is_bound()) sLS().set_implicit_omit();
if (userProtocolData().is_bound()) userProtocolData().set_implicit_omit();
}

void M3UA__Protocol__Data::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @M3UA_Types.M3UA_Protocol_Data has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) oPC().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dPC().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mP().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sLS().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) userProtocolData().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oPC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oPC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dPC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dPC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sLS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sLS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "userProtocolData")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          userProtocolData().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Protocol_Data: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_Protocol_Data");
  }
}

void M3UA__Protocol__Data::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_oPC.encode_text(text_buf);
field_dPC.encode_text(text_buf);
field_sI.encode_text(text_buf);
field_nI.encode_text(text_buf);
field_mP.encode_text(text_buf);
field_sLS.encode_text(text_buf);
field_userProtocolData.encode_text(text_buf);
}

void M3UA__Protocol__Data::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_oPC.decode_text(text_buf);
field_dPC.decode_text(text_buf);
field_sI.decode_text(text_buf);
field_nI.decode_text(text_buf);
field_mP.decode_text(text_buf);
field_sLS.decode_text(text_buf);
field_userProtocolData.decode_text(text_buf);
}

void M3UA__Protocol__Data::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 M3UA__Protocol__Data::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 M3UA__Protocol__Data::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Protocol__Data_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Protocol__Data_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Protocol__Data_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_oPC.RAW_decode(General__Types::OCT4_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::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_dPC.RAW_decode(General__Types::OCT4_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_sI.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_nI.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_mP.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_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::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_sLS.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_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, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_userProtocolData.RAW_decode(OCTETSTRING_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__Protocol__Data::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Protocol__Data_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT4_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);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, OCTETSTRING_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Protocol__Data_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 9;
  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(9);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[7].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[8].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  encoded_length += field_oPC.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_dPC.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_sI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_nI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_mP.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_sLS.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_userProtocolData.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[8]);
  return myleaf.length = encoded_length;
}

struct M3UA__Protocol__Data_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_oPC;
OCTETSTRING_template field_dPC;
OCTETSTRING_template field_sI;
OCTETSTRING_template field_nI;
OCTETSTRING_template field_mP;
OCTETSTRING_template field_sLS;
OCTETSTRING_template field_userProtocolData;
};

void M3UA__Protocol__Data_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_oPC = ANY_VALUE;
single_value->field_dPC = ANY_VALUE;
single_value->field_sI = ANY_VALUE;
single_value->field_nI = ANY_VALUE;
single_value->field_mP = ANY_VALUE;
single_value->field_sLS = ANY_VALUE;
single_value->field_userProtocolData = ANY_VALUE;
}
}
}

void M3UA__Protocol__Data_template::copy_value(const M3UA__Protocol__Data& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.oPC().is_bound()) {
  single_value->field_oPC = other_value.oPC();
} else {
  single_value->field_oPC.clean_up();
}
if (other_value.dPC().is_bound()) {
  single_value->field_dPC = other_value.dPC();
} else {
  single_value->field_dPC.clean_up();
}
if (other_value.sI().is_bound()) {
  single_value->field_sI = other_value.sI();
} else {
  single_value->field_sI.clean_up();
}
if (other_value.nI().is_bound()) {
  single_value->field_nI = other_value.nI();
} else {
  single_value->field_nI.clean_up();
}
if (other_value.mP().is_bound()) {
  single_value->field_mP = other_value.mP();
} else {
  single_value->field_mP.clean_up();
}
if (other_value.sLS().is_bound()) {
  single_value->field_sLS = other_value.sLS();
} else {
  single_value->field_sLS.clean_up();
}
if (other_value.userProtocolData().is_bound()) {
  single_value->field_userProtocolData = other_value.userProtocolData();
} else {
  single_value->field_userProtocolData.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Protocol__Data_template::copy_template(const M3UA__Protocol__Data_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oPC().get_selection()) {
single_value->field_oPC = other_value.oPC();
} else {
single_value->field_oPC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dPC().get_selection()) {
single_value->field_dPC = other_value.dPC();
} else {
single_value->field_dPC.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sI().get_selection()) {
single_value->field_sI = other_value.sI();
} else {
single_value->field_sI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nI().get_selection()) {
single_value->field_nI = other_value.nI();
} else {
single_value->field_nI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mP().get_selection()) {
single_value->field_mP = other_value.mP();
} else {
single_value->field_mP.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sLS().get_selection()) {
single_value->field_sLS = other_value.sLS();
} else {
single_value->field_sLS.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.userProtocolData().get_selection()) {
single_value->field_userProtocolData = other_value.userProtocolData();
} else {
single_value->field_userProtocolData.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 M3UA__Protocol__Data_template[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 M3UA__Protocol__Data_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Protocol__Data_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 @M3UA_Types.M3UA_Protocol_Data.");
break;
}
set_selection(other_value);
}

M3UA__Protocol__Data_template::M3UA__Protocol__Data_template()
{
}

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

M3UA__Protocol__Data_template::M3UA__Protocol__Data_template(const M3UA__Protocol__Data& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Protocol__Data_template::match(const M3UA__Protocol__Data& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.oPC().is_bound()) return FALSE;
if(!single_value->field_oPC.match(other_value.oPC(), legacy))return FALSE;
if(!other_value.dPC().is_bound()) return FALSE;
if(!single_value->field_dPC.match(other_value.dPC(), legacy))return FALSE;
if(!other_value.sI().is_bound()) return FALSE;
if(!single_value->field_sI.match(other_value.sI(), legacy))return FALSE;
if(!other_value.nI().is_bound()) return FALSE;
if(!single_value->field_nI.match(other_value.nI(), legacy))return FALSE;
if(!other_value.mP().is_bound()) return FALSE;
if(!single_value->field_mP.match(other_value.mP(), legacy))return FALSE;
if(!other_value.sLS().is_bound()) return FALSE;
if(!single_value->field_sLS.match(other_value.sLS(), legacy))return FALSE;
if(!other_value.userProtocolData().is_bound()) return FALSE;
if(!single_value->field_userProtocolData.match(other_value.userProtocolData(), 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 @M3UA_Types.M3UA_Protocol_Data.");
}
return FALSE;
}

boolean M3UA__Protocol__Data_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_oPC.is_bound()
 || single_value->field_dPC.is_bound()
 || single_value->field_sI.is_bound()
 || single_value->field_nI.is_bound()
 || single_value->field_mP.is_bound()
 || single_value->field_sLS.is_bound()
 || single_value->field_userProtocolData.is_bound();
}

boolean M3UA__Protocol__Data_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_oPC.is_value()
 && single_value->field_dPC.is_value()
 && single_value->field_sI.is_value()
 && single_value->field_nI.is_value()
 && single_value->field_mP.is_value()
 && single_value->field_sLS.is_value()
 && single_value->field_userProtocolData.is_value();
}

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

M3UA__Protocol__Data M3UA__Protocol__Data_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 @M3UA_Types.M3UA_Protocol_Data.");
M3UA__Protocol__Data ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_oPC.is_bound()) {
ret_val.oPC() = single_value->field_oPC.valueof();
}
if (single_value->field_dPC.is_bound()) {
ret_val.dPC() = single_value->field_dPC.valueof();
}
if (single_value->field_sI.is_bound()) {
ret_val.sI() = single_value->field_sI.valueof();
}
if (single_value->field_nI.is_bound()) {
ret_val.nI() = single_value->field_nI.valueof();
}
if (single_value->field_mP.is_bound()) {
ret_val.mP() = single_value->field_mP.valueof();
}
if (single_value->field_sLS.is_bound()) {
ret_val.sLS() = single_value->field_sLS.valueof();
}
if (single_value->field_userProtocolData.is_bound()) {
ret_val.userProtocolData() = single_value->field_userProtocolData.valueof();
}
return ret_val;
}

void M3UA__Protocol__Data_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 @M3UA_Types.M3UA_Protocol_Data.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Protocol__Data_template[list_length];
}

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

OCTETSTRING_template& M3UA__Protocol__Data_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Protocol__Data_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Protocol__Data_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Protocol__Data_template::oPC()
{
set_specific();
return single_value->field_oPC;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::oPC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oPC of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_oPC;
}

OCTETSTRING_template& M3UA__Protocol__Data_template::dPC()
{
set_specific();
return single_value->field_dPC;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::dPC() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dPC of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_dPC;
}

OCTETSTRING_template& M3UA__Protocol__Data_template::sI()
{
set_specific();
return single_value->field_sI;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::sI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sI of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_sI;
}

OCTETSTRING_template& M3UA__Protocol__Data_template::nI()
{
set_specific();
return single_value->field_nI;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::nI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nI of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_nI;
}

OCTETSTRING_template& M3UA__Protocol__Data_template::mP()
{
set_specific();
return single_value->field_mP;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::mP() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mP of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_mP;
}

OCTETSTRING_template& M3UA__Protocol__Data_template::sLS()
{
set_specific();
return single_value->field_sLS;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::sLS() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sLS of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_sLS;
}

OCTETSTRING_template& M3UA__Protocol__Data_template::userProtocolData()
{
set_specific();
return single_value->field_userProtocolData;
}

const OCTETSTRING_template& M3UA__Protocol__Data_template::userProtocolData() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field userProtocolData of a non-specific template of type @M3UA_Types.M3UA_Protocol_Data.");
return single_value->field_userProtocolData;
}

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

void M3UA__Protocol__Data_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", oPC := ");
single_value->field_oPC.log();
TTCN_Logger::log_event_str(", dPC := ");
single_value->field_dPC.log();
TTCN_Logger::log_event_str(", sI := ");
single_value->field_sI.log();
TTCN_Logger::log_event_str(", nI := ");
single_value->field_nI.log();
TTCN_Logger::log_event_str(", mP := ");
single_value->field_mP.log();
TTCN_Logger::log_event_str(", sLS := ");
single_value->field_sLS.log();
TTCN_Logger::log_event_str(", userProtocolData := ");
single_value->field_userProtocolData.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 M3UA__Protocol__Data_template::log_match(const M3UA__Protocol__Data& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oPC.match(match_value.oPC(), legacy)){
TTCN_Logger::log_logmatch_info(".oPC");
single_value->field_oPC.log_match(match_value.oPC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dPC.match(match_value.dPC(), legacy)){
TTCN_Logger::log_logmatch_info(".dPC");
single_value->field_dPC.log_match(match_value.dPC(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sI.match(match_value.sI(), legacy)){
TTCN_Logger::log_logmatch_info(".sI");
single_value->field_sI.log_match(match_value.sI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nI.match(match_value.nI(), legacy)){
TTCN_Logger::log_logmatch_info(".nI");
single_value->field_nI.log_match(match_value.nI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mP.match(match_value.mP(), legacy)){
TTCN_Logger::log_logmatch_info(".mP");
single_value->field_mP.log_match(match_value.mP(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sLS.match(match_value.sLS(), legacy)){
TTCN_Logger::log_logmatch_info(".sLS");
single_value->field_sLS.log_match(match_value.sLS(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_userProtocolData.match(match_value.userProtocolData(), legacy)){
TTCN_Logger::log_logmatch_info(".userProtocolData");
single_value->field_userProtocolData.log_match(match_value.userProtocolData(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", oPC := ");
single_value->field_oPC.log_match(match_value.oPC(), legacy);
TTCN_Logger::log_event_str(", dPC := ");
single_value->field_dPC.log_match(match_value.dPC(), legacy);
TTCN_Logger::log_event_str(", sI := ");
single_value->field_sI.log_match(match_value.sI(), legacy);
TTCN_Logger::log_event_str(", nI := ");
single_value->field_nI.log_match(match_value.nI(), legacy);
TTCN_Logger::log_event_str(", mP := ");
single_value->field_mP.log_match(match_value.mP(), legacy);
TTCN_Logger::log_event_str(", sLS := ");
single_value->field_sLS.log_match(match_value.sLS(), legacy);
TTCN_Logger::log_event_str(", userProtocolData := ");
single_value->field_userProtocolData.log_match(match_value.userProtocolData(), 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 M3UA__Protocol__Data_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (oPC().is_bound()) oPC().set_implicit_omit();
if (dPC().is_bound()) dPC().set_implicit_omit();
if (sI().is_bound()) sI().set_implicit_omit();
if (nI().is_bound()) nI().set_implicit_omit();
if (mP().is_bound()) mP().set_implicit_omit();
if (sLS().is_bound()) sLS().set_implicit_omit();
if (userProtocolData().is_bound()) userProtocolData().set_implicit_omit();
}

void M3UA__Protocol__Data_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_oPC.encode_text(text_buf);
single_value->field_dPC.encode_text(text_buf);
single_value->field_sI.encode_text(text_buf);
single_value->field_nI.encode_text(text_buf);
single_value->field_mP.encode_text(text_buf);
single_value->field_sLS.encode_text(text_buf);
single_value->field_userProtocolData.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 @M3UA_Types.M3UA_Protocol_Data.");
}
}

void M3UA__Protocol__Data_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_oPC.decode_text(text_buf);
single_value->field_dPC.decode_text(text_buf);
single_value->field_sI.decode_text(text_buf);
single_value->field_nI.decode_text(text_buf);
single_value->field_mP.decode_text(text_buf);
single_value->field_sLS.decode_text(text_buf);
single_value->field_userProtocolData.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 M3UA__Protocol__Data_template[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 @M3UA_Types.M3UA_Protocol_Data.");
}
}

void M3UA__Protocol__Data_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: {
    M3UA__Protocol__Data_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @M3UA_Types.M3UA_Protocol_Data has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) oPC().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dPC().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sI().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) nI().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) mP().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) sLS().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) userProtocolData().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oPC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oPC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dPC")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dPC().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mP")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mP().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sLS")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sLS().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "userProtocolData")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          userProtocolData().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Protocol_Data: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Protocol__Data_template* precondition = new M3UA__Protocol__Data_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Protocol__Data_template* implied_template = new M3UA__Protocol__Data_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Protocol__Data_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_Protocol_Data");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__Protocol__Data_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_oPC.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_dPC.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_sI.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_nI.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_mP.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_sLS.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
single_value->field_userProtocolData.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Protocol_Data");
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 : "@M3UA_Types.M3UA_Protocol_Data");
}

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

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

M3UA__Info__String::M3UA__Info__String()
{
}

M3UA__Info__String::M3UA__Info__String(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_infoString)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_infoString(par_infoString)
{
}

M3UA__Info__String::M3UA__Info__String(const M3UA__Info__String& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Info_String.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.infoString().is_bound()) field_infoString = other_value.infoString();
else field_infoString.clean_up();
}

void M3UA__Info__String::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_infoString.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Info__String::get_descriptor() const { return &M3UA__Info__String_descr_; }
M3UA__Info__String& M3UA__Info__String::operator=(const M3UA__Info__String& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Info_String.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.infoString().is_bound()) field_infoString = other_value.infoString();
  else field_infoString.clean_up();
}
return *this;
}

boolean M3UA__Info__String::operator==(const M3UA__Info__String& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_infoString==other_value.field_infoString;
}

boolean M3UA__Info__String::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_infoString.is_bound());
}
boolean M3UA__Info__String::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_infoString.is_value();
}
void M3UA__Info__String::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", infoString := ");
field_infoString.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Info__String::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (infoString().is_bound()) infoString().set_implicit_omit();
}

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

void M3UA__Info__String::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_infoString.encode_text(text_buf);
}

void M3UA__Info__String::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_infoString.decode_text(text_buf);
}

void M3UA__Info__String::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 M3UA__Info__String::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 M3UA__Info__String::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Info__String_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Info__String_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Info__String_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__OCT0__255_descr_.raw->forceomit);
  decoded_field_length = field_infoString.RAW_decode(M3UA__OCT0__255_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 M3UA__Info__String::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Info__String_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__OCT0__255_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Info__String_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_infoString.RAW_encode(M3UA__OCT0__255_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Info__String_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_infoString;
};

void M3UA__Info__String_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_infoString = ANY_VALUE;
}
}
}

void M3UA__Info__String_template::copy_value(const M3UA__Info__String& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.infoString().is_bound()) {
  single_value->field_infoString = other_value.infoString();
} else {
  single_value->field_infoString.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Info__String_template::copy_template(const M3UA__Info__String_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.infoString().get_selection()) {
single_value->field_infoString = other_value.infoString();
} else {
single_value->field_infoString.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 M3UA__Info__String_template[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 M3UA__Info__String_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Info__String_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 @M3UA_Types.M3UA_Info_String.");
break;
}
set_selection(other_value);
}

M3UA__Info__String_template::M3UA__Info__String_template()
{
}

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

M3UA__Info__String_template::M3UA__Info__String_template(const M3UA__Info__String& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Info__String_template::match(const M3UA__Info__String& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.infoString().is_bound()) return FALSE;
if(!single_value->field_infoString.match(other_value.infoString(), 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 @M3UA_Types.M3UA_Info_String.");
}
return FALSE;
}

boolean M3UA__Info__String_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_infoString.is_bound();
}

boolean M3UA__Info__String_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_infoString.is_value();
}

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

M3UA__Info__String M3UA__Info__String_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 @M3UA_Types.M3UA_Info_String.");
M3UA__Info__String ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_infoString.is_bound()) {
ret_val.infoString() = single_value->field_infoString.valueof();
}
return ret_val;
}

void M3UA__Info__String_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 @M3UA_Types.M3UA_Info_String.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Info__String_template[list_length];
}

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

OCTETSTRING_template& M3UA__Info__String_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Info__String_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Info_String.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Info__String_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Info__String_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Info_String.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Info__String_template::infoString()
{
set_specific();
return single_value->field_infoString;
}

const OCTETSTRING_template& M3UA__Info__String_template::infoString() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field infoString of a non-specific template of type @M3UA_Types.M3UA_Info_String.");
return single_value->field_infoString;
}

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

void M3UA__Info__String_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", infoString := ");
single_value->field_infoString.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 M3UA__Info__String_template::log_match(const M3UA__Info__String& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_infoString.match(match_value.infoString(), legacy)){
TTCN_Logger::log_logmatch_info(".infoString");
single_value->field_infoString.log_match(match_value.infoString(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", infoString := ");
single_value->field_infoString.log_match(match_value.infoString(), 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 M3UA__Info__String_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (infoString().is_bound()) infoString().set_implicit_omit();
}

void M3UA__Info__String_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_infoString.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 @M3UA_Types.M3UA_Info_String.");
}
}

void M3UA__Info__String_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_infoString.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 M3UA__Info__String_template[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 @M3UA_Types.M3UA_Info_String.");
}
}

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

void M3UA__Info__String_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Info_String");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Info_String");
single_value->field_infoString.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Info_String");
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 : "@M3UA_Types.M3UA_Info_String");
}

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

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

M3UA__Concerned__Destination::M3UA__Concerned__Destination()
{
}

M3UA__Concerned__Destination::M3UA__Concerned__Destination(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_concernedDestination)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_reserved(par_reserved),
  field_concernedDestination(par_concernedDestination)
{
}

M3UA__Concerned__Destination::M3UA__Concerned__Destination(const M3UA__Concerned__Destination& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Concerned_Destination.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.concernedDestination().is_bound()) field_concernedDestination = other_value.concernedDestination();
else field_concernedDestination.clean_up();
}

void M3UA__Concerned__Destination::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_reserved.clean_up();
field_concernedDestination.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Concerned__Destination::get_descriptor() const { return &M3UA__Concerned__Destination_descr_; }
M3UA__Concerned__Destination& M3UA__Concerned__Destination::operator=(const M3UA__Concerned__Destination& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Concerned_Destination.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.concernedDestination().is_bound()) field_concernedDestination = other_value.concernedDestination();
  else field_concernedDestination.clean_up();
}
return *this;
}

boolean M3UA__Concerned__Destination::operator==(const M3UA__Concerned__Destination& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_reserved==other_value.field_reserved
  && field_concernedDestination==other_value.field_concernedDestination;
}

boolean M3UA__Concerned__Destination::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_reserved.is_bound())
  || (field_concernedDestination.is_bound());
}
boolean M3UA__Concerned__Destination::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_reserved.is_value()
  && field_concernedDestination.is_value();
}
void M3UA__Concerned__Destination::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", concernedDestination := ");
field_concernedDestination.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Concerned__Destination::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (concernedDestination().is_bound()) concernedDestination().set_implicit_omit();
}

void M3UA__Concerned__Destination::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @M3UA_Types.M3UA_Concerned_Destination has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) concernedDestination().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "concernedDestination")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          concernedDestination().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Concerned_Destination: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_Concerned_Destination");
  }
}

void M3UA__Concerned__Destination::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_concernedDestination.encode_text(text_buf);
}

void M3UA__Concerned__Destination::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_concernedDestination.decode_text(text_buf);
}

void M3UA__Concerned__Destination::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 M3UA__Concerned__Destination::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 M3UA__Concerned__Destination::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Concerned__Destination_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Concerned__Destination_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Concerned__Destination_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_concernedDestination.RAW_decode(General__Types::OCT3_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__Concerned__Destination::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Concerned__Destination_lengthInd_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::OCT3_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Concerned__Destination_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 4;
  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(4);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_concernedDestination.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct M3UA__Concerned__Destination_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_concernedDestination;
};

void M3UA__Concerned__Destination_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_concernedDestination = ANY_VALUE;
}
}
}

void M3UA__Concerned__Destination_template::copy_value(const M3UA__Concerned__Destination& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.concernedDestination().is_bound()) {
  single_value->field_concernedDestination = other_value.concernedDestination();
} else {
  single_value->field_concernedDestination.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Concerned__Destination_template::copy_template(const M3UA__Concerned__Destination_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.concernedDestination().get_selection()) {
single_value->field_concernedDestination = other_value.concernedDestination();
} else {
single_value->field_concernedDestination.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 M3UA__Concerned__Destination_template[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 M3UA__Concerned__Destination_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Concerned__Destination_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 @M3UA_Types.M3UA_Concerned_Destination.");
break;
}
set_selection(other_value);
}

M3UA__Concerned__Destination_template::M3UA__Concerned__Destination_template()
{
}

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

M3UA__Concerned__Destination_template::M3UA__Concerned__Destination_template(const M3UA__Concerned__Destination& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Concerned__Destination_template::match(const M3UA__Concerned__Destination& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.concernedDestination().is_bound()) return FALSE;
if(!single_value->field_concernedDestination.match(other_value.concernedDestination(), 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 @M3UA_Types.M3UA_Concerned_Destination.");
}
return FALSE;
}

boolean M3UA__Concerned__Destination_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_concernedDestination.is_bound();
}

boolean M3UA__Concerned__Destination_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_concernedDestination.is_value();
}

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

M3UA__Concerned__Destination M3UA__Concerned__Destination_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 @M3UA_Types.M3UA_Concerned_Destination.");
M3UA__Concerned__Destination ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_concernedDestination.is_bound()) {
ret_val.concernedDestination() = single_value->field_concernedDestination.valueof();
}
return ret_val;
}

void M3UA__Concerned__Destination_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 @M3UA_Types.M3UA_Concerned_Destination.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Concerned__Destination_template[list_length];
}

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

OCTETSTRING_template& M3UA__Concerned__Destination_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Concerned__Destination_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Concerned_Destination.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Concerned__Destination_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Concerned__Destination_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Concerned_Destination.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Concerned__Destination_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__Concerned__Destination_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_Concerned_Destination.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__Concerned__Destination_template::concernedDestination()
{
set_specific();
return single_value->field_concernedDestination;
}

const OCTETSTRING_template& M3UA__Concerned__Destination_template::concernedDestination() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field concernedDestination of a non-specific template of type @M3UA_Types.M3UA_Concerned_Destination.");
return single_value->field_concernedDestination;
}

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

void M3UA__Concerned__Destination_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", concernedDestination := ");
single_value->field_concernedDestination.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 M3UA__Concerned__Destination_template::log_match(const M3UA__Concerned__Destination& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_concernedDestination.match(match_value.concernedDestination(), legacy)){
TTCN_Logger::log_logmatch_info(".concernedDestination");
single_value->field_concernedDestination.log_match(match_value.concernedDestination(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", concernedDestination := ");
single_value->field_concernedDestination.log_match(match_value.concernedDestination(), 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 M3UA__Concerned__Destination_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (concernedDestination().is_bound()) concernedDestination().set_implicit_omit();
}

void M3UA__Concerned__Destination_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_concernedDestination.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 @M3UA_Types.M3UA_Concerned_Destination.");
}
}

void M3UA__Concerned__Destination_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_concernedDestination.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 M3UA__Concerned__Destination_template[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 @M3UA_Types.M3UA_Concerned_Destination.");
}
}

void M3UA__Concerned__Destination_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: {
    M3UA__Concerned__Destination_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @M3UA_Types.M3UA_Concerned_Destination has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) concernedDestination().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "concernedDestination")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          concernedDestination().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Concerned_Destination: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Concerned__Destination_template* precondition = new M3UA__Concerned__Destination_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Concerned__Destination_template* implied_template = new M3UA__Concerned__Destination_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Concerned__Destination_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_Concerned_Destination");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__Concerned__Destination_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Concerned_Destination");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Concerned_Destination");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Concerned_Destination");
single_value->field_concernedDestination.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Concerned_Destination");
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 : "@M3UA_Types.M3UA_Concerned_Destination");
}

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

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

M3UA__Congestion__Indicators::M3UA__Congestion__Indicators()
{
}

M3UA__Congestion__Indicators::M3UA__Congestion__Indicators(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_congestionLevel)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_reserved(par_reserved),
  field_congestionLevel(par_congestionLevel)
{
}

M3UA__Congestion__Indicators::M3UA__Congestion__Indicators(const M3UA__Congestion__Indicators& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Congestion_Indicators.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.congestionLevel().is_bound()) field_congestionLevel = other_value.congestionLevel();
else field_congestionLevel.clean_up();
}

void M3UA__Congestion__Indicators::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_reserved.clean_up();
field_congestionLevel.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Congestion__Indicators::get_descriptor() const { return &M3UA__Congestion__Indicators_descr_; }
M3UA__Congestion__Indicators& M3UA__Congestion__Indicators::operator=(const M3UA__Congestion__Indicators& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Congestion_Indicators.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.congestionLevel().is_bound()) field_congestionLevel = other_value.congestionLevel();
  else field_congestionLevel.clean_up();
}
return *this;
}

boolean M3UA__Congestion__Indicators::operator==(const M3UA__Congestion__Indicators& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_reserved==other_value.field_reserved
  && field_congestionLevel==other_value.field_congestionLevel;
}

boolean M3UA__Congestion__Indicators::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_reserved.is_bound())
  || (field_congestionLevel.is_bound());
}
boolean M3UA__Congestion__Indicators::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_reserved.is_value()
  && field_congestionLevel.is_value();
}
void M3UA__Congestion__Indicators::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", congestionLevel := ");
field_congestionLevel.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Congestion__Indicators::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (congestionLevel().is_bound()) congestionLevel().set_implicit_omit();
}

void M3UA__Congestion__Indicators::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @M3UA_Types.M3UA_Congestion_Indicators has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) congestionLevel().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "congestionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          congestionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Congestion_Indicators: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_Congestion_Indicators");
  }
}

void M3UA__Congestion__Indicators::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_congestionLevel.encode_text(text_buf);
}

void M3UA__Congestion__Indicators::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_congestionLevel.decode_text(text_buf);
}

void M3UA__Congestion__Indicators::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 M3UA__Congestion__Indicators::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 M3UA__Congestion__Indicators::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Congestion__Indicators_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Congestion__Indicators_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Congestion__Indicators_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(General__Types::OCT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_congestionLevel.RAW_decode(General__Types::OCT3_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__Congestion__Indicators::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Congestion__Indicators_lengthInd_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::OCT3_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Congestion__Indicators_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 4;
  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(4);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_congestionLevel.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct M3UA__Congestion__Indicators_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_congestionLevel;
};

void M3UA__Congestion__Indicators_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_congestionLevel = ANY_VALUE;
}
}
}

void M3UA__Congestion__Indicators_template::copy_value(const M3UA__Congestion__Indicators& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.congestionLevel().is_bound()) {
  single_value->field_congestionLevel = other_value.congestionLevel();
} else {
  single_value->field_congestionLevel.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Congestion__Indicators_template::copy_template(const M3UA__Congestion__Indicators_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.congestionLevel().get_selection()) {
single_value->field_congestionLevel = other_value.congestionLevel();
} else {
single_value->field_congestionLevel.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 M3UA__Congestion__Indicators_template[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 M3UA__Congestion__Indicators_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Congestion__Indicators_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 @M3UA_Types.M3UA_Congestion_Indicators.");
break;
}
set_selection(other_value);
}

M3UA__Congestion__Indicators_template::M3UA__Congestion__Indicators_template()
{
}

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

M3UA__Congestion__Indicators_template::M3UA__Congestion__Indicators_template(const M3UA__Congestion__Indicators& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Congestion__Indicators_template::match(const M3UA__Congestion__Indicators& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.congestionLevel().is_bound()) return FALSE;
if(!single_value->field_congestionLevel.match(other_value.congestionLevel(), 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 @M3UA_Types.M3UA_Congestion_Indicators.");
}
return FALSE;
}

boolean M3UA__Congestion__Indicators_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_congestionLevel.is_bound();
}

boolean M3UA__Congestion__Indicators_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_congestionLevel.is_value();
}

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

M3UA__Congestion__Indicators M3UA__Congestion__Indicators_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 @M3UA_Types.M3UA_Congestion_Indicators.");
M3UA__Congestion__Indicators ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_congestionLevel.is_bound()) {
ret_val.congestionLevel() = single_value->field_congestionLevel.valueof();
}
return ret_val;
}

void M3UA__Congestion__Indicators_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 @M3UA_Types.M3UA_Congestion_Indicators.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Congestion__Indicators_template[list_length];
}

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

OCTETSTRING_template& M3UA__Congestion__Indicators_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Congestion__Indicators_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Congestion_Indicators.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Congestion__Indicators_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Congestion__Indicators_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Congestion_Indicators.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Congestion__Indicators_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__Congestion__Indicators_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_Congestion_Indicators.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__Congestion__Indicators_template::congestionLevel()
{
set_specific();
return single_value->field_congestionLevel;
}

const OCTETSTRING_template& M3UA__Congestion__Indicators_template::congestionLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field congestionLevel of a non-specific template of type @M3UA_Types.M3UA_Congestion_Indicators.");
return single_value->field_congestionLevel;
}

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

void M3UA__Congestion__Indicators_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", congestionLevel := ");
single_value->field_congestionLevel.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 M3UA__Congestion__Indicators_template::log_match(const M3UA__Congestion__Indicators& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_congestionLevel.match(match_value.congestionLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".congestionLevel");
single_value->field_congestionLevel.log_match(match_value.congestionLevel(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", congestionLevel := ");
single_value->field_congestionLevel.log_match(match_value.congestionLevel(), 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 M3UA__Congestion__Indicators_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (congestionLevel().is_bound()) congestionLevel().set_implicit_omit();
}

void M3UA__Congestion__Indicators_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_congestionLevel.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 @M3UA_Types.M3UA_Congestion_Indicators.");
}
}

void M3UA__Congestion__Indicators_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_congestionLevel.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 M3UA__Congestion__Indicators_template[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 @M3UA_Types.M3UA_Congestion_Indicators.");
}
}

void M3UA__Congestion__Indicators_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: {
    M3UA__Congestion__Indicators_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @M3UA_Types.M3UA_Congestion_Indicators has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) congestionLevel().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "congestionLevel")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          congestionLevel().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Congestion_Indicators: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Congestion__Indicators_template* precondition = new M3UA__Congestion__Indicators_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Congestion__Indicators_template* implied_template = new M3UA__Congestion__Indicators_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Congestion__Indicators_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_Congestion_Indicators");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__Congestion__Indicators_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Congestion_Indicators");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Congestion_Indicators");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Congestion_Indicators");
single_value->field_congestionLevel.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Congestion_Indicators");
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 : "@M3UA_Types.M3UA_Congestion_Indicators");
}

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

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

M3UA__User__Cause::M3UA__User__Cause()
{
}

M3UA__User__Cause::M3UA__User__Cause(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_cause,
    const OCTETSTRING& par_user)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_cause(par_cause),
  field_user(par_user)
{
}

M3UA__User__Cause::M3UA__User__Cause(const M3UA__User__Cause& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_User_Cause.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.user().is_bound()) field_user = other_value.user();
else field_user.clean_up();
}

void M3UA__User__Cause::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_cause.clean_up();
field_user.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__User__Cause::get_descriptor() const { return &M3UA__User__Cause_descr_; }
M3UA__User__Cause& M3UA__User__Cause::operator=(const M3UA__User__Cause& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_User_Cause.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.user().is_bound()) field_user = other_value.user();
  else field_user.clean_up();
}
return *this;
}

boolean M3UA__User__Cause::operator==(const M3UA__User__Cause& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_cause==other_value.field_cause
  && field_user==other_value.field_user;
}

boolean M3UA__User__Cause::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_cause.is_bound())
  || (field_user.is_bound());
}
boolean M3UA__User__Cause::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_cause.is_value()
  && field_user.is_value();
}
void M3UA__User__Cause::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", user := ");
field_user.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__User__Cause::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (user().is_bound()) user().set_implicit_omit();
}

void M3UA__User__Cause::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @M3UA_Types.M3UA_User_Cause has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_User_Cause: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_User_Cause");
  }
}

void M3UA__User__Cause::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_user.encode_text(text_buf);
}

void M3UA__User__Cause::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_user.decode_text(text_buf);
}

void M3UA__User__Cause::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 M3UA__User__Cause::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 M3UA__User__Cause::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__User__Cause_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__User__Cause_lengthInd_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_lengthInd.convert_to_Integer(M3UA__User__Cause_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(General__Types::OCT2_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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_user.RAW_decode(General__Types::OCT2_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__User__Cause::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__User__Cause_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT2_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__User__Cause_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 4;
  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(4);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_cause.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_user.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct M3UA__User__Cause_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_cause;
OCTETSTRING_template field_user;
};

void M3UA__User__Cause_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_user = ANY_VALUE;
}
}
}

void M3UA__User__Cause_template::copy_value(const M3UA__User__Cause& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.user().is_bound()) {
  single_value->field_user = other_value.user();
} else {
  single_value->field_user.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__User__Cause_template::copy_template(const M3UA__User__Cause_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user().get_selection()) {
single_value->field_user = other_value.user();
} else {
single_value->field_user.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 M3UA__User__Cause_template[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 M3UA__User__Cause_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__User__Cause_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 @M3UA_Types.M3UA_User_Cause.");
break;
}
set_selection(other_value);
}

M3UA__User__Cause_template::M3UA__User__Cause_template()
{
}

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

M3UA__User__Cause_template::M3UA__User__Cause_template(const M3UA__User__Cause& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__User__Cause_template::match(const M3UA__User__Cause& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.user().is_bound()) return FALSE;
if(!single_value->field_user.match(other_value.user(), 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 @M3UA_Types.M3UA_User_Cause.");
}
return FALSE;
}

boolean M3UA__User__Cause_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_cause.is_bound()
 || single_value->field_user.is_bound();
}

boolean M3UA__User__Cause_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_cause.is_value()
 && single_value->field_user.is_value();
}

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

M3UA__User__Cause M3UA__User__Cause_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 @M3UA_Types.M3UA_User_Cause.");
M3UA__User__Cause ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_user.is_bound()) {
ret_val.user() = single_value->field_user.valueof();
}
return ret_val;
}

void M3UA__User__Cause_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 @M3UA_Types.M3UA_User_Cause.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__User__Cause_template[list_length];
}

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

OCTETSTRING_template& M3UA__User__Cause_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__User__Cause_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_User_Cause.");
return single_value->field_tag;
}

INTEGER_template& M3UA__User__Cause_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__User__Cause_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_User_Cause.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__User__Cause_template::cause()
{
set_specific();
return single_value->field_cause;
}

const OCTETSTRING_template& M3UA__User__Cause_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @M3UA_Types.M3UA_User_Cause.");
return single_value->field_cause;
}

OCTETSTRING_template& M3UA__User__Cause_template::user()
{
set_specific();
return single_value->field_user;
}

const OCTETSTRING_template& M3UA__User__Cause_template::user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user of a non-specific template of type @M3UA_Types.M3UA_User_Cause.");
return single_value->field_user;
}

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

void M3UA__User__Cause_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", user := ");
single_value->field_user.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 M3UA__User__Cause_template::log_match(const M3UA__User__Cause& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user.match(match_value.user(), legacy)){
TTCN_Logger::log_logmatch_info(".user");
single_value->field_user.log_match(match_value.user(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", user := ");
single_value->field_user.log_match(match_value.user(), 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 M3UA__User__Cause_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (user().is_bound()) user().set_implicit_omit();
}

void M3UA__User__Cause_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_user.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 @M3UA_Types.M3UA_User_Cause.");
}
}

void M3UA__User__Cause_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_user.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 M3UA__User__Cause_template[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 @M3UA_Types.M3UA_User_Cause.");
}
}

void M3UA__User__Cause_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: {
    M3UA__User__Cause_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @M3UA_Types.M3UA_User_Cause has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_User_Cause: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__User__Cause_template* precondition = new M3UA__User__Cause_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__User__Cause_template* implied_template = new M3UA__User__Cause_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__User__Cause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_User_Cause");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__User__Cause_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_User_Cause");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_User_Cause");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_User_Cause");
single_value->field_user.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_User_Cause");
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 : "@M3UA_Types.M3UA_User_Cause");
}

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

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

M3UA__ASP__Identifier::M3UA__ASP__Identifier()
{
}

M3UA__ASP__Identifier::M3UA__ASP__Identifier(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_aSPIdentifier)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_aSPIdentifier(par_aSPIdentifier)
{
}

M3UA__ASP__Identifier::M3UA__ASP__Identifier(const M3UA__ASP__Identifier& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ASP_Identifier.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.aSPIdentifier().is_bound()) field_aSPIdentifier = other_value.aSPIdentifier();
else field_aSPIdentifier.clean_up();
}

void M3UA__ASP__Identifier::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_aSPIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ASP__Identifier::get_descriptor() const { return &M3UA__ASP__Identifier_descr_; }
M3UA__ASP__Identifier& M3UA__ASP__Identifier::operator=(const M3UA__ASP__Identifier& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ASP_Identifier.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.aSPIdentifier().is_bound()) field_aSPIdentifier = other_value.aSPIdentifier();
  else field_aSPIdentifier.clean_up();
}
return *this;
}

boolean M3UA__ASP__Identifier::operator==(const M3UA__ASP__Identifier& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_aSPIdentifier==other_value.field_aSPIdentifier;
}

boolean M3UA__ASP__Identifier::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_aSPIdentifier.is_bound());
}
boolean M3UA__ASP__Identifier::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_aSPIdentifier.is_value();
}
void M3UA__ASP__Identifier::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", aSPIdentifier := ");
field_aSPIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ASP__Identifier::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (aSPIdentifier().is_bound()) aSPIdentifier().set_implicit_omit();
}

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

void M3UA__ASP__Identifier::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_aSPIdentifier.encode_text(text_buf);
}

void M3UA__ASP__Identifier::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_aSPIdentifier.decode_text(text_buf);
}

void M3UA__ASP__Identifier::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 M3UA__ASP__Identifier::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 M3UA__ASP__Identifier::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__ASP__Identifier_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__ASP__Identifier_lengthInd_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_lengthInd.convert_to_Integer(M3UA__ASP__Identifier_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_aSPIdentifier.RAW_decode(General__Types::OCT4_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 M3UA__ASP__Identifier::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__ASP__Identifier_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__ASP__Identifier_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_aSPIdentifier.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__ASP__Identifier_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_aSPIdentifier;
};

void M3UA__ASP__Identifier_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_aSPIdentifier = ANY_VALUE;
}
}
}

void M3UA__ASP__Identifier_template::copy_value(const M3UA__ASP__Identifier& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.aSPIdentifier().is_bound()) {
  single_value->field_aSPIdentifier = other_value.aSPIdentifier();
} else {
  single_value->field_aSPIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ASP__Identifier_template::copy_template(const M3UA__ASP__Identifier_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aSPIdentifier().get_selection()) {
single_value->field_aSPIdentifier = other_value.aSPIdentifier();
} else {
single_value->field_aSPIdentifier.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 M3UA__ASP__Identifier_template[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 M3UA__ASP__Identifier_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ASP__Identifier_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 @M3UA_Types.M3UA_ASP_Identifier.");
break;
}
set_selection(other_value);
}

M3UA__ASP__Identifier_template::M3UA__ASP__Identifier_template()
{
}

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

M3UA__ASP__Identifier_template::M3UA__ASP__Identifier_template(const M3UA__ASP__Identifier& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__ASP__Identifier_template::match(const M3UA__ASP__Identifier& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.aSPIdentifier().is_bound()) return FALSE;
if(!single_value->field_aSPIdentifier.match(other_value.aSPIdentifier(), 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 @M3UA_Types.M3UA_ASP_Identifier.");
}
return FALSE;
}

boolean M3UA__ASP__Identifier_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_aSPIdentifier.is_bound();
}

boolean M3UA__ASP__Identifier_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_aSPIdentifier.is_value();
}

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

M3UA__ASP__Identifier M3UA__ASP__Identifier_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 @M3UA_Types.M3UA_ASP_Identifier.");
M3UA__ASP__Identifier ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_aSPIdentifier.is_bound()) {
ret_val.aSPIdentifier() = single_value->field_aSPIdentifier.valueof();
}
return ret_val;
}

void M3UA__ASP__Identifier_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 @M3UA_Types.M3UA_ASP_Identifier.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ASP__Identifier_template[list_length];
}

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

OCTETSTRING_template& M3UA__ASP__Identifier_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__ASP__Identifier_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_ASP_Identifier.");
return single_value->field_tag;
}

INTEGER_template& M3UA__ASP__Identifier_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__ASP__Identifier_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_ASP_Identifier.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__ASP__Identifier_template::aSPIdentifier()
{
set_specific();
return single_value->field_aSPIdentifier;
}

const OCTETSTRING_template& M3UA__ASP__Identifier_template::aSPIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aSPIdentifier of a non-specific template of type @M3UA_Types.M3UA_ASP_Identifier.");
return single_value->field_aSPIdentifier;
}

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

void M3UA__ASP__Identifier_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", aSPIdentifier := ");
single_value->field_aSPIdentifier.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 M3UA__ASP__Identifier_template::log_match(const M3UA__ASP__Identifier& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_aSPIdentifier.match(match_value.aSPIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".aSPIdentifier");
single_value->field_aSPIdentifier.log_match(match_value.aSPIdentifier(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", aSPIdentifier := ");
single_value->field_aSPIdentifier.log_match(match_value.aSPIdentifier(), 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 M3UA__ASP__Identifier_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (aSPIdentifier().is_bound()) aSPIdentifier().set_implicit_omit();
}

void M3UA__ASP__Identifier_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_aSPIdentifier.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 @M3UA_Types.M3UA_ASP_Identifier.");
}
}

void M3UA__ASP__Identifier_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_aSPIdentifier.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 M3UA__ASP__Identifier_template[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 @M3UA_Types.M3UA_ASP_Identifier.");
}
}

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

void M3UA__ASP__Identifier_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASP_Identifier");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASP_Identifier");
single_value->field_aSPIdentifier.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASP_Identifier");
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 : "@M3UA_Types.M3UA_ASP_Identifier");
}

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

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

M3UA__Heartbeat__Data::M3UA__Heartbeat__Data()
{
}

M3UA__Heartbeat__Data::M3UA__Heartbeat__Data(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_heartbeat__Data)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_heartbeat__Data(par_heartbeat__Data)
{
}

M3UA__Heartbeat__Data::M3UA__Heartbeat__Data(const M3UA__Heartbeat__Data& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Heartbeat_Data.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.heartbeat__Data().is_bound()) field_heartbeat__Data = other_value.heartbeat__Data();
else field_heartbeat__Data.clean_up();
}

void M3UA__Heartbeat__Data::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_heartbeat__Data.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Heartbeat__Data::get_descriptor() const { return &M3UA__Heartbeat__Data_descr_; }
M3UA__Heartbeat__Data& M3UA__Heartbeat__Data::operator=(const M3UA__Heartbeat__Data& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Heartbeat_Data.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.heartbeat__Data().is_bound()) field_heartbeat__Data = other_value.heartbeat__Data();
  else field_heartbeat__Data.clean_up();
}
return *this;
}

boolean M3UA__Heartbeat__Data::operator==(const M3UA__Heartbeat__Data& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_heartbeat__Data==other_value.field_heartbeat__Data;
}

boolean M3UA__Heartbeat__Data::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_heartbeat__Data.is_bound());
}
boolean M3UA__Heartbeat__Data::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_heartbeat__Data.is_value();
}
void M3UA__Heartbeat__Data::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", heartbeat_Data := ");
field_heartbeat__Data.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Heartbeat__Data::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (heartbeat__Data().is_bound()) heartbeat__Data().set_implicit_omit();
}

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

void M3UA__Heartbeat__Data::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_heartbeat__Data.encode_text(text_buf);
}

void M3UA__Heartbeat__Data::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_heartbeat__Data.decode_text(text_buf);
}

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

int M3UA__Heartbeat__Data::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Heartbeat__Data_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Heartbeat__Data_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_heartbeat__Data.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Heartbeat__Data_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_heartbeat__Data;
};

void M3UA__Heartbeat__Data_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_heartbeat__Data = ANY_VALUE;
}
}
}

void M3UA__Heartbeat__Data_template::copy_value(const M3UA__Heartbeat__Data& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.heartbeat__Data().is_bound()) {
  single_value->field_heartbeat__Data = other_value.heartbeat__Data();
} else {
  single_value->field_heartbeat__Data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Heartbeat__Data_template::copy_template(const M3UA__Heartbeat__Data_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.heartbeat__Data().get_selection()) {
single_value->field_heartbeat__Data = other_value.heartbeat__Data();
} else {
single_value->field_heartbeat__Data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new M3UA__Heartbeat__Data_template[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 M3UA__Heartbeat__Data_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Heartbeat__Data_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 @M3UA_Types.M3UA_Heartbeat_Data.");
break;
}
set_selection(other_value);
}

M3UA__Heartbeat__Data_template::M3UA__Heartbeat__Data_template()
{
}

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

M3UA__Heartbeat__Data_template::M3UA__Heartbeat__Data_template(const M3UA__Heartbeat__Data& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Heartbeat__Data_template::match(const M3UA__Heartbeat__Data& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.heartbeat__Data().is_bound()) return FALSE;
if(!single_value->field_heartbeat__Data.match(other_value.heartbeat__Data(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @M3UA_Types.M3UA_Heartbeat_Data.");
}
return FALSE;
}

boolean M3UA__Heartbeat__Data_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_heartbeat__Data.is_bound();
}

boolean M3UA__Heartbeat__Data_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_heartbeat__Data.is_value();
}

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

M3UA__Heartbeat__Data M3UA__Heartbeat__Data_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 @M3UA_Types.M3UA_Heartbeat_Data.");
M3UA__Heartbeat__Data ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_heartbeat__Data.is_bound()) {
ret_val.heartbeat__Data() = single_value->field_heartbeat__Data.valueof();
}
return ret_val;
}

void M3UA__Heartbeat__Data_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 @M3UA_Types.M3UA_Heartbeat_Data.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Heartbeat__Data_template[list_length];
}

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

OCTETSTRING_template& M3UA__Heartbeat__Data_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Heartbeat__Data_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Heartbeat_Data.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Heartbeat__Data_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Heartbeat__Data_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Heartbeat_Data.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Heartbeat__Data_template::heartbeat__Data()
{
set_specific();
return single_value->field_heartbeat__Data;
}

const OCTETSTRING_template& M3UA__Heartbeat__Data_template::heartbeat__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field heartbeat_Data of a non-specific template of type @M3UA_Types.M3UA_Heartbeat_Data.");
return single_value->field_heartbeat__Data;
}

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

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

void M3UA__Heartbeat__Data_template::log_match(const M3UA__Heartbeat__Data& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_heartbeat__Data.match(match_value.heartbeat__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".heartbeat_Data");
single_value->field_heartbeat__Data.log_match(match_value.heartbeat__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", heartbeat_Data := ");
single_value->field_heartbeat__Data.log_match(match_value.heartbeat__Data(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void M3UA__Heartbeat__Data_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (heartbeat__Data().is_bound()) heartbeat__Data().set_implicit_omit();
}

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

void M3UA__Heartbeat__Data_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_heartbeat__Data.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new M3UA__Heartbeat__Data_template[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 @M3UA_Types.M3UA_Heartbeat_Data.");
}
}

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

void M3UA__Heartbeat__Data_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Heartbeat_Data");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Heartbeat_Data");
single_value->field_heartbeat__Data.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Heartbeat_Data");
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 : "@M3UA_Types.M3UA_Heartbeat_Data");
}

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

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

M3UA__Traffic__Mode__Type::M3UA__Traffic__Mode__Type()
{
}

M3UA__Traffic__Mode__Type::M3UA__Traffic__Mode__Type(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_trafficModeType)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_trafficModeType(par_trafficModeType)
{
}

M3UA__Traffic__Mode__Type::M3UA__Traffic__Mode__Type(const M3UA__Traffic__Mode__Type& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Traffic_Mode_Type.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.trafficModeType().is_bound()) field_trafficModeType = other_value.trafficModeType();
else field_trafficModeType.clean_up();
}

void M3UA__Traffic__Mode__Type::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_trafficModeType.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Traffic__Mode__Type::get_descriptor() const { return &M3UA__Traffic__Mode__Type_descr_; }
M3UA__Traffic__Mode__Type& M3UA__Traffic__Mode__Type::operator=(const M3UA__Traffic__Mode__Type& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Traffic_Mode_Type.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.trafficModeType().is_bound()) field_trafficModeType = other_value.trafficModeType();
  else field_trafficModeType.clean_up();
}
return *this;
}

boolean M3UA__Traffic__Mode__Type::operator==(const M3UA__Traffic__Mode__Type& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_trafficModeType==other_value.field_trafficModeType;
}

boolean M3UA__Traffic__Mode__Type::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_trafficModeType.is_bound());
}
boolean M3UA__Traffic__Mode__Type::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_trafficModeType.is_value();
}
void M3UA__Traffic__Mode__Type::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", trafficModeType := ");
field_trafficModeType.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Traffic__Mode__Type::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (trafficModeType().is_bound()) trafficModeType().set_implicit_omit();
}

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

void M3UA__Traffic__Mode__Type::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_trafficModeType.encode_text(text_buf);
}

void M3UA__Traffic__Mode__Type::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_trafficModeType.decode_text(text_buf);
}

void M3UA__Traffic__Mode__Type::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 M3UA__Traffic__Mode__Type::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 M3UA__Traffic__Mode__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Traffic__Mode__Type_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Traffic__Mode__Type_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Traffic__Mode__Type_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_trafficModeType.RAW_decode(General__Types::OCT4_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 M3UA__Traffic__Mode__Type::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Traffic__Mode__Type_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Traffic__Mode__Type_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_trafficModeType.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Traffic__Mode__Type_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_trafficModeType;
};

void M3UA__Traffic__Mode__Type_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_trafficModeType = ANY_VALUE;
}
}
}

void M3UA__Traffic__Mode__Type_template::copy_value(const M3UA__Traffic__Mode__Type& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.trafficModeType().is_bound()) {
  single_value->field_trafficModeType = other_value.trafficModeType();
} else {
  single_value->field_trafficModeType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Traffic__Mode__Type_template::copy_template(const M3UA__Traffic__Mode__Type_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.trafficModeType().get_selection()) {
single_value->field_trafficModeType = other_value.trafficModeType();
} else {
single_value->field_trafficModeType.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 M3UA__Traffic__Mode__Type_template[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 M3UA__Traffic__Mode__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Traffic__Mode__Type_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 @M3UA_Types.M3UA_Traffic_Mode_Type.");
break;
}
set_selection(other_value);
}

M3UA__Traffic__Mode__Type_template::M3UA__Traffic__Mode__Type_template()
{
}

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

M3UA__Traffic__Mode__Type_template::M3UA__Traffic__Mode__Type_template(const M3UA__Traffic__Mode__Type& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Traffic__Mode__Type_template::match(const M3UA__Traffic__Mode__Type& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.trafficModeType().is_bound()) return FALSE;
if(!single_value->field_trafficModeType.match(other_value.trafficModeType(), 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 @M3UA_Types.M3UA_Traffic_Mode_Type.");
}
return FALSE;
}

boolean M3UA__Traffic__Mode__Type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_trafficModeType.is_bound();
}

boolean M3UA__Traffic__Mode__Type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_trafficModeType.is_value();
}

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

M3UA__Traffic__Mode__Type M3UA__Traffic__Mode__Type_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 @M3UA_Types.M3UA_Traffic_Mode_Type.");
M3UA__Traffic__Mode__Type ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_trafficModeType.is_bound()) {
ret_val.trafficModeType() = single_value->field_trafficModeType.valueof();
}
return ret_val;
}

void M3UA__Traffic__Mode__Type_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 @M3UA_Types.M3UA_Traffic_Mode_Type.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Traffic__Mode__Type_template[list_length];
}

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

OCTETSTRING_template& M3UA__Traffic__Mode__Type_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Traffic__Mode__Type_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Traffic_Mode_Type.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Traffic__Mode__Type_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Traffic__Mode__Type_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Traffic_Mode_Type.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Traffic__Mode__Type_template::trafficModeType()
{
set_specific();
return single_value->field_trafficModeType;
}

const OCTETSTRING_template& M3UA__Traffic__Mode__Type_template::trafficModeType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field trafficModeType of a non-specific template of type @M3UA_Types.M3UA_Traffic_Mode_Type.");
return single_value->field_trafficModeType;
}

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

void M3UA__Traffic__Mode__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", trafficModeType := ");
single_value->field_trafficModeType.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 M3UA__Traffic__Mode__Type_template::log_match(const M3UA__Traffic__Mode__Type& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_trafficModeType.match(match_value.trafficModeType(), legacy)){
TTCN_Logger::log_logmatch_info(".trafficModeType");
single_value->field_trafficModeType.log_match(match_value.trafficModeType(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", trafficModeType := ");
single_value->field_trafficModeType.log_match(match_value.trafficModeType(), 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 M3UA__Traffic__Mode__Type_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (trafficModeType().is_bound()) trafficModeType().set_implicit_omit();
}

void M3UA__Traffic__Mode__Type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_trafficModeType.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 @M3UA_Types.M3UA_Traffic_Mode_Type.");
}
}

void M3UA__Traffic__Mode__Type_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_trafficModeType.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 M3UA__Traffic__Mode__Type_template[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 @M3UA_Types.M3UA_Traffic_Mode_Type.");
}
}

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

void M3UA__Traffic__Mode__Type_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Traffic_Mode_Type");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Traffic_Mode_Type");
single_value->field_trafficModeType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Traffic_Mode_Type");
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 : "@M3UA_Types.M3UA_Traffic_Mode_Type");
}

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

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

M3UA__Status::M3UA__Status()
{
}

M3UA__Status::M3UA__Status(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_statusType,
    const OCTETSTRING& par_statusInfo)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_statusType(par_statusType),
  field_statusInfo(par_statusInfo)
{
}

M3UA__Status::M3UA__Status(const M3UA__Status& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Status.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.statusType().is_bound()) field_statusType = other_value.statusType();
else field_statusType.clean_up();
if (other_value.statusInfo().is_bound()) field_statusInfo = other_value.statusInfo();
else field_statusInfo.clean_up();
}

void M3UA__Status::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_statusType.clean_up();
field_statusInfo.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Status::get_descriptor() const { return &M3UA__Status_descr_; }
M3UA__Status& M3UA__Status::operator=(const M3UA__Status& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Status.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.statusType().is_bound()) field_statusType = other_value.statusType();
  else field_statusType.clean_up();
  if (other_value.statusInfo().is_bound()) field_statusInfo = other_value.statusInfo();
  else field_statusInfo.clean_up();
}
return *this;
}

boolean M3UA__Status::operator==(const M3UA__Status& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_statusType==other_value.field_statusType
  && field_statusInfo==other_value.field_statusInfo;
}

boolean M3UA__Status::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_statusType.is_bound())
  || (field_statusInfo.is_bound());
}
boolean M3UA__Status::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_statusType.is_value()
  && field_statusInfo.is_value();
}
void M3UA__Status::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", statusType := ");
field_statusType.log();
TTCN_Logger::log_event_str(", statusInfo := ");
field_statusInfo.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Status::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (statusType().is_bound()) statusType().set_implicit_omit();
if (statusInfo().is_bound()) statusInfo().set_implicit_omit();
}

void M3UA__Status::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @M3UA_Types.M3UA_Status has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) statusType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) statusInfo().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statusType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statusType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statusInfo")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statusInfo().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Status: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_Status");
  }
}

void M3UA__Status::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_statusType.encode_text(text_buf);
field_statusInfo.encode_text(text_buf);
}

void M3UA__Status::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_statusType.decode_text(text_buf);
field_statusInfo.decode_text(text_buf);
}

void M3UA__Status::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 M3UA__Status::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 M3UA__Status::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Status_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Status_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Status_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_statusType.RAW_decode(General__Types::OCT2_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::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_statusInfo.RAW_decode(General__Types::OCT2_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;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__Status::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Status_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT2_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Status_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 4;
  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(4);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_statusType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_statusInfo.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct M3UA__Status_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_statusType;
OCTETSTRING_template field_statusInfo;
};

void M3UA__Status_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_statusType = ANY_VALUE;
single_value->field_statusInfo = ANY_VALUE;
}
}
}

void M3UA__Status_template::copy_value(const M3UA__Status& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.statusType().is_bound()) {
  single_value->field_statusType = other_value.statusType();
} else {
  single_value->field_statusType.clean_up();
}
if (other_value.statusInfo().is_bound()) {
  single_value->field_statusInfo = other_value.statusInfo();
} else {
  single_value->field_statusInfo.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Status_template::copy_template(const M3UA__Status_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.statusType().get_selection()) {
single_value->field_statusType = other_value.statusType();
} else {
single_value->field_statusType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.statusInfo().get_selection()) {
single_value->field_statusInfo = other_value.statusInfo();
} else {
single_value->field_statusInfo.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 M3UA__Status_template[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 M3UA__Status_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Status_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 @M3UA_Types.M3UA_Status.");
break;
}
set_selection(other_value);
}

M3UA__Status_template::M3UA__Status_template()
{
}

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

M3UA__Status_template::M3UA__Status_template(const M3UA__Status& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Status_template::match(const M3UA__Status& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.statusType().is_bound()) return FALSE;
if(!single_value->field_statusType.match(other_value.statusType(), legacy))return FALSE;
if(!other_value.statusInfo().is_bound()) return FALSE;
if(!single_value->field_statusInfo.match(other_value.statusInfo(), 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 @M3UA_Types.M3UA_Status.");
}
return FALSE;
}

boolean M3UA__Status_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_statusType.is_bound()
 || single_value->field_statusInfo.is_bound();
}

boolean M3UA__Status_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_statusType.is_value()
 && single_value->field_statusInfo.is_value();
}

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

M3UA__Status M3UA__Status_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 @M3UA_Types.M3UA_Status.");
M3UA__Status ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_statusType.is_bound()) {
ret_val.statusType() = single_value->field_statusType.valueof();
}
if (single_value->field_statusInfo.is_bound()) {
ret_val.statusInfo() = single_value->field_statusInfo.valueof();
}
return ret_val;
}

void M3UA__Status_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 @M3UA_Types.M3UA_Status.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Status_template[list_length];
}

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

OCTETSTRING_template& M3UA__Status_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Status_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Status.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Status_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Status_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Status.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Status_template::statusType()
{
set_specific();
return single_value->field_statusType;
}

const OCTETSTRING_template& M3UA__Status_template::statusType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field statusType of a non-specific template of type @M3UA_Types.M3UA_Status.");
return single_value->field_statusType;
}

OCTETSTRING_template& M3UA__Status_template::statusInfo()
{
set_specific();
return single_value->field_statusInfo;
}

const OCTETSTRING_template& M3UA__Status_template::statusInfo() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field statusInfo of a non-specific template of type @M3UA_Types.M3UA_Status.");
return single_value->field_statusInfo;
}

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

void M3UA__Status_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", statusType := ");
single_value->field_statusType.log();
TTCN_Logger::log_event_str(", statusInfo := ");
single_value->field_statusInfo.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 M3UA__Status_template::log_match(const M3UA__Status& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_statusType.match(match_value.statusType(), legacy)){
TTCN_Logger::log_logmatch_info(".statusType");
single_value->field_statusType.log_match(match_value.statusType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_statusInfo.match(match_value.statusInfo(), legacy)){
TTCN_Logger::log_logmatch_info(".statusInfo");
single_value->field_statusInfo.log_match(match_value.statusInfo(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", statusType := ");
single_value->field_statusType.log_match(match_value.statusType(), legacy);
TTCN_Logger::log_event_str(", statusInfo := ");
single_value->field_statusInfo.log_match(match_value.statusInfo(), 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 M3UA__Status_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (statusType().is_bound()) statusType().set_implicit_omit();
if (statusInfo().is_bound()) statusInfo().set_implicit_omit();
}

void M3UA__Status_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_statusType.encode_text(text_buf);
single_value->field_statusInfo.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 @M3UA_Types.M3UA_Status.");
}
}

void M3UA__Status_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_statusType.decode_text(text_buf);
single_value->field_statusInfo.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 M3UA__Status_template[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 @M3UA_Types.M3UA_Status.");
}
}

void M3UA__Status_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: {
    M3UA__Status_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @M3UA_Types.M3UA_Status has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tag().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthInd().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) statusType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) statusInfo().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tag")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tag().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lengthInd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lengthInd().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statusType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statusType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "statusInfo")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          statusInfo().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Status: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Status_template* precondition = new M3UA__Status_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Status_template* implied_template = new M3UA__Status_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Status_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_Status");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__Status_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Status");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Status");
single_value->field_statusType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Status");
single_value->field_statusInfo.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Status");
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 : "@M3UA_Types.M3UA_Status");
}

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

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

M3UA__Local__Routing__Key__Id::M3UA__Local__Routing__Key__Id()
{
}

M3UA__Local__Routing__Key__Id::M3UA__Local__Routing__Key__Id(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_localRkId)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_localRkId(par_localRkId)
{
}

M3UA__Local__Routing__Key__Id::M3UA__Local__Routing__Key__Id(const M3UA__Local__Routing__Key__Id& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Local_Routing_Key_Id.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.localRkId().is_bound()) field_localRkId = other_value.localRkId();
else field_localRkId.clean_up();
}

void M3UA__Local__Routing__Key__Id::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_localRkId.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Local__Routing__Key__Id::get_descriptor() const { return &M3UA__Local__Routing__Key__Id_descr_; }
M3UA__Local__Routing__Key__Id& M3UA__Local__Routing__Key__Id::operator=(const M3UA__Local__Routing__Key__Id& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Local_Routing_Key_Id.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.localRkId().is_bound()) field_localRkId = other_value.localRkId();
  else field_localRkId.clean_up();
}
return *this;
}

boolean M3UA__Local__Routing__Key__Id::operator==(const M3UA__Local__Routing__Key__Id& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_localRkId==other_value.field_localRkId;
}

boolean M3UA__Local__Routing__Key__Id::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_localRkId.is_bound());
}
boolean M3UA__Local__Routing__Key__Id::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_localRkId.is_value();
}
void M3UA__Local__Routing__Key__Id::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", localRkId := ");
field_localRkId.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Local__Routing__Key__Id::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (localRkId().is_bound()) localRkId().set_implicit_omit();
}

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

void M3UA__Local__Routing__Key__Id::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_localRkId.encode_text(text_buf);
}

void M3UA__Local__Routing__Key__Id::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_localRkId.decode_text(text_buf);
}

void M3UA__Local__Routing__Key__Id::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 M3UA__Local__Routing__Key__Id::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 M3UA__Local__Routing__Key__Id::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Local__Routing__Key__Id_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Local__Routing__Key__Id_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Local__Routing__Key__Id_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_localRkId.RAW_decode(General__Types::OCT4_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 M3UA__Local__Routing__Key__Id::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Local__Routing__Key__Id_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Local__Routing__Key__Id_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_localRkId.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Local__Routing__Key__Id_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_localRkId;
};

void M3UA__Local__Routing__Key__Id_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_localRkId = ANY_VALUE;
}
}
}

void M3UA__Local__Routing__Key__Id_template::copy_value(const M3UA__Local__Routing__Key__Id& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.localRkId().is_bound()) {
  single_value->field_localRkId = other_value.localRkId();
} else {
  single_value->field_localRkId.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Local__Routing__Key__Id_template::copy_template(const M3UA__Local__Routing__Key__Id_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.localRkId().get_selection()) {
single_value->field_localRkId = other_value.localRkId();
} else {
single_value->field_localRkId.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 M3UA__Local__Routing__Key__Id_template[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 M3UA__Local__Routing__Key__Id_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Local__Routing__Key__Id_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 @M3UA_Types.M3UA_Local_Routing_Key_Id.");
break;
}
set_selection(other_value);
}

M3UA__Local__Routing__Key__Id_template::M3UA__Local__Routing__Key__Id_template()
{
}

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

M3UA__Local__Routing__Key__Id_template::M3UA__Local__Routing__Key__Id_template(const M3UA__Local__Routing__Key__Id& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Local__Routing__Key__Id_template::match(const M3UA__Local__Routing__Key__Id& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.localRkId().is_bound()) return FALSE;
if(!single_value->field_localRkId.match(other_value.localRkId(), 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 @M3UA_Types.M3UA_Local_Routing_Key_Id.");
}
return FALSE;
}

boolean M3UA__Local__Routing__Key__Id_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_localRkId.is_bound();
}

boolean M3UA__Local__Routing__Key__Id_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_localRkId.is_value();
}

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

M3UA__Local__Routing__Key__Id M3UA__Local__Routing__Key__Id_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 @M3UA_Types.M3UA_Local_Routing_Key_Id.");
M3UA__Local__Routing__Key__Id ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_localRkId.is_bound()) {
ret_val.localRkId() = single_value->field_localRkId.valueof();
}
return ret_val;
}

void M3UA__Local__Routing__Key__Id_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 @M3UA_Types.M3UA_Local_Routing_Key_Id.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Local__Routing__Key__Id_template[list_length];
}

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

OCTETSTRING_template& M3UA__Local__Routing__Key__Id_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Local__Routing__Key__Id_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Local_Routing_Key_Id.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Local__Routing__Key__Id_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Local__Routing__Key__Id_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Local_Routing_Key_Id.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Local__Routing__Key__Id_template::localRkId()
{
set_specific();
return single_value->field_localRkId;
}

const OCTETSTRING_template& M3UA__Local__Routing__Key__Id_template::localRkId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field localRkId of a non-specific template of type @M3UA_Types.M3UA_Local_Routing_Key_Id.");
return single_value->field_localRkId;
}

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

void M3UA__Local__Routing__Key__Id_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", localRkId := ");
single_value->field_localRkId.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 M3UA__Local__Routing__Key__Id_template::log_match(const M3UA__Local__Routing__Key__Id& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_localRkId.match(match_value.localRkId(), legacy)){
TTCN_Logger::log_logmatch_info(".localRkId");
single_value->field_localRkId.log_match(match_value.localRkId(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", localRkId := ");
single_value->field_localRkId.log_match(match_value.localRkId(), 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 M3UA__Local__Routing__Key__Id_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (localRkId().is_bound()) localRkId().set_implicit_omit();
}

void M3UA__Local__Routing__Key__Id_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_localRkId.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 @M3UA_Types.M3UA_Local_Routing_Key_Id.");
}
}

void M3UA__Local__Routing__Key__Id_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_localRkId.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 M3UA__Local__Routing__Key__Id_template[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 @M3UA_Types.M3UA_Local_Routing_Key_Id.");
}
}

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

void M3UA__Local__Routing__Key__Id_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Local_Routing_Key_Id");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Local_Routing_Key_Id");
single_value->field_localRkId.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Local_Routing_Key_Id");
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 : "@M3UA_Types.M3UA_Local_Routing_Key_Id");
}

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

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

M3UA__Destination__PointCode::M3UA__Destination__PointCode()
{
}

M3UA__Destination__PointCode::M3UA__Destination__PointCode(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const M3UA__Point__Code& par_pointCode)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_pointCode(par_pointCode)
{
}

M3UA__Destination__PointCode::M3UA__Destination__PointCode(const M3UA__Destination__PointCode& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Destination_PointCode.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.pointCode().is_bound()) field_pointCode = other_value.pointCode();
else field_pointCode.clean_up();
}

void M3UA__Destination__PointCode::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_pointCode.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Destination__PointCode::get_descriptor() const { return &M3UA__Destination__PointCode_descr_; }
M3UA__Destination__PointCode& M3UA__Destination__PointCode::operator=(const M3UA__Destination__PointCode& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Destination_PointCode.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.pointCode().is_bound()) field_pointCode = other_value.pointCode();
  else field_pointCode.clean_up();
}
return *this;
}

boolean M3UA__Destination__PointCode::operator==(const M3UA__Destination__PointCode& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_pointCode==other_value.field_pointCode;
}

boolean M3UA__Destination__PointCode::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_pointCode.is_bound());
}
boolean M3UA__Destination__PointCode::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_pointCode.is_value();
}
void M3UA__Destination__PointCode::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", pointCode := ");
field_pointCode.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Destination__PointCode::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (pointCode().is_bound()) pointCode().set_implicit_omit();
}

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

void M3UA__Destination__PointCode::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_pointCode.encode_text(text_buf);
}

void M3UA__Destination__PointCode::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_pointCode.decode_text(text_buf);
}

void M3UA__Destination__PointCode::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 M3UA__Destination__PointCode::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 M3UA__Destination__PointCode::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Destination__PointCode_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Destination__PointCode_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Destination__PointCode_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Point__Code_descr_.raw->forceomit);
  decoded_field_length = field_pointCode.RAW_decode(M3UA__Point__Code_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 M3UA__Destination__PointCode::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Destination__PointCode_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Point__Code_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Destination__PointCode_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_pointCode.RAW_encode(M3UA__Point__Code_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Destination__PointCode_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
M3UA__Point__Code_template field_pointCode;
};

void M3UA__Destination__PointCode_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_pointCode = ANY_VALUE;
}
}
}

void M3UA__Destination__PointCode_template::copy_value(const M3UA__Destination__PointCode& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.pointCode().is_bound()) {
  single_value->field_pointCode = other_value.pointCode();
} else {
  single_value->field_pointCode.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Destination__PointCode_template::copy_template(const M3UA__Destination__PointCode_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointCode().get_selection()) {
single_value->field_pointCode = other_value.pointCode();
} else {
single_value->field_pointCode.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 M3UA__Destination__PointCode_template[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 M3UA__Destination__PointCode_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Destination__PointCode_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 @M3UA_Types.M3UA_Destination_PointCode.");
break;
}
set_selection(other_value);
}

M3UA__Destination__PointCode_template::M3UA__Destination__PointCode_template()
{
}

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

M3UA__Destination__PointCode_template::M3UA__Destination__PointCode_template(const M3UA__Destination__PointCode& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Destination__PointCode_template::match(const M3UA__Destination__PointCode& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.pointCode().is_bound()) return FALSE;
if(!single_value->field_pointCode.match(other_value.pointCode(), 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 @M3UA_Types.M3UA_Destination_PointCode.");
}
return FALSE;
}

boolean M3UA__Destination__PointCode_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_pointCode.is_bound();
}

boolean M3UA__Destination__PointCode_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_pointCode.is_value();
}

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

M3UA__Destination__PointCode M3UA__Destination__PointCode_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 @M3UA_Types.M3UA_Destination_PointCode.");
M3UA__Destination__PointCode ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_pointCode.is_bound()) {
ret_val.pointCode() = single_value->field_pointCode.valueof();
}
return ret_val;
}

void M3UA__Destination__PointCode_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 @M3UA_Types.M3UA_Destination_PointCode.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Destination__PointCode_template[list_length];
}

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

OCTETSTRING_template& M3UA__Destination__PointCode_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Destination__PointCode_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Destination_PointCode.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Destination__PointCode_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Destination__PointCode_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Destination_PointCode.");
return single_value->field_lengthInd;
}

M3UA__Point__Code_template& M3UA__Destination__PointCode_template::pointCode()
{
set_specific();
return single_value->field_pointCode;
}

const M3UA__Point__Code_template& M3UA__Destination__PointCode_template::pointCode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointCode of a non-specific template of type @M3UA_Types.M3UA_Destination_PointCode.");
return single_value->field_pointCode;
}

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

void M3UA__Destination__PointCode_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", pointCode := ");
single_value->field_pointCode.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 M3UA__Destination__PointCode_template::log_match(const M3UA__Destination__PointCode& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointCode.match(match_value.pointCode(), legacy)){
TTCN_Logger::log_logmatch_info(".pointCode");
single_value->field_pointCode.log_match(match_value.pointCode(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", pointCode := ");
single_value->field_pointCode.log_match(match_value.pointCode(), 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 M3UA__Destination__PointCode_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (pointCode().is_bound()) pointCode().set_implicit_omit();
}

void M3UA__Destination__PointCode_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_pointCode.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 @M3UA_Types.M3UA_Destination_PointCode.");
}
}

void M3UA__Destination__PointCode_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_pointCode.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 M3UA__Destination__PointCode_template[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 @M3UA_Types.M3UA_Destination_PointCode.");
}
}

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

void M3UA__Destination__PointCode_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Destination_PointCode");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Destination_PointCode");
single_value->field_pointCode.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Destination_PointCode");
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 : "@M3UA_Types.M3UA_Destination_PointCode");
}

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

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

M3UA__Service__Indicators::M3UA__Service__Indicators()
{
}

M3UA__Service__Indicators::M3UA__Service__Indicators(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_serviceIndicators)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_serviceIndicators(par_serviceIndicators)
{
}

M3UA__Service__Indicators::M3UA__Service__Indicators(const M3UA__Service__Indicators& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Service_Indicators.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.serviceIndicators().is_bound()) field_serviceIndicators = other_value.serviceIndicators();
else field_serviceIndicators.clean_up();
}

void M3UA__Service__Indicators::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_serviceIndicators.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Service__Indicators::get_descriptor() const { return &M3UA__Service__Indicators_descr_; }
M3UA__Service__Indicators& M3UA__Service__Indicators::operator=(const M3UA__Service__Indicators& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Service_Indicators.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.serviceIndicators().is_bound()) field_serviceIndicators = other_value.serviceIndicators();
  else field_serviceIndicators.clean_up();
}
return *this;
}

boolean M3UA__Service__Indicators::operator==(const M3UA__Service__Indicators& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_serviceIndicators==other_value.field_serviceIndicators;
}

boolean M3UA__Service__Indicators::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_serviceIndicators.is_bound());
}
boolean M3UA__Service__Indicators::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_serviceIndicators.is_value();
}
void M3UA__Service__Indicators::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", serviceIndicators := ");
field_serviceIndicators.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Service__Indicators::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (serviceIndicators().is_bound()) serviceIndicators().set_implicit_omit();
}

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

void M3UA__Service__Indicators::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_serviceIndicators.encode_text(text_buf);
}

void M3UA__Service__Indicators::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_serviceIndicators.decode_text(text_buf);
}

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

int M3UA__Service__Indicators::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Service__Indicators_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Service__Indicators_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_serviceIndicators.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Service__Indicators_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_serviceIndicators;
};

void M3UA__Service__Indicators_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_serviceIndicators = ANY_VALUE;
}
}
}

void M3UA__Service__Indicators_template::copy_value(const M3UA__Service__Indicators& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.serviceIndicators().is_bound()) {
  single_value->field_serviceIndicators = other_value.serviceIndicators();
} else {
  single_value->field_serviceIndicators.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Service__Indicators_template::copy_template(const M3UA__Service__Indicators_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.serviceIndicators().get_selection()) {
single_value->field_serviceIndicators = other_value.serviceIndicators();
} else {
single_value->field_serviceIndicators.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 M3UA__Service__Indicators_template[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 M3UA__Service__Indicators_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Service__Indicators_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 @M3UA_Types.M3UA_Service_Indicators.");
break;
}
set_selection(other_value);
}

M3UA__Service__Indicators_template::M3UA__Service__Indicators_template()
{
}

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

M3UA__Service__Indicators_template::M3UA__Service__Indicators_template(const M3UA__Service__Indicators& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Service__Indicators_template::match(const M3UA__Service__Indicators& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.serviceIndicators().is_bound()) return FALSE;
if(!single_value->field_serviceIndicators.match(other_value.serviceIndicators(), 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 @M3UA_Types.M3UA_Service_Indicators.");
}
return FALSE;
}

boolean M3UA__Service__Indicators_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_serviceIndicators.is_bound();
}

boolean M3UA__Service__Indicators_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_serviceIndicators.is_value();
}

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

M3UA__Service__Indicators M3UA__Service__Indicators_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 @M3UA_Types.M3UA_Service_Indicators.");
M3UA__Service__Indicators ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_serviceIndicators.is_bound()) {
ret_val.serviceIndicators() = single_value->field_serviceIndicators.valueof();
}
return ret_val;
}

void M3UA__Service__Indicators_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 @M3UA_Types.M3UA_Service_Indicators.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Service__Indicators_template[list_length];
}

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

OCTETSTRING_template& M3UA__Service__Indicators_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Service__Indicators_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Service_Indicators.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Service__Indicators_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Service__Indicators_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Service_Indicators.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Service__Indicators_template::serviceIndicators()
{
set_specific();
return single_value->field_serviceIndicators;
}

const OCTETSTRING_template& M3UA__Service__Indicators_template::serviceIndicators() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field serviceIndicators of a non-specific template of type @M3UA_Types.M3UA_Service_Indicators.");
return single_value->field_serviceIndicators;
}

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

void M3UA__Service__Indicators_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", serviceIndicators := ");
single_value->field_serviceIndicators.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 M3UA__Service__Indicators_template::log_match(const M3UA__Service__Indicators& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_serviceIndicators.match(match_value.serviceIndicators(), legacy)){
TTCN_Logger::log_logmatch_info(".serviceIndicators");
single_value->field_serviceIndicators.log_match(match_value.serviceIndicators(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", serviceIndicators := ");
single_value->field_serviceIndicators.log_match(match_value.serviceIndicators(), 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 M3UA__Service__Indicators_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (serviceIndicators().is_bound()) serviceIndicators().set_implicit_omit();
}

void M3UA__Service__Indicators_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_serviceIndicators.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 @M3UA_Types.M3UA_Service_Indicators.");
}
}

void M3UA__Service__Indicators_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_serviceIndicators.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 M3UA__Service__Indicators_template[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 @M3UA_Types.M3UA_Service_Indicators.");
}
}

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

void M3UA__Service__Indicators_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Service_Indicators");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Service_Indicators");
single_value->field_serviceIndicators.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Service_Indicators");
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 : "@M3UA_Types.M3UA_Service_Indicators");
}

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

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

M3UA__OPC__List::M3UA__OPC__List()
{
}

M3UA__OPC__List::M3UA__OPC__List(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const M3UA__Point__Codes& par_pointCodes)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_pointCodes(par_pointCodes)
{
}

M3UA__OPC__List::M3UA__OPC__List(const M3UA__OPC__List& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_OPC_List.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.pointCodes().is_bound()) field_pointCodes = other_value.pointCodes();
else field_pointCodes.clean_up();
}

void M3UA__OPC__List::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_pointCodes.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__OPC__List::get_descriptor() const { return &M3UA__OPC__List_descr_; }
M3UA__OPC__List& M3UA__OPC__List::operator=(const M3UA__OPC__List& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_OPC_List.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.pointCodes().is_bound()) field_pointCodes = other_value.pointCodes();
  else field_pointCodes.clean_up();
}
return *this;
}

boolean M3UA__OPC__List::operator==(const M3UA__OPC__List& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_pointCodes==other_value.field_pointCodes;
}

boolean M3UA__OPC__List::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_pointCodes.is_bound());
}
boolean M3UA__OPC__List::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_pointCodes.is_value();
}
void M3UA__OPC__List::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", pointCodes := ");
field_pointCodes.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__OPC__List::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (pointCodes().is_bound()) pointCodes().set_implicit_omit();
}

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

void M3UA__OPC__List::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_pointCodes.encode_text(text_buf);
}

void M3UA__OPC__List::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_pointCodes.decode_text(text_buf);
}

void M3UA__OPC__List::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 M3UA__OPC__List::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 M3UA__OPC__List::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__OPC__List_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__OPC__List_lengthInd_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_lengthInd.convert_to_Integer(M3UA__OPC__List_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Point__Codes_descr_.raw->forceomit);
  decoded_field_length = field_pointCodes.RAW_decode(M3UA__Point__Codes_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 M3UA__OPC__List::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__OPC__List_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Point__Codes_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__OPC__List_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_pointCodes.RAW_encode(M3UA__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__OPC__List_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
M3UA__Point__Codes_template field_pointCodes;
};

void M3UA__OPC__List_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_pointCodes = ANY_VALUE;
}
}
}

void M3UA__OPC__List_template::copy_value(const M3UA__OPC__List& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.pointCodes().is_bound()) {
  single_value->field_pointCodes = other_value.pointCodes();
} else {
  single_value->field_pointCodes.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__OPC__List_template::copy_template(const M3UA__OPC__List_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointCodes().get_selection()) {
single_value->field_pointCodes = other_value.pointCodes();
} else {
single_value->field_pointCodes.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 M3UA__OPC__List_template[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 M3UA__OPC__List_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__OPC__List_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 @M3UA_Types.M3UA_OPC_List.");
break;
}
set_selection(other_value);
}

M3UA__OPC__List_template::M3UA__OPC__List_template()
{
}

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

M3UA__OPC__List_template::M3UA__OPC__List_template(const M3UA__OPC__List& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__OPC__List_template::match(const M3UA__OPC__List& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.pointCodes().is_bound()) return FALSE;
if(!single_value->field_pointCodes.match(other_value.pointCodes(), 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 @M3UA_Types.M3UA_OPC_List.");
}
return FALSE;
}

boolean M3UA__OPC__List_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_pointCodes.is_bound();
}

boolean M3UA__OPC__List_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_pointCodes.is_value();
}

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

M3UA__OPC__List M3UA__OPC__List_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 @M3UA_Types.M3UA_OPC_List.");
M3UA__OPC__List ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_pointCodes.is_bound()) {
ret_val.pointCodes() = single_value->field_pointCodes.valueof();
}
return ret_val;
}

void M3UA__OPC__List_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 @M3UA_Types.M3UA_OPC_List.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__OPC__List_template[list_length];
}

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

OCTETSTRING_template& M3UA__OPC__List_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__OPC__List_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_OPC_List.");
return single_value->field_tag;
}

INTEGER_template& M3UA__OPC__List_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__OPC__List_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_OPC_List.");
return single_value->field_lengthInd;
}

M3UA__Point__Codes_template& M3UA__OPC__List_template::pointCodes()
{
set_specific();
return single_value->field_pointCodes;
}

const M3UA__Point__Codes_template& M3UA__OPC__List_template::pointCodes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointCodes of a non-specific template of type @M3UA_Types.M3UA_OPC_List.");
return single_value->field_pointCodes;
}

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

void M3UA__OPC__List_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", pointCodes := ");
single_value->field_pointCodes.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 M3UA__OPC__List_template::log_match(const M3UA__OPC__List& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointCodes.match(match_value.pointCodes(), legacy)){
TTCN_Logger::log_logmatch_info(".pointCodes");
single_value->field_pointCodes.log_match(match_value.pointCodes(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", pointCodes := ");
single_value->field_pointCodes.log_match(match_value.pointCodes(), 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 M3UA__OPC__List_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (pointCodes().is_bound()) pointCodes().set_implicit_omit();
}

void M3UA__OPC__List_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_pointCodes.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 @M3UA_Types.M3UA_OPC_List.");
}
}

void M3UA__OPC__List_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_pointCodes.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 M3UA__OPC__List_template[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 @M3UA_Types.M3UA_OPC_List.");
}
}

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

void M3UA__OPC__List_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_OPC_List");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_OPC_List");
single_value->field_pointCodes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_OPC_List");
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 : "@M3UA_Types.M3UA_OPC_List");
}

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

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

M3UA__Routing__Key__Parameters::M3UA__Routing__Key__Parameters()
{
}

M3UA__Routing__Key__Parameters::M3UA__Routing__Key__Parameters(const M3UA__Local__Routing__Key__Id& par_local__Routing__Key__Id,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const OPTIONAL< M3UA__Traffic__Mode__Type >& par_traffic__Mode__Type,
    const M3UA__Destination__PointCode& par_destination__Point__Code,
    const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Service__Indicators >& par_service__Indicators,
    const OPTIONAL< M3UA__OPC__List >& par_opc__List)
  :   field_local__Routing__Key__Id(par_local__Routing__Key__Id),
  field_routing__Context(par_routing__Context),
  field_traffic__Mode__Type(par_traffic__Mode__Type),
  field_destination__Point__Code(par_destination__Point__Code),
  field_network__Appearance(par_network__Appearance),
  field_service__Indicators(par_service__Indicators),
  field_opc__List(par_opc__List)
{
}

M3UA__Routing__Key__Parameters::M3UA__Routing__Key__Parameters(const M3UA__Routing__Key__Parameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
if (other_value.local__Routing__Key__Id().is_bound()) field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
else field_local__Routing__Key__Id.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.traffic__Mode__Type().is_bound()) field_traffic__Mode__Type = other_value.traffic__Mode__Type();
else field_traffic__Mode__Type.clean_up();
if (other_value.destination__Point__Code().is_bound()) field_destination__Point__Code = other_value.destination__Point__Code();
else field_destination__Point__Code.clean_up();
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.service__Indicators().is_bound()) field_service__Indicators = other_value.service__Indicators();
else field_service__Indicators.clean_up();
if (other_value.opc__List().is_bound()) field_opc__List = other_value.opc__List();
else field_opc__List.clean_up();
}

void M3UA__Routing__Key__Parameters::clean_up()
{
field_local__Routing__Key__Id.clean_up();
field_routing__Context.clean_up();
field_traffic__Mode__Type.clean_up();
field_destination__Point__Code.clean_up();
field_network__Appearance.clean_up();
field_service__Indicators.clean_up();
field_opc__List.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Routing__Key__Parameters::get_descriptor() const { return &M3UA__Routing__Key__Parameters_descr_; }
M3UA__Routing__Key__Parameters& M3UA__Routing__Key__Parameters::operator=(const M3UA__Routing__Key__Parameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
  if (other_value.local__Routing__Key__Id().is_bound()) field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
  else field_local__Routing__Key__Id.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.traffic__Mode__Type().is_bound()) field_traffic__Mode__Type = other_value.traffic__Mode__Type();
  else field_traffic__Mode__Type.clean_up();
  if (other_value.destination__Point__Code().is_bound()) field_destination__Point__Code = other_value.destination__Point__Code();
  else field_destination__Point__Code.clean_up();
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.service__Indicators().is_bound()) field_service__Indicators = other_value.service__Indicators();
  else field_service__Indicators.clean_up();
  if (other_value.opc__List().is_bound()) field_opc__List = other_value.opc__List();
  else field_opc__List.clean_up();
}
return *this;
}

boolean M3UA__Routing__Key__Parameters::operator==(const M3UA__Routing__Key__Parameters& other_value) const
{
return field_local__Routing__Key__Id==other_value.field_local__Routing__Key__Id
  && field_routing__Context==other_value.field_routing__Context
  && field_traffic__Mode__Type==other_value.field_traffic__Mode__Type
  && field_destination__Point__Code==other_value.field_destination__Point__Code
  && field_network__Appearance==other_value.field_network__Appearance
  && field_service__Indicators==other_value.field_service__Indicators
  && field_opc__List==other_value.field_opc__List;
}

boolean M3UA__Routing__Key__Parameters::is_bound() const
{
return (field_local__Routing__Key__Id.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (OPTIONAL_OMIT == field_traffic__Mode__Type.get_selection() || field_traffic__Mode__Type.is_bound())
  || (field_destination__Point__Code.is_bound())
  || (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_service__Indicators.get_selection() || field_service__Indicators.is_bound())
  || (OPTIONAL_OMIT == field_opc__List.get_selection() || field_opc__List.is_bound());
}
boolean M3UA__Routing__Key__Parameters::is_value() const
{
return field_local__Routing__Key__Id.is_value()
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && (OPTIONAL_OMIT == field_traffic__Mode__Type.get_selection() || field_traffic__Mode__Type.is_value())
  && field_destination__Point__Code.is_value()
  && (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_service__Indicators.get_selection() || field_service__Indicators.is_value())
  && (OPTIONAL_OMIT == field_opc__List.get_selection() || field_opc__List.is_value());
}
int M3UA__Routing__Key__Parameters::size_of() const
{
  int ret_val = 2;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_traffic__Mode__Type.ispresent()) ret_val++;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_service__Indicators.ispresent()) ret_val++;
  if (field_opc__List.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__Routing__Key__Parameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ local_Routing_Key_Id := ");
field_local__Routing__Key__Id.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", traffic_Mode_Type := ");
field_traffic__Mode__Type.log();
TTCN_Logger::log_event_str(", destination_Point_Code := ");
field_destination__Point__Code.log();
TTCN_Logger::log_event_str(", network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", service_Indicators := ");
field_service__Indicators.log();
TTCN_Logger::log_event_str(", opc_List := ");
field_opc__List.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Routing__Key__Parameters::set_implicit_omit()
{
if (local__Routing__Key__Id().is_bound()) local__Routing__Key__Id().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (!traffic__Mode__Type().is_bound()) traffic__Mode__Type() = OMIT_VALUE;
else traffic__Mode__Type().set_implicit_omit();
if (destination__Point__Code().is_bound()) destination__Point__Code().set_implicit_omit();
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!service__Indicators().is_bound()) service__Indicators() = OMIT_VALUE;
else service__Indicators().set_implicit_omit();
if (!opc__List().is_bound()) opc__List() = OMIT_VALUE;
else opc__List().set_implicit_omit();
}

void M3UA__Routing__Key__Parameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_Routing_Key_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) local__Routing__Key__Id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) traffic__Mode__Type().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) destination__Point__Code().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) service__Indicators().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) opc__List().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(), "local_Routing_Key_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__Routing__Key__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "traffic_Mode_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          traffic__Mode__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destination_Point_Code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destination__Point__Code().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_Indicators")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__Indicators().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "opc_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          opc__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Routing_Key_Parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_Routing_Key_Parameters");
  }
}

void M3UA__Routing__Key__Parameters::encode_text(Text_Buf& text_buf) const
{
field_local__Routing__Key__Id.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_traffic__Mode__Type.encode_text(text_buf);
field_destination__Point__Code.encode_text(text_buf);
field_network__Appearance.encode_text(text_buf);
field_service__Indicators.encode_text(text_buf);
field_opc__List.encode_text(text_buf);
}

void M3UA__Routing__Key__Parameters::decode_text(Text_Buf& text_buf)
{
field_local__Routing__Key__Id.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_traffic__Mode__Type.decode_text(text_buf);
field_destination__Point__Code.decode_text(text_buf);
field_network__Appearance.decode_text(text_buf);
field_service__Indicators.decode_text(text_buf);
field_opc__List.decode_text(text_buf);
}

void M3UA__Routing__Key__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 M3UA__Routing__Key__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 M3UA__Routing__Key__Parameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[7];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_routing__Context = OMIT_VALUE;
field_traffic__Mode__Type = OMIT_VALUE;
field_network__Appearance = OMIT_VALUE;
field_service__Indicators = OMIT_VALUE;
field_opc__List = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Local__Routing__Key__Id_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Local__Routing__Key__Id_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_14) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Local__Routing__Key__Id_descr_.raw->forceomit);
int decoded_field_length = field_local__Routing__Key__Id.RAW_decode(M3UA__Local__Routing__Key__Id_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length >= 0 && (field_local__Routing__Key__Id.tag() ==  os_14)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0 && (force_omit == NULL || !(*force_omit)(2))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Traffic__Mode__Type_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Traffic__Mode__Type_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_15) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Traffic__Mode__Type_descr_.raw->forceomit);
int decoded_field_length = field_traffic__Mode__Type().RAW_decode(M3UA__Traffic__Mode__Type_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length > 0 && (field_traffic__Mode__Type.ispresent() && field_traffic__Mode__Type().tag() ==  os_15)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_traffic__Mode__Type = OMIT_VALUE;
}
}
}
if (field_map[3] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Destination__PointCode_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Destination__PointCode_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_16) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Destination__PointCode_descr_.raw->forceomit);
int decoded_field_length = field_destination__Point__Code.RAW_decode(M3UA__Destination__PointCode_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length >= 0 && (field_destination__Point__Code.tag() ==  os_16)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[4] == 0 && (force_omit == NULL || !(*force_omit)(4))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[4] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[5] == 0 && (force_omit == NULL || !(*force_omit)(5))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Service__Indicators_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Service__Indicators_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_17) {
RAW_Force_Omit field_5_force_omit(5, force_omit, M3UA__Service__Indicators_descr_.raw->forceomit);
int decoded_field_length = field_service__Indicators().RAW_decode(M3UA__Service__Indicators_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
if (decoded_field_length > 0 && (field_service__Indicators.ispresent() && field_service__Indicators().tag() ==  os_17)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[5] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_service__Indicators = OMIT_VALUE;
}
}
}
if (field_map[6] == 0 && (force_omit == NULL || !(*force_omit)(6))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__OPC__List_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__OPC__List_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_18) {
RAW_Force_Omit field_6_force_omit(6, force_omit, M3UA__OPC__List_descr_.raw->forceomit);
int decoded_field_length = field_opc__List().RAW_decode(M3UA__OPC__List_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
if (decoded_field_length > 0 && (field_opc__List.ispresent() && field_opc__List().tag() ==  os_18)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[6] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_opc__List = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 2) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__Routing__Key__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, M3UA__Local__Routing__Key__Id_descr_.raw);
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_traffic__Mode__Type.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Traffic__Mode__Type_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Destination__PointCode_descr_.raw);
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_service__Indicators.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, M3UA__Service__Indicators_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_opc__List.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, M3UA__OPC__List_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_local__Routing__Key__Id.RAW_encode(M3UA__Local__Routing__Key__Id_descr_, *myleaf.body.node.nodes[0]);
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_traffic__Mode__Type.ispresent()) {
  encoded_length += field_traffic__Mode__Type().RAW_encode(M3UA__Traffic__Mode__Type_descr_, *myleaf.body.node.nodes[2]);
  }
  encoded_length += field_destination__Point__Code.RAW_encode(M3UA__Destination__PointCode_descr_, *myleaf.body.node.nodes[3]);
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_service__Indicators.ispresent()) {
  encoded_length += field_service__Indicators().RAW_encode(M3UA__Service__Indicators_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_opc__List.ispresent()) {
  encoded_length += field_opc__List().RAW_encode(M3UA__OPC__List_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_local__Routing__Key__Id.tag() !=  os_14) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_14.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_traffic__Mode__Type.ispresent() && (!field_traffic__Mode__Type.ispresent() || field_traffic__Mode__Type().tag() !=  os_15)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_15.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_destination__Point__Code.tag() !=  os_16) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_16.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_service__Indicators.ispresent() && (!field_service__Indicators.ispresent() || field_service__Indicators().tag() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_opc__List.ispresent() && (!field_opc__List.ispresent() || field_opc__List().tag() !=  os_18)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_18.RAW_encode(General__Types::OCT2_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 M3UA__Routing__Key__Parameters_template::single_value_struct {
M3UA__Local__Routing__Key__Id_template field_local__Routing__Key__Id;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Traffic__Mode__Type_template field_traffic__Mode__Type;
M3UA__Destination__PointCode_template field_destination__Point__Code;
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Service__Indicators_template field_service__Indicators;
M3UA__OPC__List_template field_opc__List;
};

void M3UA__Routing__Key__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_local__Routing__Key__Id = ANY_VALUE;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_traffic__Mode__Type = ANY_OR_OMIT;
single_value->field_destination__Point__Code = ANY_VALUE;
single_value->field_network__Appearance = ANY_OR_OMIT;
single_value->field_service__Indicators = ANY_OR_OMIT;
single_value->field_opc__List = ANY_OR_OMIT;
}
}
}

void M3UA__Routing__Key__Parameters_template::copy_value(const M3UA__Routing__Key__Parameters& other_value)
{
single_value = new single_value_struct;
if (other_value.local__Routing__Key__Id().is_bound()) {
  single_value->field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
} else {
  single_value->field_local__Routing__Key__Id.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.traffic__Mode__Type().is_bound()) {
  if (other_value.traffic__Mode__Type().ispresent()) single_value->field_traffic__Mode__Type = other_value.traffic__Mode__Type()();
  else single_value->field_traffic__Mode__Type = OMIT_VALUE;
} else {
  single_value->field_traffic__Mode__Type.clean_up();
}
if (other_value.destination__Point__Code().is_bound()) {
  single_value->field_destination__Point__Code = other_value.destination__Point__Code();
} else {
  single_value->field_destination__Point__Code.clean_up();
}
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.service__Indicators().is_bound()) {
  if (other_value.service__Indicators().ispresent()) single_value->field_service__Indicators = other_value.service__Indicators()();
  else single_value->field_service__Indicators = OMIT_VALUE;
} else {
  single_value->field_service__Indicators.clean_up();
}
if (other_value.opc__List().is_bound()) {
  if (other_value.opc__List().ispresent()) single_value->field_opc__List = other_value.opc__List()();
  else single_value->field_opc__List = OMIT_VALUE;
} else {
  single_value->field_opc__List.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Routing__Key__Parameters_template::copy_template(const M3UA__Routing__Key__Parameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.local__Routing__Key__Id().get_selection()) {
single_value->field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
} else {
single_value->field_local__Routing__Key__Id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.traffic__Mode__Type().get_selection()) {
single_value->field_traffic__Mode__Type = other_value.traffic__Mode__Type();
} else {
single_value->field_traffic__Mode__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destination__Point__Code().get_selection()) {
single_value->field_destination__Point__Code = other_value.destination__Point__Code();
} else {
single_value->field_destination__Point__Code.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__Indicators().get_selection()) {
single_value->field_service__Indicators = other_value.service__Indicators();
} else {
single_value->field_service__Indicators.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.opc__List().get_selection()) {
single_value->field_opc__List = other_value.opc__List();
} else {
single_value->field_opc__List.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 M3UA__Routing__Key__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 M3UA__Routing__Key__Parameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Routing__Key__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 @M3UA_Types.M3UA_Routing_Key_Parameters.");
break;
}
set_selection(other_value);
}

M3UA__Routing__Key__Parameters_template::M3UA__Routing__Key__Parameters_template()
{
}

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

M3UA__Routing__Key__Parameters_template::M3UA__Routing__Key__Parameters_template(const M3UA__Routing__Key__Parameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

M3UA__Routing__Key__Parameters_template& M3UA__Routing__Key__Parameters_template::operator=(const OPTIONAL<M3UA__Routing__Key__Parameters>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__Routing__Key__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 @M3UA_Types.M3UA_Routing_Key_Parameters.");
}
return *this;
}

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

boolean M3UA__Routing__Key__Parameters_template::match(const M3UA__Routing__Key__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.local__Routing__Key__Id().is_bound()) return FALSE;
if(!single_value->field_local__Routing__Key__Id.match(other_value.local__Routing__Key__Id(), legacy))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.traffic__Mode__Type().is_bound()) return FALSE;
if((other_value.traffic__Mode__Type().ispresent() ? !single_value->field_traffic__Mode__Type.match((const M3UA__Traffic__Mode__Type&)other_value.traffic__Mode__Type(), legacy) : !single_value->field_traffic__Mode__Type.match_omit(legacy)))return FALSE;
if(!other_value.destination__Point__Code().is_bound()) return FALSE;
if(!single_value->field_destination__Point__Code.match(other_value.destination__Point__Code(), legacy))return FALSE;
if(!other_value.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.service__Indicators().is_bound()) return FALSE;
if((other_value.service__Indicators().ispresent() ? !single_value->field_service__Indicators.match((const M3UA__Service__Indicators&)other_value.service__Indicators(), legacy) : !single_value->field_service__Indicators.match_omit(legacy)))return FALSE;
if(!other_value.opc__List().is_bound()) return FALSE;
if((other_value.opc__List().ispresent() ? !single_value->field_opc__List.match((const M3UA__OPC__List&)other_value.opc__List(), legacy) : !single_value->field_opc__List.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 @M3UA_Types.M3UA_Routing_Key_Parameters.");
}
return FALSE;
}

boolean M3UA__Routing__Key__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_local__Routing__Key__Id.is_bound()
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || (single_value->field_traffic__Mode__Type.is_omit() || single_value->field_traffic__Mode__Type.is_bound())
 || single_value->field_destination__Point__Code.is_bound()
 || (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_service__Indicators.is_omit() || single_value->field_service__Indicators.is_bound())
 || (single_value->field_opc__List.is_omit() || single_value->field_opc__List.is_bound());
}

boolean M3UA__Routing__Key__Parameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_local__Routing__Key__Id.is_value()
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && (single_value->field_traffic__Mode__Type.is_omit() || single_value->field_traffic__Mode__Type.is_value())
 && single_value->field_destination__Point__Code.is_value()
 && (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_service__Indicators.is_omit() || single_value->field_service__Indicators.is_value())
 && (single_value->field_opc__List.is_omit() || single_value->field_opc__List.is_value());
}

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

M3UA__Routing__Key__Parameters M3UA__Routing__Key__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 @M3UA_Types.M3UA_Routing_Key_Parameters.");
M3UA__Routing__Key__Parameters ret_val;
if (single_value->field_local__Routing__Key__Id.is_bound()) {
ret_val.local__Routing__Key__Id() = single_value->field_local__Routing__Key__Id.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_traffic__Mode__Type.is_omit()) ret_val.traffic__Mode__Type() = OMIT_VALUE;
else if (single_value->field_traffic__Mode__Type.is_bound()) {
ret_val.traffic__Mode__Type() = single_value->field_traffic__Mode__Type.valueof();
}
if (single_value->field_destination__Point__Code.is_bound()) {
ret_val.destination__Point__Code() = single_value->field_destination__Point__Code.valueof();
}
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_service__Indicators.is_omit()) ret_val.service__Indicators() = OMIT_VALUE;
else if (single_value->field_service__Indicators.is_bound()) {
ret_val.service__Indicators() = single_value->field_service__Indicators.valueof();
}
if (single_value->field_opc__List.is_omit()) ret_val.opc__List() = OMIT_VALUE;
else if (single_value->field_opc__List.is_bound()) {
ret_val.opc__List() = single_value->field_opc__List.valueof();
}
return ret_val;
}

void M3UA__Routing__Key__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 @M3UA_Types.M3UA_Routing_Key_Parameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Routing__Key__Parameters_template[list_length];
}

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

M3UA__Local__Routing__Key__Id_template& M3UA__Routing__Key__Parameters_template::local__Routing__Key__Id()
{
set_specific();
return single_value->field_local__Routing__Key__Id;
}

const M3UA__Local__Routing__Key__Id_template& M3UA__Routing__Key__Parameters_template::local__Routing__Key__Id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_Routing_Key_Id of a non-specific template of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
return single_value->field_local__Routing__Key__Id;
}

M3UA__Routing__Context_template& M3UA__Routing__Key__Parameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__Routing__Key__Parameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
return single_value->field_routing__Context;
}

M3UA__Traffic__Mode__Type_template& M3UA__Routing__Key__Parameters_template::traffic__Mode__Type()
{
set_specific();
return single_value->field_traffic__Mode__Type;
}

const M3UA__Traffic__Mode__Type_template& M3UA__Routing__Key__Parameters_template::traffic__Mode__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field traffic_Mode_Type of a non-specific template of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
return single_value->field_traffic__Mode__Type;
}

M3UA__Destination__PointCode_template& M3UA__Routing__Key__Parameters_template::destination__Point__Code()
{
set_specific();
return single_value->field_destination__Point__Code;
}

const M3UA__Destination__PointCode_template& M3UA__Routing__Key__Parameters_template::destination__Point__Code() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destination_Point_Code of a non-specific template of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
return single_value->field_destination__Point__Code;
}

M3UA__Network__Appearance_template& M3UA__Routing__Key__Parameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__Routing__Key__Parameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
return single_value->field_network__Appearance;
}

M3UA__Service__Indicators_template& M3UA__Routing__Key__Parameters_template::service__Indicators()
{
set_specific();
return single_value->field_service__Indicators;
}

const M3UA__Service__Indicators_template& M3UA__Routing__Key__Parameters_template::service__Indicators() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_Indicators of a non-specific template of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
return single_value->field_service__Indicators;
}

M3UA__OPC__List_template& M3UA__Routing__Key__Parameters_template::opc__List()
{
set_specific();
return single_value->field_opc__List;
}

const M3UA__OPC__List_template& M3UA__Routing__Key__Parameters_template::opc__List() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field opc_List of a non-specific template of type @M3UA_Types.M3UA_Routing_Key_Parameters.");
return single_value->field_opc__List;
}

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

void M3UA__Routing__Key__Parameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ local_Routing_Key_Id := ");
single_value->field_local__Routing__Key__Id.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", traffic_Mode_Type := ");
single_value->field_traffic__Mode__Type.log();
TTCN_Logger::log_event_str(", destination_Point_Code := ");
single_value->field_destination__Point__Code.log();
TTCN_Logger::log_event_str(", network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", service_Indicators := ");
single_value->field_service__Indicators.log();
TTCN_Logger::log_event_str(", opc_List := ");
single_value->field_opc__List.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 M3UA__Routing__Key__Parameters_template::log_match(const M3UA__Routing__Key__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_local__Routing__Key__Id.match(match_value.local__Routing__Key__Id(), legacy)){
TTCN_Logger::log_logmatch_info(".local_Routing_Key_Id");
single_value->field_local__Routing__Key__Id.log_match(match_value.local__Routing__Key__Id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.traffic__Mode__Type().ispresent()){
if(!single_value->field_traffic__Mode__Type.match(match_value.traffic__Mode__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".traffic_Mode_Type");
single_value->field_traffic__Mode__Type.log_match(match_value.traffic__Mode__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_traffic__Mode__Type.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".traffic_Mode_Type := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_traffic__Mode__Type.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_destination__Point__Code.match(match_value.destination__Point__Code(), legacy)){
TTCN_Logger::log_logmatch_info(".destination_Point_Code");
single_value->field_destination__Point__Code.log_match(match_value.destination__Point__Code(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.service__Indicators().ispresent()){
if(!single_value->field_service__Indicators.match(match_value.service__Indicators(), legacy)){
TTCN_Logger::log_logmatch_info(".service_Indicators");
single_value->field_service__Indicators.log_match(match_value.service__Indicators(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_service__Indicators.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".service_Indicators := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_service__Indicators.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.opc__List().ispresent()){
if(!single_value->field_opc__List.match(match_value.opc__List(), legacy)){
TTCN_Logger::log_logmatch_info(".opc_List");
single_value->field_opc__List.log_match(match_value.opc__List(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_opc__List.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".opc_List := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_opc__List.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("{ local_Routing_Key_Id := ");
single_value->field_local__Routing__Key__Id.log_match(match_value.local__Routing__Key__Id(), legacy);
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", traffic_Mode_Type := ");
if (match_value.traffic__Mode__Type().ispresent()) {
single_value->field_traffic__Mode__Type.log_match(match_value.traffic__Mode__Type(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_traffic__Mode__Type.log();
if (single_value->field_traffic__Mode__Type.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", destination_Point_Code := ");
single_value->field_destination__Point__Code.log_match(match_value.destination__Point__Code(), legacy);
TTCN_Logger::log_event_str(", network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", service_Indicators := ");
if (match_value.service__Indicators().ispresent()) {
single_value->field_service__Indicators.log_match(match_value.service__Indicators(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_service__Indicators.log();
if (single_value->field_service__Indicators.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", opc_List := ");
if (match_value.opc__List().ispresent()) {
single_value->field_opc__List.log_match(match_value.opc__List(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_opc__List.log();
if (single_value->field_opc__List.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 M3UA__Routing__Key__Parameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (local__Routing__Key__Id().is_bound()) local__Routing__Key__Id().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (!traffic__Mode__Type().is_bound()) traffic__Mode__Type() = OMIT_VALUE;
else traffic__Mode__Type().set_implicit_omit();
if (destination__Point__Code().is_bound()) destination__Point__Code().set_implicit_omit();
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!service__Indicators().is_bound()) service__Indicators() = OMIT_VALUE;
else service__Indicators().set_implicit_omit();
if (!opc__List().is_bound()) opc__List() = OMIT_VALUE;
else opc__List().set_implicit_omit();
}

void M3UA__Routing__Key__Parameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_local__Routing__Key__Id.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_traffic__Mode__Type.encode_text(text_buf);
single_value->field_destination__Point__Code.encode_text(text_buf);
single_value->field_network__Appearance.encode_text(text_buf);
single_value->field_service__Indicators.encode_text(text_buf);
single_value->field_opc__List.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 @M3UA_Types.M3UA_Routing_Key_Parameters.");
}
}

void M3UA__Routing__Key__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_local__Routing__Key__Id.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_traffic__Mode__Type.decode_text(text_buf);
single_value->field_destination__Point__Code.decode_text(text_buf);
single_value->field_network__Appearance.decode_text(text_buf);
single_value->field_service__Indicators.decode_text(text_buf);
single_value->field_opc__List.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 M3UA__Routing__Key__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 @M3UA_Types.M3UA_Routing_Key_Parameters.");
}
}

void M3UA__Routing__Key__Parameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__Routing__Key__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("set template of type @M3UA_Types.M3UA_Routing_Key_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) local__Routing__Key__Id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) traffic__Mode__Type().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) destination__Point__Code().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) service__Indicators().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) opc__List().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(), "local_Routing_Key_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__Routing__Key__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "traffic_Mode_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          traffic__Mode__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destination_Point_Code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destination__Point__Code().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "service_Indicators")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__Indicators().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "opc_List")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          opc__List().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Routing_Key_Parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Routing__Key__Parameters_template* precondition = new M3UA__Routing__Key__Parameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Routing__Key__Parameters_template* implied_template = new M3UA__Routing__Key__Parameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Routing__Key__Parameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_Routing_Key_Parameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__Routing__Key__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_local__Routing__Key__Id.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key_Parameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key_Parameters");
single_value->field_traffic__Mode__Type.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key_Parameters");
single_value->field_destination__Point__Code.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key_Parameters");
single_value->field_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key_Parameters");
single_value->field_service__Indicators.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key_Parameters");
single_value->field_opc__List.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key_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 : "@M3UA_Types.M3UA_Routing_Key_Parameters");
}

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

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

M3UA__Routing__Key::M3UA__Routing__Key()
{
}

M3UA__Routing__Key::M3UA__Routing__Key(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const M3UA__Routing__Key__Parameters& par_routingKey)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_routingKey(par_routingKey)
{
}

M3UA__Routing__Key::M3UA__Routing__Key(const M3UA__Routing__Key& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Routing_Key.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.routingKey().is_bound()) field_routingKey = other_value.routingKey();
else field_routingKey.clean_up();
}

void M3UA__Routing__Key::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_routingKey.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Routing__Key::get_descriptor() const { return &M3UA__Routing__Key_descr_; }
M3UA__Routing__Key& M3UA__Routing__Key::operator=(const M3UA__Routing__Key& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Routing_Key.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.routingKey().is_bound()) field_routingKey = other_value.routingKey();
  else field_routingKey.clean_up();
}
return *this;
}

boolean M3UA__Routing__Key::operator==(const M3UA__Routing__Key& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_routingKey==other_value.field_routingKey;
}

boolean M3UA__Routing__Key::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_routingKey.is_bound());
}
boolean M3UA__Routing__Key::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_routingKey.is_value();
}
void M3UA__Routing__Key::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", routingKey := ");
field_routingKey.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Routing__Key::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (routingKey().is_bound()) routingKey().set_implicit_omit();
}

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

void M3UA__Routing__Key::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_routingKey.encode_text(text_buf);
}

void M3UA__Routing__Key::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_routingKey.decode_text(text_buf);
}

void M3UA__Routing__Key::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 M3UA__Routing__Key::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 M3UA__Routing__Key::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Key_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Routing__Key_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Routing__Key_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Routing__Key__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_routingKey.RAW_decode(M3UA__Routing__Key__Parameters_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 M3UA__Routing__Key::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Key_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Routing__Key__Parameters_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Routing__Key_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_routingKey.RAW_encode(M3UA__Routing__Key__Parameters_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Routing__Key_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
M3UA__Routing__Key__Parameters_template field_routingKey;
};

void M3UA__Routing__Key_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_routingKey = ANY_VALUE;
}
}
}

void M3UA__Routing__Key_template::copy_value(const M3UA__Routing__Key& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.routingKey().is_bound()) {
  single_value->field_routingKey = other_value.routingKey();
} else {
  single_value->field_routingKey.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Routing__Key_template::copy_template(const M3UA__Routing__Key_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingKey().get_selection()) {
single_value->field_routingKey = other_value.routingKey();
} else {
single_value->field_routingKey.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 M3UA__Routing__Key_template[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 M3UA__Routing__Key_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Routing__Key_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 @M3UA_Types.M3UA_Routing_Key.");
break;
}
set_selection(other_value);
}

M3UA__Routing__Key_template::M3UA__Routing__Key_template()
{
}

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

M3UA__Routing__Key_template::M3UA__Routing__Key_template(const M3UA__Routing__Key& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Routing__Key_template::match(const M3UA__Routing__Key& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.routingKey().is_bound()) return FALSE;
if(!single_value->field_routingKey.match(other_value.routingKey(), 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 @M3UA_Types.M3UA_Routing_Key.");
}
return FALSE;
}

boolean M3UA__Routing__Key_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_routingKey.is_bound();
}

boolean M3UA__Routing__Key_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_routingKey.is_value();
}

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

M3UA__Routing__Key M3UA__Routing__Key_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 @M3UA_Types.M3UA_Routing_Key.");
M3UA__Routing__Key ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_routingKey.is_bound()) {
ret_val.routingKey() = single_value->field_routingKey.valueof();
}
return ret_val;
}

void M3UA__Routing__Key_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 @M3UA_Types.M3UA_Routing_Key.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Routing__Key_template[list_length];
}

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

OCTETSTRING_template& M3UA__Routing__Key_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Routing__Key_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Routing_Key.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Routing__Key_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Routing__Key_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Routing_Key.");
return single_value->field_lengthInd;
}

M3UA__Routing__Key__Parameters_template& M3UA__Routing__Key_template::routingKey()
{
set_specific();
return single_value->field_routingKey;
}

const M3UA__Routing__Key__Parameters_template& M3UA__Routing__Key_template::routingKey() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingKey of a non-specific template of type @M3UA_Types.M3UA_Routing_Key.");
return single_value->field_routingKey;
}

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

void M3UA__Routing__Key_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", routingKey := ");
single_value->field_routingKey.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 M3UA__Routing__Key_template::log_match(const M3UA__Routing__Key& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingKey.match(match_value.routingKey(), legacy)){
TTCN_Logger::log_logmatch_info(".routingKey");
single_value->field_routingKey.log_match(match_value.routingKey(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", routingKey := ");
single_value->field_routingKey.log_match(match_value.routingKey(), 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 M3UA__Routing__Key_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (routingKey().is_bound()) routingKey().set_implicit_omit();
}

void M3UA__Routing__Key_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_routingKey.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 @M3UA_Types.M3UA_Routing_Key.");
}
}

void M3UA__Routing__Key_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_routingKey.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 M3UA__Routing__Key_template[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 @M3UA_Types.M3UA_Routing_Key.");
}
}

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

void M3UA__Routing__Key_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key");
single_value->field_routingKey.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Routing_Key");
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 : "@M3UA_Types.M3UA_Routing_Key");
}

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

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

M3UA__Registration__Status::M3UA__Registration__Status()
{
}

M3UA__Registration__Status::M3UA__Registration__Status(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_registrationStatus)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_registrationStatus(par_registrationStatus)
{
}

M3UA__Registration__Status::M3UA__Registration__Status(const M3UA__Registration__Status& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Registration_Status.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.registrationStatus().is_bound()) field_registrationStatus = other_value.registrationStatus();
else field_registrationStatus.clean_up();
}

void M3UA__Registration__Status::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_registrationStatus.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Registration__Status::get_descriptor() const { return &M3UA__Registration__Status_descr_; }
M3UA__Registration__Status& M3UA__Registration__Status::operator=(const M3UA__Registration__Status& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Registration_Status.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.registrationStatus().is_bound()) field_registrationStatus = other_value.registrationStatus();
  else field_registrationStatus.clean_up();
}
return *this;
}

boolean M3UA__Registration__Status::operator==(const M3UA__Registration__Status& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_registrationStatus==other_value.field_registrationStatus;
}

boolean M3UA__Registration__Status::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_registrationStatus.is_bound());
}
boolean M3UA__Registration__Status::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_registrationStatus.is_value();
}
void M3UA__Registration__Status::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", registrationStatus := ");
field_registrationStatus.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Registration__Status::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (registrationStatus().is_bound()) registrationStatus().set_implicit_omit();
}

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

void M3UA__Registration__Status::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_registrationStatus.encode_text(text_buf);
}

void M3UA__Registration__Status::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_registrationStatus.decode_text(text_buf);
}

void M3UA__Registration__Status::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 M3UA__Registration__Status::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 M3UA__Registration__Status::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Registration__Status_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Registration__Status_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Registration__Status_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_registrationStatus.RAW_decode(General__Types::OCT4_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 M3UA__Registration__Status::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Registration__Status_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Registration__Status_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_registrationStatus.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Registration__Status_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_registrationStatus;
};

void M3UA__Registration__Status_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_registrationStatus = ANY_VALUE;
}
}
}

void M3UA__Registration__Status_template::copy_value(const M3UA__Registration__Status& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.registrationStatus().is_bound()) {
  single_value->field_registrationStatus = other_value.registrationStatus();
} else {
  single_value->field_registrationStatus.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Registration__Status_template::copy_template(const M3UA__Registration__Status_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.registrationStatus().get_selection()) {
single_value->field_registrationStatus = other_value.registrationStatus();
} else {
single_value->field_registrationStatus.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 M3UA__Registration__Status_template[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 M3UA__Registration__Status_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Registration__Status_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 @M3UA_Types.M3UA_Registration_Status.");
break;
}
set_selection(other_value);
}

M3UA__Registration__Status_template::M3UA__Registration__Status_template()
{
}

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

M3UA__Registration__Status_template::M3UA__Registration__Status_template(const M3UA__Registration__Status& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Registration__Status_template::match(const M3UA__Registration__Status& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.registrationStatus().is_bound()) return FALSE;
if(!single_value->field_registrationStatus.match(other_value.registrationStatus(), 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 @M3UA_Types.M3UA_Registration_Status.");
}
return FALSE;
}

boolean M3UA__Registration__Status_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_registrationStatus.is_bound();
}

boolean M3UA__Registration__Status_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_registrationStatus.is_value();
}

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

M3UA__Registration__Status M3UA__Registration__Status_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 @M3UA_Types.M3UA_Registration_Status.");
M3UA__Registration__Status ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_registrationStatus.is_bound()) {
ret_val.registrationStatus() = single_value->field_registrationStatus.valueof();
}
return ret_val;
}

void M3UA__Registration__Status_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 @M3UA_Types.M3UA_Registration_Status.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Registration__Status_template[list_length];
}

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

OCTETSTRING_template& M3UA__Registration__Status_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Registration__Status_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Registration_Status.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Registration__Status_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Registration__Status_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Registration_Status.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Registration__Status_template::registrationStatus()
{
set_specific();
return single_value->field_registrationStatus;
}

const OCTETSTRING_template& M3UA__Registration__Status_template::registrationStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field registrationStatus of a non-specific template of type @M3UA_Types.M3UA_Registration_Status.");
return single_value->field_registrationStatus;
}

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

void M3UA__Registration__Status_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", registrationStatus := ");
single_value->field_registrationStatus.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 M3UA__Registration__Status_template::log_match(const M3UA__Registration__Status& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_registrationStatus.match(match_value.registrationStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".registrationStatus");
single_value->field_registrationStatus.log_match(match_value.registrationStatus(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", registrationStatus := ");
single_value->field_registrationStatus.log_match(match_value.registrationStatus(), 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 M3UA__Registration__Status_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (registrationStatus().is_bound()) registrationStatus().set_implicit_omit();
}

void M3UA__Registration__Status_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_registrationStatus.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 @M3UA_Types.M3UA_Registration_Status.");
}
}

void M3UA__Registration__Status_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_registrationStatus.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 M3UA__Registration__Status_template[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 @M3UA_Types.M3UA_Registration_Status.");
}
}

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

void M3UA__Registration__Status_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Status");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Status");
single_value->field_registrationStatus.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Status");
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 : "@M3UA_Types.M3UA_Registration_Status");
}

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

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

M3UA__Deregistration__Status::M3UA__Deregistration__Status()
{
}

M3UA__Deregistration__Status::M3UA__Deregistration__Status(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const OCTETSTRING& par_deregistrationStatus)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_deregistrationStatus(par_deregistrationStatus)
{
}

M3UA__Deregistration__Status::M3UA__Deregistration__Status(const M3UA__Deregistration__Status& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Deregistration_Status.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.deregistrationStatus().is_bound()) field_deregistrationStatus = other_value.deregistrationStatus();
else field_deregistrationStatus.clean_up();
}

void M3UA__Deregistration__Status::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_deregistrationStatus.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Deregistration__Status::get_descriptor() const { return &M3UA__Deregistration__Status_descr_; }
M3UA__Deregistration__Status& M3UA__Deregistration__Status::operator=(const M3UA__Deregistration__Status& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Deregistration_Status.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.deregistrationStatus().is_bound()) field_deregistrationStatus = other_value.deregistrationStatus();
  else field_deregistrationStatus.clean_up();
}
return *this;
}

boolean M3UA__Deregistration__Status::operator==(const M3UA__Deregistration__Status& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_deregistrationStatus==other_value.field_deregistrationStatus;
}

boolean M3UA__Deregistration__Status::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_deregistrationStatus.is_bound());
}
boolean M3UA__Deregistration__Status::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_deregistrationStatus.is_value();
}
void M3UA__Deregistration__Status::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", deregistrationStatus := ");
field_deregistrationStatus.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Deregistration__Status::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (deregistrationStatus().is_bound()) deregistrationStatus().set_implicit_omit();
}

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

void M3UA__Deregistration__Status::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_deregistrationStatus.encode_text(text_buf);
}

void M3UA__Deregistration__Status::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_deregistrationStatus.decode_text(text_buf);
}

void M3UA__Deregistration__Status::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 M3UA__Deregistration__Status::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 M3UA__Deregistration__Status::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Deregistration__Status_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Deregistration__Status_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Deregistration__Status_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT4_descr_.raw->forceomit);
  decoded_field_length = field_deregistrationStatus.RAW_decode(General__Types::OCT4_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 M3UA__Deregistration__Status::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Deregistration__Status_lengthInd_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_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Deregistration__Status_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_deregistrationStatus.RAW_encode(General__Types::OCT4_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Deregistration__Status_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
OCTETSTRING_template field_deregistrationStatus;
};

void M3UA__Deregistration__Status_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_deregistrationStatus = ANY_VALUE;
}
}
}

void M3UA__Deregistration__Status_template::copy_value(const M3UA__Deregistration__Status& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.deregistrationStatus().is_bound()) {
  single_value->field_deregistrationStatus = other_value.deregistrationStatus();
} else {
  single_value->field_deregistrationStatus.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Deregistration__Status_template::copy_template(const M3UA__Deregistration__Status_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deregistrationStatus().get_selection()) {
single_value->field_deregistrationStatus = other_value.deregistrationStatus();
} else {
single_value->field_deregistrationStatus.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 M3UA__Deregistration__Status_template[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 M3UA__Deregistration__Status_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Deregistration__Status_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 @M3UA_Types.M3UA_Deregistration_Status.");
break;
}
set_selection(other_value);
}

M3UA__Deregistration__Status_template::M3UA__Deregistration__Status_template()
{
}

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

M3UA__Deregistration__Status_template::M3UA__Deregistration__Status_template(const M3UA__Deregistration__Status& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Deregistration__Status_template::match(const M3UA__Deregistration__Status& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.deregistrationStatus().is_bound()) return FALSE;
if(!single_value->field_deregistrationStatus.match(other_value.deregistrationStatus(), 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 @M3UA_Types.M3UA_Deregistration_Status.");
}
return FALSE;
}

boolean M3UA__Deregistration__Status_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_deregistrationStatus.is_bound();
}

boolean M3UA__Deregistration__Status_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_deregistrationStatus.is_value();
}

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

M3UA__Deregistration__Status M3UA__Deregistration__Status_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 @M3UA_Types.M3UA_Deregistration_Status.");
M3UA__Deregistration__Status ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_deregistrationStatus.is_bound()) {
ret_val.deregistrationStatus() = single_value->field_deregistrationStatus.valueof();
}
return ret_val;
}

void M3UA__Deregistration__Status_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 @M3UA_Types.M3UA_Deregistration_Status.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Deregistration__Status_template[list_length];
}

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

OCTETSTRING_template& M3UA__Deregistration__Status_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Deregistration__Status_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Status.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Deregistration__Status_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Deregistration__Status_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Status.");
return single_value->field_lengthInd;
}

OCTETSTRING_template& M3UA__Deregistration__Status_template::deregistrationStatus()
{
set_specific();
return single_value->field_deregistrationStatus;
}

const OCTETSTRING_template& M3UA__Deregistration__Status_template::deregistrationStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deregistrationStatus of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Status.");
return single_value->field_deregistrationStatus;
}

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

void M3UA__Deregistration__Status_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", deregistrationStatus := ");
single_value->field_deregistrationStatus.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 M3UA__Deregistration__Status_template::log_match(const M3UA__Deregistration__Status& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_deregistrationStatus.match(match_value.deregistrationStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".deregistrationStatus");
single_value->field_deregistrationStatus.log_match(match_value.deregistrationStatus(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", deregistrationStatus := ");
single_value->field_deregistrationStatus.log_match(match_value.deregistrationStatus(), 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 M3UA__Deregistration__Status_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (deregistrationStatus().is_bound()) deregistrationStatus().set_implicit_omit();
}

void M3UA__Deregistration__Status_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_deregistrationStatus.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 @M3UA_Types.M3UA_Deregistration_Status.");
}
}

void M3UA__Deregistration__Status_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_deregistrationStatus.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 M3UA__Deregistration__Status_template[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 @M3UA_Types.M3UA_Deregistration_Status.");
}
}

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

void M3UA__Deregistration__Status_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Status");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Status");
single_value->field_deregistrationStatus.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Status");
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 : "@M3UA_Types.M3UA_Deregistration_Status");
}

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

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

M3UA__Registration__Result__Parameters::M3UA__Registration__Result__Parameters()
{
}

M3UA__Registration__Result__Parameters::M3UA__Registration__Result__Parameters(const M3UA__Local__Routing__Key__Id& par_local__Routing__Key__Id,
    const M3UA__Registration__Status& par_registration__Status,
    const M3UA__Routing__Context& par_routing__Context)
  :   field_local__Routing__Key__Id(par_local__Routing__Key__Id),
  field_registration__Status(par_registration__Status),
  field_routing__Context(par_routing__Context)
{
}

M3UA__Registration__Result__Parameters::M3UA__Registration__Result__Parameters(const M3UA__Registration__Result__Parameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Registration_Result_Parameters.");
if (other_value.local__Routing__Key__Id().is_bound()) field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
else field_local__Routing__Key__Id.clean_up();
if (other_value.registration__Status().is_bound()) field_registration__Status = other_value.registration__Status();
else field_registration__Status.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
}

void M3UA__Registration__Result__Parameters::clean_up()
{
field_local__Routing__Key__Id.clean_up();
field_registration__Status.clean_up();
field_routing__Context.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Registration__Result__Parameters::get_descriptor() const { return &M3UA__Registration__Result__Parameters_descr_; }
M3UA__Registration__Result__Parameters& M3UA__Registration__Result__Parameters::operator=(const M3UA__Registration__Result__Parameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Registration_Result_Parameters.");
  if (other_value.local__Routing__Key__Id().is_bound()) field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
  else field_local__Routing__Key__Id.clean_up();
  if (other_value.registration__Status().is_bound()) field_registration__Status = other_value.registration__Status();
  else field_registration__Status.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
}
return *this;
}

boolean M3UA__Registration__Result__Parameters::operator==(const M3UA__Registration__Result__Parameters& other_value) const
{
return field_local__Routing__Key__Id==other_value.field_local__Routing__Key__Id
  && field_registration__Status==other_value.field_registration__Status
  && field_routing__Context==other_value.field_routing__Context;
}

boolean M3UA__Registration__Result__Parameters::is_bound() const
{
return (field_local__Routing__Key__Id.is_bound())
  || (field_registration__Status.is_bound())
  || (field_routing__Context.is_bound());
}
boolean M3UA__Registration__Result__Parameters::is_value() const
{
return field_local__Routing__Key__Id.is_value()
  && field_registration__Status.is_value()
  && field_routing__Context.is_value();
}
void M3UA__Registration__Result__Parameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ local_Routing_Key_Id := ");
field_local__Routing__Key__Id.log();
TTCN_Logger::log_event_str(", registration_Status := ");
field_registration__Status.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Registration__Result__Parameters::set_implicit_omit()
{
if (local__Routing__Key__Id().is_bound()) local__Routing__Key__Id().set_implicit_omit();
if (registration__Status().is_bound()) registration__Status().set_implicit_omit();
if (routing__Context().is_bound()) routing__Context().set_implicit_omit();
}

void M3UA__Registration__Result__Parameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_Registration_Result_Parameters 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) local__Routing__Key__Id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) registration__Status().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routing__Context().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(), "local_Routing_Key_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__Routing__Key__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "registration_Status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          registration__Status().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Registration_Result_Parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_Registration_Result_Parameters");
  }
}

void M3UA__Registration__Result__Parameters::encode_text(Text_Buf& text_buf) const
{
field_local__Routing__Key__Id.encode_text(text_buf);
field_registration__Status.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
}

void M3UA__Registration__Result__Parameters::decode_text(Text_Buf& text_buf)
{
field_local__Routing__Key__Id.decode_text(text_buf);
field_registration__Status.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
}

void M3UA__Registration__Result__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 M3UA__Registration__Result__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 M3UA__Registration__Result__Parameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[3];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Local__Routing__Key__Id_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Local__Routing__Key__Id_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_14) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Local__Routing__Key__Id_descr_.raw->forceomit);
int decoded_field_length = field_local__Routing__Key__Id.RAW_decode(M3UA__Local__Routing__Key__Id_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length >= 0 && (field_local__Routing__Key__Id.tag() ==  os_14)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[1] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Registration__Status_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Registration__Status_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_19) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Registration__Status_descr_.raw->forceomit);
int decoded_field_length = field_registration__Status.RAW_decode(M3UA__Registration__Status_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length >= 0 && (field_registration__Status.tag() ==  os_19)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[2] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context.RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length >= 0 && (field_routing__Context.tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
break;
}
if (nof_mand_fields != 3) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__Registration__Result__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 = 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, M3UA__Local__Routing__Key__Id_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Registration__Status_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Routing__Context_descr_.raw);
  encoded_length += field_local__Routing__Key__Id.RAW_encode(M3UA__Local__Routing__Key__Id_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_registration__Status.RAW_encode(M3UA__Registration__Status_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routing__Context.RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[2]);
  if (field_local__Routing__Key__Id.tag() !=  os_14) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_14.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_registration__Status.tag() !=  os_19) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_19.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.tag() !=  os_1) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_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 M3UA__Registration__Result__Parameters_template::single_value_struct {
M3UA__Local__Routing__Key__Id_template field_local__Routing__Key__Id;
M3UA__Registration__Status_template field_registration__Status;
M3UA__Routing__Context_template field_routing__Context;
};

void M3UA__Registration__Result__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_local__Routing__Key__Id = ANY_VALUE;
single_value->field_registration__Status = ANY_VALUE;
single_value->field_routing__Context = ANY_VALUE;
}
}
}

void M3UA__Registration__Result__Parameters_template::copy_value(const M3UA__Registration__Result__Parameters& other_value)
{
single_value = new single_value_struct;
if (other_value.local__Routing__Key__Id().is_bound()) {
  single_value->field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
} else {
  single_value->field_local__Routing__Key__Id.clean_up();
}
if (other_value.registration__Status().is_bound()) {
  single_value->field_registration__Status = other_value.registration__Status();
} else {
  single_value->field_registration__Status.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  single_value->field_routing__Context = other_value.routing__Context();
} else {
  single_value->field_routing__Context.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Registration__Result__Parameters_template::copy_template(const M3UA__Registration__Result__Parameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.local__Routing__Key__Id().get_selection()) {
single_value->field_local__Routing__Key__Id = other_value.local__Routing__Key__Id();
} else {
single_value->field_local__Routing__Key__Id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.registration__Status().get_selection()) {
single_value->field_registration__Status = other_value.registration__Status();
} else {
single_value->field_registration__Status.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.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 M3UA__Registration__Result__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 M3UA__Registration__Result__Parameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Registration__Result__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 @M3UA_Types.M3UA_Registration_Result_Parameters.");
break;
}
set_selection(other_value);
}

M3UA__Registration__Result__Parameters_template::M3UA__Registration__Result__Parameters_template()
{
}

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

M3UA__Registration__Result__Parameters_template::M3UA__Registration__Result__Parameters_template(const M3UA__Registration__Result__Parameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

M3UA__Registration__Result__Parameters_template& M3UA__Registration__Result__Parameters_template::operator=(const OPTIONAL<M3UA__Registration__Result__Parameters>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__Registration__Result__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 @M3UA_Types.M3UA_Registration_Result_Parameters.");
}
return *this;
}

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

boolean M3UA__Registration__Result__Parameters_template::match(const M3UA__Registration__Result__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.local__Routing__Key__Id().is_bound()) return FALSE;
if(!single_value->field_local__Routing__Key__Id.match(other_value.local__Routing__Key__Id(), legacy))return FALSE;
if(!other_value.registration__Status().is_bound()) return FALSE;
if(!single_value->field_registration__Status.match(other_value.registration__Status(), legacy))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if(!single_value->field_routing__Context.match(other_value.routing__Context(), 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 @M3UA_Types.M3UA_Registration_Result_Parameters.");
}
return FALSE;
}

boolean M3UA__Registration__Result__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_local__Routing__Key__Id.is_bound()
 || single_value->field_registration__Status.is_bound()
 || single_value->field_routing__Context.is_bound();
}

boolean M3UA__Registration__Result__Parameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_local__Routing__Key__Id.is_value()
 && single_value->field_registration__Status.is_value()
 && single_value->field_routing__Context.is_value();
}

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

M3UA__Registration__Result__Parameters M3UA__Registration__Result__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 @M3UA_Types.M3UA_Registration_Result_Parameters.");
M3UA__Registration__Result__Parameters ret_val;
if (single_value->field_local__Routing__Key__Id.is_bound()) {
ret_val.local__Routing__Key__Id() = single_value->field_local__Routing__Key__Id.valueof();
}
if (single_value->field_registration__Status.is_bound()) {
ret_val.registration__Status() = single_value->field_registration__Status.valueof();
}
if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
return ret_val;
}

void M3UA__Registration__Result__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 @M3UA_Types.M3UA_Registration_Result_Parameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Registration__Result__Parameters_template[list_length];
}

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

M3UA__Local__Routing__Key__Id_template& M3UA__Registration__Result__Parameters_template::local__Routing__Key__Id()
{
set_specific();
return single_value->field_local__Routing__Key__Id;
}

const M3UA__Local__Routing__Key__Id_template& M3UA__Registration__Result__Parameters_template::local__Routing__Key__Id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field local_Routing_Key_Id of a non-specific template of type @M3UA_Types.M3UA_Registration_Result_Parameters.");
return single_value->field_local__Routing__Key__Id;
}

M3UA__Registration__Status_template& M3UA__Registration__Result__Parameters_template::registration__Status()
{
set_specific();
return single_value->field_registration__Status;
}

const M3UA__Registration__Status_template& M3UA__Registration__Result__Parameters_template::registration__Status() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field registration_Status of a non-specific template of type @M3UA_Types.M3UA_Registration_Result_Parameters.");
return single_value->field_registration__Status;
}

M3UA__Routing__Context_template& M3UA__Registration__Result__Parameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__Registration__Result__Parameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_Registration_Result_Parameters.");
return single_value->field_routing__Context;
}

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

void M3UA__Registration__Result__Parameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ local_Routing_Key_Id := ");
single_value->field_local__Routing__Key__Id.log();
TTCN_Logger::log_event_str(", registration_Status := ");
single_value->field_registration__Status.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.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 M3UA__Registration__Result__Parameters_template::log_match(const M3UA__Registration__Result__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_local__Routing__Key__Id.match(match_value.local__Routing__Key__Id(), legacy)){
TTCN_Logger::log_logmatch_info(".local_Routing_Key_Id");
single_value->field_local__Routing__Key__Id.log_match(match_value.local__Routing__Key__Id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_registration__Status.match(match_value.registration__Status(), legacy)){
TTCN_Logger::log_logmatch_info(".registration_Status");
single_value->field_registration__Status.log_match(match_value.registration__Status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), 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("{ local_Routing_Key_Id := ");
single_value->field_local__Routing__Key__Id.log_match(match_value.local__Routing__Key__Id(), legacy);
TTCN_Logger::log_event_str(", registration_Status := ");
single_value->field_registration__Status.log_match(match_value.registration__Status(), legacy);
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log_match(match_value.routing__Context(), 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 M3UA__Registration__Result__Parameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (local__Routing__Key__Id().is_bound()) local__Routing__Key__Id().set_implicit_omit();
if (registration__Status().is_bound()) registration__Status().set_implicit_omit();
if (routing__Context().is_bound()) routing__Context().set_implicit_omit();
}

void M3UA__Registration__Result__Parameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_local__Routing__Key__Id.encode_text(text_buf);
single_value->field_registration__Status.encode_text(text_buf);
single_value->field_routing__Context.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 @M3UA_Types.M3UA_Registration_Result_Parameters.");
}
}

void M3UA__Registration__Result__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_local__Routing__Key__Id.decode_text(text_buf);
single_value->field_registration__Status.decode_text(text_buf);
single_value->field_routing__Context.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 M3UA__Registration__Result__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 @M3UA_Types.M3UA_Registration_Result_Parameters.");
}
}

void M3UA__Registration__Result__Parameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__Registration__Result__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 (3<param.get_size()) {
      param.error("set template of type @M3UA_Types.M3UA_Registration_Result_Parameters 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) local__Routing__Key__Id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) registration__Status().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routing__Context().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(), "local_Routing_Key_Id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          local__Routing__Key__Id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "registration_Status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          registration__Status().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Registration_Result_Parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Registration__Result__Parameters_template* precondition = new M3UA__Registration__Result__Parameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Registration__Result__Parameters_template* implied_template = new M3UA__Registration__Result__Parameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Registration__Result__Parameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_Registration_Result_Parameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__Registration__Result__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_local__Routing__Key__Id.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Result_Parameters");
single_value->field_registration__Status.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Result_Parameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Result_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 : "@M3UA_Types.M3UA_Registration_Result_Parameters");
}

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

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

M3UA__Registration__Result::M3UA__Registration__Result()
{
}

M3UA__Registration__Result::M3UA__Registration__Result(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const M3UA__Registration__Result__Parameters& par_registrationResult)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_registrationResult(par_registrationResult)
{
}

M3UA__Registration__Result::M3UA__Registration__Result(const M3UA__Registration__Result& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Registration_Result.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.registrationResult().is_bound()) field_registrationResult = other_value.registrationResult();
else field_registrationResult.clean_up();
}

void M3UA__Registration__Result::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_registrationResult.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Registration__Result::get_descriptor() const { return &M3UA__Registration__Result_descr_; }
M3UA__Registration__Result& M3UA__Registration__Result::operator=(const M3UA__Registration__Result& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Registration_Result.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.registrationResult().is_bound()) field_registrationResult = other_value.registrationResult();
  else field_registrationResult.clean_up();
}
return *this;
}

boolean M3UA__Registration__Result::operator==(const M3UA__Registration__Result& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_registrationResult==other_value.field_registrationResult;
}

boolean M3UA__Registration__Result::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_registrationResult.is_bound());
}
boolean M3UA__Registration__Result::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_registrationResult.is_value();
}
void M3UA__Registration__Result::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", registrationResult := ");
field_registrationResult.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Registration__Result::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (registrationResult().is_bound()) registrationResult().set_implicit_omit();
}

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

void M3UA__Registration__Result::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_registrationResult.encode_text(text_buf);
}

void M3UA__Registration__Result::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_registrationResult.decode_text(text_buf);
}

void M3UA__Registration__Result::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 M3UA__Registration__Result::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 M3UA__Registration__Result::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Registration__Result_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Registration__Result_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Registration__Result_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Registration__Result__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_registrationResult.RAW_decode(M3UA__Registration__Result__Parameters_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 M3UA__Registration__Result::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Registration__Result_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Registration__Result__Parameters_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Registration__Result_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_registrationResult.RAW_encode(M3UA__Registration__Result__Parameters_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Registration__Result_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
M3UA__Registration__Result__Parameters_template field_registrationResult;
};

void M3UA__Registration__Result_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_registrationResult = ANY_VALUE;
}
}
}

void M3UA__Registration__Result_template::copy_value(const M3UA__Registration__Result& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.registrationResult().is_bound()) {
  single_value->field_registrationResult = other_value.registrationResult();
} else {
  single_value->field_registrationResult.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Registration__Result_template::copy_template(const M3UA__Registration__Result_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.registrationResult().get_selection()) {
single_value->field_registrationResult = other_value.registrationResult();
} else {
single_value->field_registrationResult.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 M3UA__Registration__Result_template[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 M3UA__Registration__Result_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Registration__Result_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 @M3UA_Types.M3UA_Registration_Result.");
break;
}
set_selection(other_value);
}

M3UA__Registration__Result_template::M3UA__Registration__Result_template()
{
}

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

M3UA__Registration__Result_template::M3UA__Registration__Result_template(const M3UA__Registration__Result& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Registration__Result_template::match(const M3UA__Registration__Result& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.registrationResult().is_bound()) return FALSE;
if(!single_value->field_registrationResult.match(other_value.registrationResult(), 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 @M3UA_Types.M3UA_Registration_Result.");
}
return FALSE;
}

boolean M3UA__Registration__Result_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_registrationResult.is_bound();
}

boolean M3UA__Registration__Result_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_registrationResult.is_value();
}

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

M3UA__Registration__Result M3UA__Registration__Result_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 @M3UA_Types.M3UA_Registration_Result.");
M3UA__Registration__Result ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_registrationResult.is_bound()) {
ret_val.registrationResult() = single_value->field_registrationResult.valueof();
}
return ret_val;
}

void M3UA__Registration__Result_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 @M3UA_Types.M3UA_Registration_Result.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Registration__Result_template[list_length];
}

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

OCTETSTRING_template& M3UA__Registration__Result_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Registration__Result_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Registration_Result.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Registration__Result_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Registration__Result_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Registration_Result.");
return single_value->field_lengthInd;
}

M3UA__Registration__Result__Parameters_template& M3UA__Registration__Result_template::registrationResult()
{
set_specific();
return single_value->field_registrationResult;
}

const M3UA__Registration__Result__Parameters_template& M3UA__Registration__Result_template::registrationResult() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field registrationResult of a non-specific template of type @M3UA_Types.M3UA_Registration_Result.");
return single_value->field_registrationResult;
}

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

void M3UA__Registration__Result_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", registrationResult := ");
single_value->field_registrationResult.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 M3UA__Registration__Result_template::log_match(const M3UA__Registration__Result& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_registrationResult.match(match_value.registrationResult(), legacy)){
TTCN_Logger::log_logmatch_info(".registrationResult");
single_value->field_registrationResult.log_match(match_value.registrationResult(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", registrationResult := ");
single_value->field_registrationResult.log_match(match_value.registrationResult(), 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 M3UA__Registration__Result_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (registrationResult().is_bound()) registrationResult().set_implicit_omit();
}

void M3UA__Registration__Result_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_registrationResult.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 @M3UA_Types.M3UA_Registration_Result.");
}
}

void M3UA__Registration__Result_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_registrationResult.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 M3UA__Registration__Result_template[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 @M3UA_Types.M3UA_Registration_Result.");
}
}

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

void M3UA__Registration__Result_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Result");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Result");
single_value->field_registrationResult.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Registration_Result");
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 : "@M3UA_Types.M3UA_Registration_Result");
}

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

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

M3UA__Deregistration__Result__Parameters::M3UA__Deregistration__Result__Parameters()
{
}

M3UA__Deregistration__Result__Parameters::M3UA__Deregistration__Result__Parameters(const M3UA__Routing__Context& par_routing__Context,
    const M3UA__Deregistration__Status& par_deregistration__Status)
  :   field_routing__Context(par_routing__Context),
  field_deregistration__Status(par_deregistration__Status)
{
}

M3UA__Deregistration__Result__Parameters::M3UA__Deregistration__Result__Parameters(const M3UA__Deregistration__Result__Parameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.deregistration__Status().is_bound()) field_deregistration__Status = other_value.deregistration__Status();
else field_deregistration__Status.clean_up();
}

void M3UA__Deregistration__Result__Parameters::clean_up()
{
field_routing__Context.clean_up();
field_deregistration__Status.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Deregistration__Result__Parameters::get_descriptor() const { return &M3UA__Deregistration__Result__Parameters_descr_; }
M3UA__Deregistration__Result__Parameters& M3UA__Deregistration__Result__Parameters::operator=(const M3UA__Deregistration__Result__Parameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.deregistration__Status().is_bound()) field_deregistration__Status = other_value.deregistration__Status();
  else field_deregistration__Status.clean_up();
}
return *this;
}

boolean M3UA__Deregistration__Result__Parameters::operator==(const M3UA__Deregistration__Result__Parameters& other_value) const
{
return field_routing__Context==other_value.field_routing__Context
  && field_deregistration__Status==other_value.field_deregistration__Status;
}

boolean M3UA__Deregistration__Result__Parameters::is_bound() const
{
return (field_routing__Context.is_bound())
  || (field_deregistration__Status.is_bound());
}
boolean M3UA__Deregistration__Result__Parameters::is_value() const
{
return field_routing__Context.is_value()
  && field_deregistration__Status.is_value();
}
void M3UA__Deregistration__Result__Parameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", deregistration_Status := ");
field_deregistration__Status.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Deregistration__Result__Parameters::set_implicit_omit()
{
if (routing__Context().is_bound()) routing__Context().set_implicit_omit();
if (deregistration__Status().is_bound()) deregistration__Status().set_implicit_omit();
}

void M3UA__Deregistration__Result__Parameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_Deregistration_Result_Parameters 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) routing__Context().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) deregistration__Status().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(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deregistration_Status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deregistration__Status().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Deregistration_Result_Parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_Deregistration_Result_Parameters");
  }
}

void M3UA__Deregistration__Result__Parameters::encode_text(Text_Buf& text_buf) const
{
field_routing__Context.encode_text(text_buf);
field_deregistration__Status.encode_text(text_buf);
}

void M3UA__Deregistration__Result__Parameters::decode_text(Text_Buf& text_buf)
{
field_routing__Context.decode_text(text_buf);
field_deregistration__Status.decode_text(text_buf);
}

void M3UA__Deregistration__Result__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 M3UA__Deregistration__Result__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 M3UA__Deregistration__Result__Parameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[2];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context.RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length >= 0 && (field_routing__Context.tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[1] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Deregistration__Status_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Deregistration__Status_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_20) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Deregistration__Status_descr_.raw->forceomit);
int decoded_field_length = field_deregistration__Status.RAW_decode(M3UA__Deregistration__Status_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length >= 0 && (field_deregistration__Status.tag() ==  os_20)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
break;
}
if (nof_mand_fields != 2) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__Deregistration__Result__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 = 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, M3UA__Routing__Context_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Deregistration__Status_descr_.raw);
  encoded_length += field_routing__Context.RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_deregistration__Status.RAW_encode(M3UA__Deregistration__Status_descr_, *myleaf.body.node.nodes[1]);
  if (field_routing__Context.tag() !=  os_1) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_deregistration__Status.tag() !=  os_20) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_20.RAW_encode(General__Types::OCT2_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 M3UA__Deregistration__Result__Parameters_template::single_value_struct {
M3UA__Routing__Context_template field_routing__Context;
M3UA__Deregistration__Status_template field_deregistration__Status;
};

void M3UA__Deregistration__Result__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_routing__Context = ANY_VALUE;
single_value->field_deregistration__Status = ANY_VALUE;
}
}
}

void M3UA__Deregistration__Result__Parameters_template::copy_value(const M3UA__Deregistration__Result__Parameters& other_value)
{
single_value = new single_value_struct;
if (other_value.routing__Context().is_bound()) {
  single_value->field_routing__Context = other_value.routing__Context();
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.deregistration__Status().is_bound()) {
  single_value->field_deregistration__Status = other_value.deregistration__Status();
} else {
  single_value->field_deregistration__Status.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Deregistration__Result__Parameters_template::copy_template(const M3UA__Deregistration__Result__Parameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deregistration__Status().get_selection()) {
single_value->field_deregistration__Status = other_value.deregistration__Status();
} else {
single_value->field_deregistration__Status.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 M3UA__Deregistration__Result__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 M3UA__Deregistration__Result__Parameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Deregistration__Result__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 @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
break;
}
set_selection(other_value);
}

M3UA__Deregistration__Result__Parameters_template::M3UA__Deregistration__Result__Parameters_template()
{
}

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

M3UA__Deregistration__Result__Parameters_template::M3UA__Deregistration__Result__Parameters_template(const M3UA__Deregistration__Result__Parameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

M3UA__Deregistration__Result__Parameters_template& M3UA__Deregistration__Result__Parameters_template::operator=(const OPTIONAL<M3UA__Deregistration__Result__Parameters>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__Deregistration__Result__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 @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
}
return *this;
}

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

boolean M3UA__Deregistration__Result__Parameters_template::match(const M3UA__Deregistration__Result__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.routing__Context().is_bound()) return FALSE;
if(!single_value->field_routing__Context.match(other_value.routing__Context(), legacy))return FALSE;
if(!other_value.deregistration__Status().is_bound()) return FALSE;
if(!single_value->field_deregistration__Status.match(other_value.deregistration__Status(), 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 @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
}
return FALSE;
}

boolean M3UA__Deregistration__Result__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_routing__Context.is_bound()
 || single_value->field_deregistration__Status.is_bound();
}

boolean M3UA__Deregistration__Result__Parameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_routing__Context.is_value()
 && single_value->field_deregistration__Status.is_value();
}

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

M3UA__Deregistration__Result__Parameters M3UA__Deregistration__Result__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 @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
M3UA__Deregistration__Result__Parameters ret_val;
if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_deregistration__Status.is_bound()) {
ret_val.deregistration__Status() = single_value->field_deregistration__Status.valueof();
}
return ret_val;
}

void M3UA__Deregistration__Result__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 @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Deregistration__Result__Parameters_template[list_length];
}

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

M3UA__Routing__Context_template& M3UA__Deregistration__Result__Parameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__Deregistration__Result__Parameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
return single_value->field_routing__Context;
}

M3UA__Deregistration__Status_template& M3UA__Deregistration__Result__Parameters_template::deregistration__Status()
{
set_specific();
return single_value->field_deregistration__Status;
}

const M3UA__Deregistration__Status_template& M3UA__Deregistration__Result__Parameters_template::deregistration__Status() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deregistration_Status of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
return single_value->field_deregistration__Status;
}

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

void M3UA__Deregistration__Result__Parameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", deregistration_Status := ");
single_value->field_deregistration__Status.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 M3UA__Deregistration__Result__Parameters_template::log_match(const M3UA__Deregistration__Result__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_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_deregistration__Status.match(match_value.deregistration__Status(), legacy)){
TTCN_Logger::log_logmatch_info(".deregistration_Status");
single_value->field_deregistration__Status.log_match(match_value.deregistration__Status(), 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("{ routing_Context := ");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::log_event_str(", deregistration_Status := ");
single_value->field_deregistration__Status.log_match(match_value.deregistration__Status(), 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 M3UA__Deregistration__Result__Parameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (routing__Context().is_bound()) routing__Context().set_implicit_omit();
if (deregistration__Status().is_bound()) deregistration__Status().set_implicit_omit();
}

void M3UA__Deregistration__Result__Parameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_deregistration__Status.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 @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
}
}

void M3UA__Deregistration__Result__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_routing__Context.decode_text(text_buf);
single_value->field_deregistration__Status.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 M3UA__Deregistration__Result__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 @M3UA_Types.M3UA_Deregistration_Result_Parameters.");
}
}

void M3UA__Deregistration__Result__Parameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__Deregistration__Result__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 (2<param.get_size()) {
      param.error("set template of type @M3UA_Types.M3UA_Deregistration_Result_Parameters 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) routing__Context().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) deregistration__Status().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(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deregistration_Status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deregistration__Status().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_Deregistration_Result_Parameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__Deregistration__Result__Parameters_template* precondition = new M3UA__Deregistration__Result__Parameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__Deregistration__Result__Parameters_template* implied_template = new M3UA__Deregistration__Result__Parameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__Deregistration__Result__Parameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_Deregistration_Result_Parameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__Deregistration__Result__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_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Result_Parameters");
single_value->field_deregistration__Status.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Result_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 : "@M3UA_Types.M3UA_Deregistration_Result_Parameters");
}

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

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

M3UA__Deregistration__Result::M3UA__Deregistration__Result()
{
}

M3UA__Deregistration__Result::M3UA__Deregistration__Result(const OCTETSTRING& par_tag,
    const INTEGER& par_lengthInd,
    const M3UA__Deregistration__Result__Parameters& par_deregistrationResult)
  :   field_tag(par_tag),
  field_lengthInd(par_lengthInd),
  field_deregistrationResult(par_deregistrationResult)
{
}

M3UA__Deregistration__Result::M3UA__Deregistration__Result(const M3UA__Deregistration__Result& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_Deregistration_Result.");
if (other_value.tag().is_bound()) field_tag = other_value.tag();
else field_tag.clean_up();
if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
else field_lengthInd.clean_up();
if (other_value.deregistrationResult().is_bound()) field_deregistrationResult = other_value.deregistrationResult();
else field_deregistrationResult.clean_up();
}

void M3UA__Deregistration__Result::clean_up()
{
field_tag.clean_up();
field_lengthInd.clean_up();
field_deregistrationResult.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__Deregistration__Result::get_descriptor() const { return &M3UA__Deregistration__Result_descr_; }
M3UA__Deregistration__Result& M3UA__Deregistration__Result::operator=(const M3UA__Deregistration__Result& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_Deregistration_Result.");
  if (other_value.tag().is_bound()) field_tag = other_value.tag();
  else field_tag.clean_up();
  if (other_value.lengthInd().is_bound()) field_lengthInd = other_value.lengthInd();
  else field_lengthInd.clean_up();
  if (other_value.deregistrationResult().is_bound()) field_deregistrationResult = other_value.deregistrationResult();
  else field_deregistrationResult.clean_up();
}
return *this;
}

boolean M3UA__Deregistration__Result::operator==(const M3UA__Deregistration__Result& other_value) const
{
return field_tag==other_value.field_tag
  && field_lengthInd==other_value.field_lengthInd
  && field_deregistrationResult==other_value.field_deregistrationResult;
}

boolean M3UA__Deregistration__Result::is_bound() const
{
return (field_tag.is_bound())
  || (field_lengthInd.is_bound())
  || (field_deregistrationResult.is_bound());
}
boolean M3UA__Deregistration__Result::is_value() const
{
return field_tag.is_value()
  && field_lengthInd.is_value()
  && field_deregistrationResult.is_value();
}
void M3UA__Deregistration__Result::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tag := ");
field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
field_lengthInd.log();
TTCN_Logger::log_event_str(", deregistrationResult := ");
field_deregistrationResult.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__Deregistration__Result::set_implicit_omit()
{
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (deregistrationResult().is_bound()) deregistrationResult().set_implicit_omit();
}

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

void M3UA__Deregistration__Result::encode_text(Text_Buf& text_buf) const
{
field_tag.encode_text(text_buf);
field_lengthInd.encode_text(text_buf);
field_deregistrationResult.encode_text(text_buf);
}

void M3UA__Deregistration__Result::decode_text(Text_Buf& text_buf)
{
field_tag.decode_text(text_buf);
field_lengthInd.decode_text(text_buf);
field_deregistrationResult.decode_text(text_buf);
}

void M3UA__Deregistration__Result::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 M3UA__Deregistration__Result::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 M3UA__Deregistration__Result::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_tag.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Deregistration__Result_lengthInd_descr_.raw->forceomit);
  decoded_field_length = field_lengthInd.RAW_decode(M3UA__Deregistration__Result_lengthInd_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_lengthInd.convert_to_Integer(M3UA__Deregistration__Result_lengthInd_descr_);
  field_lengthInd = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Deregistration__Result__Parameters_descr_.raw->forceomit);
  decoded_field_length = field_deregistrationResult.RAW_decode(M3UA__Deregistration__Result__Parameters_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 M3UA__Deregistration__Result::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT2_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Deregistration__Result_lengthInd_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Deregistration__Result__Parameters_descr_.raw);
  encoded_length += field_tag.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 16;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &M3UA__Deregistration__Result_lengthInd_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  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(3);
  myleaf.body.node.nodes[1]->length = 16;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_deregistrationResult.RAW_encode(M3UA__Deregistration__Result__Parameters_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct M3UA__Deregistration__Result_template::single_value_struct {
OCTETSTRING_template field_tag;
INTEGER_template field_lengthInd;
M3UA__Deregistration__Result__Parameters_template field_deregistrationResult;
};

void M3UA__Deregistration__Result_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_tag = ANY_VALUE;
single_value->field_lengthInd = ANY_VALUE;
single_value->field_deregistrationResult = ANY_VALUE;
}
}
}

void M3UA__Deregistration__Result_template::copy_value(const M3UA__Deregistration__Result& other_value)
{
single_value = new single_value_struct;
if (other_value.tag().is_bound()) {
  single_value->field_tag = other_value.tag();
} else {
  single_value->field_tag.clean_up();
}
if (other_value.lengthInd().is_bound()) {
  single_value->field_lengthInd = other_value.lengthInd();
} else {
  single_value->field_lengthInd.clean_up();
}
if (other_value.deregistrationResult().is_bound()) {
  single_value->field_deregistrationResult = other_value.deregistrationResult();
} else {
  single_value->field_deregistrationResult.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__Deregistration__Result_template::copy_template(const M3UA__Deregistration__Result_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tag().get_selection()) {
single_value->field_tag = other_value.tag();
} else {
single_value->field_tag.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lengthInd().get_selection()) {
single_value->field_lengthInd = other_value.lengthInd();
} else {
single_value->field_lengthInd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deregistrationResult().get_selection()) {
single_value->field_deregistrationResult = other_value.deregistrationResult();
} else {
single_value->field_deregistrationResult.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 M3UA__Deregistration__Result_template[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 M3UA__Deregistration__Result_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__Deregistration__Result_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 @M3UA_Types.M3UA_Deregistration_Result.");
break;
}
set_selection(other_value);
}

M3UA__Deregistration__Result_template::M3UA__Deregistration__Result_template()
{
}

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

M3UA__Deregistration__Result_template::M3UA__Deregistration__Result_template(const M3UA__Deregistration__Result& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__Deregistration__Result_template::match(const M3UA__Deregistration__Result& 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.tag().is_bound()) return FALSE;
if(!single_value->field_tag.match(other_value.tag(), legacy))return FALSE;
if(!other_value.lengthInd().is_bound()) return FALSE;
if(!single_value->field_lengthInd.match(other_value.lengthInd(), legacy))return FALSE;
if(!other_value.deregistrationResult().is_bound()) return FALSE;
if(!single_value->field_deregistrationResult.match(other_value.deregistrationResult(), 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 @M3UA_Types.M3UA_Deregistration_Result.");
}
return FALSE;
}

boolean M3UA__Deregistration__Result_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tag.is_bound()
 || single_value->field_lengthInd.is_bound()
 || single_value->field_deregistrationResult.is_bound();
}

boolean M3UA__Deregistration__Result_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tag.is_value()
 && single_value->field_lengthInd.is_value()
 && single_value->field_deregistrationResult.is_value();
}

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

M3UA__Deregistration__Result M3UA__Deregistration__Result_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 @M3UA_Types.M3UA_Deregistration_Result.");
M3UA__Deregistration__Result ret_val;
if (single_value->field_tag.is_bound()) {
ret_val.tag() = single_value->field_tag.valueof();
}
if (single_value->field_lengthInd.is_bound()) {
ret_val.lengthInd() = single_value->field_lengthInd.valueof();
}
if (single_value->field_deregistrationResult.is_bound()) {
ret_val.deregistrationResult() = single_value->field_deregistrationResult.valueof();
}
return ret_val;
}

void M3UA__Deregistration__Result_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 @M3UA_Types.M3UA_Deregistration_Result.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__Deregistration__Result_template[list_length];
}

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

OCTETSTRING_template& M3UA__Deregistration__Result_template::tag()
{
set_specific();
return single_value->field_tag;
}

const OCTETSTRING_template& M3UA__Deregistration__Result_template::tag() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tag of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Result.");
return single_value->field_tag;
}

INTEGER_template& M3UA__Deregistration__Result_template::lengthInd()
{
set_specific();
return single_value->field_lengthInd;
}

const INTEGER_template& M3UA__Deregistration__Result_template::lengthInd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthInd of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Result.");
return single_value->field_lengthInd;
}

M3UA__Deregistration__Result__Parameters_template& M3UA__Deregistration__Result_template::deregistrationResult()
{
set_specific();
return single_value->field_deregistrationResult;
}

const M3UA__Deregistration__Result__Parameters_template& M3UA__Deregistration__Result_template::deregistrationResult() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deregistrationResult of a non-specific template of type @M3UA_Types.M3UA_Deregistration_Result.");
return single_value->field_deregistrationResult;
}

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

void M3UA__Deregistration__Result_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tag := ");
single_value->field_tag.log();
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log();
TTCN_Logger::log_event_str(", deregistrationResult := ");
single_value->field_deregistrationResult.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 M3UA__Deregistration__Result_template::log_match(const M3UA__Deregistration__Result& 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_tag.match(match_value.tag(), legacy)){
TTCN_Logger::log_logmatch_info(".tag");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lengthInd.match(match_value.lengthInd(), legacy)){
TTCN_Logger::log_logmatch_info(".lengthInd");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_deregistrationResult.match(match_value.deregistrationResult(), legacy)){
TTCN_Logger::log_logmatch_info(".deregistrationResult");
single_value->field_deregistrationResult.log_match(match_value.deregistrationResult(), 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("{ tag := ");
single_value->field_tag.log_match(match_value.tag(), legacy);
TTCN_Logger::log_event_str(", lengthInd := ");
single_value->field_lengthInd.log_match(match_value.lengthInd(), legacy);
TTCN_Logger::log_event_str(", deregistrationResult := ");
single_value->field_deregistrationResult.log_match(match_value.deregistrationResult(), 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 M3UA__Deregistration__Result_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (tag().is_bound()) tag().set_implicit_omit();
if (lengthInd().is_bound()) lengthInd().set_implicit_omit();
if (deregistrationResult().is_bound()) deregistrationResult().set_implicit_omit();
}

void M3UA__Deregistration__Result_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tag.encode_text(text_buf);
single_value->field_lengthInd.encode_text(text_buf);
single_value->field_deregistrationResult.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 @M3UA_Types.M3UA_Deregistration_Result.");
}
}

void M3UA__Deregistration__Result_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_tag.decode_text(text_buf);
single_value->field_lengthInd.decode_text(text_buf);
single_value->field_deregistrationResult.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 M3UA__Deregistration__Result_template[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 @M3UA_Types.M3UA_Deregistration_Result.");
}
}

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

void M3UA__Deregistration__Result_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_tag.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Result");
single_value->field_lengthInd.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Result");
single_value->field_deregistrationResult.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_Deregistration_Result");
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 : "@M3UA_Types.M3UA_Deregistration_Result");
}

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

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

M3UA__ERR__MessageParameters::M3UA__ERR__MessageParameters()
{
}

M3UA__ERR__MessageParameters::M3UA__ERR__MessageParameters(const M3UA__Error__Code& par_error__Code,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const OPTIONAL< M3UA__Affected__Point__Codes >& par_affected__Point__Codes,
    const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Diagnostic__information >& par_diagnostic__information)
  :   field_error__Code(par_error__Code),
  field_routing__Context(par_routing__Context),
  field_affected__Point__Codes(par_affected__Point__Codes),
  field_network__Appearance(par_network__Appearance),
  field_diagnostic__information(par_diagnostic__information)
{
}

M3UA__ERR__MessageParameters::M3UA__ERR__MessageParameters(const M3UA__ERR__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ERR_MessageParameters.");
if (other_value.error__Code().is_bound()) field_error__Code = other_value.error__Code();
else field_error__Code.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
else field_affected__Point__Codes.clean_up();
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.diagnostic__information().is_bound()) field_diagnostic__information = other_value.diagnostic__information();
else field_diagnostic__information.clean_up();
}

void M3UA__ERR__MessageParameters::clean_up()
{
field_error__Code.clean_up();
field_routing__Context.clean_up();
field_affected__Point__Codes.clean_up();
field_network__Appearance.clean_up();
field_diagnostic__information.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ERR__MessageParameters::get_descriptor() const { return &M3UA__ERR__MessageParameters_descr_; }
M3UA__ERR__MessageParameters& M3UA__ERR__MessageParameters::operator=(const M3UA__ERR__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ERR_MessageParameters.");
  if (other_value.error__Code().is_bound()) field_error__Code = other_value.error__Code();
  else field_error__Code.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
  else field_affected__Point__Codes.clean_up();
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.diagnostic__information().is_bound()) field_diagnostic__information = other_value.diagnostic__information();
  else field_diagnostic__information.clean_up();
}
return *this;
}

boolean M3UA__ERR__MessageParameters::operator==(const M3UA__ERR__MessageParameters& other_value) const
{
return field_error__Code==other_value.field_error__Code
  && field_routing__Context==other_value.field_routing__Context
  && field_affected__Point__Codes==other_value.field_affected__Point__Codes
  && field_network__Appearance==other_value.field_network__Appearance
  && field_diagnostic__information==other_value.field_diagnostic__information;
}

boolean M3UA__ERR__MessageParameters::is_bound() const
{
return (field_error__Code.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (OPTIONAL_OMIT == field_affected__Point__Codes.get_selection() || field_affected__Point__Codes.is_bound())
  || (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_diagnostic__information.get_selection() || field_diagnostic__information.is_bound());
}
boolean M3UA__ERR__MessageParameters::is_value() const
{
return field_error__Code.is_value()
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && (OPTIONAL_OMIT == field_affected__Point__Codes.get_selection() || field_affected__Point__Codes.is_value())
  && (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_diagnostic__information.get_selection() || field_diagnostic__information.is_value());
}
int M3UA__ERR__MessageParameters::size_of() const
{
  int ret_val = 1;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_affected__Point__Codes.ispresent()) ret_val++;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_diagnostic__information.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__ERR__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ error_Code := ");
field_error__Code.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", diagnostic_information := ");
field_diagnostic__information.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ERR__MessageParameters::set_implicit_omit()
{
if (error__Code().is_bound()) error__Code().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (!affected__Point__Codes().is_bound()) affected__Point__Codes() = OMIT_VALUE;
else affected__Point__Codes().set_implicit_omit();
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!diagnostic__information().is_bound()) diagnostic__information() = OMIT_VALUE;
else diagnostic__information().set_implicit_omit();
}

void M3UA__ERR__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_ERR_MessageParameters 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) error__Code().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) diagnostic__information().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(), "error_Code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          error__Code().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "diagnostic_information")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          diagnostic__information().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ERR_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_ERR_MessageParameters");
  }
}

void M3UA__ERR__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_error__Code.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_affected__Point__Codes.encode_text(text_buf);
field_network__Appearance.encode_text(text_buf);
field_diagnostic__information.encode_text(text_buf);
}

void M3UA__ERR__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_error__Code.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_affected__Point__Codes.decode_text(text_buf);
field_network__Appearance.decode_text(text_buf);
field_diagnostic__information.decode_text(text_buf);
}

void M3UA__ERR__MessageParameters::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 M3UA__ERR__MessageParameters::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 M3UA__ERR__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[5];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_routing__Context = OMIT_VALUE;
field_affected__Point__Codes = OMIT_VALUE;
field_network__Appearance = OMIT_VALUE;
field_diagnostic__information = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Error__Code_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Error__Code_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_0) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Error__Code_descr_.raw->forceomit);
int decoded_field_length = field_error__Code.RAW_decode(M3UA__Error__Code_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length >= 0 && (field_error__Code.tag() ==  os_0)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0 && (force_omit == NULL || !(*force_omit)(2))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_2) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Affected__Point__Codes_descr_.raw->forceomit);
int decoded_field_length = field_affected__Point__Codes().RAW_decode(M3UA__Affected__Point__Codes_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length > 0 && (field_affected__Point__Codes.ispresent() && field_affected__Point__Codes().tag() ==  os_2)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_affected__Point__Codes = OMIT_VALUE;
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[4] == 0 && (force_omit == NULL || !(*force_omit)(4))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Diagnostic__information_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Diagnostic__information_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_4) {
RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__Diagnostic__information_descr_.raw->forceomit);
int decoded_field_length = field_diagnostic__information().RAW_decode(M3UA__Diagnostic__information_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
if (decoded_field_length > 0 && (field_diagnostic__information.ispresent() && field_diagnostic__information().tag() ==  os_4)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[4] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_diagnostic__information = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 1) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__ERR__MessageParameters::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, M3UA__Error__Code_descr_.raw);
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_affected__Point__Codes.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Affected__Point__Codes_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_diagnostic__information.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__Diagnostic__information_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_error__Code.RAW_encode(M3UA__Error__Code_descr_, *myleaf.body.node.nodes[0]);
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_affected__Point__Codes.ispresent()) {
  encoded_length += field_affected__Point__Codes().RAW_encode(M3UA__Affected__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_diagnostic__information.ispresent()) {
  encoded_length += field_diagnostic__information().RAW_encode(M3UA__Diagnostic__information_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_error__Code.tag() !=  os_0) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_affected__Point__Codes.ispresent() && (!field_affected__Point__Codes.ispresent() || field_affected__Point__Codes().tag() !=  os_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_diagnostic__information.ispresent() && (!field_diagnostic__information.ispresent() || field_diagnostic__information().tag() !=  os_4)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_4.RAW_encode(General__Types::OCT2_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 M3UA__ERR__MessageParameters_template::single_value_struct {
M3UA__Error__Code_template field_error__Code;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Affected__Point__Codes_template field_affected__Point__Codes;
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Diagnostic__information_template field_diagnostic__information;
};

void M3UA__ERR__MessageParameters_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_error__Code = ANY_VALUE;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_affected__Point__Codes = ANY_OR_OMIT;
single_value->field_network__Appearance = ANY_OR_OMIT;
single_value->field_diagnostic__information = ANY_OR_OMIT;
}
}
}

void M3UA__ERR__MessageParameters_template::copy_value(const M3UA__ERR__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.error__Code().is_bound()) {
  single_value->field_error__Code = other_value.error__Code();
} else {
  single_value->field_error__Code.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.affected__Point__Codes().is_bound()) {
  if (other_value.affected__Point__Codes().ispresent()) single_value->field_affected__Point__Codes = other_value.affected__Point__Codes()();
  else single_value->field_affected__Point__Codes = OMIT_VALUE;
} else {
  single_value->field_affected__Point__Codes.clean_up();
}
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.diagnostic__information().is_bound()) {
  if (other_value.diagnostic__information().ispresent()) single_value->field_diagnostic__information = other_value.diagnostic__information()();
  else single_value->field_diagnostic__information = OMIT_VALUE;
} else {
  single_value->field_diagnostic__information.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ERR__MessageParameters_template::copy_template(const M3UA__ERR__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.error__Code().get_selection()) {
single_value->field_error__Code = other_value.error__Code();
} else {
single_value->field_error__Code.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.affected__Point__Codes().get_selection()) {
single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
single_value->field_affected__Point__Codes.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.diagnostic__information().get_selection()) {
single_value->field_diagnostic__information = other_value.diagnostic__information();
} else {
single_value->field_diagnostic__information.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 M3UA__ERR__MessageParameters_template[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 M3UA__ERR__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ERR__MessageParameters_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 @M3UA_Types.M3UA_ERR_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__ERR__MessageParameters_template::M3UA__ERR__MessageParameters_template()
{
}

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

M3UA__ERR__MessageParameters_template::M3UA__ERR__MessageParameters_template(const M3UA__ERR__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__ERR__MessageParameters_template::match(const M3UA__ERR__MessageParameters& 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.error__Code().is_bound()) return FALSE;
if(!single_value->field_error__Code.match(other_value.error__Code(), legacy))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.affected__Point__Codes().is_bound()) return FALSE;
if((other_value.affected__Point__Codes().ispresent() ? !single_value->field_affected__Point__Codes.match((const M3UA__Affected__Point__Codes&)other_value.affected__Point__Codes(), legacy) : !single_value->field_affected__Point__Codes.match_omit(legacy)))return FALSE;
if(!other_value.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.diagnostic__information().is_bound()) return FALSE;
if((other_value.diagnostic__information().ispresent() ? !single_value->field_diagnostic__information.match((const M3UA__Diagnostic__information&)other_value.diagnostic__information(), legacy) : !single_value->field_diagnostic__information.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 @M3UA_Types.M3UA_ERR_MessageParameters.");
}
return FALSE;
}

boolean M3UA__ERR__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_error__Code.is_bound()
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || (single_value->field_affected__Point__Codes.is_omit() || single_value->field_affected__Point__Codes.is_bound())
 || (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_diagnostic__information.is_omit() || single_value->field_diagnostic__information.is_bound());
}

boolean M3UA__ERR__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_error__Code.is_value()
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && (single_value->field_affected__Point__Codes.is_omit() || single_value->field_affected__Point__Codes.is_value())
 && (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_diagnostic__information.is_omit() || single_value->field_diagnostic__information.is_value());
}

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

M3UA__ERR__MessageParameters M3UA__ERR__MessageParameters_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 @M3UA_Types.M3UA_ERR_MessageParameters.");
M3UA__ERR__MessageParameters ret_val;
if (single_value->field_error__Code.is_bound()) {
ret_val.error__Code() = single_value->field_error__Code.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_affected__Point__Codes.is_omit()) ret_val.affected__Point__Codes() = OMIT_VALUE;
else if (single_value->field_affected__Point__Codes.is_bound()) {
ret_val.affected__Point__Codes() = single_value->field_affected__Point__Codes.valueof();
}
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_diagnostic__information.is_omit()) ret_val.diagnostic__information() = OMIT_VALUE;
else if (single_value->field_diagnostic__information.is_bound()) {
ret_val.diagnostic__information() = single_value->field_diagnostic__information.valueof();
}
return ret_val;
}

void M3UA__ERR__MessageParameters_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 @M3UA_Types.M3UA_ERR_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ERR__MessageParameters_template[list_length];
}

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

M3UA__Error__Code_template& M3UA__ERR__MessageParameters_template::error__Code()
{
set_specific();
return single_value->field_error__Code;
}

const M3UA__Error__Code_template& M3UA__ERR__MessageParameters_template::error__Code() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field error_Code of a non-specific template of type @M3UA_Types.M3UA_ERR_MessageParameters.");
return single_value->field_error__Code;
}

M3UA__Routing__Context_template& M3UA__ERR__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__ERR__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_ERR_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Affected__Point__Codes_template& M3UA__ERR__MessageParameters_template::affected__Point__Codes()
{
set_specific();
return single_value->field_affected__Point__Codes;
}

const M3UA__Affected__Point__Codes_template& M3UA__ERR__MessageParameters_template::affected__Point__Codes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field affected_Point_Codes of a non-specific template of type @M3UA_Types.M3UA_ERR_MessageParameters.");
return single_value->field_affected__Point__Codes;
}

M3UA__Network__Appearance_template& M3UA__ERR__MessageParameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__ERR__MessageParameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_ERR_MessageParameters.");
return single_value->field_network__Appearance;
}

M3UA__Diagnostic__information_template& M3UA__ERR__MessageParameters_template::diagnostic__information()
{
set_specific();
return single_value->field_diagnostic__information;
}

const M3UA__Diagnostic__information_template& M3UA__ERR__MessageParameters_template::diagnostic__information() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field diagnostic_information of a non-specific template of type @M3UA_Types.M3UA_ERR_MessageParameters.");
return single_value->field_diagnostic__information;
}

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

void M3UA__ERR__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ error_Code := ");
single_value->field_error__Code.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", diagnostic_information := ");
single_value->field_diagnostic__information.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 M3UA__ERR__MessageParameters_template::log_match(const M3UA__ERR__MessageParameters& 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_error__Code.match(match_value.error__Code(), legacy)){
TTCN_Logger::log_logmatch_info(".error_Code");
single_value->field_error__Code.log_match(match_value.error__Code(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.affected__Point__Codes().ispresent()){
if(!single_value->field_affected__Point__Codes.match(match_value.affected__Point__Codes(), legacy)){
TTCN_Logger::log_logmatch_info(".affected_Point_Codes");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_affected__Point__Codes.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".affected_Point_Codes := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.diagnostic__information().ispresent()){
if(!single_value->field_diagnostic__information.match(match_value.diagnostic__information(), legacy)){
TTCN_Logger::log_logmatch_info(".diagnostic_information");
single_value->field_diagnostic__information.log_match(match_value.diagnostic__information(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_diagnostic__information.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".diagnostic_information := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_diagnostic__information.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("{ error_Code := ");
single_value->field_error__Code.log_match(match_value.error__Code(), legacy);
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
if (match_value.affected__Point__Codes().ispresent()) {
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_affected__Point__Codes.log();
if (single_value->field_affected__Point__Codes.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", diagnostic_information := ");
if (match_value.diagnostic__information().ispresent()) {
single_value->field_diagnostic__information.log_match(match_value.diagnostic__information(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_diagnostic__information.log();
if (single_value->field_diagnostic__information.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 M3UA__ERR__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (error__Code().is_bound()) error__Code().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (!affected__Point__Codes().is_bound()) affected__Point__Codes() = OMIT_VALUE;
else affected__Point__Codes().set_implicit_omit();
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!diagnostic__information().is_bound()) diagnostic__information() = OMIT_VALUE;
else diagnostic__information().set_implicit_omit();
}

void M3UA__ERR__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_error__Code.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_affected__Point__Codes.encode_text(text_buf);
single_value->field_network__Appearance.encode_text(text_buf);
single_value->field_diagnostic__information.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 @M3UA_Types.M3UA_ERR_MessageParameters.");
}
}

void M3UA__ERR__MessageParameters_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_error__Code.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_affected__Point__Codes.decode_text(text_buf);
single_value->field_network__Appearance.decode_text(text_buf);
single_value->field_diagnostic__information.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 M3UA__ERR__MessageParameters_template[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 @M3UA_Types.M3UA_ERR_MessageParameters.");
}
}

void M3UA__ERR__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__ERR__MessageParameters_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("set template of type @M3UA_Types.M3UA_ERR_MessageParameters 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) error__Code().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) diagnostic__information().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(), "error_Code")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          error__Code().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "diagnostic_information")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          diagnostic__information().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ERR_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ERR__MessageParameters_template* precondition = new M3UA__ERR__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ERR__MessageParameters_template* implied_template = new M3UA__ERR__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ERR__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_ERR_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ERR__MessageParameters_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_error__Code.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR_MessageParameters");
single_value->field_affected__Point__Codes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR_MessageParameters");
single_value->field_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR_MessageParameters");
single_value->field_diagnostic__information.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR_MessageParameters");
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 : "@M3UA_Types.M3UA_ERR_MessageParameters");
}

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

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

M3UA__ERR::M3UA__ERR()
{
}

M3UA__ERR::M3UA__ERR(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__ERR__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__ERR::M3UA__ERR(const M3UA__ERR& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ERR.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__ERR::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ERR::get_descriptor() const { return &M3UA__ERR_descr_; }
M3UA__ERR& M3UA__ERR::operator=(const M3UA__ERR& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ERR.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__ERR::operator==(const M3UA__ERR& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__ERR::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__ERR::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__ERR::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ERR::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ERR::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 @M3UA_Types.M3UA_ERR 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ERR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_ERR");
  }
}

void M3UA__ERR::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__ERR::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__ERR::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 M3UA__ERR::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 M3UA__ERR::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__ERR_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__ERR_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__ERR_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__ERR__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__ERR__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__ERR::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__ERR_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__ERR__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__ERR_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__ERR__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__ERR_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__ERR__MessageParameters_template field_messageParameters;
};

void M3UA__ERR_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__ERR_template::copy_value(const M3UA__ERR& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ERR_template::copy_template(const M3UA__ERR_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__ERR_template[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 M3UA__ERR_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ERR_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 @M3UA_Types.M3UA_ERR.");
break;
}
set_selection(other_value);
}

M3UA__ERR_template::M3UA__ERR_template()
{
}

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

M3UA__ERR_template::M3UA__ERR_template(const M3UA__ERR& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__ERR_template::match(const M3UA__ERR& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_ERR.");
}
return FALSE;
}

boolean M3UA__ERR_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__ERR_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__ERR M3UA__ERR_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 @M3UA_Types.M3UA_ERR.");
M3UA__ERR ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__ERR_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 @M3UA_Types.M3UA_ERR.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ERR_template[list_length];
}

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

OCTETSTRING_template& M3UA__ERR_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__ERR_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_ERR.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__ERR_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__ERR_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_ERR.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__ERR_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__ERR_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_ERR.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__ERR_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__ERR_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_ERR.");
return single_value->field_messageLength;
}

M3UA__ERR__MessageParameters_template& M3UA__ERR_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__ERR__MessageParameters_template& M3UA__ERR_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_ERR.");
return single_value->field_messageParameters;
}

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

void M3UA__ERR_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__ERR_template::log_match(const M3UA__ERR& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__ERR_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ERR_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_ERR.");
}
}

void M3UA__ERR_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__ERR_template[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 @M3UA_Types.M3UA_ERR.");
}
}

void M3UA__ERR_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: {
    M3UA__ERR_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 @M3UA_Types.M3UA_ERR 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ERR: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ERR_template* precondition = new M3UA__ERR_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ERR_template* implied_template = new M3UA__ERR_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ERR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_ERR");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ERR_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ERR");
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 : "@M3UA_Types.M3UA_ERR");
}

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

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

M3UA__NOTIFY__MessageParameters::M3UA__NOTIFY__MessageParameters()
{
}

M3UA__NOTIFY__MessageParameters::M3UA__NOTIFY__MessageParameters(const M3UA__Status& par_status,
    const OPTIONAL< M3UA__ASP__Identifier >& par_aSP__Identifier,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_status(par_status),
  field_aSP__Identifier(par_aSP__Identifier),
  field_routing__Context(par_routing__Context),
  field_info__String(par_info__String)
{
}

M3UA__NOTIFY__MessageParameters::M3UA__NOTIFY__MessageParameters(const M3UA__NOTIFY__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
if (other_value.status().is_bound()) field_status = other_value.status();
else field_status.clean_up();
if (other_value.aSP__Identifier().is_bound()) field_aSP__Identifier = other_value.aSP__Identifier();
else field_aSP__Identifier.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__NOTIFY__MessageParameters::clean_up()
{
field_status.clean_up();
field_aSP__Identifier.clean_up();
field_routing__Context.clean_up();
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__NOTIFY__MessageParameters::get_descriptor() const { return &M3UA__NOTIFY__MessageParameters_descr_; }
M3UA__NOTIFY__MessageParameters& M3UA__NOTIFY__MessageParameters::operator=(const M3UA__NOTIFY__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
  if (other_value.status().is_bound()) field_status = other_value.status();
  else field_status.clean_up();
  if (other_value.aSP__Identifier().is_bound()) field_aSP__Identifier = other_value.aSP__Identifier();
  else field_aSP__Identifier.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__NOTIFY__MessageParameters::operator==(const M3UA__NOTIFY__MessageParameters& other_value) const
{
return field_status==other_value.field_status
  && field_aSP__Identifier==other_value.field_aSP__Identifier
  && field_routing__Context==other_value.field_routing__Context
  && field_info__String==other_value.field_info__String;
}

boolean M3UA__NOTIFY__MessageParameters::is_bound() const
{
return (field_status.is_bound())
  || (OPTIONAL_OMIT == field_aSP__Identifier.get_selection() || field_aSP__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__NOTIFY__MessageParameters::is_value() const
{
return field_status.is_value()
  && (OPTIONAL_OMIT == field_aSP__Identifier.get_selection() || field_aSP__Identifier.is_value())
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__NOTIFY__MessageParameters::size_of() const
{
  int ret_val = 1;
  if (field_aSP__Identifier.ispresent()) ret_val++;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__NOTIFY__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ status := ");
field_status.log();
TTCN_Logger::log_event_str(", aSP_Identifier := ");
field_aSP__Identifier.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__NOTIFY__MessageParameters::set_implicit_omit()
{
if (status().is_bound()) status().set_implicit_omit();
if (!aSP__Identifier().is_bound()) aSP__Identifier() = OMIT_VALUE;
else aSP__Identifier().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__NOTIFY__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_NOTIFY_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) status().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) aSP__Identifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          status().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aSP_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aSP__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_NOTIFY_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_NOTIFY_MessageParameters");
  }
}

void M3UA__NOTIFY__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_status.encode_text(text_buf);
field_aSP__Identifier.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_info__String.encode_text(text_buf);
}

void M3UA__NOTIFY__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_status.decode_text(text_buf);
field_aSP__Identifier.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_info__String.decode_text(text_buf);
}

void M3UA__NOTIFY__MessageParameters::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 M3UA__NOTIFY__MessageParameters::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 M3UA__NOTIFY__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[4];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_aSP__Identifier = OMIT_VALUE;
field_routing__Context = OMIT_VALUE;
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__ASP__Identifier_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__ASP__Identifier_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_5) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__ASP__Identifier_descr_.raw->forceomit);
int decoded_field_length = field_aSP__Identifier().RAW_decode(M3UA__ASP__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_aSP__Identifier.ispresent() && field_aSP__Identifier().tag() ==  os_5)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_aSP__Identifier = OMIT_VALUE;
}
}
}
if (field_map[2] == 0 && (force_omit == NULL || !(*force_omit)(2))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
if (field_map[0] == 0) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Status_descr_.raw->forceomit);
int decoded_field_length = field_status.RAW_decode(M3UA__Status_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length >= 0) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
break;
}
if (nof_mand_fields != 1) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__NOTIFY__MessageParameters::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Status_descr_.raw);
  if (field_aSP__Identifier.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__ASP__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_status.RAW_encode(M3UA__Status_descr_, *myleaf.body.node.nodes[0]);
  if (field_aSP__Identifier.ispresent()) {
  encoded_length += field_aSP__Identifier().RAW_encode(M3UA__ASP__Identifier_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_aSP__Identifier.ispresent() && (!field_aSP__Identifier.ispresent() || field_aSP__Identifier().tag() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__NOTIFY__MessageParameters_template::single_value_struct {
M3UA__Status_template field_status;
M3UA__ASP__Identifier_template field_aSP__Identifier;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Info__String_template field_info__String;
};

void M3UA__NOTIFY__MessageParameters_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_status = ANY_VALUE;
single_value->field_aSP__Identifier = ANY_OR_OMIT;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__NOTIFY__MessageParameters_template::copy_value(const M3UA__NOTIFY__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.status().is_bound()) {
  single_value->field_status = other_value.status();
} else {
  single_value->field_status.clean_up();
}
if (other_value.aSP__Identifier().is_bound()) {
  if (other_value.aSP__Identifier().ispresent()) single_value->field_aSP__Identifier = other_value.aSP__Identifier()();
  else single_value->field_aSP__Identifier = OMIT_VALUE;
} else {
  single_value->field_aSP__Identifier.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__NOTIFY__MessageParameters_template::copy_template(const M3UA__NOTIFY__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.status().get_selection()) {
single_value->field_status = other_value.status();
} else {
single_value->field_status.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.aSP__Identifier().get_selection()) {
single_value->field_aSP__Identifier = other_value.aSP__Identifier();
} else {
single_value->field_aSP__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__NOTIFY__MessageParameters_template[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 M3UA__NOTIFY__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__NOTIFY__MessageParameters_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 @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__NOTIFY__MessageParameters_template::M3UA__NOTIFY__MessageParameters_template()
{
}

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

M3UA__NOTIFY__MessageParameters_template::M3UA__NOTIFY__MessageParameters_template(const M3UA__NOTIFY__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__NOTIFY__MessageParameters_template::match(const M3UA__NOTIFY__MessageParameters& 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.status().is_bound()) return FALSE;
if(!single_value->field_status.match(other_value.status(), legacy))return FALSE;
if(!other_value.aSP__Identifier().is_bound()) return FALSE;
if((other_value.aSP__Identifier().ispresent() ? !single_value->field_aSP__Identifier.match((const M3UA__ASP__Identifier&)other_value.aSP__Identifier(), legacy) : !single_value->field_aSP__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
}
return FALSE;
}

boolean M3UA__NOTIFY__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_status.is_bound()
 || (single_value->field_aSP__Identifier.is_omit() || single_value->field_aSP__Identifier.is_bound())
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__NOTIFY__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_status.is_value()
 && (single_value->field_aSP__Identifier.is_omit() || single_value->field_aSP__Identifier.is_value())
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

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

M3UA__NOTIFY__MessageParameters M3UA__NOTIFY__MessageParameters_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 @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
M3UA__NOTIFY__MessageParameters ret_val;
if (single_value->field_status.is_bound()) {
ret_val.status() = single_value->field_status.valueof();
}
if (single_value->field_aSP__Identifier.is_omit()) ret_val.aSP__Identifier() = OMIT_VALUE;
else if (single_value->field_aSP__Identifier.is_bound()) {
ret_val.aSP__Identifier() = single_value->field_aSP__Identifier.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__NOTIFY__MessageParameters_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 @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__NOTIFY__MessageParameters_template[list_length];
}

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

M3UA__Status_template& M3UA__NOTIFY__MessageParameters_template::status()
{
set_specific();
return single_value->field_status;
}

const M3UA__Status_template& M3UA__NOTIFY__MessageParameters_template::status() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field status of a non-specific template of type @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
return single_value->field_status;
}

M3UA__ASP__Identifier_template& M3UA__NOTIFY__MessageParameters_template::aSP__Identifier()
{
set_specific();
return single_value->field_aSP__Identifier;
}

const M3UA__ASP__Identifier_template& M3UA__NOTIFY__MessageParameters_template::aSP__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aSP_Identifier of a non-specific template of type @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
return single_value->field_aSP__Identifier;
}

M3UA__Routing__Context_template& M3UA__NOTIFY__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__NOTIFY__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Info__String_template& M3UA__NOTIFY__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__NOTIFY__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
return single_value->field_info__String;
}

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

void M3UA__NOTIFY__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ status := ");
single_value->field_status.log();
TTCN_Logger::log_event_str(", aSP_Identifier := ");
single_value->field_aSP__Identifier.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", info_String := ");
single_value->field_info__String.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 M3UA__NOTIFY__MessageParameters_template::log_match(const M3UA__NOTIFY__MessageParameters& 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_status.match(match_value.status(), legacy)){
TTCN_Logger::log_logmatch_info(".status");
single_value->field_status.log_match(match_value.status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.aSP__Identifier().ispresent()){
if(!single_value->field_aSP__Identifier.match(match_value.aSP__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".aSP_Identifier");
single_value->field_aSP__Identifier.log_match(match_value.aSP__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_aSP__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".aSP_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_aSP__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ status := ");
single_value->field_status.log_match(match_value.status(), legacy);
TTCN_Logger::log_event_str(", aSP_Identifier := ");
if (match_value.aSP__Identifier().ispresent()) {
single_value->field_aSP__Identifier.log_match(match_value.aSP__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_aSP__Identifier.log();
if (single_value->field_aSP__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__NOTIFY__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (status().is_bound()) status().set_implicit_omit();
if (!aSP__Identifier().is_bound()) aSP__Identifier() = OMIT_VALUE;
else aSP__Identifier().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__NOTIFY__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_status.encode_text(text_buf);
single_value->field_aSP__Identifier.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_info__String.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 @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
}
}

void M3UA__NOTIFY__MessageParameters_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_status.decode_text(text_buf);
single_value->field_aSP__Identifier.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_info__String.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 M3UA__NOTIFY__MessageParameters_template[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 @M3UA_Types.M3UA_NOTIFY_MessageParameters.");
}
}

void M3UA__NOTIFY__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__NOTIFY__MessageParameters_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set template of type @M3UA_Types.M3UA_NOTIFY_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) status().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) aSP__Identifier().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          status().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "aSP_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aSP__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_NOTIFY_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__NOTIFY__MessageParameters_template* precondition = new M3UA__NOTIFY__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__NOTIFY__MessageParameters_template* implied_template = new M3UA__NOTIFY__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__NOTIFY__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_NOTIFY_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__NOTIFY__MessageParameters_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_status.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY_MessageParameters");
single_value->field_aSP__Identifier.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY_MessageParameters");
single_value->field_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY_MessageParameters");
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 : "@M3UA_Types.M3UA_NOTIFY_MessageParameters");
}

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

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

M3UA__NOTIFY::M3UA__NOTIFY()
{
}

M3UA__NOTIFY::M3UA__NOTIFY(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__NOTIFY__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__NOTIFY::M3UA__NOTIFY(const M3UA__NOTIFY& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_NOTIFY.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__NOTIFY::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__NOTIFY::get_descriptor() const { return &M3UA__NOTIFY_descr_; }
M3UA__NOTIFY& M3UA__NOTIFY::operator=(const M3UA__NOTIFY& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_NOTIFY.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__NOTIFY::operator==(const M3UA__NOTIFY& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__NOTIFY::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__NOTIFY::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__NOTIFY::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__NOTIFY::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__NOTIFY::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 @M3UA_Types.M3UA_NOTIFY 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_NOTIFY: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_NOTIFY");
  }
}

void M3UA__NOTIFY::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__NOTIFY::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__NOTIFY::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 M3UA__NOTIFY::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 M3UA__NOTIFY::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__NOTIFY_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__NOTIFY_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__NOTIFY_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__NOTIFY__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__NOTIFY__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__NOTIFY::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__NOTIFY_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__NOTIFY__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__NOTIFY_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__NOTIFY__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__NOTIFY_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__NOTIFY__MessageParameters_template field_messageParameters;
};

void M3UA__NOTIFY_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__NOTIFY_template::copy_value(const M3UA__NOTIFY& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__NOTIFY_template::copy_template(const M3UA__NOTIFY_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__NOTIFY_template[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 M3UA__NOTIFY_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__NOTIFY_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 @M3UA_Types.M3UA_NOTIFY.");
break;
}
set_selection(other_value);
}

M3UA__NOTIFY_template::M3UA__NOTIFY_template()
{
}

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

M3UA__NOTIFY_template::M3UA__NOTIFY_template(const M3UA__NOTIFY& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__NOTIFY_template::match(const M3UA__NOTIFY& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_NOTIFY.");
}
return FALSE;
}

boolean M3UA__NOTIFY_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__NOTIFY_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__NOTIFY M3UA__NOTIFY_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 @M3UA_Types.M3UA_NOTIFY.");
M3UA__NOTIFY ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__NOTIFY_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 @M3UA_Types.M3UA_NOTIFY.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__NOTIFY_template[list_length];
}

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

OCTETSTRING_template& M3UA__NOTIFY_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__NOTIFY_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_NOTIFY.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__NOTIFY_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__NOTIFY_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_NOTIFY.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__NOTIFY_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__NOTIFY_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_NOTIFY.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__NOTIFY_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__NOTIFY_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_NOTIFY.");
return single_value->field_messageLength;
}

M3UA__NOTIFY__MessageParameters_template& M3UA__NOTIFY_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__NOTIFY__MessageParameters_template& M3UA__NOTIFY_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_NOTIFY.");
return single_value->field_messageParameters;
}

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

void M3UA__NOTIFY_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__NOTIFY_template::log_match(const M3UA__NOTIFY& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__NOTIFY_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__NOTIFY_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_NOTIFY.");
}
}

void M3UA__NOTIFY_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__NOTIFY_template[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 @M3UA_Types.M3UA_NOTIFY.");
}
}

void M3UA__NOTIFY_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: {
    M3UA__NOTIFY_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 @M3UA_Types.M3UA_NOTIFY 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_NOTIFY: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__NOTIFY_template* precondition = new M3UA__NOTIFY_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__NOTIFY_template* implied_template = new M3UA__NOTIFY_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__NOTIFY_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_NOTIFY");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__NOTIFY_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_NOTIFY");
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 : "@M3UA_Types.M3UA_NOTIFY");
}

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

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

M3UA__DATA__MessageParameters::M3UA__DATA__MessageParameters()
{
}

M3UA__DATA__MessageParameters::M3UA__DATA__MessageParameters(const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const M3UA__Protocol__Data& par_protocol__Data,
    const OPTIONAL< M3UA__Correlation__ID >& par_correlation__ID)
  :   field_network__Appearance(par_network__Appearance),
  field_routing__Context(par_routing__Context),
  field_protocol__Data(par_protocol__Data),
  field_correlation__ID(par_correlation__ID)
{
}

M3UA__DATA__MessageParameters::M3UA__DATA__MessageParameters(const M3UA__DATA__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DATA_MessageParameters.");
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.protocol__Data().is_bound()) field_protocol__Data = other_value.protocol__Data();
else field_protocol__Data.clean_up();
if (other_value.correlation__ID().is_bound()) field_correlation__ID = other_value.correlation__ID();
else field_correlation__ID.clean_up();
}

void M3UA__DATA__MessageParameters::clean_up()
{
field_network__Appearance.clean_up();
field_routing__Context.clean_up();
field_protocol__Data.clean_up();
field_correlation__ID.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DATA__MessageParameters::get_descriptor() const { return &M3UA__DATA__MessageParameters_descr_; }
M3UA__DATA__MessageParameters& M3UA__DATA__MessageParameters::operator=(const M3UA__DATA__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DATA_MessageParameters.");
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.protocol__Data().is_bound()) field_protocol__Data = other_value.protocol__Data();
  else field_protocol__Data.clean_up();
  if (other_value.correlation__ID().is_bound()) field_correlation__ID = other_value.correlation__ID();
  else field_correlation__ID.clean_up();
}
return *this;
}

boolean M3UA__DATA__MessageParameters::operator==(const M3UA__DATA__MessageParameters& other_value) const
{
return field_network__Appearance==other_value.field_network__Appearance
  && field_routing__Context==other_value.field_routing__Context
  && field_protocol__Data==other_value.field_protocol__Data
  && field_correlation__ID==other_value.field_correlation__ID;
}

boolean M3UA__DATA__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (field_protocol__Data.is_bound())
  || (OPTIONAL_OMIT == field_correlation__ID.get_selection() || field_correlation__ID.is_bound());
}
boolean M3UA__DATA__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && field_protocol__Data.is_value()
  && (OPTIONAL_OMIT == field_correlation__ID.get_selection() || field_correlation__ID.is_value());
}
int M3UA__DATA__MessageParameters::size_of() const
{
  int ret_val = 1;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_correlation__ID.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__DATA__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", protocol_Data := ");
field_protocol__Data.log();
TTCN_Logger::log_event_str(", correlation_ID := ");
field_correlation__ID.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DATA__MessageParameters::set_implicit_omit()
{
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (protocol__Data().is_bound()) protocol__Data().set_implicit_omit();
if (!correlation__ID().is_bound()) correlation__ID() = OMIT_VALUE;
else correlation__ID().set_implicit_omit();
}

void M3UA__DATA__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_DATA_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) protocol__Data().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) correlation__ID().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocol_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocol__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "correlation_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          correlation__ID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DATA_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_DATA_MessageParameters");
  }
}

void M3UA__DATA__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_network__Appearance.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_protocol__Data.encode_text(text_buf);
field_correlation__ID.encode_text(text_buf);
}

void M3UA__DATA__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_network__Appearance.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_protocol__Data.decode_text(text_buf);
field_correlation__ID.decode_text(text_buf);
}

void M3UA__DATA__MessageParameters::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 M3UA__DATA__MessageParameters::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 M3UA__DATA__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[4];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_network__Appearance = OMIT_VALUE;
field_routing__Context = OMIT_VALUE;
field_correlation__ID = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Protocol__Data_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Protocol__Data_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_7) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Protocol__Data_descr_.raw->forceomit);
int decoded_field_length = field_protocol__Data.RAW_decode(M3UA__Protocol__Data_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length >= 0 && (field_protocol__Data.tag() ==  os_7)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Correlation__ID_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Correlation__ID_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_8) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Correlation__ID_descr_.raw->forceomit);
int decoded_field_length = field_correlation__ID().RAW_decode(M3UA__Correlation__ID_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_correlation__ID.ispresent() && field_correlation__ID().tag() ==  os_8)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_correlation__ID = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 1) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__DATA__MessageParameters::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Protocol__Data_descr_.raw);
  if (field_correlation__ID.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Correlation__ID_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_protocol__Data.RAW_encode(M3UA__Protocol__Data_descr_, *myleaf.body.node.nodes[2]);
  if (field_correlation__ID.ispresent()) {
  encoded_length += field_correlation__ID().RAW_encode(M3UA__Correlation__ID_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_protocol__Data.tag() !=  os_7) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_7.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_correlation__ID.ispresent() && (!field_correlation__ID.ispresent() || field_correlation__ID().tag() !=  os_8)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_8.RAW_encode(General__Types::OCT2_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 M3UA__DATA__MessageParameters_template::single_value_struct {
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Protocol__Data_template field_protocol__Data;
M3UA__Correlation__ID_template field_correlation__ID;
};

void M3UA__DATA__MessageParameters_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_network__Appearance = ANY_OR_OMIT;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_protocol__Data = ANY_VALUE;
single_value->field_correlation__ID = ANY_OR_OMIT;
}
}
}

void M3UA__DATA__MessageParameters_template::copy_value(const M3UA__DATA__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.protocol__Data().is_bound()) {
  single_value->field_protocol__Data = other_value.protocol__Data();
} else {
  single_value->field_protocol__Data.clean_up();
}
if (other_value.correlation__ID().is_bound()) {
  if (other_value.correlation__ID().ispresent()) single_value->field_correlation__ID = other_value.correlation__ID()();
  else single_value->field_correlation__ID = OMIT_VALUE;
} else {
  single_value->field_correlation__ID.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DATA__MessageParameters_template::copy_template(const M3UA__DATA__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protocol__Data().get_selection()) {
single_value->field_protocol__Data = other_value.protocol__Data();
} else {
single_value->field_protocol__Data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.correlation__ID().get_selection()) {
single_value->field_correlation__ID = other_value.correlation__ID();
} else {
single_value->field_correlation__ID.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new M3UA__DATA__MessageParameters_template[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 M3UA__DATA__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DATA__MessageParameters_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 @M3UA_Types.M3UA_DATA_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__DATA__MessageParameters_template::M3UA__DATA__MessageParameters_template()
{
}

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

M3UA__DATA__MessageParameters_template::M3UA__DATA__MessageParameters_template(const M3UA__DATA__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DATA__MessageParameters_template::match(const M3UA__DATA__MessageParameters& 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.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.protocol__Data().is_bound()) return FALSE;
if(!single_value->field_protocol__Data.match(other_value.protocol__Data(), legacy))return FALSE;
if(!other_value.correlation__ID().is_bound()) return FALSE;
if((other_value.correlation__ID().ispresent() ? !single_value->field_correlation__ID.match((const M3UA__Correlation__ID&)other_value.correlation__ID(), legacy) : !single_value->field_correlation__ID.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 @M3UA_Types.M3UA_DATA_MessageParameters.");
}
return FALSE;
}

boolean M3UA__DATA__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || single_value->field_protocol__Data.is_bound()
 || (single_value->field_correlation__ID.is_omit() || single_value->field_correlation__ID.is_bound());
}

boolean M3UA__DATA__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && single_value->field_protocol__Data.is_value()
 && (single_value->field_correlation__ID.is_omit() || single_value->field_correlation__ID.is_value());
}

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

M3UA__DATA__MessageParameters M3UA__DATA__MessageParameters_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 @M3UA_Types.M3UA_DATA_MessageParameters.");
M3UA__DATA__MessageParameters ret_val;
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_protocol__Data.is_bound()) {
ret_val.protocol__Data() = single_value->field_protocol__Data.valueof();
}
if (single_value->field_correlation__ID.is_omit()) ret_val.correlation__ID() = OMIT_VALUE;
else if (single_value->field_correlation__ID.is_bound()) {
ret_val.correlation__ID() = single_value->field_correlation__ID.valueof();
}
return ret_val;
}

void M3UA__DATA__MessageParameters_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 @M3UA_Types.M3UA_DATA_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DATA__MessageParameters_template[list_length];
}

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

M3UA__Network__Appearance_template& M3UA__DATA__MessageParameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__DATA__MessageParameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_DATA_MessageParameters.");
return single_value->field_network__Appearance;
}

M3UA__Routing__Context_template& M3UA__DATA__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__DATA__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_DATA_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Protocol__Data_template& M3UA__DATA__MessageParameters_template::protocol__Data()
{
set_specific();
return single_value->field_protocol__Data;
}

const M3UA__Protocol__Data_template& M3UA__DATA__MessageParameters_template::protocol__Data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protocol_Data of a non-specific template of type @M3UA_Types.M3UA_DATA_MessageParameters.");
return single_value->field_protocol__Data;
}

M3UA__Correlation__ID_template& M3UA__DATA__MessageParameters_template::correlation__ID()
{
set_specific();
return single_value->field_correlation__ID;
}

const M3UA__Correlation__ID_template& M3UA__DATA__MessageParameters_template::correlation__ID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field correlation_ID of a non-specific template of type @M3UA_Types.M3UA_DATA_MessageParameters.");
return single_value->field_correlation__ID;
}

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

void M3UA__DATA__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", protocol_Data := ");
single_value->field_protocol__Data.log();
TTCN_Logger::log_event_str(", correlation_ID := ");
single_value->field_correlation__ID.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void M3UA__DATA__MessageParameters_template::log_match(const M3UA__DATA__MessageParameters& 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 (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_protocol__Data.match(match_value.protocol__Data(), legacy)){
TTCN_Logger::log_logmatch_info(".protocol_Data");
single_value->field_protocol__Data.log_match(match_value.protocol__Data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.correlation__ID().ispresent()){
if(!single_value->field_correlation__ID.match(match_value.correlation__ID(), legacy)){
TTCN_Logger::log_logmatch_info(".correlation_ID");
single_value->field_correlation__ID.log_match(match_value.correlation__ID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_correlation__ID.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".correlation_ID := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_correlation__ID.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("{ network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", protocol_Data := ");
single_value->field_protocol__Data.log_match(match_value.protocol__Data(), legacy);
TTCN_Logger::log_event_str(", correlation_ID := ");
if (match_value.correlation__ID().ispresent()) {
single_value->field_correlation__ID.log_match(match_value.correlation__ID(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_correlation__ID.log();
if (single_value->field_correlation__ID.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 M3UA__DATA__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (protocol__Data().is_bound()) protocol__Data().set_implicit_omit();
if (!correlation__ID().is_bound()) correlation__ID() = OMIT_VALUE;
else correlation__ID().set_implicit_omit();
}

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

void M3UA__DATA__MessageParameters_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_network__Appearance.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_protocol__Data.decode_text(text_buf);
single_value->field_correlation__ID.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new M3UA__DATA__MessageParameters_template[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 @M3UA_Types.M3UA_DATA_MessageParameters.");
}
}

void M3UA__DATA__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__DATA__MessageParameters_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set template of type @M3UA_Types.M3UA_DATA_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) protocol__Data().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) correlation__ID().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protocol_Data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protocol__Data().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "correlation_ID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          correlation__ID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DATA_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DATA__MessageParameters_template* precondition = new M3UA__DATA__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DATA__MessageParameters_template* implied_template = new M3UA__DATA__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DATA__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_DATA_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DATA__MessageParameters_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_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA_MessageParameters");
single_value->field_protocol__Data.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA_MessageParameters");
single_value->field_correlation__ID.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA_MessageParameters");
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 : "@M3UA_Types.M3UA_DATA_MessageParameters");
}

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

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

M3UA__DATA::M3UA__DATA()
{
}

M3UA__DATA::M3UA__DATA(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__DATA__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__DATA::M3UA__DATA(const M3UA__DATA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DATA.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__DATA::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DATA::get_descriptor() const { return &M3UA__DATA_descr_; }
M3UA__DATA& M3UA__DATA::operator=(const M3UA__DATA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DATA.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__DATA::operator==(const M3UA__DATA& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__DATA::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__DATA::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__DATA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DATA::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DATA::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 @M3UA_Types.M3UA_DATA 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_DATA");
  }
}

void M3UA__DATA::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__DATA::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__DATA::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 M3UA__DATA::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 M3UA__DATA::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__DATA_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__DATA_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__DATA_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__DATA__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__DATA__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__DATA::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__DATA_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__DATA__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__DATA_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__DATA__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__DATA_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__DATA__MessageParameters_template field_messageParameters;
};

void M3UA__DATA_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__DATA_template::copy_value(const M3UA__DATA& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DATA_template::copy_template(const M3UA__DATA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__DATA_template[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 M3UA__DATA_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DATA_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 @M3UA_Types.M3UA_DATA.");
break;
}
set_selection(other_value);
}

M3UA__DATA_template::M3UA__DATA_template()
{
}

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

M3UA__DATA_template::M3UA__DATA_template(const M3UA__DATA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DATA_template::match(const M3UA__DATA& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_DATA.");
}
return FALSE;
}

boolean M3UA__DATA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__DATA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__DATA M3UA__DATA_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 @M3UA_Types.M3UA_DATA.");
M3UA__DATA ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__DATA_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 @M3UA_Types.M3UA_DATA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DATA_template[list_length];
}

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

OCTETSTRING_template& M3UA__DATA_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__DATA_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_DATA.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__DATA_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__DATA_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_DATA.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__DATA_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__DATA_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_DATA.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__DATA_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__DATA_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_DATA.");
return single_value->field_messageLength;
}

M3UA__DATA__MessageParameters_template& M3UA__DATA_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__DATA__MessageParameters_template& M3UA__DATA_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_DATA.");
return single_value->field_messageParameters;
}

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

void M3UA__DATA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__DATA_template::log_match(const M3UA__DATA& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__DATA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DATA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_DATA.");
}
}

void M3UA__DATA_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__DATA_template[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 @M3UA_Types.M3UA_DATA.");
}
}

void M3UA__DATA_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: {
    M3UA__DATA_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 @M3UA_Types.M3UA_DATA 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DATA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DATA_template* precondition = new M3UA__DATA_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DATA_template* implied_template = new M3UA__DATA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DATA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_DATA");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DATA_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DATA");
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 : "@M3UA_Types.M3UA_DATA");
}

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

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

M3UA__DUNA__MessageParameters::M3UA__DUNA__MessageParameters()
{
}

M3UA__DUNA__MessageParameters::M3UA__DUNA__MessageParameters(const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const M3UA__Affected__Point__Codes& par_affected__Point__Codes,
    const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_network__Appearance(par_network__Appearance),
  field_routing__Context(par_routing__Context),
  field_affected__Point__Codes(par_affected__Point__Codes),
  field_info__String(par_info__String)
{
}

M3UA__DUNA__MessageParameters::M3UA__DUNA__MessageParameters(const M3UA__DUNA__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DUNA_MessageParameters.");
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
else field_affected__Point__Codes.clean_up();
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__DUNA__MessageParameters::clean_up()
{
field_network__Appearance.clean_up();
field_routing__Context.clean_up();
field_affected__Point__Codes.clean_up();
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DUNA__MessageParameters::get_descriptor() const { return &M3UA__DUNA__MessageParameters_descr_; }
M3UA__DUNA__MessageParameters& M3UA__DUNA__MessageParameters::operator=(const M3UA__DUNA__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DUNA_MessageParameters.");
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
  else field_affected__Point__Codes.clean_up();
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__DUNA__MessageParameters::operator==(const M3UA__DUNA__MessageParameters& other_value) const
{
return field_network__Appearance==other_value.field_network__Appearance
  && field_routing__Context==other_value.field_routing__Context
  && field_affected__Point__Codes==other_value.field_affected__Point__Codes
  && field_info__String==other_value.field_info__String;
}

boolean M3UA__DUNA__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (field_affected__Point__Codes.is_bound())
  || (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__DUNA__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && field_affected__Point__Codes.is_value()
  && (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__DUNA__MessageParameters::size_of() const
{
  int ret_val = 1;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__DUNA__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DUNA__MessageParameters::set_implicit_omit()
{
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DUNA__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_DUNA_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUNA_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_DUNA_MessageParameters");
  }
}

void M3UA__DUNA__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_network__Appearance.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_affected__Point__Codes.encode_text(text_buf);
field_info__String.encode_text(text_buf);
}

void M3UA__DUNA__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_network__Appearance.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_affected__Point__Codes.decode_text(text_buf);
field_info__String.decode_text(text_buf);
}

void M3UA__DUNA__MessageParameters::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 M3UA__DUNA__MessageParameters::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 M3UA__DUNA__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[4];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_network__Appearance = OMIT_VALUE;
field_routing__Context = OMIT_VALUE;
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_2) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Affected__Point__Codes_descr_.raw->forceomit);
int decoded_field_length = field_affected__Point__Codes.RAW_decode(M3UA__Affected__Point__Codes_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length >= 0 && (field_affected__Point__Codes.tag() ==  os_2)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 1) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__DUNA__MessageParameters::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Affected__Point__Codes_descr_.raw);
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_affected__Point__Codes.RAW_encode(M3UA__Affected__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_affected__Point__Codes.tag() !=  os_2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__DUNA__MessageParameters_template::single_value_struct {
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Affected__Point__Codes_template field_affected__Point__Codes;
M3UA__Info__String_template field_info__String;
};

void M3UA__DUNA__MessageParameters_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_network__Appearance = ANY_OR_OMIT;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_affected__Point__Codes = ANY_VALUE;
single_value->field_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__DUNA__MessageParameters_template::copy_value(const M3UA__DUNA__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.affected__Point__Codes().is_bound()) {
  single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
  single_value->field_affected__Point__Codes.clean_up();
}
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DUNA__MessageParameters_template::copy_template(const M3UA__DUNA__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.affected__Point__Codes().get_selection()) {
single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
single_value->field_affected__Point__Codes.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__DUNA__MessageParameters_template[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 M3UA__DUNA__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DUNA__MessageParameters_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 @M3UA_Types.M3UA_DUNA_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__DUNA__MessageParameters_template::M3UA__DUNA__MessageParameters_template()
{
}

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

M3UA__DUNA__MessageParameters_template::M3UA__DUNA__MessageParameters_template(const M3UA__DUNA__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DUNA__MessageParameters_template::match(const M3UA__DUNA__MessageParameters& 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.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.affected__Point__Codes().is_bound()) return FALSE;
if(!single_value->field_affected__Point__Codes.match(other_value.affected__Point__Codes(), legacy))return FALSE;
if(!other_value.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_DUNA_MessageParameters.");
}
return FALSE;
}

boolean M3UA__DUNA__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || single_value->field_affected__Point__Codes.is_bound()
 || (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__DUNA__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && single_value->field_affected__Point__Codes.is_value()
 && (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

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

M3UA__DUNA__MessageParameters M3UA__DUNA__MessageParameters_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 @M3UA_Types.M3UA_DUNA_MessageParameters.");
M3UA__DUNA__MessageParameters ret_val;
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_affected__Point__Codes.is_bound()) {
ret_val.affected__Point__Codes() = single_value->field_affected__Point__Codes.valueof();
}
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__DUNA__MessageParameters_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 @M3UA_Types.M3UA_DUNA_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DUNA__MessageParameters_template[list_length];
}

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

M3UA__Network__Appearance_template& M3UA__DUNA__MessageParameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__DUNA__MessageParameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_DUNA_MessageParameters.");
return single_value->field_network__Appearance;
}

M3UA__Routing__Context_template& M3UA__DUNA__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__DUNA__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_DUNA_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Affected__Point__Codes_template& M3UA__DUNA__MessageParameters_template::affected__Point__Codes()
{
set_specific();
return single_value->field_affected__Point__Codes;
}

const M3UA__Affected__Point__Codes_template& M3UA__DUNA__MessageParameters_template::affected__Point__Codes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field affected_Point_Codes of a non-specific template of type @M3UA_Types.M3UA_DUNA_MessageParameters.");
return single_value->field_affected__Point__Codes;
}

M3UA__Info__String_template& M3UA__DUNA__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__DUNA__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_DUNA_MessageParameters.");
return single_value->field_info__String;
}

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

void M3UA__DUNA__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", info_String := ");
single_value->field_info__String.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 M3UA__DUNA__MessageParameters_template::log_match(const M3UA__DUNA__MessageParameters& 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 (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_affected__Point__Codes.match(match_value.affected__Point__Codes(), legacy)){
TTCN_Logger::log_logmatch_info(".affected_Point_Codes");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::log_event_str(", info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__DUNA__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DUNA__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_network__Appearance.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_affected__Point__Codes.encode_text(text_buf);
single_value->field_info__String.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 @M3UA_Types.M3UA_DUNA_MessageParameters.");
}
}

void M3UA__DUNA__MessageParameters_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_network__Appearance.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_affected__Point__Codes.decode_text(text_buf);
single_value->field_info__String.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 M3UA__DUNA__MessageParameters_template[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 @M3UA_Types.M3UA_DUNA_MessageParameters.");
}
}

void M3UA__DUNA__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__DUNA__MessageParameters_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set template of type @M3UA_Types.M3UA_DUNA_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUNA_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DUNA__MessageParameters_template* precondition = new M3UA__DUNA__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DUNA__MessageParameters_template* implied_template = new M3UA__DUNA__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DUNA__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_DUNA_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DUNA__MessageParameters_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_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA_MessageParameters");
single_value->field_affected__Point__Codes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA_MessageParameters");
single_value->field_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA_MessageParameters");
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 : "@M3UA_Types.M3UA_DUNA_MessageParameters");
}

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

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

M3UA__DUNA::M3UA__DUNA()
{
}

M3UA__DUNA::M3UA__DUNA(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__DUNA__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__DUNA::M3UA__DUNA(const M3UA__DUNA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DUNA.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__DUNA::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DUNA::get_descriptor() const { return &M3UA__DUNA_descr_; }
M3UA__DUNA& M3UA__DUNA::operator=(const M3UA__DUNA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DUNA.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__DUNA::operator==(const M3UA__DUNA& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__DUNA::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__DUNA::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__DUNA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DUNA::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DUNA::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 @M3UA_Types.M3UA_DUNA 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUNA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_DUNA");
  }
}

void M3UA__DUNA::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__DUNA::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__DUNA::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 M3UA__DUNA::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 M3UA__DUNA::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__DUNA_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__DUNA_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__DUNA_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__DUNA__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__DUNA__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__DUNA::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__DUNA_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__DUNA__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__DUNA_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__DUNA__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__DUNA_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__DUNA__MessageParameters_template field_messageParameters;
};

void M3UA__DUNA_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__DUNA_template::copy_value(const M3UA__DUNA& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DUNA_template::copy_template(const M3UA__DUNA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__DUNA_template[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 M3UA__DUNA_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DUNA_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 @M3UA_Types.M3UA_DUNA.");
break;
}
set_selection(other_value);
}

M3UA__DUNA_template::M3UA__DUNA_template()
{
}

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

M3UA__DUNA_template::M3UA__DUNA_template(const M3UA__DUNA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DUNA_template::match(const M3UA__DUNA& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_DUNA.");
}
return FALSE;
}

boolean M3UA__DUNA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__DUNA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__DUNA M3UA__DUNA_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 @M3UA_Types.M3UA_DUNA.");
M3UA__DUNA ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__DUNA_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 @M3UA_Types.M3UA_DUNA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DUNA_template[list_length];
}

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

OCTETSTRING_template& M3UA__DUNA_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__DUNA_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_DUNA.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__DUNA_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__DUNA_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_DUNA.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__DUNA_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__DUNA_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_DUNA.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__DUNA_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__DUNA_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_DUNA.");
return single_value->field_messageLength;
}

M3UA__DUNA__MessageParameters_template& M3UA__DUNA_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__DUNA__MessageParameters_template& M3UA__DUNA_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_DUNA.");
return single_value->field_messageParameters;
}

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

void M3UA__DUNA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__DUNA_template::log_match(const M3UA__DUNA& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__DUNA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DUNA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_DUNA.");
}
}

void M3UA__DUNA_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__DUNA_template[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 @M3UA_Types.M3UA_DUNA.");
}
}

void M3UA__DUNA_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: {
    M3UA__DUNA_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 @M3UA_Types.M3UA_DUNA 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUNA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DUNA_template* precondition = new M3UA__DUNA_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DUNA_template* implied_template = new M3UA__DUNA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DUNA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_DUNA");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DUNA_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUNA");
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 : "@M3UA_Types.M3UA_DUNA");
}

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

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

M3UA__DAVA__MessageParameters::M3UA__DAVA__MessageParameters()
{
}

M3UA__DAVA__MessageParameters::M3UA__DAVA__MessageParameters(const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const M3UA__Affected__Point__Codes& par_affected__Point__Codes,
    const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_network__Appearance(par_network__Appearance),
  field_routing__Context(par_routing__Context),
  field_affected__Point__Codes(par_affected__Point__Codes),
  field_info__String(par_info__String)
{
}

M3UA__DAVA__MessageParameters::M3UA__DAVA__MessageParameters(const M3UA__DAVA__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DAVA_MessageParameters.");
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
else field_affected__Point__Codes.clean_up();
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__DAVA__MessageParameters::clean_up()
{
field_network__Appearance.clean_up();
field_routing__Context.clean_up();
field_affected__Point__Codes.clean_up();
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DAVA__MessageParameters::get_descriptor() const { return &M3UA__DAVA__MessageParameters_descr_; }
M3UA__DAVA__MessageParameters& M3UA__DAVA__MessageParameters::operator=(const M3UA__DAVA__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DAVA_MessageParameters.");
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
  else field_affected__Point__Codes.clean_up();
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__DAVA__MessageParameters::operator==(const M3UA__DAVA__MessageParameters& other_value) const
{
return field_network__Appearance==other_value.field_network__Appearance
  && field_routing__Context==other_value.field_routing__Context
  && field_affected__Point__Codes==other_value.field_affected__Point__Codes
  && field_info__String==other_value.field_info__String;
}

boolean M3UA__DAVA__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (field_affected__Point__Codes.is_bound())
  || (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__DAVA__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && field_affected__Point__Codes.is_value()
  && (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__DAVA__MessageParameters::size_of() const
{
  int ret_val = 1;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__DAVA__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DAVA__MessageParameters::set_implicit_omit()
{
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DAVA__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_DAVA_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAVA_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_DAVA_MessageParameters");
  }
}

void M3UA__DAVA__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_network__Appearance.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_affected__Point__Codes.encode_text(text_buf);
field_info__String.encode_text(text_buf);
}

void M3UA__DAVA__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_network__Appearance.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_affected__Point__Codes.decode_text(text_buf);
field_info__String.decode_text(text_buf);
}

void M3UA__DAVA__MessageParameters::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 M3UA__DAVA__MessageParameters::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 M3UA__DAVA__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[4];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_network__Appearance = OMIT_VALUE;
field_routing__Context = OMIT_VALUE;
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_2) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Affected__Point__Codes_descr_.raw->forceomit);
int decoded_field_length = field_affected__Point__Codes.RAW_decode(M3UA__Affected__Point__Codes_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length >= 0 && (field_affected__Point__Codes.tag() ==  os_2)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 1) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__DAVA__MessageParameters::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Affected__Point__Codes_descr_.raw);
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_affected__Point__Codes.RAW_encode(M3UA__Affected__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_affected__Point__Codes.tag() !=  os_2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__DAVA__MessageParameters_template::single_value_struct {
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Affected__Point__Codes_template field_affected__Point__Codes;
M3UA__Info__String_template field_info__String;
};

void M3UA__DAVA__MessageParameters_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_network__Appearance = ANY_OR_OMIT;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_affected__Point__Codes = ANY_VALUE;
single_value->field_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__DAVA__MessageParameters_template::copy_value(const M3UA__DAVA__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.affected__Point__Codes().is_bound()) {
  single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
  single_value->field_affected__Point__Codes.clean_up();
}
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DAVA__MessageParameters_template::copy_template(const M3UA__DAVA__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.affected__Point__Codes().get_selection()) {
single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
single_value->field_affected__Point__Codes.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__DAVA__MessageParameters_template[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 M3UA__DAVA__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DAVA__MessageParameters_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 @M3UA_Types.M3UA_DAVA_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__DAVA__MessageParameters_template::M3UA__DAVA__MessageParameters_template()
{
}

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

M3UA__DAVA__MessageParameters_template::M3UA__DAVA__MessageParameters_template(const M3UA__DAVA__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DAVA__MessageParameters_template::match(const M3UA__DAVA__MessageParameters& 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.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.affected__Point__Codes().is_bound()) return FALSE;
if(!single_value->field_affected__Point__Codes.match(other_value.affected__Point__Codes(), legacy))return FALSE;
if(!other_value.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_DAVA_MessageParameters.");
}
return FALSE;
}

boolean M3UA__DAVA__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || single_value->field_affected__Point__Codes.is_bound()
 || (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__DAVA__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && single_value->field_affected__Point__Codes.is_value()
 && (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

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

M3UA__DAVA__MessageParameters M3UA__DAVA__MessageParameters_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 @M3UA_Types.M3UA_DAVA_MessageParameters.");
M3UA__DAVA__MessageParameters ret_val;
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_affected__Point__Codes.is_bound()) {
ret_val.affected__Point__Codes() = single_value->field_affected__Point__Codes.valueof();
}
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__DAVA__MessageParameters_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 @M3UA_Types.M3UA_DAVA_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DAVA__MessageParameters_template[list_length];
}

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

M3UA__Network__Appearance_template& M3UA__DAVA__MessageParameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__DAVA__MessageParameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_DAVA_MessageParameters.");
return single_value->field_network__Appearance;
}

M3UA__Routing__Context_template& M3UA__DAVA__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__DAVA__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_DAVA_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Affected__Point__Codes_template& M3UA__DAVA__MessageParameters_template::affected__Point__Codes()
{
set_specific();
return single_value->field_affected__Point__Codes;
}

const M3UA__Affected__Point__Codes_template& M3UA__DAVA__MessageParameters_template::affected__Point__Codes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field affected_Point_Codes of a non-specific template of type @M3UA_Types.M3UA_DAVA_MessageParameters.");
return single_value->field_affected__Point__Codes;
}

M3UA__Info__String_template& M3UA__DAVA__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__DAVA__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_DAVA_MessageParameters.");
return single_value->field_info__String;
}

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

void M3UA__DAVA__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", info_String := ");
single_value->field_info__String.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 M3UA__DAVA__MessageParameters_template::log_match(const M3UA__DAVA__MessageParameters& 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 (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_affected__Point__Codes.match(match_value.affected__Point__Codes(), legacy)){
TTCN_Logger::log_logmatch_info(".affected_Point_Codes");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::log_event_str(", info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__DAVA__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DAVA__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_network__Appearance.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_affected__Point__Codes.encode_text(text_buf);
single_value->field_info__String.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 @M3UA_Types.M3UA_DAVA_MessageParameters.");
}
}

void M3UA__DAVA__MessageParameters_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_network__Appearance.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_affected__Point__Codes.decode_text(text_buf);
single_value->field_info__String.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 M3UA__DAVA__MessageParameters_template[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 @M3UA_Types.M3UA_DAVA_MessageParameters.");
}
}

void M3UA__DAVA__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__DAVA__MessageParameters_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set template of type @M3UA_Types.M3UA_DAVA_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAVA_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DAVA__MessageParameters_template* precondition = new M3UA__DAVA__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DAVA__MessageParameters_template* implied_template = new M3UA__DAVA__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DAVA__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_DAVA_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DAVA__MessageParameters_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_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA_MessageParameters");
single_value->field_affected__Point__Codes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA_MessageParameters");
single_value->field_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA_MessageParameters");
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 : "@M3UA_Types.M3UA_DAVA_MessageParameters");
}

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

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

M3UA__DAVA::M3UA__DAVA()
{
}

M3UA__DAVA::M3UA__DAVA(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__DAVA__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__DAVA::M3UA__DAVA(const M3UA__DAVA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DAVA.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__DAVA::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DAVA::get_descriptor() const { return &M3UA__DAVA_descr_; }
M3UA__DAVA& M3UA__DAVA::operator=(const M3UA__DAVA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DAVA.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__DAVA::operator==(const M3UA__DAVA& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__DAVA::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__DAVA::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__DAVA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DAVA::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DAVA::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 @M3UA_Types.M3UA_DAVA 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAVA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_DAVA");
  }
}

void M3UA__DAVA::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__DAVA::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__DAVA::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 M3UA__DAVA::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 M3UA__DAVA::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__DAVA_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__DAVA_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__DAVA_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__DAVA__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__DAVA__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__DAVA::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__DAVA_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__DAVA__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__DAVA_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__DAVA__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__DAVA_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__DAVA__MessageParameters_template field_messageParameters;
};

void M3UA__DAVA_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__DAVA_template::copy_value(const M3UA__DAVA& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DAVA_template::copy_template(const M3UA__DAVA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__DAVA_template[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 M3UA__DAVA_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DAVA_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 @M3UA_Types.M3UA_DAVA.");
break;
}
set_selection(other_value);
}

M3UA__DAVA_template::M3UA__DAVA_template()
{
}

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

M3UA__DAVA_template::M3UA__DAVA_template(const M3UA__DAVA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DAVA_template::match(const M3UA__DAVA& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_DAVA.");
}
return FALSE;
}

boolean M3UA__DAVA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__DAVA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__DAVA M3UA__DAVA_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 @M3UA_Types.M3UA_DAVA.");
M3UA__DAVA ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__DAVA_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 @M3UA_Types.M3UA_DAVA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DAVA_template[list_length];
}

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

OCTETSTRING_template& M3UA__DAVA_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__DAVA_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_DAVA.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__DAVA_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__DAVA_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_DAVA.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__DAVA_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__DAVA_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_DAVA.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__DAVA_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__DAVA_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_DAVA.");
return single_value->field_messageLength;
}

M3UA__DAVA__MessageParameters_template& M3UA__DAVA_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__DAVA__MessageParameters_template& M3UA__DAVA_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_DAVA.");
return single_value->field_messageParameters;
}

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

void M3UA__DAVA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__DAVA_template::log_match(const M3UA__DAVA& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__DAVA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DAVA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_DAVA.");
}
}

void M3UA__DAVA_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__DAVA_template[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 @M3UA_Types.M3UA_DAVA.");
}
}

void M3UA__DAVA_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: {
    M3UA__DAVA_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 @M3UA_Types.M3UA_DAVA 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAVA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DAVA_template* precondition = new M3UA__DAVA_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DAVA_template* implied_template = new M3UA__DAVA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DAVA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_DAVA");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DAVA_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAVA");
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 : "@M3UA_Types.M3UA_DAVA");
}

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

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

M3UA__DAUD__MessageParameters::M3UA__DAUD__MessageParameters()
{
}

M3UA__DAUD__MessageParameters::M3UA__DAUD__MessageParameters(const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const M3UA__Affected__Point__Codes& par_affected__Point__Codes,
    const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_network__Appearance(par_network__Appearance),
  field_routing__Context(par_routing__Context),
  field_affected__Point__Codes(par_affected__Point__Codes),
  field_info__String(par_info__String)
{
}

M3UA__DAUD__MessageParameters::M3UA__DAUD__MessageParameters(const M3UA__DAUD__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DAUD_MessageParameters.");
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
else field_affected__Point__Codes.clean_up();
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__DAUD__MessageParameters::clean_up()
{
field_network__Appearance.clean_up();
field_routing__Context.clean_up();
field_affected__Point__Codes.clean_up();
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DAUD__MessageParameters::get_descriptor() const { return &M3UA__DAUD__MessageParameters_descr_; }
M3UA__DAUD__MessageParameters& M3UA__DAUD__MessageParameters::operator=(const M3UA__DAUD__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DAUD_MessageParameters.");
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
  else field_affected__Point__Codes.clean_up();
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__DAUD__MessageParameters::operator==(const M3UA__DAUD__MessageParameters& other_value) const
{
return field_network__Appearance==other_value.field_network__Appearance
  && field_routing__Context==other_value.field_routing__Context
  && field_affected__Point__Codes==other_value.field_affected__Point__Codes
  && field_info__String==other_value.field_info__String;
}

boolean M3UA__DAUD__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (field_affected__Point__Codes.is_bound())
  || (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__DAUD__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && field_affected__Point__Codes.is_value()
  && (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__DAUD__MessageParameters::size_of() const
{
  int ret_val = 1;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__DAUD__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DAUD__MessageParameters::set_implicit_omit()
{
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DAUD__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_DAUD_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAUD_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_DAUD_MessageParameters");
  }
}

void M3UA__DAUD__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_network__Appearance.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_affected__Point__Codes.encode_text(text_buf);
field_info__String.encode_text(text_buf);
}

void M3UA__DAUD__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_network__Appearance.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_affected__Point__Codes.decode_text(text_buf);
field_info__String.decode_text(text_buf);
}

void M3UA__DAUD__MessageParameters::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 M3UA__DAUD__MessageParameters::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 M3UA__DAUD__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[4];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_network__Appearance = OMIT_VALUE;
field_routing__Context = OMIT_VALUE;
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_2) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Affected__Point__Codes_descr_.raw->forceomit);
int decoded_field_length = field_affected__Point__Codes.RAW_decode(M3UA__Affected__Point__Codes_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length >= 0 && (field_affected__Point__Codes.tag() ==  os_2)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 1) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__DAUD__MessageParameters::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Affected__Point__Codes_descr_.raw);
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_affected__Point__Codes.RAW_encode(M3UA__Affected__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_affected__Point__Codes.tag() !=  os_2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__DAUD__MessageParameters_template::single_value_struct {
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Affected__Point__Codes_template field_affected__Point__Codes;
M3UA__Info__String_template field_info__String;
};

void M3UA__DAUD__MessageParameters_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_network__Appearance = ANY_OR_OMIT;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_affected__Point__Codes = ANY_VALUE;
single_value->field_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__DAUD__MessageParameters_template::copy_value(const M3UA__DAUD__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.affected__Point__Codes().is_bound()) {
  single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
  single_value->field_affected__Point__Codes.clean_up();
}
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DAUD__MessageParameters_template::copy_template(const M3UA__DAUD__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.affected__Point__Codes().get_selection()) {
single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
single_value->field_affected__Point__Codes.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__DAUD__MessageParameters_template[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 M3UA__DAUD__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DAUD__MessageParameters_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 @M3UA_Types.M3UA_DAUD_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__DAUD__MessageParameters_template::M3UA__DAUD__MessageParameters_template()
{
}

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

M3UA__DAUD__MessageParameters_template::M3UA__DAUD__MessageParameters_template(const M3UA__DAUD__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DAUD__MessageParameters_template::match(const M3UA__DAUD__MessageParameters& 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.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.affected__Point__Codes().is_bound()) return FALSE;
if(!single_value->field_affected__Point__Codes.match(other_value.affected__Point__Codes(), legacy))return FALSE;
if(!other_value.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_DAUD_MessageParameters.");
}
return FALSE;
}

boolean M3UA__DAUD__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || single_value->field_affected__Point__Codes.is_bound()
 || (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__DAUD__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && single_value->field_affected__Point__Codes.is_value()
 && (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

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

M3UA__DAUD__MessageParameters M3UA__DAUD__MessageParameters_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 @M3UA_Types.M3UA_DAUD_MessageParameters.");
M3UA__DAUD__MessageParameters ret_val;
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_affected__Point__Codes.is_bound()) {
ret_val.affected__Point__Codes() = single_value->field_affected__Point__Codes.valueof();
}
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__DAUD__MessageParameters_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 @M3UA_Types.M3UA_DAUD_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DAUD__MessageParameters_template[list_length];
}

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

M3UA__Network__Appearance_template& M3UA__DAUD__MessageParameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__DAUD__MessageParameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_DAUD_MessageParameters.");
return single_value->field_network__Appearance;
}

M3UA__Routing__Context_template& M3UA__DAUD__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__DAUD__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_DAUD_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Affected__Point__Codes_template& M3UA__DAUD__MessageParameters_template::affected__Point__Codes()
{
set_specific();
return single_value->field_affected__Point__Codes;
}

const M3UA__Affected__Point__Codes_template& M3UA__DAUD__MessageParameters_template::affected__Point__Codes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field affected_Point_Codes of a non-specific template of type @M3UA_Types.M3UA_DAUD_MessageParameters.");
return single_value->field_affected__Point__Codes;
}

M3UA__Info__String_template& M3UA__DAUD__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__DAUD__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_DAUD_MessageParameters.");
return single_value->field_info__String;
}

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

void M3UA__DAUD__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", info_String := ");
single_value->field_info__String.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 M3UA__DAUD__MessageParameters_template::log_match(const M3UA__DAUD__MessageParameters& 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 (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_affected__Point__Codes.match(match_value.affected__Point__Codes(), legacy)){
TTCN_Logger::log_logmatch_info(".affected_Point_Codes");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::log_event_str(", info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__DAUD__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DAUD__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_network__Appearance.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_affected__Point__Codes.encode_text(text_buf);
single_value->field_info__String.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 @M3UA_Types.M3UA_DAUD_MessageParameters.");
}
}

void M3UA__DAUD__MessageParameters_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_network__Appearance.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_affected__Point__Codes.decode_text(text_buf);
single_value->field_info__String.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 M3UA__DAUD__MessageParameters_template[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 @M3UA_Types.M3UA_DAUD_MessageParameters.");
}
}

void M3UA__DAUD__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__DAUD__MessageParameters_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("set template of type @M3UA_Types.M3UA_DAUD_MessageParameters has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) info__String().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAUD_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DAUD__MessageParameters_template* precondition = new M3UA__DAUD__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DAUD__MessageParameters_template* implied_template = new M3UA__DAUD__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DAUD__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_DAUD_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DAUD__MessageParameters_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_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD_MessageParameters");
single_value->field_affected__Point__Codes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD_MessageParameters");
single_value->field_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD_MessageParameters");
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 : "@M3UA_Types.M3UA_DAUD_MessageParameters");
}

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

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

M3UA__DAUD::M3UA__DAUD()
{
}

M3UA__DAUD::M3UA__DAUD(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__DAUD__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__DAUD::M3UA__DAUD(const M3UA__DAUD& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DAUD.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__DAUD::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DAUD::get_descriptor() const { return &M3UA__DAUD_descr_; }
M3UA__DAUD& M3UA__DAUD::operator=(const M3UA__DAUD& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DAUD.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__DAUD::operator==(const M3UA__DAUD& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__DAUD::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__DAUD::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__DAUD::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DAUD::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DAUD::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 @M3UA_Types.M3UA_DAUD 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAUD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_DAUD");
  }
}

void M3UA__DAUD::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__DAUD::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__DAUD::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 M3UA__DAUD::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 M3UA__DAUD::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__DAUD_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__DAUD_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__DAUD_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__DAUD__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__DAUD__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__DAUD::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__DAUD_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__DAUD__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__DAUD_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__DAUD__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__DAUD_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__DAUD__MessageParameters_template field_messageParameters;
};

void M3UA__DAUD_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__DAUD_template::copy_value(const M3UA__DAUD& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DAUD_template::copy_template(const M3UA__DAUD_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__DAUD_template[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 M3UA__DAUD_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DAUD_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 @M3UA_Types.M3UA_DAUD.");
break;
}
set_selection(other_value);
}

M3UA__DAUD_template::M3UA__DAUD_template()
{
}

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

M3UA__DAUD_template::M3UA__DAUD_template(const M3UA__DAUD& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DAUD_template::match(const M3UA__DAUD& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_DAUD.");
}
return FALSE;
}

boolean M3UA__DAUD_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__DAUD_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__DAUD M3UA__DAUD_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 @M3UA_Types.M3UA_DAUD.");
M3UA__DAUD ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__DAUD_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 @M3UA_Types.M3UA_DAUD.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DAUD_template[list_length];
}

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

OCTETSTRING_template& M3UA__DAUD_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__DAUD_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_DAUD.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__DAUD_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__DAUD_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_DAUD.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__DAUD_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__DAUD_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_DAUD.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__DAUD_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__DAUD_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_DAUD.");
return single_value->field_messageLength;
}

M3UA__DAUD__MessageParameters_template& M3UA__DAUD_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__DAUD__MessageParameters_template& M3UA__DAUD_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_DAUD.");
return single_value->field_messageParameters;
}

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

void M3UA__DAUD_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__DAUD_template::log_match(const M3UA__DAUD& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__DAUD_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DAUD_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_DAUD.");
}
}

void M3UA__DAUD_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__DAUD_template[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 @M3UA_Types.M3UA_DAUD.");
}
}

void M3UA__DAUD_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: {
    M3UA__DAUD_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 @M3UA_Types.M3UA_DAUD 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DAUD: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DAUD_template* precondition = new M3UA__DAUD_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DAUD_template* implied_template = new M3UA__DAUD_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DAUD_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_DAUD");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DAUD_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DAUD");
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 : "@M3UA_Types.M3UA_DAUD");
}

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

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

M3UA__SCON__MessageParameters::M3UA__SCON__MessageParameters()
{
}

M3UA__SCON__MessageParameters::M3UA__SCON__MessageParameters(const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const M3UA__Affected__Point__Codes& par_affected__Point__Codes,
    const OPTIONAL< M3UA__Concerned__Destination >& par_concerned__Destination,
    const OPTIONAL< M3UA__Congestion__Indicators >& par_congestion__Indicators,
    const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_network__Appearance(par_network__Appearance),
  field_routing__Context(par_routing__Context),
  field_affected__Point__Codes(par_affected__Point__Codes),
  field_concerned__Destination(par_concerned__Destination),
  field_congestion__Indicators(par_congestion__Indicators),
  field_info__String(par_info__String)
{
}

M3UA__SCON__MessageParameters::M3UA__SCON__MessageParameters(const M3UA__SCON__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_SCON_MessageParameters.");
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
else field_affected__Point__Codes.clean_up();
if (other_value.concerned__Destination().is_bound()) field_concerned__Destination = other_value.concerned__Destination();
else field_concerned__Destination.clean_up();
if (other_value.congestion__Indicators().is_bound()) field_congestion__Indicators = other_value.congestion__Indicators();
else field_congestion__Indicators.clean_up();
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__SCON__MessageParameters::clean_up()
{
field_network__Appearance.clean_up();
field_routing__Context.clean_up();
field_affected__Point__Codes.clean_up();
field_concerned__Destination.clean_up();
field_congestion__Indicators.clean_up();
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__SCON__MessageParameters::get_descriptor() const { return &M3UA__SCON__MessageParameters_descr_; }
M3UA__SCON__MessageParameters& M3UA__SCON__MessageParameters::operator=(const M3UA__SCON__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_SCON_MessageParameters.");
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
  else field_affected__Point__Codes.clean_up();
  if (other_value.concerned__Destination().is_bound()) field_concerned__Destination = other_value.concerned__Destination();
  else field_concerned__Destination.clean_up();
  if (other_value.congestion__Indicators().is_bound()) field_congestion__Indicators = other_value.congestion__Indicators();
  else field_congestion__Indicators.clean_up();
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__SCON__MessageParameters::operator==(const M3UA__SCON__MessageParameters& other_value) const
{
return field_network__Appearance==other_value.field_network__Appearance
  && field_routing__Context==other_value.field_routing__Context
  && field_affected__Point__Codes==other_value.field_affected__Point__Codes
  && field_concerned__Destination==other_value.field_concerned__Destination
  && field_congestion__Indicators==other_value.field_congestion__Indicators
  && field_info__String==other_value.field_info__String;
}

boolean M3UA__SCON__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (field_affected__Point__Codes.is_bound())
  || (OPTIONAL_OMIT == field_concerned__Destination.get_selection() || field_concerned__Destination.is_bound())
  || (OPTIONAL_OMIT == field_congestion__Indicators.get_selection() || field_congestion__Indicators.is_bound())
  || (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__SCON__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && field_affected__Point__Codes.is_value()
  && (OPTIONAL_OMIT == field_concerned__Destination.get_selection() || field_concerned__Destination.is_value())
  && (OPTIONAL_OMIT == field_congestion__Indicators.get_selection() || field_congestion__Indicators.is_value())
  && (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__SCON__MessageParameters::size_of() const
{
  int ret_val = 1;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_concerned__Destination.ispresent()) ret_val++;
  if (field_congestion__Indicators.ispresent()) ret_val++;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__SCON__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", concerned_Destination := ");
field_concerned__Destination.log();
TTCN_Logger::log_event_str(", congestion_Indicators := ");
field_congestion__Indicators.log();
TTCN_Logger::log_event_str(", info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__SCON__MessageParameters::set_implicit_omit()
{
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!concerned__Destination().is_bound()) concerned__Destination() = OMIT_VALUE;
else concerned__Destination().set_implicit_omit();
if (!congestion__Indicators().is_bound()) congestion__Indicators() = OMIT_VALUE;
else congestion__Indicators().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__SCON__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_SCON_MessageParameters 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) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) concerned__Destination().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) congestion__Indicators().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) info__String().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(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "concerned_Destination")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          concerned__Destination().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "congestion_Indicators")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          congestion__Indicators().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_SCON_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_SCON_MessageParameters");
  }
}

void M3UA__SCON__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_network__Appearance.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_affected__Point__Codes.encode_text(text_buf);
field_concerned__Destination.encode_text(text_buf);
field_congestion__Indicators.encode_text(text_buf);
field_info__String.encode_text(text_buf);
}

void M3UA__SCON__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_network__Appearance.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_affected__Point__Codes.decode_text(text_buf);
field_concerned__Destination.decode_text(text_buf);
field_congestion__Indicators.decode_text(text_buf);
field_info__String.decode_text(text_buf);
}

void M3UA__SCON__MessageParameters::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 M3UA__SCON__MessageParameters::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 M3UA__SCON__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[6];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_network__Appearance = OMIT_VALUE;
field_routing__Context = OMIT_VALUE;
field_concerned__Destination = OMIT_VALUE;
field_congestion__Indicators = OMIT_VALUE;
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_2) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Affected__Point__Codes_descr_.raw->forceomit);
int decoded_field_length = field_affected__Point__Codes.RAW_decode(M3UA__Affected__Point__Codes_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length >= 0 && (field_affected__Point__Codes.tag() ==  os_2)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Concerned__Destination_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Concerned__Destination_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_9) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__Concerned__Destination_descr_.raw->forceomit);
int decoded_field_length = field_concerned__Destination().RAW_decode(M3UA__Concerned__Destination_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_concerned__Destination.ispresent() && field_concerned__Destination().tag() ==  os_9)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_concerned__Destination = OMIT_VALUE;
}
}
}
if (field_map[4] == 0 && (force_omit == NULL || !(*force_omit)(4))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Congestion__Indicators_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Congestion__Indicators_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_10) {
RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__Congestion__Indicators_descr_.raw->forceomit);
int decoded_field_length = field_congestion__Indicators().RAW_decode(M3UA__Congestion__Indicators_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
if (decoded_field_length > 0 && (field_congestion__Indicators.ispresent() && field_congestion__Indicators().tag() ==  os_10)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[4] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_congestion__Indicators = OMIT_VALUE;
}
}
}
if (field_map[5] == 0 && (force_omit == NULL || !(*force_omit)(5))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_5_force_omit(5, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[5] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 1) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__SCON__MessageParameters::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);
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Affected__Point__Codes_descr_.raw);
  if (field_concerned__Destination.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__Concerned__Destination_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_congestion__Indicators.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__Congestion__Indicators_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_affected__Point__Codes.RAW_encode(M3UA__Affected__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  if (field_concerned__Destination.ispresent()) {
  encoded_length += field_concerned__Destination().RAW_encode(M3UA__Concerned__Destination_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_congestion__Indicators.ispresent()) {
  encoded_length += field_congestion__Indicators().RAW_encode(M3UA__Congestion__Indicators_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_affected__Point__Codes.tag() !=  os_2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_concerned__Destination.ispresent() && (!field_concerned__Destination.ispresent() || field_concerned__Destination().tag() !=  os_9)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_9.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_congestion__Indicators.ispresent() && (!field_congestion__Indicators.ispresent() || field_congestion__Indicators().tag() !=  os_10)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_10.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__SCON__MessageParameters_template::single_value_struct {
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Affected__Point__Codes_template field_affected__Point__Codes;
M3UA__Concerned__Destination_template field_concerned__Destination;
M3UA__Congestion__Indicators_template field_congestion__Indicators;
M3UA__Info__String_template field_info__String;
};

void M3UA__SCON__MessageParameters_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_network__Appearance = ANY_OR_OMIT;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_affected__Point__Codes = ANY_VALUE;
single_value->field_concerned__Destination = ANY_OR_OMIT;
single_value->field_congestion__Indicators = ANY_OR_OMIT;
single_value->field_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__SCON__MessageParameters_template::copy_value(const M3UA__SCON__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.affected__Point__Codes().is_bound()) {
  single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
  single_value->field_affected__Point__Codes.clean_up();
}
if (other_value.concerned__Destination().is_bound()) {
  if (other_value.concerned__Destination().ispresent()) single_value->field_concerned__Destination = other_value.concerned__Destination()();
  else single_value->field_concerned__Destination = OMIT_VALUE;
} else {
  single_value->field_concerned__Destination.clean_up();
}
if (other_value.congestion__Indicators().is_bound()) {
  if (other_value.congestion__Indicators().ispresent()) single_value->field_congestion__Indicators = other_value.congestion__Indicators()();
  else single_value->field_congestion__Indicators = OMIT_VALUE;
} else {
  single_value->field_congestion__Indicators.clean_up();
}
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__SCON__MessageParameters_template::copy_template(const M3UA__SCON__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.affected__Point__Codes().get_selection()) {
single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
single_value->field_affected__Point__Codes.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.concerned__Destination().get_selection()) {
single_value->field_concerned__Destination = other_value.concerned__Destination();
} else {
single_value->field_concerned__Destination.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.congestion__Indicators().get_selection()) {
single_value->field_congestion__Indicators = other_value.congestion__Indicators();
} else {
single_value->field_congestion__Indicators.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__SCON__MessageParameters_template[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 M3UA__SCON__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__SCON__MessageParameters_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 @M3UA_Types.M3UA_SCON_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__SCON__MessageParameters_template::M3UA__SCON__MessageParameters_template()
{
}

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

M3UA__SCON__MessageParameters_template::M3UA__SCON__MessageParameters_template(const M3UA__SCON__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__SCON__MessageParameters_template::match(const M3UA__SCON__MessageParameters& 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.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.affected__Point__Codes().is_bound()) return FALSE;
if(!single_value->field_affected__Point__Codes.match(other_value.affected__Point__Codes(), legacy))return FALSE;
if(!other_value.concerned__Destination().is_bound()) return FALSE;
if((other_value.concerned__Destination().ispresent() ? !single_value->field_concerned__Destination.match((const M3UA__Concerned__Destination&)other_value.concerned__Destination(), legacy) : !single_value->field_concerned__Destination.match_omit(legacy)))return FALSE;
if(!other_value.congestion__Indicators().is_bound()) return FALSE;
if((other_value.congestion__Indicators().ispresent() ? !single_value->field_congestion__Indicators.match((const M3UA__Congestion__Indicators&)other_value.congestion__Indicators(), legacy) : !single_value->field_congestion__Indicators.match_omit(legacy)))return FALSE;
if(!other_value.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_SCON_MessageParameters.");
}
return FALSE;
}

boolean M3UA__SCON__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || single_value->field_affected__Point__Codes.is_bound()
 || (single_value->field_concerned__Destination.is_omit() || single_value->field_concerned__Destination.is_bound())
 || (single_value->field_congestion__Indicators.is_omit() || single_value->field_congestion__Indicators.is_bound())
 || (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__SCON__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && single_value->field_affected__Point__Codes.is_value()
 && (single_value->field_concerned__Destination.is_omit() || single_value->field_concerned__Destination.is_value())
 && (single_value->field_congestion__Indicators.is_omit() || single_value->field_congestion__Indicators.is_value())
 && (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

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

M3UA__SCON__MessageParameters M3UA__SCON__MessageParameters_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 @M3UA_Types.M3UA_SCON_MessageParameters.");
M3UA__SCON__MessageParameters ret_val;
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_affected__Point__Codes.is_bound()) {
ret_val.affected__Point__Codes() = single_value->field_affected__Point__Codes.valueof();
}
if (single_value->field_concerned__Destination.is_omit()) ret_val.concerned__Destination() = OMIT_VALUE;
else if (single_value->field_concerned__Destination.is_bound()) {
ret_val.concerned__Destination() = single_value->field_concerned__Destination.valueof();
}
if (single_value->field_congestion__Indicators.is_omit()) ret_val.congestion__Indicators() = OMIT_VALUE;
else if (single_value->field_congestion__Indicators.is_bound()) {
ret_val.congestion__Indicators() = single_value->field_congestion__Indicators.valueof();
}
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__SCON__MessageParameters_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 @M3UA_Types.M3UA_SCON_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__SCON__MessageParameters_template[list_length];
}

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

M3UA__Network__Appearance_template& M3UA__SCON__MessageParameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__SCON__MessageParameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_SCON_MessageParameters.");
return single_value->field_network__Appearance;
}

M3UA__Routing__Context_template& M3UA__SCON__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__SCON__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_SCON_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Affected__Point__Codes_template& M3UA__SCON__MessageParameters_template::affected__Point__Codes()
{
set_specific();
return single_value->field_affected__Point__Codes;
}

const M3UA__Affected__Point__Codes_template& M3UA__SCON__MessageParameters_template::affected__Point__Codes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field affected_Point_Codes of a non-specific template of type @M3UA_Types.M3UA_SCON_MessageParameters.");
return single_value->field_affected__Point__Codes;
}

M3UA__Concerned__Destination_template& M3UA__SCON__MessageParameters_template::concerned__Destination()
{
set_specific();
return single_value->field_concerned__Destination;
}

const M3UA__Concerned__Destination_template& M3UA__SCON__MessageParameters_template::concerned__Destination() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field concerned_Destination of a non-specific template of type @M3UA_Types.M3UA_SCON_MessageParameters.");
return single_value->field_concerned__Destination;
}

M3UA__Congestion__Indicators_template& M3UA__SCON__MessageParameters_template::congestion__Indicators()
{
set_specific();
return single_value->field_congestion__Indicators;
}

const M3UA__Congestion__Indicators_template& M3UA__SCON__MessageParameters_template::congestion__Indicators() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field congestion_Indicators of a non-specific template of type @M3UA_Types.M3UA_SCON_MessageParameters.");
return single_value->field_congestion__Indicators;
}

M3UA__Info__String_template& M3UA__SCON__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__SCON__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_SCON_MessageParameters.");
return single_value->field_info__String;
}

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

void M3UA__SCON__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", concerned_Destination := ");
single_value->field_concerned__Destination.log();
TTCN_Logger::log_event_str(", congestion_Indicators := ");
single_value->field_congestion__Indicators.log();
TTCN_Logger::log_event_str(", info_String := ");
single_value->field_info__String.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 M3UA__SCON__MessageParameters_template::log_match(const M3UA__SCON__MessageParameters& 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 (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_affected__Point__Codes.match(match_value.affected__Point__Codes(), legacy)){
TTCN_Logger::log_logmatch_info(".affected_Point_Codes");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.concerned__Destination().ispresent()){
if(!single_value->field_concerned__Destination.match(match_value.concerned__Destination(), legacy)){
TTCN_Logger::log_logmatch_info(".concerned_Destination");
single_value->field_concerned__Destination.log_match(match_value.concerned__Destination(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_concerned__Destination.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".concerned_Destination := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_concerned__Destination.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.congestion__Indicators().ispresent()){
if(!single_value->field_congestion__Indicators.match(match_value.congestion__Indicators(), legacy)){
TTCN_Logger::log_logmatch_info(".congestion_Indicators");
single_value->field_congestion__Indicators.log_match(match_value.congestion__Indicators(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_congestion__Indicators.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".congestion_Indicators := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_congestion__Indicators.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::log_event_str(", concerned_Destination := ");
if (match_value.concerned__Destination().ispresent()) {
single_value->field_concerned__Destination.log_match(match_value.concerned__Destination(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_concerned__Destination.log();
if (single_value->field_concerned__Destination.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", congestion_Indicators := ");
if (match_value.congestion__Indicators().ispresent()) {
single_value->field_congestion__Indicators.log_match(match_value.congestion__Indicators(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_congestion__Indicators.log();
if (single_value->field_congestion__Indicators.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__SCON__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (!concerned__Destination().is_bound()) concerned__Destination() = OMIT_VALUE;
else concerned__Destination().set_implicit_omit();
if (!congestion__Indicators().is_bound()) congestion__Indicators() = OMIT_VALUE;
else congestion__Indicators().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__SCON__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_network__Appearance.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_affected__Point__Codes.encode_text(text_buf);
single_value->field_concerned__Destination.encode_text(text_buf);
single_value->field_congestion__Indicators.encode_text(text_buf);
single_value->field_info__String.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 @M3UA_Types.M3UA_SCON_MessageParameters.");
}
}

void M3UA__SCON__MessageParameters_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_network__Appearance.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_affected__Point__Codes.decode_text(text_buf);
single_value->field_concerned__Destination.decode_text(text_buf);
single_value->field_congestion__Indicators.decode_text(text_buf);
single_value->field_info__String.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 M3UA__SCON__MessageParameters_template[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 @M3UA_Types.M3UA_SCON_MessageParameters.");
}
}

void M3UA__SCON__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__SCON__MessageParameters_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("set template of type @M3UA_Types.M3UA_SCON_MessageParameters 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) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) concerned__Destination().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) congestion__Indicators().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) info__String().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(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "concerned_Destination")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          concerned__Destination().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "congestion_Indicators")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          congestion__Indicators().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_SCON_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__SCON__MessageParameters_template* precondition = new M3UA__SCON__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__SCON__MessageParameters_template* implied_template = new M3UA__SCON__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__SCON__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_SCON_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__SCON__MessageParameters_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_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON_MessageParameters");
single_value->field_affected__Point__Codes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON_MessageParameters");
single_value->field_concerned__Destination.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON_MessageParameters");
single_value->field_congestion__Indicators.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON_MessageParameters");
single_value->field_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON_MessageParameters");
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 : "@M3UA_Types.M3UA_SCON_MessageParameters");
}

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

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

M3UA__SCON::M3UA__SCON()
{
}

M3UA__SCON::M3UA__SCON(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__SCON__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__SCON::M3UA__SCON(const M3UA__SCON& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_SCON.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__SCON::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__SCON::get_descriptor() const { return &M3UA__SCON_descr_; }
M3UA__SCON& M3UA__SCON::operator=(const M3UA__SCON& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_SCON.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__SCON::operator==(const M3UA__SCON& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__SCON::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__SCON::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__SCON::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__SCON::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__SCON::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 @M3UA_Types.M3UA_SCON 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_SCON: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_SCON");
  }
}

void M3UA__SCON::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__SCON::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__SCON::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 M3UA__SCON::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 M3UA__SCON::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__SCON_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__SCON_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__SCON_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__SCON__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__SCON__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__SCON::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__SCON_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__SCON__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__SCON_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__SCON__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__SCON_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__SCON__MessageParameters_template field_messageParameters;
};

void M3UA__SCON_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__SCON_template::copy_value(const M3UA__SCON& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__SCON_template::copy_template(const M3UA__SCON_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__SCON_template[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 M3UA__SCON_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__SCON_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 @M3UA_Types.M3UA_SCON.");
break;
}
set_selection(other_value);
}

M3UA__SCON_template::M3UA__SCON_template()
{
}

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

M3UA__SCON_template::M3UA__SCON_template(const M3UA__SCON& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__SCON_template::match(const M3UA__SCON& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_SCON.");
}
return FALSE;
}

boolean M3UA__SCON_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__SCON_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__SCON M3UA__SCON_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 @M3UA_Types.M3UA_SCON.");
M3UA__SCON ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__SCON_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 @M3UA_Types.M3UA_SCON.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__SCON_template[list_length];
}

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

OCTETSTRING_template& M3UA__SCON_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__SCON_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_SCON.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__SCON_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__SCON_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_SCON.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__SCON_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__SCON_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_SCON.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__SCON_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__SCON_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_SCON.");
return single_value->field_messageLength;
}

M3UA__SCON__MessageParameters_template& M3UA__SCON_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__SCON__MessageParameters_template& M3UA__SCON_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_SCON.");
return single_value->field_messageParameters;
}

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

void M3UA__SCON_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__SCON_template::log_match(const M3UA__SCON& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__SCON_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__SCON_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_SCON.");
}
}

void M3UA__SCON_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__SCON_template[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 @M3UA_Types.M3UA_SCON.");
}
}

void M3UA__SCON_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: {
    M3UA__SCON_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 @M3UA_Types.M3UA_SCON 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_SCON: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__SCON_template* precondition = new M3UA__SCON_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__SCON_template* implied_template = new M3UA__SCON_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__SCON_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_SCON");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__SCON_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_SCON");
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 : "@M3UA_Types.M3UA_SCON");
}

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

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

M3UA__DUPU__MessageParameters::M3UA__DUPU__MessageParameters()
{
}

M3UA__DUPU__MessageParameters::M3UA__DUPU__MessageParameters(const OPTIONAL< M3UA__Network__Appearance >& par_network__Appearance,
    const OPTIONAL< M3UA__Routing__Context >& par_routing__Context,
    const M3UA__Affected__Point__Codes& par_affected__Point__Codes,
    const M3UA__User__Cause& par_user__Cause,
    const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_network__Appearance(par_network__Appearance),
  field_routing__Context(par_routing__Context),
  field_affected__Point__Codes(par_affected__Point__Codes),
  field_user__Cause(par_user__Cause),
  field_info__String(par_info__String)
{
}

M3UA__DUPU__MessageParameters::M3UA__DUPU__MessageParameters(const M3UA__DUPU__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DUPU_MessageParameters.");
if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
else field_network__Appearance.clean_up();
if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
else field_routing__Context.clean_up();
if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
else field_affected__Point__Codes.clean_up();
if (other_value.user__Cause().is_bound()) field_user__Cause = other_value.user__Cause();
else field_user__Cause.clean_up();
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__DUPU__MessageParameters::clean_up()
{
field_network__Appearance.clean_up();
field_routing__Context.clean_up();
field_affected__Point__Codes.clean_up();
field_user__Cause.clean_up();
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DUPU__MessageParameters::get_descriptor() const { return &M3UA__DUPU__MessageParameters_descr_; }
M3UA__DUPU__MessageParameters& M3UA__DUPU__MessageParameters::operator=(const M3UA__DUPU__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DUPU_MessageParameters.");
  if (other_value.network__Appearance().is_bound()) field_network__Appearance = other_value.network__Appearance();
  else field_network__Appearance.clean_up();
  if (other_value.routing__Context().is_bound()) field_routing__Context = other_value.routing__Context();
  else field_routing__Context.clean_up();
  if (other_value.affected__Point__Codes().is_bound()) field_affected__Point__Codes = other_value.affected__Point__Codes();
  else field_affected__Point__Codes.clean_up();
  if (other_value.user__Cause().is_bound()) field_user__Cause = other_value.user__Cause();
  else field_user__Cause.clean_up();
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__DUPU__MessageParameters::operator==(const M3UA__DUPU__MessageParameters& other_value) const
{
return field_network__Appearance==other_value.field_network__Appearance
  && field_routing__Context==other_value.field_routing__Context
  && field_affected__Point__Codes==other_value.field_affected__Point__Codes
  && field_user__Cause==other_value.field_user__Cause
  && field_info__String==other_value.field_info__String;
}

boolean M3UA__DUPU__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_bound())
  || (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_bound())
  || (field_affected__Point__Codes.is_bound())
  || (field_user__Cause.is_bound())
  || (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__DUPU__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_network__Appearance.get_selection() || field_network__Appearance.is_value())
  && (OPTIONAL_OMIT == field_routing__Context.get_selection() || field_routing__Context.is_value())
  && field_affected__Point__Codes.is_value()
  && field_user__Cause.is_value()
  && (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__DUPU__MessageParameters::size_of() const
{
  int ret_val = 2;
  if (field_network__Appearance.ispresent()) ret_val++;
  if (field_routing__Context.ispresent()) ret_val++;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__DUPU__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ network_Appearance := ");
field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", user_Cause := ");
field_user__Cause.log();
TTCN_Logger::log_event_str(", info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DUPU__MessageParameters::set_implicit_omit()
{
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (user__Cause().is_bound()) user__Cause().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DUPU__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_DUPU_MessageParameters 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) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__Cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) info__String().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(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUPU_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_DUPU_MessageParameters");
  }
}

void M3UA__DUPU__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_network__Appearance.encode_text(text_buf);
field_routing__Context.encode_text(text_buf);
field_affected__Point__Codes.encode_text(text_buf);
field_user__Cause.encode_text(text_buf);
field_info__String.encode_text(text_buf);
}

void M3UA__DUPU__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_network__Appearance.decode_text(text_buf);
field_routing__Context.decode_text(text_buf);
field_affected__Point__Codes.decode_text(text_buf);
field_user__Cause.decode_text(text_buf);
field_info__String.decode_text(text_buf);
}

void M3UA__DUPU__MessageParameters::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 M3UA__DUPU__MessageParameters::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 M3UA__DUPU__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[5];
memset(field_map, 0, sizeof(field_map));
size_t nof_mand_fields = 0;
field_network__Appearance = OMIT_VALUE;
field_routing__Context = OMIT_VALUE;
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Network__Appearance_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_3) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Network__Appearance_descr_.raw->forceomit);
int decoded_field_length = field_network__Appearance().RAW_decode(M3UA__Network__Appearance_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_network__Appearance.ispresent() && field_network__Appearance().tag() ==  os_3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_network__Appearance = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Routing__Context_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_1) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Routing__Context_descr_.raw->forceomit);
int decoded_field_length = field_routing__Context().RAW_decode(M3UA__Routing__Context_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_routing__Context.ispresent() && field_routing__Context().tag() ==  os_1)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_routing__Context = OMIT_VALUE;
}
}
}
if (field_map[2] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Affected__Point__Codes_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_2) {
RAW_Force_Omit field_2_force_omit(2, force_omit, M3UA__Affected__Point__Codes_descr_.raw->forceomit);
int decoded_field_length = field_affected__Point__Codes.RAW_decode(M3UA__Affected__Point__Codes_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length >= 0 && (field_affected__Point__Codes.tag() ==  os_2)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[3] == 0) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__User__Cause_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__User__Cause_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_11) {
RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__User__Cause_descr_.raw->forceomit);
int decoded_field_length = field_user__Cause.RAW_decode(M3UA__User__Cause_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length >= 0 && (field_user__Cause.tag() ==  os_11)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
nof_mand_fields++;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
}
}
}
if (field_map[4] == 0 && (force_omit == NULL || !(*force_omit)(4))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[4] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
if (nof_mand_fields != 2) return limit ? -1 : -TTCN_EncDec::ET_INCOMPL_MSG;
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__DUPU__MessageParameters::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);
  if (field_network__Appearance.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Network__Appearance_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_routing__Context.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Routing__Context_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, M3UA__Affected__Point__Codes_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__User__Cause_descr_.raw);
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_network__Appearance.ispresent()) {
  encoded_length += field_network__Appearance().RAW_encode(M3UA__Network__Appearance_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_routing__Context.ispresent()) {
  encoded_length += field_routing__Context().RAW_encode(M3UA__Routing__Context_descr_, *myleaf.body.node.nodes[1]);
  }
  encoded_length += field_affected__Point__Codes.RAW_encode(M3UA__Affected__Point__Codes_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_user__Cause.RAW_encode(M3UA__User__Cause_descr_, *myleaf.body.node.nodes[3]);
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_network__Appearance.ispresent() && (!field_network__Appearance.ispresent() || field_network__Appearance().tag() !=  os_3)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_3.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_routing__Context.ispresent() && (!field_routing__Context.ispresent() || field_routing__Context().tag() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_affected__Point__Codes.tag() !=  os_2) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_2.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_user__Cause.tag() !=  os_11) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_11.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__DUPU__MessageParameters_template::single_value_struct {
M3UA__Network__Appearance_template field_network__Appearance;
M3UA__Routing__Context_template field_routing__Context;
M3UA__Affected__Point__Codes_template field_affected__Point__Codes;
M3UA__User__Cause_template field_user__Cause;
M3UA__Info__String_template field_info__String;
};

void M3UA__DUPU__MessageParameters_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_network__Appearance = ANY_OR_OMIT;
single_value->field_routing__Context = ANY_OR_OMIT;
single_value->field_affected__Point__Codes = ANY_VALUE;
single_value->field_user__Cause = ANY_VALUE;
single_value->field_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__DUPU__MessageParameters_template::copy_value(const M3UA__DUPU__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.network__Appearance().is_bound()) {
  if (other_value.network__Appearance().ispresent()) single_value->field_network__Appearance = other_value.network__Appearance()();
  else single_value->field_network__Appearance = OMIT_VALUE;
} else {
  single_value->field_network__Appearance.clean_up();
}
if (other_value.routing__Context().is_bound()) {
  if (other_value.routing__Context().ispresent()) single_value->field_routing__Context = other_value.routing__Context()();
  else single_value->field_routing__Context = OMIT_VALUE;
} else {
  single_value->field_routing__Context.clean_up();
}
if (other_value.affected__Point__Codes().is_bound()) {
  single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
  single_value->field_affected__Point__Codes.clean_up();
}
if (other_value.user__Cause().is_bound()) {
  single_value->field_user__Cause = other_value.user__Cause();
} else {
  single_value->field_user__Cause.clean_up();
}
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DUPU__MessageParameters_template::copy_template(const M3UA__DUPU__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.network__Appearance().get_selection()) {
single_value->field_network__Appearance = other_value.network__Appearance();
} else {
single_value->field_network__Appearance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routing__Context().get_selection()) {
single_value->field_routing__Context = other_value.routing__Context();
} else {
single_value->field_routing__Context.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.affected__Point__Codes().get_selection()) {
single_value->field_affected__Point__Codes = other_value.affected__Point__Codes();
} else {
single_value->field_affected__Point__Codes.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.user__Cause().get_selection()) {
single_value->field_user__Cause = other_value.user__Cause();
} else {
single_value->field_user__Cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__DUPU__MessageParameters_template[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 M3UA__DUPU__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DUPU__MessageParameters_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 @M3UA_Types.M3UA_DUPU_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__DUPU__MessageParameters_template::M3UA__DUPU__MessageParameters_template()
{
}

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

M3UA__DUPU__MessageParameters_template::M3UA__DUPU__MessageParameters_template(const M3UA__DUPU__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DUPU__MessageParameters_template::match(const M3UA__DUPU__MessageParameters& 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.network__Appearance().is_bound()) return FALSE;
if((other_value.network__Appearance().ispresent() ? !single_value->field_network__Appearance.match((const M3UA__Network__Appearance&)other_value.network__Appearance(), legacy) : !single_value->field_network__Appearance.match_omit(legacy)))return FALSE;
if(!other_value.routing__Context().is_bound()) return FALSE;
if((other_value.routing__Context().ispresent() ? !single_value->field_routing__Context.match((const M3UA__Routing__Context&)other_value.routing__Context(), legacy) : !single_value->field_routing__Context.match_omit(legacy)))return FALSE;
if(!other_value.affected__Point__Codes().is_bound()) return FALSE;
if(!single_value->field_affected__Point__Codes.match(other_value.affected__Point__Codes(), legacy))return FALSE;
if(!other_value.user__Cause().is_bound()) return FALSE;
if(!single_value->field_user__Cause.match(other_value.user__Cause(), legacy))return FALSE;
if(!other_value.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_DUPU_MessageParameters.");
}
return FALSE;
}

boolean M3UA__DUPU__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_bound())
 || (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_bound())
 || single_value->field_affected__Point__Codes.is_bound()
 || single_value->field_user__Cause.is_bound()
 || (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__DUPU__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_network__Appearance.is_omit() || single_value->field_network__Appearance.is_value())
 && (single_value->field_routing__Context.is_omit() || single_value->field_routing__Context.is_value())
 && single_value->field_affected__Point__Codes.is_value()
 && single_value->field_user__Cause.is_value()
 && (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

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

M3UA__DUPU__MessageParameters M3UA__DUPU__MessageParameters_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 @M3UA_Types.M3UA_DUPU_MessageParameters.");
M3UA__DUPU__MessageParameters ret_val;
if (single_value->field_network__Appearance.is_omit()) ret_val.network__Appearance() = OMIT_VALUE;
else if (single_value->field_network__Appearance.is_bound()) {
ret_val.network__Appearance() = single_value->field_network__Appearance.valueof();
}
if (single_value->field_routing__Context.is_omit()) ret_val.routing__Context() = OMIT_VALUE;
else if (single_value->field_routing__Context.is_bound()) {
ret_val.routing__Context() = single_value->field_routing__Context.valueof();
}
if (single_value->field_affected__Point__Codes.is_bound()) {
ret_val.affected__Point__Codes() = single_value->field_affected__Point__Codes.valueof();
}
if (single_value->field_user__Cause.is_bound()) {
ret_val.user__Cause() = single_value->field_user__Cause.valueof();
}
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__DUPU__MessageParameters_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 @M3UA_Types.M3UA_DUPU_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DUPU__MessageParameters_template[list_length];
}

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

M3UA__Network__Appearance_template& M3UA__DUPU__MessageParameters_template::network__Appearance()
{
set_specific();
return single_value->field_network__Appearance;
}

const M3UA__Network__Appearance_template& M3UA__DUPU__MessageParameters_template::network__Appearance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field network_Appearance of a non-specific template of type @M3UA_Types.M3UA_DUPU_MessageParameters.");
return single_value->field_network__Appearance;
}

M3UA__Routing__Context_template& M3UA__DUPU__MessageParameters_template::routing__Context()
{
set_specific();
return single_value->field_routing__Context;
}

const M3UA__Routing__Context_template& M3UA__DUPU__MessageParameters_template::routing__Context() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routing_Context of a non-specific template of type @M3UA_Types.M3UA_DUPU_MessageParameters.");
return single_value->field_routing__Context;
}

M3UA__Affected__Point__Codes_template& M3UA__DUPU__MessageParameters_template::affected__Point__Codes()
{
set_specific();
return single_value->field_affected__Point__Codes;
}

const M3UA__Affected__Point__Codes_template& M3UA__DUPU__MessageParameters_template::affected__Point__Codes() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field affected_Point_Codes of a non-specific template of type @M3UA_Types.M3UA_DUPU_MessageParameters.");
return single_value->field_affected__Point__Codes;
}

M3UA__User__Cause_template& M3UA__DUPU__MessageParameters_template::user__Cause()
{
set_specific();
return single_value->field_user__Cause;
}

const M3UA__User__Cause_template& M3UA__DUPU__MessageParameters_template::user__Cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field user_Cause of a non-specific template of type @M3UA_Types.M3UA_DUPU_MessageParameters.");
return single_value->field_user__Cause;
}

M3UA__Info__String_template& M3UA__DUPU__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__DUPU__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_DUPU_MessageParameters.");
return single_value->field_info__String;
}

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

void M3UA__DUPU__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ network_Appearance := ");
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(", routing_Context := ");
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log();
TTCN_Logger::log_event_str(", user_Cause := ");
single_value->field_user__Cause.log();
TTCN_Logger::log_event_str(", info_String := ");
single_value->field_info__String.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 M3UA__DUPU__MessageParameters_template::log_match(const M3UA__DUPU__MessageParameters& 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 (match_value.network__Appearance().ispresent()){
if(!single_value->field_network__Appearance.match(match_value.network__Appearance(), legacy)){
TTCN_Logger::log_logmatch_info(".network_Appearance");
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_network__Appearance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".network_Appearance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_network__Appearance.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routing__Context().ispresent()){
if(!single_value->field_routing__Context.match(match_value.routing__Context(), legacy)){
TTCN_Logger::log_logmatch_info(".routing_Context");
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routing__Context.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routing_Context := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routing__Context.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_affected__Point__Codes.match(match_value.affected__Point__Codes(), legacy)){
TTCN_Logger::log_logmatch_info(".affected_Point_Codes");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_user__Cause.match(match_value.user__Cause(), legacy)){
TTCN_Logger::log_logmatch_info(".user_Cause");
single_value->field_user__Cause.log_match(match_value.user__Cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ network_Appearance := ");
if (match_value.network__Appearance().ispresent()) {
single_value->field_network__Appearance.log_match(match_value.network__Appearance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_network__Appearance.log();
if (single_value->field_network__Appearance.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routing_Context := ");
if (match_value.routing__Context().ispresent()) {
single_value->field_routing__Context.log_match(match_value.routing__Context(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routing__Context.log();
if (single_value->field_routing__Context.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", affected_Point_Codes := ");
single_value->field_affected__Point__Codes.log_match(match_value.affected__Point__Codes(), legacy);
TTCN_Logger::log_event_str(", user_Cause := ");
single_value->field_user__Cause.log_match(match_value.user__Cause(), legacy);
TTCN_Logger::log_event_str(", info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__DUPU__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!network__Appearance().is_bound()) network__Appearance() = OMIT_VALUE;
else network__Appearance().set_implicit_omit();
if (!routing__Context().is_bound()) routing__Context() = OMIT_VALUE;
else routing__Context().set_implicit_omit();
if (affected__Point__Codes().is_bound()) affected__Point__Codes().set_implicit_omit();
if (user__Cause().is_bound()) user__Cause().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__DUPU__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_network__Appearance.encode_text(text_buf);
single_value->field_routing__Context.encode_text(text_buf);
single_value->field_affected__Point__Codes.encode_text(text_buf);
single_value->field_user__Cause.encode_text(text_buf);
single_value->field_info__String.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 @M3UA_Types.M3UA_DUPU_MessageParameters.");
}
}

void M3UA__DUPU__MessageParameters_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_network__Appearance.decode_text(text_buf);
single_value->field_routing__Context.decode_text(text_buf);
single_value->field_affected__Point__Codes.decode_text(text_buf);
single_value->field_user__Cause.decode_text(text_buf);
single_value->field_info__String.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 M3UA__DUPU__MessageParameters_template[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 @M3UA_Types.M3UA_DUPU_MessageParameters.");
}
}

void M3UA__DUPU__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__DUPU__MessageParameters_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("set template of type @M3UA_Types.M3UA_DUPU_MessageParameters 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) network__Appearance().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) routing__Context().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) affected__Point__Codes().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) user__Cause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) info__String().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(), "network_Appearance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          network__Appearance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routing_Context")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routing__Context().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "affected_Point_Codes")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          affected__Point__Codes().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "user_Cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          user__Cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUPU_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DUPU__MessageParameters_template* precondition = new M3UA__DUPU__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DUPU__MessageParameters_template* implied_template = new M3UA__DUPU__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DUPU__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_DUPU_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DUPU__MessageParameters_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_network__Appearance.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU_MessageParameters");
single_value->field_routing__Context.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU_MessageParameters");
single_value->field_affected__Point__Codes.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU_MessageParameters");
single_value->field_user__Cause.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU_MessageParameters");
single_value->field_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU_MessageParameters");
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 : "@M3UA_Types.M3UA_DUPU_MessageParameters");
}

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

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

M3UA__DUPU::M3UA__DUPU()
{
}

M3UA__DUPU::M3UA__DUPU(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__DUPU__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__DUPU::M3UA__DUPU(const M3UA__DUPU& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DUPU.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__DUPU::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DUPU::get_descriptor() const { return &M3UA__DUPU_descr_; }
M3UA__DUPU& M3UA__DUPU::operator=(const M3UA__DUPU& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DUPU.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__DUPU::operator==(const M3UA__DUPU& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__DUPU::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__DUPU::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__DUPU::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DUPU::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DUPU::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 @M3UA_Types.M3UA_DUPU 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUPU: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_DUPU");
  }
}

void M3UA__DUPU::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__DUPU::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__DUPU::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 M3UA__DUPU::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 M3UA__DUPU::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__DUPU_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__DUPU_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__DUPU_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__DUPU__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__DUPU__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__DUPU::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__DUPU_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__DUPU__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__DUPU_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__DUPU__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__DUPU_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__DUPU__MessageParameters_template field_messageParameters;
};

void M3UA__DUPU_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__DUPU_template::copy_value(const M3UA__DUPU& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DUPU_template::copy_template(const M3UA__DUPU_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__DUPU_template[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 M3UA__DUPU_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DUPU_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 @M3UA_Types.M3UA_DUPU.");
break;
}
set_selection(other_value);
}

M3UA__DUPU_template::M3UA__DUPU_template()
{
}

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

M3UA__DUPU_template::M3UA__DUPU_template(const M3UA__DUPU& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DUPU_template::match(const M3UA__DUPU& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_DUPU.");
}
return FALSE;
}

boolean M3UA__DUPU_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__DUPU_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__DUPU M3UA__DUPU_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 @M3UA_Types.M3UA_DUPU.");
M3UA__DUPU ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__DUPU_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 @M3UA_Types.M3UA_DUPU.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DUPU_template[list_length];
}

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

OCTETSTRING_template& M3UA__DUPU_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__DUPU_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_DUPU.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__DUPU_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__DUPU_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_DUPU.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__DUPU_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__DUPU_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_DUPU.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__DUPU_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__DUPU_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_DUPU.");
return single_value->field_messageLength;
}

M3UA__DUPU__MessageParameters_template& M3UA__DUPU_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__DUPU__MessageParameters_template& M3UA__DUPU_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_DUPU.");
return single_value->field_messageParameters;
}

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

void M3UA__DUPU_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__DUPU_template::log_match(const M3UA__DUPU& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__DUPU_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DUPU_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_DUPU.");
}
}

void M3UA__DUPU_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__DUPU_template[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 @M3UA_Types.M3UA_DUPU.");
}
}

void M3UA__DUPU_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: {
    M3UA__DUPU_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 @M3UA_Types.M3UA_DUPU 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DUPU: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DUPU_template* precondition = new M3UA__DUPU_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DUPU_template* implied_template = new M3UA__DUPU_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DUPU_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_DUPU");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DUPU_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DUPU");
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 : "@M3UA_Types.M3UA_DUPU");
}

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

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

M3UA__DRST::M3UA__DRST()
{
}

M3UA__DRST::M3UA__DRST(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const OCTETSTRING& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__DRST::M3UA__DRST(const M3UA__DRST& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_DRST.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__DRST::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__DRST::get_descriptor() const { return &M3UA__DRST_descr_; }
M3UA__DRST& M3UA__DRST::operator=(const M3UA__DRST& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_DRST.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__DRST::operator==(const M3UA__DRST& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__DRST::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__DRST::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__DRST::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__DRST::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DRST::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 @M3UA_Types.M3UA_DRST 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DRST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_DRST");
  }
}

void M3UA__DRST::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__DRST::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__DRST::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 M3UA__DRST::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 M3UA__DRST::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__DRST_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__DRST_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__DRST_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__DRST::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__DRST_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, OCTETSTRING_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__DRST_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__DRST_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
OCTETSTRING_template field_messageParameters;
};

void M3UA__DRST_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__DRST_template::copy_value(const M3UA__DRST& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__DRST_template::copy_template(const M3UA__DRST_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__DRST_template[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 M3UA__DRST_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__DRST_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 @M3UA_Types.M3UA_DRST.");
break;
}
set_selection(other_value);
}

M3UA__DRST_template::M3UA__DRST_template()
{
}

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

M3UA__DRST_template::M3UA__DRST_template(const M3UA__DRST& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__DRST_template::match(const M3UA__DRST& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_DRST.");
}
return FALSE;
}

boolean M3UA__DRST_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__DRST_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__DRST M3UA__DRST_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 @M3UA_Types.M3UA_DRST.");
M3UA__DRST ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__DRST_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 @M3UA_Types.M3UA_DRST.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__DRST_template[list_length];
}

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

OCTETSTRING_template& M3UA__DRST_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__DRST_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_DRST.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__DRST_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__DRST_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_DRST.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__DRST_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__DRST_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_DRST.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__DRST_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__DRST_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_DRST.");
return single_value->field_messageLength;
}

OCTETSTRING_template& M3UA__DRST_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const OCTETSTRING_template& M3UA__DRST_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_DRST.");
return single_value->field_messageParameters;
}

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

void M3UA__DRST_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__DRST_template::log_match(const M3UA__DRST& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__DRST_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__DRST_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_DRST.");
}
}

void M3UA__DRST_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__DRST_template[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 @M3UA_Types.M3UA_DRST.");
}
}

void M3UA__DRST_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: {
    M3UA__DRST_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 @M3UA_Types.M3UA_DRST 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_DRST: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__DRST_template* precondition = new M3UA__DRST_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__DRST_template* implied_template = new M3UA__DRST_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__DRST_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_DRST");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__DRST_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DRST");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DRST");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DRST");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DRST");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_DRST");
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 : "@M3UA_Types.M3UA_DRST");
}

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

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

M3UA__ASPUP__MessageParameters::M3UA__ASPUP__MessageParameters()
{
}

M3UA__ASPUP__MessageParameters::M3UA__ASPUP__MessageParameters(const OPTIONAL< M3UA__ASP__Identifier >& par_aSP__Identifier,
    const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_aSP__Identifier(par_aSP__Identifier),
  field_info__String(par_info__String)
{
}

M3UA__ASPUP__MessageParameters::M3UA__ASPUP__MessageParameters(const M3UA__ASPUP__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ASPUP_MessageParameters.");
if (other_value.aSP__Identifier().is_bound()) field_aSP__Identifier = other_value.aSP__Identifier();
else field_aSP__Identifier.clean_up();
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__ASPUP__MessageParameters::clean_up()
{
field_aSP__Identifier.clean_up();
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ASPUP__MessageParameters::get_descriptor() const { return &M3UA__ASPUP__MessageParameters_descr_; }
M3UA__ASPUP__MessageParameters& M3UA__ASPUP__MessageParameters::operator=(const M3UA__ASPUP__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ASPUP_MessageParameters.");
  if (other_value.aSP__Identifier().is_bound()) field_aSP__Identifier = other_value.aSP__Identifier();
  else field_aSP__Identifier.clean_up();
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__ASPUP__MessageParameters::operator==(const M3UA__ASPUP__MessageParameters& other_value) const
{
return field_aSP__Identifier==other_value.field_aSP__Identifier
  && field_info__String==other_value.field_info__String;
}

boolean M3UA__ASPUP__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_aSP__Identifier.get_selection() || field_aSP__Identifier.is_bound())
  || (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__ASPUP__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_aSP__Identifier.get_selection() || field_aSP__Identifier.is_value())
  && (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__ASPUP__MessageParameters::size_of() const
{
  int ret_val = 0;
  if (field_aSP__Identifier.ispresent()) ret_val++;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__ASPUP__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ aSP_Identifier := ");
field_aSP__Identifier.log();
TTCN_Logger::log_event_str(", info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ASPUP__MessageParameters::set_implicit_omit()
{
if (!aSP__Identifier().is_bound()) aSP__Identifier() = OMIT_VALUE;
else aSP__Identifier().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__ASPUP__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_ASPUP_MessageParameters 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) aSP__Identifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) info__String().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(), "aSP_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aSP__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_ASPUP_MessageParameters");
  }
}

void M3UA__ASPUP__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_aSP__Identifier.encode_text(text_buf);
field_info__String.encode_text(text_buf);
}

void M3UA__ASPUP__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_aSP__Identifier.decode_text(text_buf);
field_info__String.decode_text(text_buf);
}

void M3UA__ASPUP__MessageParameters::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 M3UA__ASPUP__MessageParameters::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 M3UA__ASPUP__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[2];
memset(field_map, 0, sizeof(field_map));
field_aSP__Identifier = OMIT_VALUE;
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__ASP__Identifier_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__ASP__Identifier_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_5) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__ASP__Identifier_descr_.raw->forceomit);
int decoded_field_length = field_aSP__Identifier().RAW_decode(M3UA__ASP__Identifier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_aSP__Identifier.ispresent() && field_aSP__Identifier().tag() ==  os_5)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_aSP__Identifier = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_1_force_omit(1, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__ASPUP__MessageParameters::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);
  if (field_aSP__Identifier.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__ASP__Identifier_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_aSP__Identifier.ispresent()) {
  encoded_length += field_aSP__Identifier().RAW_encode(M3UA__ASP__Identifier_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_aSP__Identifier.ispresent() && (!field_aSP__Identifier.ispresent() || field_aSP__Identifier().tag() !=  os_5)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_5.RAW_encode(General__Types::OCT2_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={1,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__ASPUP__MessageParameters_template::single_value_struct {
M3UA__ASP__Identifier_template field_aSP__Identifier;
M3UA__Info__String_template field_info__String;
};

void M3UA__ASPUP__MessageParameters_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_aSP__Identifier = ANY_OR_OMIT;
single_value->field_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__ASPUP__MessageParameters_template::copy_value(const M3UA__ASPUP__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.aSP__Identifier().is_bound()) {
  if (other_value.aSP__Identifier().ispresent()) single_value->field_aSP__Identifier = other_value.aSP__Identifier()();
  else single_value->field_aSP__Identifier = OMIT_VALUE;
} else {
  single_value->field_aSP__Identifier.clean_up();
}
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ASPUP__MessageParameters_template::copy_template(const M3UA__ASPUP__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.aSP__Identifier().get_selection()) {
single_value->field_aSP__Identifier = other_value.aSP__Identifier();
} else {
single_value->field_aSP__Identifier.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__ASPUP__MessageParameters_template[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 M3UA__ASPUP__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ASPUP__MessageParameters_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 @M3UA_Types.M3UA_ASPUP_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__ASPUP__MessageParameters_template::M3UA__ASPUP__MessageParameters_template()
{
}

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

M3UA__ASPUP__MessageParameters_template::M3UA__ASPUP__MessageParameters_template(const M3UA__ASPUP__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__ASPUP__MessageParameters_template::match(const M3UA__ASPUP__MessageParameters& 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.aSP__Identifier().is_bound()) return FALSE;
if((other_value.aSP__Identifier().ispresent() ? !single_value->field_aSP__Identifier.match((const M3UA__ASP__Identifier&)other_value.aSP__Identifier(), legacy) : !single_value->field_aSP__Identifier.match_omit(legacy)))return FALSE;
if(!other_value.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_ASPUP_MessageParameters.");
}
return FALSE;
}

boolean M3UA__ASPUP__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_aSP__Identifier.is_omit() || single_value->field_aSP__Identifier.is_bound())
 || (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

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

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

M3UA__ASPUP__MessageParameters M3UA__ASPUP__MessageParameters_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 @M3UA_Types.M3UA_ASPUP_MessageParameters.");
M3UA__ASPUP__MessageParameters ret_val;
if (single_value->field_aSP__Identifier.is_omit()) ret_val.aSP__Identifier() = OMIT_VALUE;
else if (single_value->field_aSP__Identifier.is_bound()) {
ret_val.aSP__Identifier() = single_value->field_aSP__Identifier.valueof();
}
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__ASPUP__MessageParameters_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 @M3UA_Types.M3UA_ASPUP_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ASPUP__MessageParameters_template[list_length];
}

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

M3UA__ASP__Identifier_template& M3UA__ASPUP__MessageParameters_template::aSP__Identifier()
{
set_specific();
return single_value->field_aSP__Identifier;
}

const M3UA__ASP__Identifier_template& M3UA__ASPUP__MessageParameters_template::aSP__Identifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field aSP_Identifier of a non-specific template of type @M3UA_Types.M3UA_ASPUP_MessageParameters.");
return single_value->field_aSP__Identifier;
}

M3UA__Info__String_template& M3UA__ASPUP__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__ASPUP__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_ASPUP_MessageParameters.");
return single_value->field_info__String;
}

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

void M3UA__ASPUP__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ aSP_Identifier := ");
single_value->field_aSP__Identifier.log();
TTCN_Logger::log_event_str(", info_String := ");
single_value->field_info__String.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 M3UA__ASPUP__MessageParameters_template::log_match(const M3UA__ASPUP__MessageParameters& 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 (match_value.aSP__Identifier().ispresent()){
if(!single_value->field_aSP__Identifier.match(match_value.aSP__Identifier(), legacy)){
TTCN_Logger::log_logmatch_info(".aSP_Identifier");
single_value->field_aSP__Identifier.log_match(match_value.aSP__Identifier(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_aSP__Identifier.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".aSP_Identifier := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_aSP__Identifier.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ aSP_Identifier := ");
if (match_value.aSP__Identifier().ispresent()) {
single_value->field_aSP__Identifier.log_match(match_value.aSP__Identifier(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_aSP__Identifier.log();
if (single_value->field_aSP__Identifier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__ASPUP__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!aSP__Identifier().is_bound()) aSP__Identifier() = OMIT_VALUE;
else aSP__Identifier().set_implicit_omit();
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__ASPUP__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_aSP__Identifier.encode_text(text_buf);
single_value->field_info__String.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 @M3UA_Types.M3UA_ASPUP_MessageParameters.");
}
}

void M3UA__ASPUP__MessageParameters_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_aSP__Identifier.decode_text(text_buf);
single_value->field_info__String.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 M3UA__ASPUP__MessageParameters_template[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 @M3UA_Types.M3UA_ASPUP_MessageParameters.");
}
}

void M3UA__ASPUP__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__ASPUP__MessageParameters_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("set template of type @M3UA_Types.M3UA_ASPUP_MessageParameters 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) aSP__Identifier().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) info__String().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(), "aSP_Identifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          aSP__Identifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ASPUP__MessageParameters_template* precondition = new M3UA__ASPUP__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ASPUP__MessageParameters_template* implied_template = new M3UA__ASPUP__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ASPUP__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_ASPUP_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ASPUP__MessageParameters_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_aSP__Identifier.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_MessageParameters");
single_value->field_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_MessageParameters");
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 : "@M3UA_Types.M3UA_ASPUP_MessageParameters");
}

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

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

M3UA__ASPUP::M3UA__ASPUP()
{
}

M3UA__ASPUP::M3UA__ASPUP(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__ASPUP__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__ASPUP::M3UA__ASPUP(const M3UA__ASPUP& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ASPUP.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__ASPUP::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ASPUP::get_descriptor() const { return &M3UA__ASPUP_descr_; }
M3UA__ASPUP& M3UA__ASPUP::operator=(const M3UA__ASPUP& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ASPUP.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__ASPUP::operator==(const M3UA__ASPUP& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__ASPUP::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__ASPUP::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__ASPUP::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ASPUP::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ASPUP::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 @M3UA_Types.M3UA_ASPUP 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_ASPUP");
  }
}

void M3UA__ASPUP::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__ASPUP::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__ASPUP::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 M3UA__ASPUP::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 M3UA__ASPUP::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__ASPUP_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__ASPUP_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__ASPUP_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__ASPUP__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__ASPUP__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__ASPUP::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__ASPUP_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__ASPUP__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__ASPUP_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__ASPUP__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__ASPUP_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__ASPUP__MessageParameters_template field_messageParameters;
};

void M3UA__ASPUP_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__ASPUP_template::copy_value(const M3UA__ASPUP& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ASPUP_template::copy_template(const M3UA__ASPUP_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__ASPUP_template[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 M3UA__ASPUP_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ASPUP_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 @M3UA_Types.M3UA_ASPUP.");
break;
}
set_selection(other_value);
}

M3UA__ASPUP_template::M3UA__ASPUP_template()
{
}

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

M3UA__ASPUP_template::M3UA__ASPUP_template(const M3UA__ASPUP& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean M3UA__ASPUP_template::match(const M3UA__ASPUP& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_ASPUP.");
}
return FALSE;
}

boolean M3UA__ASPUP_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__ASPUP_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

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

M3UA__ASPUP M3UA__ASPUP_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 @M3UA_Types.M3UA_ASPUP.");
M3UA__ASPUP ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__ASPUP_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 @M3UA_Types.M3UA_ASPUP.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ASPUP_template[list_length];
}

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

OCTETSTRING_template& M3UA__ASPUP_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__ASPUP_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_ASPUP.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__ASPUP_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__ASPUP_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_ASPUP.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__ASPUP_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__ASPUP_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_ASPUP.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__ASPUP_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__ASPUP_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_ASPUP.");
return single_value->field_messageLength;
}

M3UA__ASPUP__MessageParameters_template& M3UA__ASPUP_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__ASPUP__MessageParameters_template& M3UA__ASPUP_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_ASPUP.");
return single_value->field_messageParameters;
}

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

void M3UA__ASPUP_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__ASPUP_template::log_match(const M3UA__ASPUP& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__ASPUP_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ASPUP_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_ASPUP.");
}
}

void M3UA__ASPUP_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__ASPUP_template[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 @M3UA_Types.M3UA_ASPUP.");
}
}

void M3UA__ASPUP_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: {
    M3UA__ASPUP_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 @M3UA_Types.M3UA_ASPUP 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ASPUP_template* precondition = new M3UA__ASPUP_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ASPUP_template* implied_template = new M3UA__ASPUP_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ASPUP_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_ASPUP");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ASPUP_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP");
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 : "@M3UA_Types.M3UA_ASPUP");
}

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

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

M3UA__ASPUP__Ack__MessageParameters::M3UA__ASPUP__Ack__MessageParameters()
{
}

M3UA__ASPUP__Ack__MessageParameters::M3UA__ASPUP__Ack__MessageParameters(const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_info__String(par_info__String)
{
}

M3UA__ASPUP__Ack__MessageParameters::M3UA__ASPUP__Ack__MessageParameters(const M3UA__ASPUP__Ack__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__ASPUP__Ack__MessageParameters::clean_up()
{
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ASPUP__Ack__MessageParameters::get_descriptor() const { return &M3UA__ASPUP__Ack__MessageParameters_descr_; }
M3UA__ASPUP__Ack__MessageParameters& M3UA__ASPUP__Ack__MessageParameters::operator=(const M3UA__ASPUP__Ack__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__ASPUP__Ack__MessageParameters::operator==(const M3UA__ASPUP__Ack__MessageParameters& other_value) const
{
return field_info__String==other_value.field_info__String;
}

boolean M3UA__ASPUP__Ack__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__ASPUP__Ack__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__ASPUP__Ack__MessageParameters::size_of() const
{
  int ret_val = 0;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__ASPUP__Ack__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ASPUP__Ack__MessageParameters::set_implicit_omit()
{
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__ASPUP__Ack__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters 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) info__String().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(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_ASPUP_Ack_MessageParameters");
  }
}

void M3UA__ASPUP__Ack__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_info__String.encode_text(text_buf);
}

void M3UA__ASPUP__Ack__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_info__String.decode_text(text_buf);
}

void M3UA__ASPUP__Ack__MessageParameters::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 M3UA__ASPUP__Ack__MessageParameters::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 M3UA__ASPUP__Ack__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[1];
memset(field_map, 0, sizeof(field_map));
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__ASPUP__Ack__MessageParameters::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);
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__ASPUP__Ack__MessageParameters_template::single_value_struct {
M3UA__Info__String_template field_info__String;
};

void M3UA__ASPUP__Ack__MessageParameters_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_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__ASPUP__Ack__MessageParameters_template::copy_value(const M3UA__ASPUP__Ack__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ASPUP__Ack__MessageParameters_template::copy_template(const M3UA__ASPUP__Ack__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__ASPUP__Ack__MessageParameters_template[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 M3UA__ASPUP__Ack__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ASPUP__Ack__MessageParameters_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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__ASPUP__Ack__MessageParameters_template::M3UA__ASPUP__Ack__MessageParameters_template()
{
}

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

M3UA__ASPUP__Ack__MessageParameters_template::M3UA__ASPUP__Ack__MessageParameters_template(const M3UA__ASPUP__Ack__MessageParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

M3UA__ASPUP__Ack__MessageParameters_template& M3UA__ASPUP__Ack__MessageParameters_template::operator=(const OPTIONAL<M3UA__ASPUP__Ack__MessageParameters>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__ASPUP__Ack__MessageParameters&)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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
}
return *this;
}

M3UA__ASPUP__Ack__MessageParameters_template& M3UA__ASPUP__Ack__MessageParameters_template::operator=(const M3UA__ASPUP__Ack__MessageParameters_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean M3UA__ASPUP__Ack__MessageParameters_template::match(const M3UA__ASPUP__Ack__MessageParameters& 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.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
}
return FALSE;
}

boolean M3UA__ASPUP__Ack__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__ASPUP__Ack__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

void M3UA__ASPUP__Ack__MessageParameters_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;
}

M3UA__ASPUP__Ack__MessageParameters M3UA__ASPUP__Ack__MessageParameters_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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
M3UA__ASPUP__Ack__MessageParameters ret_val;
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__ASPUP__Ack__MessageParameters_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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ASPUP__Ack__MessageParameters_template[list_length];
}

M3UA__ASPUP__Ack__MessageParameters_template& M3UA__ASPUP__Ack__MessageParameters_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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
return value_list.list_value[list_index];
}

M3UA__Info__String_template& M3UA__ASPUP__Ack__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__ASPUP__Ack__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
return single_value->field_info__String;
}

int M3UA__ASPUP__Ack__MessageParameters_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 0;
      if (single_value->field_info__String.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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters 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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
  }
  return 0;
}

void M3UA__ASPUP__Ack__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ info_String := ");
single_value->field_info__String.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 M3UA__ASPUP__Ack__MessageParameters_template::log_match(const M3UA__ASPUP__Ack__MessageParameters& 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 (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__ASPUP__Ack__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__ASPUP__Ack__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_info__String.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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
}
}

void M3UA__ASPUP__Ack__MessageParameters_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_info__String.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 M3UA__ASPUP__Ack__MessageParameters_template[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 @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters.");
}
}

void M3UA__ASPUP__Ack__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__ASPUP__Ack__MessageParameters_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("set template of type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters 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) info__String().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(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP_Ack_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ASPUP__Ack__MessageParameters_template* precondition = new M3UA__ASPUP__Ack__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ASPUP__Ack__MessageParameters_template* implied_template = new M3UA__ASPUP__Ack__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ASPUP__Ack__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_ASPUP_Ack_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ASPUP__Ack__MessageParameters_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_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_Ack_MessageParameters");
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 : "@M3UA_Types.M3UA_ASPUP_Ack_MessageParameters");
}

boolean M3UA__ASPUP__Ack__MessageParameters_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean M3UA__ASPUP__Ack__MessageParameters_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;
}

M3UA__ASPUP__Ack::M3UA__ASPUP__Ack()
{
}

M3UA__ASPUP__Ack::M3UA__ASPUP__Ack(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__ASPUP__Ack__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__ASPUP__Ack::M3UA__ASPUP__Ack(const M3UA__ASPUP__Ack& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ASPUP_Ack.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__ASPUP__Ack::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ASPUP__Ack::get_descriptor() const { return &M3UA__ASPUP__Ack_descr_; }
M3UA__ASPUP__Ack& M3UA__ASPUP__Ack::operator=(const M3UA__ASPUP__Ack& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ASPUP_Ack.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__ASPUP__Ack::operator==(const M3UA__ASPUP__Ack& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__ASPUP__Ack::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__ASPUP__Ack::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__ASPUP__Ack::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ASPUP__Ack::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ASPUP__Ack::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @M3UA_Types.M3UA_ASPUP_Ack 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP_Ack: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_ASPUP_Ack");
  }
}

void M3UA__ASPUP__Ack::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__ASPUP__Ack::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__ASPUP__Ack::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void M3UA__ASPUP__Ack::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int M3UA__ASPUP__Ack::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__ASPUP__Ack_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__ASPUP__Ack_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__ASPUP__Ack_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__ASPUP__Ack__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__ASPUP__Ack__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__ASPUP__Ack::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__ASPUP__Ack_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__ASPUP__Ack__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__ASPUP__Ack_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__ASPUP__Ack__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__ASPUP__Ack_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__ASPUP__Ack__MessageParameters_template field_messageParameters;
};

void M3UA__ASPUP__Ack_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__ASPUP__Ack_template::copy_value(const M3UA__ASPUP__Ack& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ASPUP__Ack_template::copy_template(const M3UA__ASPUP__Ack_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__ASPUP__Ack_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new M3UA__ASPUP__Ack_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ASPUP__Ack_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @M3UA_Types.M3UA_ASPUP_Ack.");
break;
}
set_selection(other_value);
}

M3UA__ASPUP__Ack_template::M3UA__ASPUP__Ack_template()
{
}

M3UA__ASPUP__Ack_template::M3UA__ASPUP__Ack_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

M3UA__ASPUP__Ack_template::M3UA__ASPUP__Ack_template(const M3UA__ASPUP__Ack& other_value)
{
copy_value(other_value);
}

M3UA__ASPUP__Ack_template::M3UA__ASPUP__Ack_template(const OPTIONAL<M3UA__ASPUP__Ack>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__ASPUP__Ack&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @M3UA_Types.M3UA_ASPUP_Ack from an unbound optional field.");
}
}

M3UA__ASPUP__Ack_template::M3UA__ASPUP__Ack_template(M3UA__ASPUP__Ack_template* p_precondition, M3UA__ASPUP__Ack_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

M3UA__ASPUP__Ack_template::M3UA__ASPUP__Ack_template(Dynamic_Match_Interface<M3UA__ASPUP__Ack>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<M3UA__ASPUP__Ack>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

M3UA__ASPUP__Ack_template::M3UA__ASPUP__Ack_template(const M3UA__ASPUP__Ack_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

M3UA__ASPUP__Ack_template::~M3UA__ASPUP__Ack_template()
{
clean_up();
}

M3UA__ASPUP__Ack_template& M3UA__ASPUP__Ack_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

M3UA__ASPUP__Ack_template& M3UA__ASPUP__Ack_template::operator=(const M3UA__ASPUP__Ack& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

M3UA__ASPUP__Ack_template& M3UA__ASPUP__Ack_template::operator=(const OPTIONAL<M3UA__ASPUP__Ack>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__ASPUP__Ack&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @M3UA_Types.M3UA_ASPUP_Ack.");
}
return *this;
}

M3UA__ASPUP__Ack_template& M3UA__ASPUP__Ack_template::operator=(const M3UA__ASPUP__Ack_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean M3UA__ASPUP__Ack_template::match(const M3UA__ASPUP__Ack& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_ASPUP_Ack.");
}
return FALSE;
}

boolean M3UA__ASPUP__Ack_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__ASPUP__Ack_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

void M3UA__ASPUP__Ack_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

M3UA__ASPUP__Ack M3UA__ASPUP__Ack_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @M3UA_Types.M3UA_ASPUP_Ack.");
M3UA__ASPUP__Ack ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__ASPUP__Ack_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @M3UA_Types.M3UA_ASPUP_Ack.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ASPUP__Ack_template[list_length];
}

M3UA__ASPUP__Ack_template& M3UA__ASPUP__Ack_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @M3UA_Types.M3UA_ASPUP_Ack.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @M3UA_Types.M3UA_ASPUP_Ack.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& M3UA__ASPUP__Ack_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__ASPUP__Ack_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_ASPUP_Ack.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__ASPUP__Ack_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__ASPUP__Ack_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_ASPUP_Ack.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__ASPUP__Ack_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__ASPUP__Ack_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_ASPUP_Ack.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__ASPUP__Ack_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__ASPUP__Ack_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_ASPUP_Ack.");
return single_value->field_messageLength;
}

M3UA__ASPUP__Ack__MessageParameters_template& M3UA__ASPUP__Ack_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__ASPUP__Ack__MessageParameters_template& M3UA__ASPUP__Ack_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_ASPUP_Ack.");
return single_value->field_messageParameters;
}

int M3UA__ASPUP__Ack_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack 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 @M3UA_Types.M3UA_ASPUP_Ack containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPUP_Ack containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @M3UA_Types.M3UA_ASPUP_Ack.");
  }
  return 0;
}

void M3UA__ASPUP__Ack_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__ASPUP__Ack_template::log_match(const M3UA__ASPUP__Ack& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__ASPUP__Ack_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ASPUP__Ack_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_ASPUP_Ack.");
}
}

void M3UA__ASPUP__Ack_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__ASPUP__Ack_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @M3UA_Types.M3UA_ASPUP_Ack.");
}
}

void M3UA__ASPUP__Ack_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    M3UA__ASPUP__Ack_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @M3UA_Types.M3UA_ASPUP_Ack 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPUP_Ack: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ASPUP__Ack_template* precondition = new M3UA__ASPUP__Ack_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ASPUP__Ack_template* implied_template = new M3UA__ASPUP__Ack_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ASPUP__Ack_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_ASPUP_Ack");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ASPUP__Ack_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_Ack");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_Ack");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_Ack");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_Ack");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_Ack");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@M3UA_Types.M3UA_ASPUP_Ack");
}

boolean M3UA__ASPUP__Ack_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean M3UA__ASPUP__Ack_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

M3UA__ASPDN__MessageParameters::M3UA__ASPDN__MessageParameters()
{
}

M3UA__ASPDN__MessageParameters::M3UA__ASPDN__MessageParameters(const OPTIONAL< M3UA__Info__String >& par_info__String)
  :   field_info__String(par_info__String)
{
}

M3UA__ASPDN__MessageParameters::M3UA__ASPDN__MessageParameters(const M3UA__ASPDN__MessageParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ASPDN_MessageParameters.");
if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
else field_info__String.clean_up();
}

void M3UA__ASPDN__MessageParameters::clean_up()
{
field_info__String.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ASPDN__MessageParameters::get_descriptor() const { return &M3UA__ASPDN__MessageParameters_descr_; }
M3UA__ASPDN__MessageParameters& M3UA__ASPDN__MessageParameters::operator=(const M3UA__ASPDN__MessageParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ASPDN_MessageParameters.");
  if (other_value.info__String().is_bound()) field_info__String = other_value.info__String();
  else field_info__String.clean_up();
}
return *this;
}

boolean M3UA__ASPDN__MessageParameters::operator==(const M3UA__ASPDN__MessageParameters& other_value) const
{
return field_info__String==other_value.field_info__String;
}

boolean M3UA__ASPDN__MessageParameters::is_bound() const
{
return (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_bound());
}
boolean M3UA__ASPDN__MessageParameters::is_value() const
{
return (OPTIONAL_OMIT == field_info__String.get_selection() || field_info__String.is_value());
}
int M3UA__ASPDN__MessageParameters::size_of() const
{
  int ret_val = 0;
  if (field_info__String.ispresent()) ret_val++;
  return ret_val;
}

void M3UA__ASPDN__MessageParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ info_String := ");
field_info__String.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ASPDN__MessageParameters::set_implicit_omit()
{
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__ASPDN__MessageParameters::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("set value of type @M3UA_Types.M3UA_ASPDN_MessageParameters 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) info__String().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(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPDN_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@M3UA_Types.M3UA_ASPDN_MessageParameters");
  }
}

void M3UA__ASPDN__MessageParameters::encode_text(Text_Buf& text_buf) const
{
field_info__String.encode_text(text_buf);
}

void M3UA__ASPDN__MessageParameters::decode_text(Text_Buf& text_buf)
{
field_info__String.decode_text(text_buf);
}

void M3UA__ASPDN__MessageParameters::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 M3UA__ASPDN__MessageParameters::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 M3UA__ASPDN__MessageParameters::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean, int, 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 field_map[1];
memset(field_map, 0, sizeof(field_map));
field_info__String = OMIT_VALUE;
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;
while (limit > 0) {
size_t fl_start_pos = p_buf.get_pos_bit();
if (field_map[0] == 0 && (force_omit == NULL || !(*force_omit)(0))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (M3UA__Info__String_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
OCTETSTRING temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(General__Types::OCT2_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 ==  os_6) {
RAW_Force_Omit field_0_force_omit(0, force_omit, M3UA__Info__String_descr_.raw->forceomit);
int decoded_field_length = field_info__String().RAW_decode(M3UA__Info__String_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_info__String.ispresent() && field_info__String().tag() ==  os_6)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_info__String = OMIT_VALUE;
}
}
}
break;
}
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int M3UA__ASPDN__MessageParameters::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);
  if (field_info__String.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, M3UA__Info__String_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_info__String.ispresent()) {
  encoded_length += field_info__String().RAW_encode(M3UA__Info__String_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_info__String.ispresent() && (!field_info__String.ispresent() || field_info__String().tag() !=  os_6)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_6.RAW_encode(General__Types::OCT2_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 M3UA__ASPDN__MessageParameters_template::single_value_struct {
M3UA__Info__String_template field_info__String;
};

void M3UA__ASPDN__MessageParameters_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_info__String = ANY_OR_OMIT;
}
}
}

void M3UA__ASPDN__MessageParameters_template::copy_value(const M3UA__ASPDN__MessageParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.info__String().is_bound()) {
  if (other_value.info__String().ispresent()) single_value->field_info__String = other_value.info__String()();
  else single_value->field_info__String = OMIT_VALUE;
} else {
  single_value->field_info__String.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ASPDN__MessageParameters_template::copy_template(const M3UA__ASPDN__MessageParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.info__String().get_selection()) {
single_value->field_info__String = other_value.info__String();
} else {
single_value->field_info__String.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 M3UA__ASPDN__MessageParameters_template[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 M3UA__ASPDN__MessageParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ASPDN__MessageParameters_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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
break;
}
set_selection(other_value);
}

M3UA__ASPDN__MessageParameters_template::M3UA__ASPDN__MessageParameters_template()
{
}

M3UA__ASPDN__MessageParameters_template::M3UA__ASPDN__MessageParameters_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

M3UA__ASPDN__MessageParameters_template::M3UA__ASPDN__MessageParameters_template(const M3UA__ASPDN__MessageParameters& other_value)
{
copy_value(other_value);
}

M3UA__ASPDN__MessageParameters_template::M3UA__ASPDN__MessageParameters_template(const OPTIONAL<M3UA__ASPDN__MessageParameters>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__ASPDN__MessageParameters&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters from an unbound optional field.");
}
}

M3UA__ASPDN__MessageParameters_template::M3UA__ASPDN__MessageParameters_template(M3UA__ASPDN__MessageParameters_template* p_precondition, M3UA__ASPDN__MessageParameters_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

M3UA__ASPDN__MessageParameters_template::M3UA__ASPDN__MessageParameters_template(Dynamic_Match_Interface<M3UA__ASPDN__MessageParameters>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<M3UA__ASPDN__MessageParameters>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

M3UA__ASPDN__MessageParameters_template::M3UA__ASPDN__MessageParameters_template(const M3UA__ASPDN__MessageParameters_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

M3UA__ASPDN__MessageParameters_template::~M3UA__ASPDN__MessageParameters_template()
{
clean_up();
}

M3UA__ASPDN__MessageParameters_template& M3UA__ASPDN__MessageParameters_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

M3UA__ASPDN__MessageParameters_template& M3UA__ASPDN__MessageParameters_template::operator=(const M3UA__ASPDN__MessageParameters& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

M3UA__ASPDN__MessageParameters_template& M3UA__ASPDN__MessageParameters_template::operator=(const OPTIONAL<M3UA__ASPDN__MessageParameters>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__ASPDN__MessageParameters&)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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
}
return *this;
}

M3UA__ASPDN__MessageParameters_template& M3UA__ASPDN__MessageParameters_template::operator=(const M3UA__ASPDN__MessageParameters_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean M3UA__ASPDN__MessageParameters_template::match(const M3UA__ASPDN__MessageParameters& 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.info__String().is_bound()) return FALSE;
if((other_value.info__String().ispresent() ? !single_value->field_info__String.match((const M3UA__Info__String&)other_value.info__String(), legacy) : !single_value->field_info__String.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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
}
return FALSE;
}

boolean M3UA__ASPDN__MessageParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_info__String.is_omit() || single_value->field_info__String.is_bound());
}

boolean M3UA__ASPDN__MessageParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_info__String.is_omit() || single_value->field_info__String.is_value());
}

void M3UA__ASPDN__MessageParameters_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;
}

M3UA__ASPDN__MessageParameters M3UA__ASPDN__MessageParameters_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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
M3UA__ASPDN__MessageParameters ret_val;
if (single_value->field_info__String.is_omit()) ret_val.info__String() = OMIT_VALUE;
else if (single_value->field_info__String.is_bound()) {
ret_val.info__String() = single_value->field_info__String.valueof();
}
return ret_val;
}

void M3UA__ASPDN__MessageParameters_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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ASPDN__MessageParameters_template[list_length];
}

M3UA__ASPDN__MessageParameters_template& M3UA__ASPDN__MessageParameters_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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @M3UA_Types.M3UA_ASPDN_MessageParameters.");
return value_list.list_value[list_index];
}

M3UA__Info__String_template& M3UA__ASPDN__MessageParameters_template::info__String()
{
set_specific();
return single_value->field_info__String;
}

const M3UA__Info__String_template& M3UA__ASPDN__MessageParameters_template::info__String() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info_String of a non-specific template of type @M3UA_Types.M3UA_ASPDN_MessageParameters.");
return single_value->field_info__String;
}

int M3UA__ASPDN__MessageParameters_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 0;
      if (single_value->field_info__String.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 @M3UA_Types.M3UA_ASPDN_MessageParameters 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 @M3UA_Types.M3UA_ASPDN_MessageParameters containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN_MessageParameters containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @M3UA_Types.M3UA_ASPDN_MessageParameters.");
  }
  return 0;
}

void M3UA__ASPDN__MessageParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ info_String := ");
single_value->field_info__String.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 M3UA__ASPDN__MessageParameters_template::log_match(const M3UA__ASPDN__MessageParameters& 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 (match_value.info__String().ispresent()){
if(!single_value->field_info__String.match(match_value.info__String(), legacy)){
TTCN_Logger::log_logmatch_info(".info_String");
single_value->field_info__String.log_match(match_value.info__String(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_info__String.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".info_String := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_info__String.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("{ info_String := ");
if (match_value.info__String().ispresent()) {
single_value->field_info__String.log_match(match_value.info__String(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_info__String.log();
if (single_value->field_info__String.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 M3UA__ASPDN__MessageParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!info__String().is_bound()) info__String() = OMIT_VALUE;
else info__String().set_implicit_omit();
}

void M3UA__ASPDN__MessageParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_info__String.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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
}
}

void M3UA__ASPDN__MessageParameters_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_info__String.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 M3UA__ASPDN__MessageParameters_template[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 @M3UA_Types.M3UA_ASPDN_MessageParameters.");
}
}

void M3UA__ASPDN__MessageParameters_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set 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: {
    M3UA__ASPDN__MessageParameters_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("set template of type @M3UA_Types.M3UA_ASPDN_MessageParameters 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) info__String().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(), "info_String")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info__String().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPDN_MessageParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ASPDN__MessageParameters_template* precondition = new M3UA__ASPDN__MessageParameters_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ASPDN__MessageParameters_template* implied_template = new M3UA__ASPDN__MessageParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ASPDN__MessageParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@M3UA_Types.M3UA_ASPDN_MessageParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ASPDN__MessageParameters_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_info__String.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPDN_MessageParameters");
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 : "@M3UA_Types.M3UA_ASPDN_MessageParameters");
}

boolean M3UA__ASPDN__MessageParameters_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean M3UA__ASPDN__MessageParameters_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;
}

M3UA__ASPDN::M3UA__ASPDN()
{
}

M3UA__ASPDN::M3UA__ASPDN(const OCTETSTRING& par_version,
    const OCTETSTRING& par_reserved,
    const OCTETSTRING& par_messageClassAndType,
    const INTEGER& par_messageLength,
    const M3UA__ASPDN__MessageParameters& par_messageParameters)
  :   field_version(par_version),
  field_reserved(par_reserved),
  field_messageClassAndType(par_messageClassAndType),
  field_messageLength(par_messageLength),
  field_messageParameters(par_messageParameters)
{
}

M3UA__ASPDN::M3UA__ASPDN(const M3UA__ASPDN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @M3UA_Types.M3UA_ASPDN.");
if (other_value.version().is_bound()) field_version = other_value.version();
else field_version.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
else field_messageClassAndType.clean_up();
if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
else field_messageLength.clean_up();
if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
else field_messageParameters.clean_up();
}

void M3UA__ASPDN::clean_up()
{
field_version.clean_up();
field_reserved.clean_up();
field_messageClassAndType.clean_up();
field_messageLength.clean_up();
field_messageParameters.clean_up();
}

const TTCN_Typedescriptor_t* M3UA__ASPDN::get_descriptor() const { return &M3UA__ASPDN_descr_; }
M3UA__ASPDN& M3UA__ASPDN::operator=(const M3UA__ASPDN& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @M3UA_Types.M3UA_ASPDN.");
  if (other_value.version().is_bound()) field_version = other_value.version();
  else field_version.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.messageClassAndType().is_bound()) field_messageClassAndType = other_value.messageClassAndType();
  else field_messageClassAndType.clean_up();
  if (other_value.messageLength().is_bound()) field_messageLength = other_value.messageLength();
  else field_messageLength.clean_up();
  if (other_value.messageParameters().is_bound()) field_messageParameters = other_value.messageParameters();
  else field_messageParameters.clean_up();
}
return *this;
}

boolean M3UA__ASPDN::operator==(const M3UA__ASPDN& other_value) const
{
return field_version==other_value.field_version
  && field_reserved==other_value.field_reserved
  && field_messageClassAndType==other_value.field_messageClassAndType
  && field_messageLength==other_value.field_messageLength
  && field_messageParameters==other_value.field_messageParameters;
}

boolean M3UA__ASPDN::is_bound() const
{
return (field_version.is_bound())
  || (field_reserved.is_bound())
  || (field_messageClassAndType.is_bound())
  || (field_messageLength.is_bound())
  || (field_messageParameters.is_bound());
}
boolean M3UA__ASPDN::is_value() const
{
return field_version.is_value()
  && field_reserved.is_value()
  && field_messageClassAndType.is_value()
  && field_messageLength.is_value()
  && field_messageParameters.is_value();
}
void M3UA__ASPDN::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ version := ");
field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
field_messageParameters.log();
TTCN_Logger::log_event_str(" }");
}

void M3UA__ASPDN::set_implicit_omit()
{
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ASPDN::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 @M3UA_Types.M3UA_ASPDN 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPDN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@M3UA_Types.M3UA_ASPDN");
  }
}

void M3UA__ASPDN::encode_text(Text_Buf& text_buf) const
{
field_version.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_messageClassAndType.encode_text(text_buf);
field_messageLength.encode_text(text_buf);
field_messageParameters.encode_text(text_buf);
}

void M3UA__ASPDN::decode_text(Text_Buf& text_buf)
{
field_version.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_messageClassAndType.decode_text(text_buf);
field_messageLength.decode_text(text_buf);
field_messageParameters.decode_text(text_buf);
}

void M3UA__ASPDN::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 M3UA__ASPDN::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 M3UA__ASPDN::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_field3 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_version.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT2_descr_.raw->forceomit);
  decoded_field_length = field_messageClassAndType.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());
  value_of_length_field3 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, M3UA__ASPDN_messageLength_descr_.raw->forceomit);
  decoded_field_length = field_messageLength.RAW_decode(M3UA__ASPDN_messageLength_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());
  INTEGER tmp3 = field_messageLength.convert_to_Integer(M3UA__ASPDN_messageLength_descr_);
  field_messageLength = tmp3;
  value_of_length_field3 += tmp3.get_long_long_val() * 8;
  value_of_length_field3 -= decoded_field_length;
  if (value_of_length_field3 < 0) return -1;
  RAW_Force_Omit field_4_force_omit(4, force_omit, M3UA__ASPDN__MessageParameters_descr_.raw->forceomit);
  decoded_field_length = field_messageParameters.RAW_decode(M3UA__ASPDN__MessageParameters_descr_, p_buf, min_of_ints(2, limit, value_of_length_field3), 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_field3 -= 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 M3UA__ASPDN::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::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::OCT2_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, M3UA__ASPDN_messageLength_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, M3UA__ASPDN__MessageParameters_descr_.raw);
  encoded_length += field_version.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_messageClassAndType.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 32;
  myleaf.body.node.nodes[3]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[3]->coding_descr = &M3UA__ASPDN_messageLength_descr_;
  myleaf.body.node.nodes[3]->calcof.lengthto.num_of_fields = 5;
  myleaf.body.node.nodes[3]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields = init_lengthto_fields_list(5);
  myleaf.body.node.nodes[3]->length = 32;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  encoded_length += field_messageParameters.RAW_encode(M3UA__ASPDN__MessageParameters_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct M3UA__ASPDN_template::single_value_struct {
OCTETSTRING_template field_version;
OCTETSTRING_template field_reserved;
OCTETSTRING_template field_messageClassAndType;
INTEGER_template field_messageLength;
M3UA__ASPDN__MessageParameters_template field_messageParameters;
};

void M3UA__ASPDN_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_version = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_messageClassAndType = ANY_VALUE;
single_value->field_messageLength = ANY_VALUE;
single_value->field_messageParameters = ANY_VALUE;
}
}
}

void M3UA__ASPDN_template::copy_value(const M3UA__ASPDN& other_value)
{
single_value = new single_value_struct;
if (other_value.version().is_bound()) {
  single_value->field_version = other_value.version();
} else {
  single_value->field_version.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.messageClassAndType().is_bound()) {
  single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
  single_value->field_messageClassAndType.clean_up();
}
if (other_value.messageLength().is_bound()) {
  single_value->field_messageLength = other_value.messageLength();
} else {
  single_value->field_messageLength.clean_up();
}
if (other_value.messageParameters().is_bound()) {
  single_value->field_messageParameters = other_value.messageParameters();
} else {
  single_value->field_messageParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void M3UA__ASPDN_template::copy_template(const M3UA__ASPDN_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) {
single_value->field_version = other_value.version();
} else {
single_value->field_version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageClassAndType().get_selection()) {
single_value->field_messageClassAndType = other_value.messageClassAndType();
} else {
single_value->field_messageClassAndType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageLength().get_selection()) {
single_value->field_messageLength = other_value.messageLength();
} else {
single_value->field_messageLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageParameters().get_selection()) {
single_value->field_messageParameters = other_value.messageParameters();
} else {
single_value->field_messageParameters.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 M3UA__ASPDN_template[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 M3UA__ASPDN_template(*other_value.implication_.precondition);
implication_.implied_template = new M3UA__ASPDN_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 @M3UA_Types.M3UA_ASPDN.");
break;
}
set_selection(other_value);
}

M3UA__ASPDN_template::M3UA__ASPDN_template()
{
}

M3UA__ASPDN_template::M3UA__ASPDN_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

M3UA__ASPDN_template::M3UA__ASPDN_template(const M3UA__ASPDN& other_value)
{
copy_value(other_value);
}

M3UA__ASPDN_template::M3UA__ASPDN_template(const OPTIONAL<M3UA__ASPDN>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__ASPDN&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @M3UA_Types.M3UA_ASPDN from an unbound optional field.");
}
}

M3UA__ASPDN_template::M3UA__ASPDN_template(M3UA__ASPDN_template* p_precondition, M3UA__ASPDN_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

M3UA__ASPDN_template::M3UA__ASPDN_template(Dynamic_Match_Interface<M3UA__ASPDN>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<M3UA__ASPDN>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

M3UA__ASPDN_template::M3UA__ASPDN_template(const M3UA__ASPDN_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

M3UA__ASPDN_template::~M3UA__ASPDN_template()
{
clean_up();
}

M3UA__ASPDN_template& M3UA__ASPDN_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

M3UA__ASPDN_template& M3UA__ASPDN_template::operator=(const M3UA__ASPDN& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

M3UA__ASPDN_template& M3UA__ASPDN_template::operator=(const OPTIONAL<M3UA__ASPDN>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const M3UA__ASPDN&)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 @M3UA_Types.M3UA_ASPDN.");
}
return *this;
}

M3UA__ASPDN_template& M3UA__ASPDN_template::operator=(const M3UA__ASPDN_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean M3UA__ASPDN_template::match(const M3UA__ASPDN& 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.version().is_bound()) return FALSE;
if(!single_value->field_version.match(other_value.version(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.messageClassAndType().is_bound()) return FALSE;
if(!single_value->field_messageClassAndType.match(other_value.messageClassAndType(), legacy))return FALSE;
if(!other_value.messageLength().is_bound()) return FALSE;
if(!single_value->field_messageLength.match(other_value.messageLength(), legacy))return FALSE;
if(!other_value.messageParameters().is_bound()) return FALSE;
if(!single_value->field_messageParameters.match(other_value.messageParameters(), 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 @M3UA_Types.M3UA_ASPDN.");
}
return FALSE;
}

boolean M3UA__ASPDN_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_version.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_messageClassAndType.is_bound()
 || single_value->field_messageLength.is_bound()
 || single_value->field_messageParameters.is_bound();
}

boolean M3UA__ASPDN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_version.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_messageClassAndType.is_value()
 && single_value->field_messageLength.is_value()
 && single_value->field_messageParameters.is_value();
}

void M3UA__ASPDN_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;
}

M3UA__ASPDN M3UA__ASPDN_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 @M3UA_Types.M3UA_ASPDN.");
M3UA__ASPDN ret_val;
if (single_value->field_version.is_bound()) {
ret_val.version() = single_value->field_version.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_messageClassAndType.is_bound()) {
ret_val.messageClassAndType() = single_value->field_messageClassAndType.valueof();
}
if (single_value->field_messageLength.is_bound()) {
ret_val.messageLength() = single_value->field_messageLength.valueof();
}
if (single_value->field_messageParameters.is_bound()) {
ret_val.messageParameters() = single_value->field_messageParameters.valueof();
}
return ret_val;
}

void M3UA__ASPDN_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 @M3UA_Types.M3UA_ASPDN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new M3UA__ASPDN_template[list_length];
}

M3UA__ASPDN_template& M3UA__ASPDN_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 @M3UA_Types.M3UA_ASPDN.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @M3UA_Types.M3UA_ASPDN.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& M3UA__ASPDN_template::version()
{
set_specific();
return single_value->field_version;
}

const OCTETSTRING_template& M3UA__ASPDN_template::version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field version of a non-specific template of type @M3UA_Types.M3UA_ASPDN.");
return single_value->field_version;
}

OCTETSTRING_template& M3UA__ASPDN_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const OCTETSTRING_template& M3UA__ASPDN_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @M3UA_Types.M3UA_ASPDN.");
return single_value->field_reserved;
}

OCTETSTRING_template& M3UA__ASPDN_template::messageClassAndType()
{
set_specific();
return single_value->field_messageClassAndType;
}

const OCTETSTRING_template& M3UA__ASPDN_template::messageClassAndType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageClassAndType of a non-specific template of type @M3UA_Types.M3UA_ASPDN.");
return single_value->field_messageClassAndType;
}

INTEGER_template& M3UA__ASPDN_template::messageLength()
{
set_specific();
return single_value->field_messageLength;
}

const INTEGER_template& M3UA__ASPDN_template::messageLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageLength of a non-specific template of type @M3UA_Types.M3UA_ASPDN.");
return single_value->field_messageLength;
}

M3UA__ASPDN__MessageParameters_template& M3UA__ASPDN_template::messageParameters()
{
set_specific();
return single_value->field_messageParameters;
}

const M3UA__ASPDN__MessageParameters_template& M3UA__ASPDN_template::messageParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageParameters of a non-specific template of type @M3UA_Types.M3UA_ASPDN.");
return single_value->field_messageParameters;
}

int M3UA__ASPDN_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN 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 @M3UA_Types.M3UA_ASPDN 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 @M3UA_Types.M3UA_ASPDN containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @M3UA_Types.M3UA_ASPDN containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @M3UA_Types.M3UA_ASPDN.");
  }
  return 0;
}

void M3UA__ASPDN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ version := ");
single_value->field_version.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log();
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log();
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.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 M3UA__ASPDN_template::log_match(const M3UA__ASPDN& 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_version.match(match_value.version(), legacy)){
TTCN_Logger::log_logmatch_info(".version");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageClassAndType.match(match_value.messageClassAndType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageClassAndType");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageLength.match(match_value.messageLength(), legacy)){
TTCN_Logger::log_logmatch_info(".messageLength");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageParameters.match(match_value.messageParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".messageParameters");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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("{ version := ");
single_value->field_version.log_match(match_value.version(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", messageClassAndType := ");
single_value->field_messageClassAndType.log_match(match_value.messageClassAndType(), legacy);
TTCN_Logger::log_event_str(", messageLength := ");
single_value->field_messageLength.log_match(match_value.messageLength(), legacy);
TTCN_Logger::log_event_str(", messageParameters := ");
single_value->field_messageParameters.log_match(match_value.messageParameters(), 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 M3UA__ASPDN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (version().is_bound()) version().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (messageClassAndType().is_bound()) messageClassAndType().set_implicit_omit();
if (messageLength().is_bound()) messageLength().set_implicit_omit();
if (messageParameters().is_bound()) messageParameters().set_implicit_omit();
}

void M3UA__ASPDN_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_version.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_messageClassAndType.encode_text(text_buf);
single_value->field_messageLength.encode_text(text_buf);
single_value->field_messageParameters.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 @M3UA_Types.M3UA_ASPDN.");
}
}

void M3UA__ASPDN_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_version.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_messageClassAndType.decode_text(text_buf);
single_value->field_messageLength.decode_text(text_buf);
single_value->field_messageParameters.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 M3UA__ASPDN_template[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 @M3UA_Types.M3UA_ASPDN.");
}
}

void M3UA__ASPDN_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: {
    M3UA__ASPDN_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 @M3UA_Types.M3UA_ASPDN 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) version().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) messageClassAndType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) messageLength().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) messageParameters().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(), "version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageClassAndType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageClassAndType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @M3UA_Types.M3UA_ASPDN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    M3UA__ASPDN_template* precondition = new M3UA__ASPDN_template;
    precondition->set_param(*param.get_elem(0));
    M3UA__ASPDN_template* implied_template = new M3UA__ASPDN_template;
    implied_template->set_param(*param.get_elem(1));
    *this = M3UA__ASPDN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@M3UA_Types.M3UA_ASPDN");
  }
  is_ifpresent = param.get_ifpresent();
}

void M3UA__ASPDN_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_version.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPDN");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPDN");
single_value->field_messageClassAndType.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPDN");
single_value->field_messageLength.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPDN");
single_value->field_messageParameters.check_restriction(t_res, t_name ? t_name : "@M3UA_Types.M3UA_ASPDN");
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 : "@M3UA_Types.M3UA_ASPDN");
}

boolean M3UA__ASPDN_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean M3UA__ASPDN_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 */
