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

namespace SCCP__Types {

/* Literal string constants */

const unsigned char bs_1_bits[] = { 8 },
bs_2_bits[] = { 4 },
bs_3_bits[] = { 12 },
bs_4_bits[] = { 2 },
bs_0_bits[] = { 1 };
extern const BITSTRING bs_1(4, bs_1_bits),
bs_2(4, bs_2_bits),
bs_3(4, bs_3_bits),
bs_4(4, bs_4_bits),
bs_0(1, bs_0_bits);
extern const CHARSTRING cs_6(4, "m3ua"),
cs_1(9, "mtp3_ansi"),
cs_0(8, "mtp3_itu"),
cs_7(8, "mtp3_mpt"),
cs_2(8, "mtp3_ttc"),
cs_4(10, "mtp3b_ansi"),
cs_3(9, "mtp3b_itu"),
cs_5(9, "mtp3b_ttc");
const unsigned char module_checksum[] = { 0xc7, 0x6b, 0x12, 0x8b, 0x05, 0x82, 0x65, 0xe9, 0xad, 0xad, 0xa2, 0xae, 0xaf, 0x4e, 0x1a, 0x9f };

/* Global variable definitions */

FLOAT modulepar_tspc__timer__T__conn__est;
const FLOAT& tspc__timer__T__conn__est = modulepar_tspc__timer__T__conn__est;
FLOAT modulepar_tspc__timer__T__ias;
const FLOAT& tspc__timer__T__ias = modulepar_tspc__timer__T__ias;
FLOAT modulepar_tspc__timer__T__iar;
const FLOAT& tspc__timer__T__iar = modulepar_tspc__timer__T__iar;
FLOAT modulepar_tspc__timer__T__rel;
const FLOAT& tspc__timer__T__rel = modulepar_tspc__timer__T__rel;
FLOAT modulepar_tspc__timer__T__repeat__rel;
const FLOAT& tspc__timer__T__repeat__rel = modulepar_tspc__timer__T__repeat__rel;
FLOAT modulepar_tspc__timer__T__int;
const FLOAT& tspc__timer__T__int = modulepar_tspc__timer__T__int;
FLOAT modulepar_tspc__timer__T__guard;
const FLOAT& tspc__timer__T__guard = modulepar_tspc__timer__T__guard;
FLOAT modulepar_tspc__timer__T__reset;
const FLOAT& tspc__timer__T__reset = modulepar_tspc__timer__T__reset;
FLOAT modulepar_tspc__timer__T__internal__reset;
const FLOAT& tspc__timer__T__internal__reset = modulepar_tspc__timer__T__internal__reset;
FLOAT modulepar_tspc__timer__guard;
const FLOAT& tspc__timer__guard = modulepar_tspc__timer__guard;
const TTCN_RAWdescriptor_t SCCP__field__ParameterName_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__field__ParameterName_xer_ = { {"SCCP_field_ParameterName>\n", "SCCP_field_ParameterName>\n"}, {26, 26}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__field__ParameterName_descr_ = { "@SCCP_Types.SCCP_field_ParameterName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__field__ParameterName_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__ParameterName_default_coding("RAW");
const XERdescriptor_t       _T_con__SCCP__eop_xer_ = { {"SCCP_field_ParameterName>\n", "SCCP_field_ParameterName>\n"}, {26, 26}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t _T_con__SCCP__eop_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t _T_con__SCCP__eop_descr_ = { "@SCCP_Types.con_SCCP_eop.<type>", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &_T_con__SCCP__eop_xer_, &INTEGER_json_, &_T_con__SCCP__eop_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
INTEGER const_con__SCCP__eop;
const INTEGER& con__SCCP__eop = const_con__SCCP__eop;
INTEGER const_con__SCCP__dLocRef;
const INTEGER& con__SCCP__dLocRef = const_con__SCCP__dLocRef;
INTEGER const_con__SCCP__sLocRef;
const INTEGER& con__SCCP__sLocRef = const_con__SCCP__sLocRef;
INTEGER const_con__SCCP__cdPA;
const INTEGER& con__SCCP__cdPA = const_con__SCCP__cdPA;
INTEGER const_con__SCCP__cgPA;
const INTEGER& con__SCCP__cgPA = const_con__SCCP__cgPA;
INTEGER const_con__SCCP__protclass;
const INTEGER& con__SCCP__protclass = const_con__SCCP__protclass;
INTEGER const_con__SCCP__segmReas;
const INTEGER& con__SCCP__segmReas = const_con__SCCP__segmReas;
INTEGER const_con__SCCP__recSeqNum;
const INTEGER& con__SCCP__recSeqNum = const_con__SCCP__recSeqNum;
INTEGER const_con__SCCP__seqSegm;
const INTEGER& con__SCCP__seqSegm = const_con__SCCP__seqSegm;
INTEGER const_con__SCCP__credit;
const INTEGER& con__SCCP__credit = const_con__SCCP__credit;
INTEGER const_con__SCCP__relCause;
const INTEGER& con__SCCP__relCause = const_con__SCCP__relCause;
INTEGER const_con__SCCP__retCause;
const INTEGER& con__SCCP__retCause = const_con__SCCP__retCause;
INTEGER const_con__SCCP__resCause;
const INTEGER& con__SCCP__resCause = const_con__SCCP__resCause;
INTEGER const_con__SCCP__errorCause;
const INTEGER& con__SCCP__errorCause = const_con__SCCP__errorCause;
INTEGER const_con__SCCP__refCause;
const INTEGER& con__SCCP__refCause = const_con__SCCP__refCause;
INTEGER const_con__SCCP__data;
const INTEGER& con__SCCP__data = const_con__SCCP__data;
INTEGER const_con__SCCP__segm;
const INTEGER& con__SCCP__segm = const_con__SCCP__segm;
INTEGER const_con__SCCP__hopCount;
const INTEGER& con__SCCP__hopCount = const_con__SCCP__hopCount;
INTEGER const_con__SCCP__imp;
const INTEGER& con__SCCP__imp = const_con__SCCP__imp;
INTEGER const_con__SCCP__longData;
const INTEGER& con__SCCP__longData = const_con__SCCP__longData;
INTEGER const_con__SCCP__mti;
const INTEGER& con__SCCP__mti = const_con__SCCP__mti;
INTEGER const_con__SCCP__ins;
const INTEGER& con__SCCP__ins = const_con__SCCP__ins;
INTEGER const_con__SCCP__isni;
const INTEGER& con__SCCP__isni = const_con__SCCP__isni;
const XERdescriptor_t       SCCP__field__AddressIndicator__itu_pointCodeIndic_xer_ = { {"pointCodeIndic>\n", "pointCodeIndic>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__itu_pointCodeIndic_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__itu_pointCodeIndic_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_itu.pointCodeIndic", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__itu_pointCodeIndic_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__itu_pointCodeIndic_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__itu_pointCodeIndic_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__itu_ssnIndicator_xer_ = { {"ssnIndicator>\n", "ssnIndicator>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__itu_ssnIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__itu_ssnIndicator_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_itu.ssnIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__itu_ssnIndicator_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__itu_ssnIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__itu_ssnIndicator_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__itu_globalTitleIndic_xer_ = { {"globalTitleIndic>\n", "globalTitleIndic>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__itu_globalTitleIndic_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__itu_globalTitleIndic_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_itu.globalTitleIndic", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__field__AddressIndicator__itu_globalTitleIndic_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__itu_globalTitleIndic_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__itu_globalTitleIndic_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__itu_routingIndicator_xer_ = { {"routingIndicator>\n", "routingIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__itu_routingIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__itu_routingIndicator_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_itu.routingIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__itu_routingIndicator_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__itu_routingIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__itu_routingIndicator_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__itu_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__itu_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__itu_reserved_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_itu.reserved", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__itu_reserved_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__itu_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__itu_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__AddressIndicator__itu_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 SCCP__field__AddressIndicator__itu
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__itu_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_itu", NULL, &SCCP__field__AddressIndicator__itu_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__itu_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__ansi_ssnIndicator_xer_ = { {"ssnIndicator>\n", "ssnIndicator>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__ansi_ssnIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__ansi_ssnIndicator_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_ansi.ssnIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__ansi_ssnIndicator_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__ansi_ssnIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__ansi_ssnIndicator_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__ansi_pointCodeIndic_xer_ = { {"pointCodeIndic>\n", "pointCodeIndic>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__ansi_pointCodeIndic_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__ansi_pointCodeIndic_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_ansi.pointCodeIndic", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__ansi_pointCodeIndic_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__ansi_pointCodeIndic_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__ansi_pointCodeIndic_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__ansi_globalTitleIndic_xer_ = { {"globalTitleIndic>\n", "globalTitleIndic>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__ansi_globalTitleIndic_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__ansi_globalTitleIndic_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_ansi.globalTitleIndic", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__field__AddressIndicator__ansi_globalTitleIndic_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__ansi_globalTitleIndic_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__ansi_globalTitleIndic_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__ansi_routingIndicator_xer_ = { {"routingIndicator>\n", "routingIndicator>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__ansi_routingIndicator_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__ansi_routingIndicator_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_ansi.routingIndicator", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__ansi_routingIndicator_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__ansi_routingIndicator_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__ansi_routingIndicator_default_coding("RAW");
const XERdescriptor_t       SCCP__field__AddressIndicator__ansi_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__AddressIndicator__ansi_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__ansi_reserved_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_ansi.reserved", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__AddressIndicator__ansi_reserved_xer_, &BITSTRING_json_, &SCCP__field__AddressIndicator__ansi_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__ansi_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__AddressIndicator__ansi_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 SCCP__field__AddressIndicator__ansi
const TTCN_Typedescriptor_t SCCP__field__AddressIndicator__ansi_descr_ = { "@SCCP_Types.SCCP_field_AddressIndicator_ansi", NULL, &SCCP__field__AddressIndicator__ansi_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__AddressIndicator__ansi_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__itu_xer_ = { {"SCCP_field_SignallingPointCode_itu>\n", "SCCP_field_SignallingPointCode_itu>\n"}, {36, 36}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__itu_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__itu_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_itu", &BITSTRING_ber_, &General__Types::BIT16_raw_, NULL, &SCCP__field__SignallingPointCode__itu_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__itu_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__itu_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__ansi_xer_ = { {"SCCP_field_SignallingPointCode_ansi>\n", "SCCP_field_SignallingPointCode_ansi>\n"}, {37, 37}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__ansi_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__ansi_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_ansi", &BITSTRING_ber_, &General__Types::BIT24_raw_, NULL, &SCCP__field__SignallingPointCode__ansi_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__ansi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__ansi_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__ttc_xer_ = { {"SCCP_field_SignallingPointCode_ttc>\n", "SCCP_field_SignallingPointCode_ttc>\n"}, {36, 36}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__ttc_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__ttc_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_ttc", &BITSTRING_ber_, &General__Types::BIT16_raw_, NULL, &SCCP__field__SignallingPointCode__ttc_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__ttc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__ttc_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__mpt_xer_ = { {"SCCP_field_SignallingPointCode_mpt>\n", "SCCP_field_SignallingPointCode_mpt>\n"}, {36, 36}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__mpt_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__mpt_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_mpt", &BITSTRING_ber_, &General__Types::BIT24_raw_, NULL, &SCCP__field__SignallingPointCode__mpt_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__mpt_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__mpt_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__SubsystemNumber_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__field__SubsystemNumber_xer_ = { {"SCCP_field_SubsystemNumber>\n", "SCCP_field_SubsystemNumber>\n"}, {28, 28}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__field__SubsystemNumber_descr_ = { "@SCCP_Types.SCCP_field_SubsystemNumber", &INTEGER_ber_, &SCCP__field__SubsystemNumber_raw_, &INTEGER_text_, &SCCP__field__SubsystemNumber_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SubsystemNumber_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__NoA_natureOfAddress_xer_ = { {"natureOfAddress>\n", "natureOfAddress>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__GlobalTitle__NoA_natureOfAddress_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__NoA_natureOfAddress_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_NoA.natureOfAddress", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &SCCP__field__GlobalTitle__NoA_natureOfAddress_xer_, &BITSTRING_json_, &SCCP__field__GlobalTitle__NoA_natureOfAddress_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__NoA_natureOfAddress_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__NoA_oddeven_xer_ = { {"oddeven>\n", "oddeven>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__GlobalTitle__NoA_oddeven_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__NoA_oddeven_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_NoA.oddeven", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__GlobalTitle__NoA_oddeven_xer_, &BITSTRING_json_, &SCCP__field__GlobalTitle__NoA_oddeven_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__NoA_oddeven_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__NoA_globalTitleAddress_xer_ = { {"globalTitleAddress>\n", "globalTitleAddress>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__NoA_globalTitleAddress_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_NoA.globalTitleAddress", NULL, &HEXSTRING_raw_, NULL, &SCCP__field__GlobalTitle__NoA_globalTitleAddress_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__NoA_globalTitleAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__GlobalTitle__NoA_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 SCCP__field__GlobalTitle__NoA
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__NoA_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_NoA", NULL, &SCCP__field__GlobalTitle__NoA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__NoA_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__TT_translationType_xer_ = { {"translationType>\n", "translationType>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__field__GlobalTitle__TT_translationType_oer_ext_arr_[0] = {};
const int SCCP__field__GlobalTitle__TT_translationType_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__field__GlobalTitle__TT_translationType_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SCCP__field__GlobalTitle__TT_translationType_oer_ext_arr_, 0, SCCP__field__GlobalTitle__TT_translationType_oer_p_};
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT_translationType_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT.translationType", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SCCP__field__GlobalTitle__TT_translationType_xer_, &OCTETSTRING_json_, &SCCP__field__GlobalTitle__TT_translationType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT_translationType_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__TT_globalTitleAddress_xer_ = { {"globalTitleAddress>\n", "globalTitleAddress>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT_globalTitleAddress_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT.globalTitleAddress", NULL, &HEXSTRING_raw_, NULL, &SCCP__field__GlobalTitle__TT_globalTitleAddress_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT_globalTitleAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__GlobalTitle__TT_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 SCCP__field__GlobalTitle__TT
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT", NULL, &SCCP__field__GlobalTitle__TT_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__TT__NP__ES_translationType_xer_ = { {"translationType>\n", "translationType>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__field__GlobalTitle__TT__NP__ES_translationType_oer_ext_arr_[0] = {};
const int SCCP__field__GlobalTitle__TT__NP__ES_translationType_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_translationType_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SCCP__field__GlobalTitle__TT__NP__ES_translationType_oer_ext_arr_, 0, SCCP__field__GlobalTitle__TT__NP__ES_translationType_oer_p_};
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_translationType_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.translationType", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SCCP__field__GlobalTitle__TT__NP__ES_translationType_xer_, &OCTETSTRING_json_, &SCCP__field__GlobalTitle__TT__NP__ES_translationType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT__NP__ES_translationType_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__TT__NP__ES_encodingScheme_xer_ = { {"encodingScheme>\n", "encodingScheme>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_encodingScheme_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_encodingScheme_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.encodingScheme", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__field__GlobalTitle__TT__NP__ES_encodingScheme_xer_, &BITSTRING_json_, &SCCP__field__GlobalTitle__TT__NP__ES_encodingScheme_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT__NP__ES_encodingScheme_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__TT__NP__ES_numberingPlan_xer_ = { {"numberingPlan>\n", "numberingPlan>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_numberingPlan_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_numberingPlan_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.numberingPlan", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__field__GlobalTitle__TT__NP__ES_numberingPlan_xer_, &BITSTRING_json_, &SCCP__field__GlobalTitle__TT__NP__ES_numberingPlan_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT__NP__ES_numberingPlan_default_coding("RAW");
const XERdescriptor_t       SCCP__field__GlobalTitle__TT__NP__ES_globalTitleAddress_xer_ = { {"globalTitleAddress>\n", "globalTitleAddress>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_globalTitleAddress_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.globalTitleAddress", NULL, &HEXSTRING_raw_, NULL, &SCCP__field__GlobalTitle__TT__NP__ES_globalTitleAddress_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT__NP__ES_globalTitleAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_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 SCCP__field__GlobalTitle__TT__NP__ES
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__TT__NP__ES_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES", NULL, &SCCP__field__GlobalTitle__TT__NP__ES_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__TT__NP__ES_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_xer_ = { {"translationType>\n", "translationType>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_oer_ext_arr_[0] = {};
const int SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_oer_ext_arr_, 0, SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_oer_p_};
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.translationType", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_xer_, &OCTETSTRING_json_, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__TT__NP__ES__NoA_translationType_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__TT__NP__ES__NoA_encodingScheme_xer_ = { {"encodingScheme>\n", "encodingScheme>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_encodingScheme_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_encodingScheme_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.encodingScheme", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_encodingScheme_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_encodingScheme_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__TT__NP__ES__NoA_encodingScheme_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__TT__NP__ES__NoA_numberingPlan_xer_ = { {"numberingPlan>\n", "numberingPlan>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_numberingPlan_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_numberingPlan_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.numberingPlan", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_numberingPlan_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_numberingPlan_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__TT__NP__ES__NoA_numberingPlan_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__TT__NP__ES__NoA_natureOfAddress_xer_ = { {"natureOfAddress>\n", "natureOfAddress>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_natureOfAddress_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_natureOfAddress_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.natureOfAddress", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_natureOfAddress_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_natureOfAddress_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__TT__NP__ES__NoA_natureOfAddress_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__TT__NP__ES__NoA_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_reserved_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.reserved", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_reserved_xer_, &BITSTRING_json_, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__TT__NP__ES__NoA_reserved_default_coding("RAW");
const XERdescriptor_t       SCCP__field__SignallingPointCode__TT__NP__ES__NoA_globalTitleAddress_xer_ = { {"globalTitleAddress>\n", "globalTitleAddress>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_globalTitleAddress_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.globalTitleAddress", NULL, &HEXSTRING_raw_, NULL, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_globalTitleAddress_xer_, &HEXSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__TT__NP__ES__NoA_globalTitleAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA
const TTCN_Typedescriptor_t SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_ = { "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA", NULL, &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__SignallingPointCode__TT__NP__ES__NoA_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__GlobalTitle__itu_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 SCCP__field__GlobalTitle__itu
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__itu_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_itu", NULL, &SCCP__field__GlobalTitle__itu_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__itu_gti0001_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__itu_gti0010_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__itu_gti0011_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__itu_gti0100_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__itu_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__GlobalTitle__ansi_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 SCCP__field__GlobalTitle__ansi
const TTCN_Typedescriptor_t SCCP__field__GlobalTitle__ansi_descr_ = { "@SCCP_Types.SCCP_field_GlobalTitle_ansi", NULL, &SCCP__field__GlobalTitle__ansi_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__ansi_gti0001_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__ansi_gti0010_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__field__GlobalTitle__ansi_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__field__Importance_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_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       SCCP__field__Importance_xer_ = { {"SCCP_field_Importance>\n", "SCCP_field_Importance>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__field__Importance_descr_ = { "@SCCP_Types.SCCP_field_Importance", &INTEGER_ber_, &SCCP__field__Importance_raw_, &INTEGER_text_, &SCCP__field__Importance_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__field__Importance_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__MessageType_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__MessageType_xer_ = { {"SCCP_param_MessageType>\n", "SCCP_param_MessageType>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__param__MessageType_descr_ = { "@SCCP_Types.SCCP_param_MessageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &SCCP__param__MessageType_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__MessageType_default_coding("RAW");
const XERdescriptor_t       _T_cr_xer_ = { {"SCCP_param_MessageType>\n", "SCCP_param_MessageType>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t _T_cr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t _T_cr_descr_ = { "@SCCP_Types.cr.<type>", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &_T_cr_xer_, &INTEGER_json_, &_T_cr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
INTEGER const_cr;
const INTEGER& cr = const_cr;
INTEGER const_cc;
const INTEGER& cc = const_cc;
INTEGER const_cref;
const INTEGER& cref = const_cref;
INTEGER const_rlsd;
const INTEGER& rlsd = const_rlsd;
INTEGER const_rlc;
const INTEGER& rlc = const_rlc;
INTEGER const_dt1;
const INTEGER& dt1 = const_dt1;
INTEGER const_dt2;
const INTEGER& dt2 = const_dt2;
INTEGER const_ak;
const INTEGER& ak = const_ak;
INTEGER const_udt;
const INTEGER& udt = const_udt;
INTEGER const_udts;
const INTEGER& udts = const_udts;
INTEGER const_ed;
const INTEGER& ed = const_ed;
INTEGER const_ea;
const INTEGER& ea = const_ea;
INTEGER const_rsr;
const INTEGER& rsr = const_rsr;
INTEGER const_rsc;
const INTEGER& rsc = const_rsc;
INTEGER const_err;
const INTEGER& err = const_err;
INTEGER const_it;
const INTEGER& it = const_it;
INTEGER const_xudt;
const INTEGER& xudt = const_xudt;
INTEGER const_xudts;
const INTEGER& xudts = const_xudts;
INTEGER const_ludt;
const INTEGER& ludt = const_ludt;
INTEGER const_ludts;
const INTEGER& ludts = const_ludts;
const XERdescriptor_t       SCCP__param__EndOfOptionalParams_paramName_xer_ = { {"paramName>\n", "paramName>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__EndOfOptionalParams_paramName_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__EndOfOptionalParams_paramName_descr_ = { "@SCCP_Types.SCCP_param_EndOfOptionalParams.paramName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__param__EndOfOptionalParams_paramName_xer_, &INTEGER_json_, &SCCP__param__EndOfOptionalParams_paramName_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__EndOfOptionalParams_paramName_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__EndOfOptionalParams_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 SCCP__param__EndOfOptionalParams
const TTCN_Typedescriptor_t SCCP__param__EndOfOptionalParams_descr_ = { "@SCCP_Types.SCCP_param_EndOfOptionalParams", NULL, &SCCP__param__EndOfOptionalParams_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__EndOfOptionalParams_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__DestLocalReference_raw_ = {24,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__DestLocalReference_xer_ = { {"SCCP_param_DestLocalReference>\n", "SCCP_param_DestLocalReference>\n"}, {31, 31}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__DestLocalReference_oer_ext_arr_[0] = {};
const int SCCP__param__DestLocalReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__DestLocalReference_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__DestLocalReference_oer_ext_arr_, 0, SCCP__param__DestLocalReference_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__DestLocalReference_descr_ = { "@SCCP_Types.SCCP_param_DestLocalReference", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &SCCP__param__DestLocalReference_xer_, &OCTETSTRING_json_, &SCCP__param__DestLocalReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__DestLocalReference_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__SourceLocalReference_raw_ = {24,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__SourceLocalReference_xer_ = { {"SCCP_param_SourceLocalReference>\n", "SCCP_param_SourceLocalReference>\n"}, {33, 33}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__SourceLocalReference_oer_ext_arr_[0] = {};
const int SCCP__param__SourceLocalReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__SourceLocalReference_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__SourceLocalReference_oer_ext_arr_, 0, SCCP__param__SourceLocalReference_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__SourceLocalReference_descr_ = { "@SCCP_Types.SCCP_param_SourceLocalReference", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &SCCP__param__SourceLocalReference_xer_, &OCTETSTRING_json_, &SCCP__param__SourceLocalReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SourceLocalReference_default_coding("RAW");
const XERdescriptor_t       SCCP__CPartyAddressEnc__addr_xer_ = { {"SCCP_CPartyAddressEnc_addr>\n", "SCCP_CPartyAddressEnc_addr>\n"}, {28, 28}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__CPartyAddressEnc__addr_oer_ext_arr_[0] = {};
const int SCCP__CPartyAddressEnc__addr_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__CPartyAddressEnc__addr_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__CPartyAddressEnc__addr_oer_ext_arr_, 0, SCCP__CPartyAddressEnc__addr_oer_p_};
const TTCN_Typedescriptor_t SCCP__CPartyAddressEnc__addr_descr_ = { "@SCCP_Types.SCCP_CPartyAddressEnc_addr", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SCCP__CPartyAddressEnc__addr_xer_, &OCTETSTRING_json_, &SCCP__CPartyAddressEnc__addr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__CPartyAddressEnc__addr_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddressEnc_paramLength_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddressEnc_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddressEnc_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddressEnc_paramLength_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddressEnc.paramLength", &INTEGER_ber_, &SCCP__param__CPartyAddressEnc_paramLength_raw_, &INTEGER_text_, &SCCP__param__CPartyAddressEnc_paramLength_xer_, &INTEGER_json_, &SCCP__param__CPartyAddressEnc_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddressEnc_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__CPartyAddressEnc_addr_xer_ = { {"addr>\n", "addr>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__CPartyAddressEnc_addr_oer_ext_arr_[0] = {};
const int SCCP__param__CPartyAddressEnc_addr_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__CPartyAddressEnc_addr_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__CPartyAddressEnc_addr_oer_ext_arr_, 0, SCCP__param__CPartyAddressEnc_addr_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__CPartyAddressEnc_addr_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddressEnc.addr", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SCCP__param__CPartyAddressEnc_addr_xer_, &OCTETSTRING_json_, &SCCP__param__CPartyAddressEnc_addr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddressEnc_addr_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddressEnc_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 SCCP__param__CPartyAddressEnc
const TTCN_Typedescriptor_t SCCP__param__CPartyAddressEnc_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddressEnc", NULL, &SCCP__param__CPartyAddressEnc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddressEnc_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__itu_addressIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__itu_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 SCCP__param__CPartyAddress__itu
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__itu_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_itu", NULL, &SCCP__param__CPartyAddress__itu_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__itu_signPointCode_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,16,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__itu_signPointCode_xer_ = { {"signPointCode>\n", "signPointCode>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__itu_signPointCode_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__itu_signPointCode_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_itu.signPointCode", &BITSTRING_ber_, &SCCP__param__CPartyAddress__itu_signPointCode_raw_, NULL, &SCCP__param__CPartyAddress__itu_signPointCode_xer_, &BITSTRING_json_, &SCCP__param__CPartyAddress__itu_signPointCode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__itu_signPointCode_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__itu_subsystemNumber_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__itu_subsystemNumber_xer_ = { {"subsystemNumber>\n", "subsystemNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__itu_subsystemNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__itu_subsystemNumber_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_itu.subsystemNumber", &INTEGER_ber_, &SCCP__param__CPartyAddress__itu_subsystemNumber_raw_, &INTEGER_text_, &SCCP__param__CPartyAddress__itu_subsystemNumber_xer_, &INTEGER_json_, &SCCP__param__CPartyAddress__itu_subsystemNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__itu_subsystemNumber_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__itu_globalTitle_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 SCCP__param__CPartyAddress__itu_globalTitle
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__itu_globalTitle_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_itu.globalTitle", NULL, &SCCP__param__CPartyAddress__itu_globalTitle_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__itu_globalTitle_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__itu_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ansi_addressIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ansi_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 SCCP__param__CPartyAddress__ansi
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ansi_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ansi", NULL, &SCCP__param__CPartyAddress__ansi_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ansi_subsystemNumber_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__ansi_subsystemNumber_xer_ = { {"subsystemNumber>\n", "subsystemNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__ansi_subsystemNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ansi_subsystemNumber_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ansi.subsystemNumber", &INTEGER_ber_, &SCCP__param__CPartyAddress__ansi_subsystemNumber_raw_, &INTEGER_text_, &SCCP__param__CPartyAddress__ansi_subsystemNumber_xer_, &INTEGER_json_, &SCCP__param__CPartyAddress__ansi_subsystemNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ansi_subsystemNumber_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ansi_signPointCode_raw_ = {24,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,24,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__ansi_signPointCode_xer_ = { {"signPointCode>\n", "signPointCode>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__ansi_signPointCode_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ansi_signPointCode_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ansi.signPointCode", &BITSTRING_ber_, &SCCP__param__CPartyAddress__ansi_signPointCode_raw_, NULL, &SCCP__param__CPartyAddress__ansi_signPointCode_xer_, &BITSTRING_json_, &SCCP__param__CPartyAddress__ansi_signPointCode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ansi_signPointCode_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ansi_globalTitle_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 SCCP__param__CPartyAddress__ansi_globalTitle
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ansi_globalTitle_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ansi.globalTitle", NULL, &SCCP__param__CPartyAddress__ansi_globalTitle_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ansi_globalTitle_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ansi_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ttc_addressIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ttc_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 SCCP__param__CPartyAddress__ttc
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ttc_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ttc", NULL, &SCCP__param__CPartyAddress__ttc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ttc_signPointCode_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,16,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__ttc_signPointCode_xer_ = { {"signPointCode>\n", "signPointCode>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__ttc_signPointCode_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ttc_signPointCode_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ttc.signPointCode", &BITSTRING_ber_, &SCCP__param__CPartyAddress__ttc_signPointCode_raw_, NULL, &SCCP__param__CPartyAddress__ttc_signPointCode_xer_, &BITSTRING_json_, &SCCP__param__CPartyAddress__ttc_signPointCode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ttc_signPointCode_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ttc_subsystemNumber_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__ttc_subsystemNumber_xer_ = { {"subsystemNumber>\n", "subsystemNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__ttc_subsystemNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ttc_subsystemNumber_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ttc.subsystemNumber", &INTEGER_ber_, &SCCP__param__CPartyAddress__ttc_subsystemNumber_raw_, &INTEGER_text_, &SCCP__param__CPartyAddress__ttc_subsystemNumber_xer_, &INTEGER_json_, &SCCP__param__CPartyAddress__ttc_subsystemNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ttc_subsystemNumber_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__ttc_globalTitle_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 SCCP__param__CPartyAddress__ttc_globalTitle
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__ttc_globalTitle_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_ttc.globalTitle", NULL, &SCCP__param__CPartyAddress__ttc_globalTitle_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ttc_globalTitle_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__ttc_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__mpt_addressIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__mpt_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 SCCP__param__CPartyAddress__mpt
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__mpt_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_mpt", NULL, &SCCP__param__CPartyAddress__mpt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__mpt_signPointCode_raw_ = {24,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,24,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__mpt_signPointCode_xer_ = { {"signPointCode>\n", "signPointCode>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__mpt_signPointCode_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__mpt_signPointCode_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_mpt.signPointCode", &BITSTRING_ber_, &SCCP__param__CPartyAddress__mpt_signPointCode_raw_, NULL, &SCCP__param__CPartyAddress__mpt_signPointCode_xer_, &BITSTRING_json_, &SCCP__param__CPartyAddress__mpt_signPointCode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__mpt_signPointCode_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__mpt_subsystemNumber_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddress__mpt_subsystemNumber_xer_ = { {"subsystemNumber>\n", "subsystemNumber>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddress__mpt_subsystemNumber_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__mpt_subsystemNumber_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_mpt.subsystemNumber", &INTEGER_ber_, &SCCP__param__CPartyAddress__mpt_subsystemNumber_raw_, &INTEGER_text_, &SCCP__param__CPartyAddress__mpt_subsystemNumber_xer_, &INTEGER_json_, &SCCP__param__CPartyAddress__mpt_subsystemNumber_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__mpt_subsystemNumber_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddress__mpt_globalTitle_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 SCCP__param__CPartyAddress__mpt_globalTitle
const TTCN_Typedescriptor_t SCCP__param__CPartyAddress__mpt_globalTitle_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddress_mpt.globalTitle", NULL, &SCCP__param__CPartyAddress__mpt_globalTitle_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__mpt_globalTitle_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddress__mpt_default_coding("RAW");
const XERdescriptor_t       SCCP__param__CPartyAddressEnc__opt_paramName_xer_ = { {"paramName>\n", "paramName>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddressEnc__opt_paramName_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddressEnc__opt_paramName_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt.paramName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__param__CPartyAddressEnc__opt_paramName_xer_, &INTEGER_json_, &SCCP__param__CPartyAddressEnc__opt_paramName_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddressEnc__opt_paramName_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddressEnc__opt_paramLength_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__CPartyAddressEnc__opt_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__CPartyAddressEnc__opt_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__CPartyAddressEnc__opt_paramLength_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt.paramLength", &INTEGER_ber_, &SCCP__param__CPartyAddressEnc__opt_paramLength_raw_, &INTEGER_text_, &SCCP__param__CPartyAddressEnc__opt_paramLength_xer_, &INTEGER_json_, &SCCP__param__CPartyAddressEnc__opt_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddressEnc__opt_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__CPartyAddressEnc__opt_addr_xer_ = { {"addr>\n", "addr>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__CPartyAddressEnc__opt_addr_oer_ext_arr_[0] = {};
const int SCCP__param__CPartyAddressEnc__opt_addr_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__CPartyAddressEnc__opt_addr_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__CPartyAddressEnc__opt_addr_oer_ext_arr_, 0, SCCP__param__CPartyAddressEnc__opt_addr_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__CPartyAddressEnc__opt_addr_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt.addr", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SCCP__param__CPartyAddressEnc__opt_addr_xer_, &OCTETSTRING_json_, &SCCP__param__CPartyAddressEnc__opt_addr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddressEnc__opt_addr_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__CPartyAddressEnc__opt_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 SCCP__param__CPartyAddressEnc__opt
const TTCN_Typedescriptor_t SCCP__param__CPartyAddressEnc__opt_descr_ = { "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt", NULL, &SCCP__param__CPartyAddressEnc__opt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__CPartyAddressEnc__opt_default_coding("RAW");
const XERdescriptor_t       SCCP__param__ProtocolClass_class__xer_ = { {"class>\n", "class>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__ProtocolClass_class__oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__ProtocolClass_class__descr_ = { "@SCCP_Types.SCCP_param_ProtocolClass.class", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__param__ProtocolClass_class__xer_, &BITSTRING_json_, &SCCP__param__ProtocolClass_class__oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__ProtocolClass_class__default_coding("RAW");
const XERdescriptor_t       SCCP__param__ProtocolClass_messageHandling_xer_ = { {"messageHandling>\n", "messageHandling>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__ProtocolClass_messageHandling_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__ProtocolClass_messageHandling_descr_ = { "@SCCP_Types.SCCP_param_ProtocolClass.messageHandling", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__param__ProtocolClass_messageHandling_xer_, &BITSTRING_json_, &SCCP__param__ProtocolClass_messageHandling_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__ProtocolClass_messageHandling_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__ProtocolClass_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 SCCP__param__ProtocolClass
const TTCN_Typedescriptor_t SCCP__param__ProtocolClass_descr_ = { "@SCCP_Types.SCCP_param_ProtocolClass", NULL, &SCCP__param__ProtocolClass_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__ProtocolClass_default_coding("RAW");
const XERdescriptor_t       SCCP__param__SegmentingReassembl_more_xer_ = { {"more>\n", "more>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__SegmentingReassembl_more_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__SegmentingReassembl_more_descr_ = { "@SCCP_Types.SCCP_param_SegmentingReassembl.more", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__param__SegmentingReassembl_more_xer_, &BITSTRING_json_, &SCCP__param__SegmentingReassembl_more_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SegmentingReassembl_more_default_coding("RAW");
const XERdescriptor_t       SCCP__param__SegmentingReassembl_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__SegmentingReassembl_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__SegmentingReassembl_reserved_descr_ = { "@SCCP_Types.SCCP_param_SegmentingReassembl.reserved", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &SCCP__param__SegmentingReassembl_reserved_xer_, &BITSTRING_json_, &SCCP__param__SegmentingReassembl_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SegmentingReassembl_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__SegmentingReassembl_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 SCCP__param__SegmentingReassembl
const TTCN_Typedescriptor_t SCCP__param__SegmentingReassembl_descr_ = { "@SCCP_Types.SCCP_param_SegmentingReassembl", NULL, &SCCP__param__SegmentingReassembl_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SegmentingReassembl_default_coding("RAW");
const XERdescriptor_t       SCCP__param__RecSeqNumber_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__RecSeqNumber_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__RecSeqNumber_reserved_descr_ = { "@SCCP_Types.SCCP_param_RecSeqNumber.reserved", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__param__RecSeqNumber_reserved_xer_, &BITSTRING_json_, &SCCP__param__RecSeqNumber_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__RecSeqNumber_reserved_default_coding("RAW");
const XERdescriptor_t       SCCP__param__RecSeqNumber_pr_xer_ = { {"pr>\n", "pr>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__RecSeqNumber_pr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__RecSeqNumber_pr_descr_ = { "@SCCP_Types.SCCP_param_RecSeqNumber.pr", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &SCCP__param__RecSeqNumber_pr_xer_, &BITSTRING_json_, &SCCP__param__RecSeqNumber_pr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__RecSeqNumber_pr_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__RecSeqNumber_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 SCCP__param__RecSeqNumber
const TTCN_Typedescriptor_t SCCP__param__RecSeqNumber_descr_ = { "@SCCP_Types.SCCP_param_RecSeqNumber", NULL, &SCCP__param__RecSeqNumber_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__RecSeqNumber_default_coding("RAW");
const XERdescriptor_t       SCCP__param__SequencingSegmenting_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__SequencingSegmenting_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__SequencingSegmenting_reserved_descr_ = { "@SCCP_Types.SCCP_param_SequencingSegmenting.reserved", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__param__SequencingSegmenting_reserved_xer_, &BITSTRING_json_, &SCCP__param__SequencingSegmenting_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SequencingSegmenting_reserved_default_coding("RAW");
const XERdescriptor_t       SCCP__param__SequencingSegmenting_p__s_xer_ = { {"p_s>\n", "p_s>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__SequencingSegmenting_p__s_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__SequencingSegmenting_p__s_descr_ = { "@SCCP_Types.SCCP_param_SequencingSegmenting.p_s", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &SCCP__param__SequencingSegmenting_p__s_xer_, &BITSTRING_json_, &SCCP__param__SequencingSegmenting_p__s_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SequencingSegmenting_p__s_default_coding("RAW");
const XERdescriptor_t       SCCP__param__SequencingSegmenting_more_xer_ = { {"more>\n", "more>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__SequencingSegmenting_more_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__SequencingSegmenting_more_descr_ = { "@SCCP_Types.SCCP_param_SequencingSegmenting.more", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__param__SequencingSegmenting_more_xer_, &BITSTRING_json_, &SCCP__param__SequencingSegmenting_more_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SequencingSegmenting_more_default_coding("RAW");
const XERdescriptor_t       SCCP__param__SequencingSegmenting_pr_xer_ = { {"pr>\n", "pr>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__SequencingSegmenting_pr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__SequencingSegmenting_pr_descr_ = { "@SCCP_Types.SCCP_param_SequencingSegmenting.pr", &BITSTRING_ber_, &General__Types::BIT7_raw_, NULL, &SCCP__param__SequencingSegmenting_pr_xer_, &BITSTRING_json_, &SCCP__param__SequencingSegmenting_pr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SequencingSegmenting_pr_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__SequencingSegmenting_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 SCCP__param__SequencingSegmenting
const TTCN_Typedescriptor_t SCCP__param__SequencingSegmenting_descr_ = { "@SCCP_Types.SCCP_param_SequencingSegmenting", NULL, &SCCP__param__SequencingSegmenting_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__SequencingSegmenting_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__Credit_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__Credit_xer_ = { {"SCCP_param_Credit>\n", "SCCP_param_Credit>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__Credit_oer_ext_arr_[0] = {};
const int SCCP__param__Credit_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__Credit_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__Credit_oer_ext_arr_, 0, SCCP__param__Credit_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__Credit_descr_ = { "@SCCP_Types.SCCP_param_Credit", &OCTETSTRING_ber_, &SCCP__param__Credit_raw_, &OCTETSTRING_text_, &SCCP__param__Credit_xer_, &OCTETSTRING_json_, &SCCP__param__Credit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Credit_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Credit__opt_paramName_xer_ = { {"paramName>\n", "paramName>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Credit__opt_paramName_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Credit__opt_paramName_descr_ = { "@SCCP_Types.SCCP_param_Credit_opt.paramName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__param__Credit__opt_paramName_xer_, &INTEGER_json_, &SCCP__param__Credit__opt_paramName_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Credit__opt_paramName_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Credit__opt_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Credit__opt_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Credit__opt_paramLength_descr_ = { "@SCCP_Types.SCCP_param_Credit_opt.paramLength", &INTEGER_ber_, &General__Types::LIN1_raw_, &INTEGER_text_, &SCCP__param__Credit__opt_paramLength_xer_, &INTEGER_json_, &SCCP__param__Credit__opt_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Credit__opt_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Credit__opt_credit_xer_ = { {"credit>\n", "credit>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__Credit__opt_credit_oer_ext_arr_[0] = {};
const int SCCP__param__Credit__opt_credit_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__Credit__opt_credit_oer_ = { -1, TRUE, 1, FALSE, 0, 0, SCCP__param__Credit__opt_credit_oer_ext_arr_, 0, SCCP__param__Credit__opt_credit_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__Credit__opt_credit_descr_ = { "@SCCP_Types.SCCP_param_Credit_opt.credit", &OCTETSTRING_ber_, &General__Types::OCT1_raw_, &OCTETSTRING_text_, &SCCP__param__Credit__opt_credit_xer_, &OCTETSTRING_json_, &SCCP__param__Credit__opt_credit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Credit__opt_credit_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__Credit__opt_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 SCCP__param__Credit__opt
const TTCN_Typedescriptor_t SCCP__param__Credit__opt_descr_ = { "@SCCP_Types.SCCP_param_Credit_opt", NULL, &SCCP__param__Credit__opt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Credit__opt_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__ReleaseCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__ReleaseCause_xer_ = { {"SCCP_param_ReleaseCause>\n", "SCCP_param_ReleaseCause>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__param__ReleaseCause_descr_ = { "@SCCP_Types.SCCP_param_ReleaseCause", &INTEGER_ber_, &SCCP__param__ReleaseCause_raw_, &INTEGER_text_, &SCCP__param__ReleaseCause_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__ReleaseCause_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__ReturnCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__ReturnCause_xer_ = { {"SCCP_param_ReturnCause>\n", "SCCP_param_ReturnCause>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__param__ReturnCause_descr_ = { "@SCCP_Types.SCCP_param_ReturnCause", &INTEGER_ber_, &SCCP__param__ReturnCause_raw_, &INTEGER_text_, &SCCP__param__ReturnCause_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__ReturnCause_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__ResetCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__ResetCause_xer_ = { {"SCCP_param_ResetCause>\n", "SCCP_param_ResetCause>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__param__ResetCause_descr_ = { "@SCCP_Types.SCCP_param_ResetCause", &INTEGER_ber_, &SCCP__param__ResetCause_raw_, &INTEGER_text_, &SCCP__param__ResetCause_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__ResetCause_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__ErrorCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__ErrorCause_xer_ = { {"SCCP_param_ErrorCause>\n", "SCCP_param_ErrorCause>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__param__ErrorCause_descr_ = { "@SCCP_Types.SCCP_param_ErrorCause", &INTEGER_ber_, &SCCP__param__ErrorCause_raw_, &INTEGER_text_, &SCCP__param__ErrorCause_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__ErrorCause_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__RefusalCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__RefusalCause_xer_ = { {"SCCP_param_RefusalCause>\n", "SCCP_param_RefusalCause>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__param__RefusalCause_descr_ = { "@SCCP_Types.SCCP_param_RefusalCause", &INTEGER_ber_, &SCCP__param__RefusalCause_raw_, &INTEGER_text_, &SCCP__param__RefusalCause_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__RefusalCause_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__Data_paramLength_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__Data_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Data_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Data_paramLength_descr_ = { "@SCCP_Types.SCCP_param_Data.paramLength", &INTEGER_ber_, &SCCP__param__Data_paramLength_raw_, &INTEGER_text_, &SCCP__param__Data_paramLength_xer_, &INTEGER_json_, &SCCP__param__Data_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Data_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Data_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__Data_data_oer_ext_arr_[0] = {};
const int SCCP__param__Data_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__Data_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__Data_data_oer_ext_arr_, 0, SCCP__param__Data_data_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__Data_data_descr_ = { "@SCCP_Types.SCCP_param_Data.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SCCP__param__Data_data_xer_, &OCTETSTRING_json_, &SCCP__param__Data_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Data_data_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__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 SCCP__param__Data
const TTCN_Typedescriptor_t SCCP__param__Data_descr_ = { "@SCCP_Types.SCCP_param_Data", NULL, &SCCP__param__Data_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Data_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Data__opt_paramName_xer_ = { {"paramName>\n", "paramName>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Data__opt_paramName_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Data__opt_paramName_descr_ = { "@SCCP_Types.SCCP_param_Data_opt.paramName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__param__Data__opt_paramName_xer_, &INTEGER_json_, &SCCP__param__Data__opt_paramName_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Data__opt_paramName_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__Data__opt_paramLength_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__Data__opt_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Data__opt_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Data__opt_paramLength_descr_ = { "@SCCP_Types.SCCP_param_Data_opt.paramLength", &INTEGER_ber_, &SCCP__param__Data__opt_paramLength_raw_, &INTEGER_text_, &SCCP__param__Data__opt_paramLength_xer_, &INTEGER_json_, &SCCP__param__Data__opt_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Data__opt_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Data__opt_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__Data__opt_data_oer_ext_arr_[0] = {};
const int SCCP__param__Data__opt_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__Data__opt_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__Data__opt_data_oer_ext_arr_, 0, SCCP__param__Data__opt_data_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__Data__opt_data_descr_ = { "@SCCP_Types.SCCP_param_Data_opt.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SCCP__param__Data__opt_data_xer_, &OCTETSTRING_json_, &SCCP__param__Data__opt_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Data__opt_data_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__Data__opt_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 SCCP__param__Data__opt
const TTCN_Typedescriptor_t SCCP__param__Data__opt_descr_ = { "@SCCP_Types.SCCP_param_Data_opt", NULL, &SCCP__param__Data__opt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Data__opt_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Segmentation__opt_paramName_xer_ = { {"paramName>\n", "paramName>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Segmentation__opt_paramName_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_paramName_descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt.paramName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__param__Segmentation__opt_paramName_xer_, &INTEGER_json_, &SCCP__param__Segmentation__opt_paramName_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_paramName_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Segmentation__opt_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Segmentation__opt_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_paramLength_descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt.paramLength", &INTEGER_ber_, &General__Types::LIN1_raw_, &INTEGER_text_, &SCCP__param__Segmentation__opt_paramLength_xer_, &INTEGER_json_, &SCCP__param__Segmentation__opt_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Segmentation__opt_remainingSegment_xer_ = { {"remainingSegment>\n", "remainingSegment>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Segmentation__opt_remainingSegment_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_remainingSegment_descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt.remainingSegment", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCCP__param__Segmentation__opt_remainingSegment_xer_, &BITSTRING_json_, &SCCP__param__Segmentation__opt_remainingSegment_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_remainingSegment_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Segmentation__opt_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Segmentation__opt_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_reserved_descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt.reserved", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SCCP__param__Segmentation__opt_reserved_xer_, &BITSTRING_json_, &SCCP__param__Segmentation__opt_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_reserved_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Segmentation__opt_class__xer_ = { {"class>\n", "class>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Segmentation__opt_class__oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_class__descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt.class", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__param__Segmentation__opt_class__xer_, &BITSTRING_json_, &SCCP__param__Segmentation__opt_class__oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_class__default_coding("RAW");
const XERdescriptor_t       SCCP__param__Segmentation__opt_firstSegm_xer_ = { {"firstSegm>\n", "firstSegm>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Segmentation__opt_firstSegm_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_firstSegm_descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt.firstSegm", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &SCCP__param__Segmentation__opt_firstSegm_xer_, &BITSTRING_json_, &SCCP__param__Segmentation__opt_firstSegm_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_firstSegm_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Segmentation__opt_segmLocalRef_xer_ = { {"segmLocalRef>\n", "segmLocalRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__Segmentation__opt_segmLocalRef_oer_ext_arr_[0] = {};
const int SCCP__param__Segmentation__opt_segmLocalRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__Segmentation__opt_segmLocalRef_oer_ = { -1, TRUE, 3, FALSE, 0, 0, SCCP__param__Segmentation__opt_segmLocalRef_oer_ext_arr_, 0, SCCP__param__Segmentation__opt_segmLocalRef_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_segmLocalRef_descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt.segmLocalRef", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &SCCP__param__Segmentation__opt_segmLocalRef_xer_, &OCTETSTRING_json_, &SCCP__param__Segmentation__opt_segmLocalRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_segmLocalRef_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__Segmentation__opt_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 SCCP__param__Segmentation__opt
const TTCN_Typedescriptor_t SCCP__param__Segmentation__opt_descr_ = { "@SCCP_Types.SCCP_param_Segmentation_opt", NULL, &SCCP__param__Segmentation__opt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Segmentation__opt_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__HopCounter_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__HopCounter_xer_ = { {"SCCP_param_HopCounter>\n", "SCCP_param_HopCounter>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__param__HopCounter_descr_ = { "@SCCP_Types.SCCP_param_HopCounter", &INTEGER_ber_, &SCCP__param__HopCounter_raw_, &INTEGER_text_, &SCCP__param__HopCounter_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__HopCounter_default_coding("RAW");
const XERdescriptor_t       SCCP__param__HopCounter__opt_paramName_xer_ = { {"paramName>\n", "paramName>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__HopCounter__opt_paramName_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__HopCounter__opt_paramName_descr_ = { "@SCCP_Types.SCCP_param_HopCounter_opt.paramName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__param__HopCounter__opt_paramName_xer_, &INTEGER_json_, &SCCP__param__HopCounter__opt_paramName_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__HopCounter__opt_paramName_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__HopCounter__opt_paramLength_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SCCP__param__HopCounter__opt_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__HopCounter__opt_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__HopCounter__opt_paramLength_descr_ = { "@SCCP_Types.SCCP_param_HopCounter_opt.paramLength", &INTEGER_ber_, &SCCP__param__HopCounter__opt_paramLength_raw_, &INTEGER_text_, &SCCP__param__HopCounter__opt_paramLength_xer_, &INTEGER_json_, &SCCP__param__HopCounter__opt_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__HopCounter__opt_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__HopCounter__opt_counter_xer_ = { {"counter>\n", "counter>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__HopCounter__opt_counter_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__HopCounter__opt_counter_descr_ = { "@SCCP_Types.SCCP_param_HopCounter_opt.counter", &INTEGER_ber_, &SCCP__param__HopCounter_raw_, &INTEGER_text_, &SCCP__param__HopCounter__opt_counter_xer_, &INTEGER_json_, &SCCP__param__HopCounter__opt_counter_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__HopCounter__opt_counter_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__HopCounter__opt_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 SCCP__param__HopCounter__opt
const TTCN_Typedescriptor_t SCCP__param__HopCounter__opt_descr_ = { "@SCCP_Types.SCCP_param_HopCounter_opt", NULL, &SCCP__param__HopCounter__opt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__HopCounter__opt_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Importance__opt_paramName_xer_ = { {"paramName>\n", "paramName>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Importance__opt_paramName_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Importance__opt_paramName_descr_ = { "@SCCP_Types.SCCP_param_Importance_opt.paramName", &INTEGER_ber_, &SCCP__field__ParameterName_raw_, &INTEGER_text_, &SCCP__param__Importance__opt_paramName_xer_, &INTEGER_json_, &SCCP__param__Importance__opt_paramName_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Importance__opt_paramName_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Importance__opt_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Importance__opt_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Importance__opt_paramLength_descr_ = { "@SCCP_Types.SCCP_param_Importance_opt.paramLength", &INTEGER_ber_, &General__Types::LIN1_raw_, &INTEGER_text_, &SCCP__param__Importance__opt_paramLength_xer_, &INTEGER_json_, &SCCP__param__Importance__opt_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Importance__opt_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Importance__opt_importance_xer_ = { {"importance>\n", "importance>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Importance__opt_importance_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Importance__opt_importance_descr_ = { "@SCCP_Types.SCCP_param_Importance_opt.importance", &INTEGER_ber_, &SCCP__field__Importance_raw_, &INTEGER_text_, &SCCP__param__Importance__opt_importance_xer_, &INTEGER_json_, &SCCP__param__Importance__opt_importance_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Importance__opt_importance_default_coding("RAW");
const XERdescriptor_t       SCCP__param__Importance__opt_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__Importance__opt_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__Importance__opt_reserved_descr_ = { "@SCCP_Types.SCCP_param_Importance_opt.reserved", &BITSTRING_ber_, &General__Types::BIT5_raw_, NULL, &SCCP__param__Importance__opt_reserved_xer_, &BITSTRING_json_, &SCCP__param__Importance__opt_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Importance__opt_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__Importance__opt_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 SCCP__param__Importance__opt
const TTCN_Typedescriptor_t SCCP__param__Importance__opt_descr_ = { "@SCCP_Types.SCCP_param_Importance_opt", NULL, &SCCP__param__Importance__opt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__Importance__opt_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__LongData_paramLength_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_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       SCCP__param__LongData_paramLength_xer_ = { {"paramLength>\n", "paramLength>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCCP__param__LongData_paramLength_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCCP__param__LongData_paramLength_descr_ = { "@SCCP_Types.SCCP_param_LongData.paramLength", &INTEGER_ber_, &SCCP__param__LongData_paramLength_raw_, &INTEGER_text_, &SCCP__param__LongData_paramLength_xer_, &INTEGER_json_, &SCCP__param__LongData_paramLength_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__LongData_paramLength_default_coding("RAW");
const XERdescriptor_t       SCCP__param__LongData_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SCCP__param__LongData_data_oer_ext_arr_[0] = {};
const int SCCP__param__LongData_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t SCCP__param__LongData_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SCCP__param__LongData_data_oer_ext_arr_, 0, SCCP__param__LongData_data_oer_p_};
const TTCN_Typedescriptor_t SCCP__param__LongData_data_descr_ = { "@SCCP_Types.SCCP_param_LongData.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SCCP__param__LongData_data_xer_, &OCTETSTRING_json_, &SCCP__param__LongData_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__LongData_data_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__param__LongData_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 SCCP__param__LongData
const TTCN_Typedescriptor_t SCCP__param__LongData_descr_ = { "@SCCP_Types.SCCP_param_LongData", NULL, &SCCP__param__LongData_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__param__LongData_default_coding("RAW");
const TTCN_RAWdescriptor_t SCMG__param__FormatId_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SCMG__param__FormatId
const TTCN_Typedescriptor_t SCMG__param__FormatId_descr_ = { "@SCCP_Types.SCMG_param_FormatId", NULL, &SCMG__param__FormatId_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__FormatId_default_coding("RAW");
const XERdescriptor_t       SCMG__param__AffectedSSN_xer_ = { {"SCMG_param_AffectedSSN>\n", "SCMG_param_AffectedSSN>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCMG__param__AffectedSSN_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCMG__param__AffectedSSN_descr_ = { "@SCCP_Types.SCMG_param_AffectedSSN", &INTEGER_ber_, &SCCP__field__SubsystemNumber_raw_, &INTEGER_text_, &SCMG__param__AffectedSSN_xer_, &INTEGER_json_, &SCMG__param__AffectedSSN_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__AffectedSSN_default_coding("RAW");
const XERdescriptor_t       SCMG__param__AffectedPointCode_xer_ = { {"SCMG_param_AffectedPointCode>\n", "SCMG_param_AffectedPointCode>\n"}, {30, 30}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCMG__param__AffectedPointCode_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCMG__param__AffectedPointCode_descr_ = { "@SCCP_Types.SCMG_param_AffectedPointCode", &BITSTRING_ber_, &General__Types::BIT16_raw_, NULL, &SCMG__param__AffectedPointCode_xer_, &BITSTRING_json_, &SCMG__param__AffectedPointCode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__AffectedPointCode_default_coding("RAW");
const XERdescriptor_t       SCMG__param__MultiplIndicator_smi_xer_ = { {"smi>\n", "smi>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCMG__param__MultiplIndicator_smi_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCMG__param__MultiplIndicator_smi_descr_ = { "@SCCP_Types.SCMG_param_MultiplIndicator.smi", &BITSTRING_ber_, &General__Types::BIT2_raw_, NULL, &SCMG__param__MultiplIndicator_smi_xer_, &BITSTRING_json_, &SCMG__param__MultiplIndicator_smi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__MultiplIndicator_smi_default_coding("RAW");
const XERdescriptor_t       SCMG__param__MultiplIndicator_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCMG__param__MultiplIndicator_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCMG__param__MultiplIndicator_reserved_descr_ = { "@SCCP_Types.SCMG_param_MultiplIndicator.reserved", &BITSTRING_ber_, &General__Types::BIT6_raw_, NULL, &SCMG__param__MultiplIndicator_reserved_xer_, &BITSTRING_json_, &SCMG__param__MultiplIndicator_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__MultiplIndicator_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t SCMG__param__MultiplIndicator_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 SCMG__param__MultiplIndicator
const TTCN_Typedescriptor_t SCMG__param__MultiplIndicator_descr_ = { "@SCCP_Types.SCMG_param_MultiplIndicator", NULL, &SCMG__param__MultiplIndicator_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__MultiplIndicator_default_coding("RAW");
const XERdescriptor_t       SCMG__param__CongestionLevel_congLevel_xer_ = { {"congLevel>\n", "congLevel>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCMG__param__CongestionLevel_congLevel_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCMG__param__CongestionLevel_congLevel_descr_ = { "@SCCP_Types.SCMG_param_CongestionLevel.congLevel", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCMG__param__CongestionLevel_congLevel_xer_, &BITSTRING_json_, &SCMG__param__CongestionLevel_congLevel_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__CongestionLevel_congLevel_default_coding("RAW");
const XERdescriptor_t       SCMG__param__CongestionLevel_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SCMG__param__CongestionLevel_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SCMG__param__CongestionLevel_reserved_descr_ = { "@SCCP_Types.SCMG_param_CongestionLevel.reserved", &BITSTRING_ber_, &General__Types::BIT4_raw_, NULL, &SCMG__param__CongestionLevel_reserved_xer_, &BITSTRING_json_, &SCMG__param__CongestionLevel_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__CongestionLevel_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t SCMG__param__CongestionLevel_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 SCMG__param__CongestionLevel
const TTCN_Typedescriptor_t SCMG__param__CongestionLevel_descr_ = { "@SCCP_Types.SCMG_param_CongestionLevel", NULL, &SCMG__param__CongestionLevel_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCMG__param__CongestionLevel_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__ConnReq__optionalPart_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 SCCP__ConnReq__optionalPart
const TTCN_Typedescriptor_t SCCP__ConnReq__optionalPart_descr_ = { "@SCCP_Types.SCCP_ConnReq_optionalPart", NULL, &SCCP__ConnReq__optionalPart_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__ConnReq__optionalPart_credit_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnReq__optionalPart_callingPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnReq__optionalPart_data_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnReq__optionalPart_hopCounter_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnReq__optionalPart_importance_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnReq__optionalPart_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionRequest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRequest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRequest_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRequest.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionRequest_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionRequest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionRequest_sourceLocRef_xer_ = { {"sourceLocRef>\n", "sourceLocRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ConnectionRequest_sourceLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ConnectionRequest_sourceLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRequest_sourceLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ConnectionRequest_sourceLocRef_oer_ext_arr_, 0, PDU__SCCP__ConnectionRequest_sourceLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRequest_sourceLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRequest.sourceLocRef", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ConnectionRequest_sourceLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ConnectionRequest_sourceLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_sourceLocRef_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_protClass_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ConnectionRequest_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ConnectionRequest_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRequest_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRequest_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRequest.pointer1", &INTEGER_ber_, &PDU__SCCP__ConnectionRequest_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionRequest_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionRequest_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ConnectionRequest_pointer2_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ConnectionRequest_pointer2_xer_ = { {"pointer2>\n", "pointer2>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRequest_pointer2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRequest_pointer2_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRequest.pointer2", &INTEGER_ber_, &PDU__SCCP__ConnectionRequest_pointer2_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionRequest_pointer2_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionRequest_pointer2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_pointer2_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_calledPAddress_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ConnectionRequest_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__SCCP__ConnectionRequest
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRequest_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRequest", NULL, &PDU__SCCP__ConnectionRequest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRequest_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__ConnConfirm__optionalPart_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 SCCP__ConnConfirm__optionalPart
const TTCN_Typedescriptor_t SCCP__ConnConfirm__optionalPart_descr_ = { "@SCCP_Types.SCCP_ConnConfirm_optionalPart", NULL, &SCCP__ConnConfirm__optionalPart_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__ConnConfirm__optionalPart_credit_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnConfirm__optionalPart_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnConfirm__optionalPart_data_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnConfirm__optionalPart_importance_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnConfirm__optionalPart_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionConfirm_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionConfirm_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionConfirm_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionConfirm.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionConfirm_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionConfirm_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionConfirm_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ConnectionConfirm_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ConnectionConfirm_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionConfirm_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ConnectionConfirm_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ConnectionConfirm_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionConfirm_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionConfirm.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ConnectionConfirm_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ConnectionConfirm_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionConfirm_sourceLocRef_xer_ = { {"sourceLocRef>\n", "sourceLocRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ConnectionConfirm_sourceLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ConnectionConfirm_sourceLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionConfirm_sourceLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ConnectionConfirm_sourceLocRef_oer_ext_arr_, 0, PDU__SCCP__ConnectionConfirm_sourceLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionConfirm_sourceLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionConfirm.sourceLocRef", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ConnectionConfirm_sourceLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ConnectionConfirm_sourceLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_sourceLocRef_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_protClass_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ConnectionConfirm_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ConnectionConfirm_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionConfirm_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionConfirm_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionConfirm.pointer1", &INTEGER_ber_, &PDU__SCCP__ConnectionConfirm_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionConfirm_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionConfirm_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ConnectionConfirm_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__SCCP__ConnectionConfirm
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionConfirm_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionConfirm", NULL, &PDU__SCCP__ConnectionConfirm_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionConfirm_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__ConnRefused__optionalPart_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 SCCP__ConnRefused__optionalPart
const TTCN_Typedescriptor_t SCCP__ConnRefused__optionalPart_descr_ = { "@SCCP_Types.SCCP_ConnRefused_optionalPart", NULL, &SCCP__ConnRefused__optionalPart_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__ConnRefused__optionalPart_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnRefused__optionalPart_data_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnRefused__optionalPart_importance_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ConnRefused__optionalPart_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionRefused_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRefused_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRefused_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRefused.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionRefused_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionRefused_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRefused_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionRefused_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ConnectionRefused_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ConnectionRefused_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRefused_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ConnectionRefused_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ConnectionRefused_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRefused_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRefused.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ConnectionRefused_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ConnectionRefused_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRefused_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ConnectionRefused_refusalCause_xer_ = { {"refusalCause>\n", "refusalCause>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRefused_refusalCause_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRefused_refusalCause_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRefused.refusalCause", &INTEGER_ber_, &SCCP__param__RefusalCause_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionRefused_refusalCause_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionRefused_refusalCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRefused_refusalCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ConnectionRefused_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ConnectionRefused_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ConnectionRefused_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRefused_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRefused.pointer1", &INTEGER_ber_, &PDU__SCCP__ConnectionRefused_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__ConnectionRefused_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__ConnectionRefused_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRefused_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ConnectionRefused_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__SCCP__ConnectionRefused
const TTCN_Typedescriptor_t PDU__SCCP__ConnectionRefused_descr_ = { "@SCCP_Types.PDU_SCCP_ConnectionRefused", NULL, &PDU__SCCP__ConnectionRefused_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRefused_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRefused_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ConnectionRefused_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__Released__optionalPart_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 SCCP__Released__optionalPart
const TTCN_Typedescriptor_t SCCP__Released__optionalPart_descr_ = { "@SCCP_Types.SCCP_Released_optionalPart", NULL, &SCCP__Released__optionalPart_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__Released__optionalPart_data_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__Released__optionalPart_importance_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__Released__optionalPart_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__Released_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__Released_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__Released_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_Released.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__Released_messageType_xer_, &INTEGER_json_, &PDU__SCCP__Released_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Released_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__Released_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__Released_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__Released_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__Released_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__Released_destLocRef_oer_ext_arr_, 0, PDU__SCCP__Released_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__Released_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_Released.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__Released_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__Released_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Released_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__Released_sourceLocRef_xer_ = { {"sourceLocRef>\n", "sourceLocRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__Released_sourceLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__Released_sourceLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__Released_sourceLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__Released_sourceLocRef_oer_ext_arr_, 0, PDU__SCCP__Released_sourceLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__Released_sourceLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_Released.sourceLocRef", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__Released_sourceLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__Released_sourceLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Released_sourceLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__Released_releaseCause_xer_ = { {"releaseCause>\n", "releaseCause>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__Released_releaseCause_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__Released_releaseCause_descr_ = { "@SCCP_Types.PDU_SCCP_Released.releaseCause", &INTEGER_ber_, &SCCP__param__ReleaseCause_raw_, &INTEGER_text_, &PDU__SCCP__Released_releaseCause_xer_, &INTEGER_json_, &PDU__SCCP__Released_releaseCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Released_releaseCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__Released_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__Released_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__Released_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__Released_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_Released.pointer1", &INTEGER_ber_, &PDU__SCCP__Released_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__Released_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__Released_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Released_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__Released_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__SCCP__Released
const TTCN_Typedescriptor_t PDU__SCCP__Released_descr_ = { "@SCCP_Types.PDU_SCCP_Released", NULL, &PDU__SCCP__Released_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Released_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__Released_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__Released_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ReleaseComplete_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ReleaseComplete_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ReleaseComplete_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ReleaseComplete.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ReleaseComplete_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ReleaseComplete_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ReleaseComplete_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ReleaseComplete_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ReleaseComplete_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ReleaseComplete_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ReleaseComplete_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ReleaseComplete_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ReleaseComplete_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ReleaseComplete_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ReleaseComplete.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ReleaseComplete_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ReleaseComplete_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ReleaseComplete_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ReleaseComplete_sourceLocRef_xer_ = { {"sourceLocRef>\n", "sourceLocRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ReleaseComplete_sourceLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ReleaseComplete_sourceLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ReleaseComplete_sourceLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ReleaseComplete_sourceLocRef_oer_ext_arr_, 0, PDU__SCCP__ReleaseComplete_sourceLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ReleaseComplete_sourceLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ReleaseComplete.sourceLocRef", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ReleaseComplete_sourceLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ReleaseComplete_sourceLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ReleaseComplete_sourceLocRef_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ReleaseComplete_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__SCCP__ReleaseComplete
const TTCN_Typedescriptor_t PDU__SCCP__ReleaseComplete_descr_ = { "@SCCP_Types.PDU_SCCP_ReleaseComplete", NULL, &PDU__SCCP__ReleaseComplete_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ReleaseComplete_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__DataForm1_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__DataForm1_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__DataForm1_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm1.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__DataForm1_messageType_xer_, &INTEGER_json_, &PDU__SCCP__DataForm1_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm1_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__DataForm1_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__DataForm1_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__DataForm1_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__DataForm1_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__DataForm1_destLocRef_oer_ext_arr_, 0, PDU__SCCP__DataForm1_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__DataForm1_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm1.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__DataForm1_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__DataForm1_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm1_destLocRef_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm1_segmentingReassembl_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__DataForm1_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__DataForm1_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__DataForm1_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__DataForm1_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm1.pointer1", &INTEGER_ber_, &PDU__SCCP__DataForm1_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__DataForm1_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__DataForm1_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm1_pointer1_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm1_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__DataForm1_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__SCCP__DataForm1
const TTCN_Typedescriptor_t PDU__SCCP__DataForm1_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm1", NULL, &PDU__SCCP__DataForm1_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm1_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__DataForm2_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__DataForm2_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__DataForm2_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm2.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__DataForm2_messageType_xer_, &INTEGER_json_, &PDU__SCCP__DataForm2_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm2_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__DataForm2_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__DataForm2_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__DataForm2_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__DataForm2_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__DataForm2_destLocRef_oer_ext_arr_, 0, PDU__SCCP__DataForm2_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__DataForm2_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm2.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__DataForm2_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__DataForm2_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm2_destLocRef_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm2_sequencingSegmenting_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__DataForm2_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__DataForm2_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__DataForm2_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__DataForm2_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm2.pointer1", &INTEGER_ber_, &PDU__SCCP__DataForm2_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__DataForm2_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__DataForm2_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm2_pointer1_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm2_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__DataForm2_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__SCCP__DataForm2
const TTCN_Typedescriptor_t PDU__SCCP__DataForm2_descr_ = { "@SCCP_Types.PDU_SCCP_DataForm2", NULL, &PDU__SCCP__DataForm2_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataForm2_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__DataAcknowledgement_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__DataAcknowledgement_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__DataAcknowledgement_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_DataAcknowledgement.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__DataAcknowledgement_messageType_xer_, &INTEGER_json_, &PDU__SCCP__DataAcknowledgement_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataAcknowledgement_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__DataAcknowledgement_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__DataAcknowledgement_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__DataAcknowledgement_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__DataAcknowledgement_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__DataAcknowledgement_destLocRef_oer_ext_arr_, 0, PDU__SCCP__DataAcknowledgement_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__DataAcknowledgement_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_DataAcknowledgement.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__DataAcknowledgement_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__DataAcknowledgement_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataAcknowledgement_destLocRef_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__DataAcknowledgement_recSeqNumber_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__DataAcknowledgement_credit_xer_ = { {"credit>\n", "credit>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__DataAcknowledgement_credit_oer_ext_arr_[0] = {};
const int PDU__SCCP__DataAcknowledgement_credit_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__DataAcknowledgement_credit_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__DataAcknowledgement_credit_oer_ext_arr_, 0, PDU__SCCP__DataAcknowledgement_credit_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__DataAcknowledgement_credit_descr_ = { "@SCCP_Types.PDU_SCCP_DataAcknowledgement.credit", &OCTETSTRING_ber_, &SCCP__param__Credit_raw_, &OCTETSTRING_text_, &PDU__SCCP__DataAcknowledgement_credit_xer_, &OCTETSTRING_json_, &PDU__SCCP__DataAcknowledgement_credit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataAcknowledgement_credit_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__DataAcknowledgement_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__SCCP__DataAcknowledgement
const TTCN_Typedescriptor_t PDU__SCCP__DataAcknowledgement_descr_ = { "@SCCP_Types.PDU_SCCP_DataAcknowledgement", NULL, &PDU__SCCP__DataAcknowledgement_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__DataAcknowledgement_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__Unitdata_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__Unitdata_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__Unitdata_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_Unitdata.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__Unitdata_messageType_xer_, &INTEGER_json_, &PDU__SCCP__Unitdata_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_messageType_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_protClass_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__Unitdata_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__Unitdata_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__Unitdata_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__Unitdata_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_Unitdata.pointer1", &INTEGER_ber_, &PDU__SCCP__Unitdata_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__Unitdata_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__Unitdata_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__Unitdata_pointer2_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__Unitdata_pointer2_xer_ = { {"pointer2>\n", "pointer2>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__Unitdata_pointer2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__Unitdata_pointer2_descr_ = { "@SCCP_Types.PDU_SCCP_Unitdata.pointer2", &INTEGER_ber_, &PDU__SCCP__Unitdata_pointer2_raw_, &INTEGER_text_, &PDU__SCCP__Unitdata_pointer2_xer_, &INTEGER_json_, &PDU__SCCP__Unitdata_pointer2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_pointer2_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__Unitdata_pointer3_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__Unitdata_pointer3_xer_ = { {"pointer3>\n", "pointer3>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__Unitdata_pointer3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__Unitdata_pointer3_descr_ = { "@SCCP_Types.PDU_SCCP_Unitdata.pointer3", &INTEGER_ber_, &PDU__SCCP__Unitdata_pointer3_raw_, &INTEGER_text_, &PDU__SCCP__Unitdata_pointer3_xer_, &INTEGER_json_, &PDU__SCCP__Unitdata_pointer3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_pointer3_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_callingPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__Unitdata_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__SCCP__Unitdata
const TTCN_Typedescriptor_t PDU__SCCP__Unitdata_descr_ = { "@SCCP_Types.PDU_SCCP_Unitdata", NULL, &PDU__SCCP__Unitdata_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__Unitdata_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__UnitdataService_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__UnitdataService_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__UnitdataService_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_UnitdataService.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__UnitdataService_messageType_xer_, &INTEGER_json_, &PDU__SCCP__UnitdataService_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__UnitdataService_returnCause_xer_ = { {"returnCause>\n", "returnCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__UnitdataService_returnCause_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__UnitdataService_returnCause_descr_ = { "@SCCP_Types.PDU_SCCP_UnitdataService.returnCause", &INTEGER_ber_, &SCCP__param__ReturnCause_raw_, &INTEGER_text_, &PDU__SCCP__UnitdataService_returnCause_xer_, &INTEGER_json_, &PDU__SCCP__UnitdataService_returnCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_returnCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__UnitdataService_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__UnitdataService_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__UnitdataService_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__UnitdataService_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_UnitdataService.pointer1", &INTEGER_ber_, &PDU__SCCP__UnitdataService_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__UnitdataService_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__UnitdataService_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__UnitdataService_pointer2_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__UnitdataService_pointer2_xer_ = { {"pointer2>\n", "pointer2>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__UnitdataService_pointer2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__UnitdataService_pointer2_descr_ = { "@SCCP_Types.PDU_SCCP_UnitdataService.pointer2", &INTEGER_ber_, &PDU__SCCP__UnitdataService_pointer2_raw_, &INTEGER_text_, &PDU__SCCP__UnitdataService_pointer2_xer_, &INTEGER_json_, &PDU__SCCP__UnitdataService_pointer2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_pointer2_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__UnitdataService_pointer3_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__UnitdataService_pointer3_xer_ = { {"pointer3>\n", "pointer3>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__UnitdataService_pointer3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__UnitdataService_pointer3_descr_ = { "@SCCP_Types.PDU_SCCP_UnitdataService.pointer3", &INTEGER_ber_, &PDU__SCCP__UnitdataService_pointer3_raw_, &INTEGER_text_, &PDU__SCCP__UnitdataService_pointer3_xer_, &INTEGER_json_, &PDU__SCCP__UnitdataService_pointer3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_pointer3_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_callingPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__UnitdataService_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__SCCP__UnitdataService
const TTCN_Typedescriptor_t PDU__SCCP__UnitdataService_descr_ = { "@SCCP_Types.PDU_SCCP_UnitdataService", NULL, &PDU__SCCP__UnitdataService_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__UnitdataService_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExpeditedData_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExpeditedData_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExpeditedData_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ExpeditedData.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ExpeditedData_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ExpeditedData_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedData_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExpeditedData_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ExpeditedData_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ExpeditedData_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ExpeditedData_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ExpeditedData_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ExpeditedData_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ExpeditedData_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ExpeditedData.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ExpeditedData_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ExpeditedData_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedData_destLocRef_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExpeditedData_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExpeditedData_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExpeditedData_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExpeditedData_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_ExpeditedData.pointer1", &INTEGER_ber_, &PDU__SCCP__ExpeditedData_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__ExpeditedData_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__ExpeditedData_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedData_pointer1_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedData_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExpeditedData_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__SCCP__ExpeditedData
const TTCN_Typedescriptor_t PDU__SCCP__ExpeditedData_descr_ = { "@SCCP_Types.PDU_SCCP_ExpeditedData", NULL, &PDU__SCCP__ExpeditedData_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedData_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExpeditedDataAck_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExpeditedDataAck_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExpeditedDataAck_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ExpeditedDataAck.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ExpeditedDataAck_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ExpeditedDataAck_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedDataAck_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExpeditedDataAck_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ExpeditedDataAck_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ExpeditedDataAck_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ExpeditedDataAck_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ExpeditedDataAck_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ExpeditedDataAck_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ExpeditedDataAck_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ExpeditedDataAck.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ExpeditedDataAck_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ExpeditedDataAck_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedDataAck_destLocRef_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExpeditedDataAck_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__SCCP__ExpeditedDataAck
const TTCN_Typedescriptor_t PDU__SCCP__ExpeditedDataAck_descr_ = { "@SCCP_Types.PDU_SCCP_ExpeditedDataAck", NULL, &PDU__SCCP__ExpeditedDataAck_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExpeditedDataAck_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ResetRequest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ResetRequest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ResetRequest_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ResetRequest.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ResetRequest_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ResetRequest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetRequest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ResetRequest_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ResetRequest_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ResetRequest_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ResetRequest_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ResetRequest_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ResetRequest_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ResetRequest_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ResetRequest.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ResetRequest_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ResetRequest_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetRequest_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ResetRequest_sourceLocRef_xer_ = { {"sourceLocRef>\n", "sourceLocRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ResetRequest_sourceLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ResetRequest_sourceLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ResetRequest_sourceLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ResetRequest_sourceLocRef_oer_ext_arr_, 0, PDU__SCCP__ResetRequest_sourceLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ResetRequest_sourceLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ResetRequest.sourceLocRef", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ResetRequest_sourceLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ResetRequest_sourceLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetRequest_sourceLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ResetRequest_resetCause_xer_ = { {"resetCause>\n", "resetCause>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ResetRequest_resetCause_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ResetRequest_resetCause_descr_ = { "@SCCP_Types.PDU_SCCP_ResetRequest.resetCause", &INTEGER_ber_, &SCCP__param__ResetCause_raw_, &INTEGER_text_, &PDU__SCCP__ResetRequest_resetCause_xer_, &INTEGER_json_, &PDU__SCCP__ResetRequest_resetCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetRequest_resetCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ResetRequest_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__SCCP__ResetRequest
const TTCN_Typedescriptor_t PDU__SCCP__ResetRequest_descr_ = { "@SCCP_Types.PDU_SCCP_ResetRequest", NULL, &PDU__SCCP__ResetRequest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetRequest_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ResetConfirm_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ResetConfirm_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ResetConfirm_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ResetConfirm.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ResetConfirm_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ResetConfirm_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetConfirm_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ResetConfirm_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ResetConfirm_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ResetConfirm_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ResetConfirm_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ResetConfirm_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ResetConfirm_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ResetConfirm_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ResetConfirm.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ResetConfirm_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ResetConfirm_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetConfirm_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ResetConfirm_sourceLocRef_xer_ = { {"sourceLocRef>\n", "sourceLocRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ResetConfirm_sourceLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ResetConfirm_sourceLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ResetConfirm_sourceLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ResetConfirm_sourceLocRef_oer_ext_arr_, 0, PDU__SCCP__ResetConfirm_sourceLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ResetConfirm_sourceLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ResetConfirm.sourceLocRef", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ResetConfirm_sourceLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ResetConfirm_sourceLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetConfirm_sourceLocRef_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ResetConfirm_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__SCCP__ResetConfirm
const TTCN_Typedescriptor_t PDU__SCCP__ResetConfirm_descr_ = { "@SCCP_Types.PDU_SCCP_ResetConfirm", NULL, &PDU__SCCP__ResetConfirm_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ResetConfirm_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ProtDataUnitError_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ProtDataUnitError_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ProtDataUnitError_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ProtDataUnitError.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ProtDataUnitError_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ProtDataUnitError_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ProtDataUnitError_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ProtDataUnitError_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__ProtDataUnitError_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__ProtDataUnitError_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__ProtDataUnitError_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__ProtDataUnitError_destLocRef_oer_ext_arr_, 0, PDU__SCCP__ProtDataUnitError_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__ProtDataUnitError_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_ProtDataUnitError.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__ProtDataUnitError_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__ProtDataUnitError_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ProtDataUnitError_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ProtDataUnitError_errorCause_xer_ = { {"errorCause>\n", "errorCause>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ProtDataUnitError_errorCause_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ProtDataUnitError_errorCause_descr_ = { "@SCCP_Types.PDU_SCCP_ProtDataUnitError.errorCause", &INTEGER_ber_, &SCCP__param__ErrorCause_raw_, &INTEGER_text_, &PDU__SCCP__ProtDataUnitError_errorCause_xer_, &INTEGER_json_, &PDU__SCCP__ProtDataUnitError_errorCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ProtDataUnitError_errorCause_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ProtDataUnitError_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__SCCP__ProtDataUnitError
const TTCN_Typedescriptor_t PDU__SCCP__ProtDataUnitError_descr_ = { "@SCCP_Types.PDU_SCCP_ProtDataUnitError", NULL, &PDU__SCCP__ProtDataUnitError_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ProtDataUnitError_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__InactivityTest_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__InactivityTest_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__InactivityTest_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_InactivityTest.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__InactivityTest_messageType_xer_, &INTEGER_json_, &PDU__SCCP__InactivityTest_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__InactivityTest_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__InactivityTest_destLocRef_xer_ = { {"destLocRef>\n", "destLocRef>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__InactivityTest_destLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__InactivityTest_destLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__InactivityTest_destLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__InactivityTest_destLocRef_oer_ext_arr_, 0, PDU__SCCP__InactivityTest_destLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__InactivityTest_destLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_InactivityTest.destLocRef", &OCTETSTRING_ber_, &SCCP__param__DestLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__InactivityTest_destLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__InactivityTest_destLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__InactivityTest_destLocRef_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__InactivityTest_sourceLocRef_xer_ = { {"sourceLocRef>\n", "sourceLocRef>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__InactivityTest_sourceLocRef_oer_ext_arr_[0] = {};
const int PDU__SCCP__InactivityTest_sourceLocRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__InactivityTest_sourceLocRef_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__InactivityTest_sourceLocRef_oer_ext_arr_, 0, PDU__SCCP__InactivityTest_sourceLocRef_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__InactivityTest_sourceLocRef_descr_ = { "@SCCP_Types.PDU_SCCP_InactivityTest.sourceLocRef", &OCTETSTRING_ber_, &SCCP__param__SourceLocalReference_raw_, &OCTETSTRING_text_, &PDU__SCCP__InactivityTest_sourceLocRef_xer_, &OCTETSTRING_json_, &PDU__SCCP__InactivityTest_sourceLocRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__InactivityTest_sourceLocRef_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__InactivityTest_protClass_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__InactivityTest_sequencingSegmenting_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__InactivityTest_credit_xer_ = { {"credit>\n", "credit>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PDU__SCCP__InactivityTest_credit_oer_ext_arr_[0] = {};
const int PDU__SCCP__InactivityTest_credit_oer_p_[0] = {};
const TTCN_OERdescriptor_t PDU__SCCP__InactivityTest_credit_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PDU__SCCP__InactivityTest_credit_oer_ext_arr_, 0, PDU__SCCP__InactivityTest_credit_oer_p_};
const TTCN_Typedescriptor_t PDU__SCCP__InactivityTest_credit_descr_ = { "@SCCP_Types.PDU_SCCP_InactivityTest.credit", &OCTETSTRING_ber_, &SCCP__param__Credit_raw_, &OCTETSTRING_text_, &PDU__SCCP__InactivityTest_credit_xer_, &OCTETSTRING_json_, &PDU__SCCP__InactivityTest_credit_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__InactivityTest_credit_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__InactivityTest_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__SCCP__InactivityTest
const TTCN_Typedescriptor_t PDU__SCCP__InactivityTest_descr_ = { "@SCCP_Types.PDU_SCCP_InactivityTest", NULL, &PDU__SCCP__InactivityTest_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__InactivityTest_default_coding("RAW");
const TTCN_RAWdescriptor_t SCCP__ExtUnitdata__optionalPart_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 SCCP__ExtUnitdata__optionalPart
const TTCN_Typedescriptor_t SCCP__ExtUnitdata__optionalPart_descr_ = { "@SCCP_Types.SCCP_ExtUnitdata_optionalPart", NULL, &SCCP__ExtUnitdata__optionalPart_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__ExtUnitdata__optionalPart_segmentation_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ExtUnitdata__optionalPart_importance_default_coding("RAW");
UNIVERSAL_CHARSTRING SCCP__ExtUnitdata__optionalPart_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExtUnitdata_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdata_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdata_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdata.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdata_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdata_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_messageType_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_protClass_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExtUnitdata_hopCounter_xer_ = { {"hopCounter>\n", "hopCounter>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdata_hopCounter_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdata_hopCounter_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdata.hopCounter", &INTEGER_ber_, &SCCP__param__HopCounter_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdata_hopCounter_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdata_hopCounter_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_hopCounter_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdata_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdata_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdata_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdata_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdata.pointer1", &INTEGER_ber_, &PDU__SCCP__ExtUnitdata_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdata_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdata_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdata_pointer2_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdata_pointer2_xer_ = { {"pointer2>\n", "pointer2>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdata_pointer2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdata_pointer2_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdata.pointer2", &INTEGER_ber_, &PDU__SCCP__ExtUnitdata_pointer2_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdata_pointer2_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdata_pointer2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_pointer2_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdata_pointer3_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdata_pointer3_xer_ = { {"pointer3>\n", "pointer3>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdata_pointer3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdata_pointer3_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdata.pointer3", &INTEGER_ber_, &PDU__SCCP__ExtUnitdata_pointer3_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdata_pointer3_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdata_pointer3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_pointer3_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdata_pointer4_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdata_pointer4_xer_ = { {"pointer4>\n", "pointer4>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdata_pointer4_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdata_pointer4_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdata.pointer4", &INTEGER_ber_, &PDU__SCCP__ExtUnitdata_pointer4_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdata_pointer4_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdata_pointer4_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_pointer4_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_callingPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdata_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__SCCP__ExtUnitdata
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdata_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdata", NULL, &PDU__SCCP__ExtUnitdata_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdata_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExtUnitdataService_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdataService_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdataService_messageType_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdataService_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExtUnitdataService_returnCause_xer_ = { {"returnCause>\n", "returnCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdataService_returnCause_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_returnCause_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService.returnCause", &INTEGER_ber_, &SCCP__param__ReturnCause_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdataService_returnCause_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdataService_returnCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_returnCause_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__ExtUnitdataService_hopCounter_xer_ = { {"hopCounter>\n", "hopCounter>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdataService_hopCounter_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_hopCounter_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService.hopCounter", &INTEGER_ber_, &SCCP__param__HopCounter_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdataService_hopCounter_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdataService_hopCounter_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_hopCounter_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdataService_pointer1_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdataService_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdataService_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService.pointer1", &INTEGER_ber_, &PDU__SCCP__ExtUnitdataService_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdataService_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdataService_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdataService_pointer2_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdataService_pointer2_xer_ = { {"pointer2>\n", "pointer2>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdataService_pointer2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_pointer2_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService.pointer2", &INTEGER_ber_, &PDU__SCCP__ExtUnitdataService_pointer2_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdataService_pointer2_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdataService_pointer2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_pointer2_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdataService_pointer3_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdataService_pointer3_xer_ = { {"pointer3>\n", "pointer3>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdataService_pointer3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_pointer3_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService.pointer3", &INTEGER_ber_, &PDU__SCCP__ExtUnitdataService_pointer3_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdataService_pointer3_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdataService_pointer3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_pointer3_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdataService_pointer4_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__ExtUnitdataService_pointer4_xer_ = { {"pointer4>\n", "pointer4>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__ExtUnitdataService_pointer4_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_pointer4_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService.pointer4", &INTEGER_ber_, &PDU__SCCP__ExtUnitdataService_pointer4_raw_, &INTEGER_text_, &PDU__SCCP__ExtUnitdataService_pointer4_xer_, &INTEGER_json_, &PDU__SCCP__ExtUnitdataService_pointer4_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_pointer4_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_callingPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_data_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__ExtUnitdataService_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__SCCP__ExtUnitdataService
const TTCN_Typedescriptor_t PDU__SCCP__ExtUnitdataService_descr_ = { "@SCCP_Types.PDU_SCCP_ExtUnitdataService", NULL, &PDU__SCCP__ExtUnitdataService_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__ExtUnitdataService_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__LongUnitdata_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdata_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdata_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdata.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdata_messageType_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdata_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_messageType_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_protClass_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__LongUnitdata_hopCounter_xer_ = { {"hopCounter>\n", "hopCounter>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdata_hopCounter_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdata_hopCounter_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdata.hopCounter", &INTEGER_ber_, &SCCP__param__HopCounter_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdata_hopCounter_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdata_hopCounter_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_hopCounter_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdata_pointer1_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdata_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdata_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdata_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdata.pointer1", &INTEGER_ber_, &PDU__SCCP__LongUnitdata_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdata_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdata_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdata_pointer2_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdata_pointer2_xer_ = { {"pointer2>\n", "pointer2>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdata_pointer2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdata_pointer2_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdata.pointer2", &INTEGER_ber_, &PDU__SCCP__LongUnitdata_pointer2_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdata_pointer2_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdata_pointer2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_pointer2_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdata_pointer3_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdata_pointer3_xer_ = { {"pointer3>\n", "pointer3>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdata_pointer3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdata_pointer3_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdata.pointer3", &INTEGER_ber_, &PDU__SCCP__LongUnitdata_pointer3_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdata_pointer3_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdata_pointer3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_pointer3_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdata_pointer4_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdata_pointer4_xer_ = { {"pointer4>\n", "pointer4>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdata_pointer4_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdata_pointer4_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdata.pointer4", &INTEGER_ber_, &PDU__SCCP__LongUnitdata_pointer4_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdata_pointer4_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdata_pointer4_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_pointer4_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_callingPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_longData_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdata_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__SCCP__LongUnitdata
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdata_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdata", NULL, &PDU__SCCP__LongUnitdata_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdata_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__LongUnitdataService_messageType_xer_ = { {"messageType>\n", "messageType>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdataService_messageType_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_messageType_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService.messageType", &INTEGER_ber_, &SCCP__param__MessageType_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdataService_messageType_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdataService_messageType_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__LongUnitdataService_returnCause_xer_ = { {"returnCause>\n", "returnCause>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdataService_returnCause_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_returnCause_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService.returnCause", &INTEGER_ber_, &SCCP__param__ReturnCause_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdataService_returnCause_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdataService_returnCause_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_returnCause_default_coding("RAW");
const XERdescriptor_t       PDU__SCCP__LongUnitdataService_hopCounter_xer_ = { {"hopCounter>\n", "hopCounter>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdataService_hopCounter_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_hopCounter_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService.hopCounter", &INTEGER_ber_, &SCCP__param__HopCounter_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdataService_hopCounter_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdataService_hopCounter_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_hopCounter_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdataService_pointer1_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdataService_pointer1_xer_ = { {"pointer1>\n", "pointer1>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdataService_pointer1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_pointer1_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService.pointer1", &INTEGER_ber_, &PDU__SCCP__LongUnitdataService_pointer1_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdataService_pointer1_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdataService_pointer1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_pointer1_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdataService_pointer2_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdataService_pointer2_xer_ = { {"pointer2>\n", "pointer2>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdataService_pointer2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_pointer2_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService.pointer2", &INTEGER_ber_, &PDU__SCCP__LongUnitdataService_pointer2_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdataService_pointer2_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdataService_pointer2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_pointer2_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdataService_pointer3_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdataService_pointer3_xer_ = { {"pointer3>\n", "pointer3>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdataService_pointer3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_pointer3_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService.pointer3", &INTEGER_ber_, &PDU__SCCP__LongUnitdataService_pointer3_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdataService_pointer3_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdataService_pointer3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_pointer3_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdataService_pointer4_raw_ = {16,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,8,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       PDU__SCCP__LongUnitdataService_pointer4_xer_ = { {"pointer4>\n", "pointer4>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCCP__LongUnitdataService_pointer4_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_pointer4_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService.pointer4", &INTEGER_ber_, &PDU__SCCP__LongUnitdataService_pointer4_raw_, &INTEGER_text_, &PDU__SCCP__LongUnitdataService_pointer4_xer_, &INTEGER_json_, &PDU__SCCP__LongUnitdataService_pointer4_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_pointer4_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_calledPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_callingPAddress_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_longData_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP__LongUnitdataService_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__SCCP__LongUnitdataService
const TTCN_Typedescriptor_t PDU__SCCP__LongUnitdataService_descr_ = { "@SCCP_Types.PDU_SCCP_LongUnitdataService", NULL, &PDU__SCCP__LongUnitdataService_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_optionalPart_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_eop_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP__LongUnitdataService_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCMG__message_messageType_default_coding("RAW");
const XERdescriptor_t       PDU__SCMG__message_affectedSSN_xer_ = { {"affectedSSN>\n", "affectedSSN>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCMG__message_affectedSSN_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCMG__message_affectedSSN_descr_ = { "@SCCP_Types.PDU_SCMG_message.affectedSSN", &INTEGER_ber_, &SCCP__field__SubsystemNumber_raw_, &INTEGER_text_, &PDU__SCMG__message_affectedSSN_xer_, &INTEGER_json_, &PDU__SCMG__message_affectedSSN_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCMG__message_affectedSSN_default_coding("RAW");
const XERdescriptor_t       PDU__SCMG__message_affectedPC_xer_ = { {"affectedPC>\n", "affectedPC>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t PDU__SCMG__message_affectedPC_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t PDU__SCMG__message_affectedPC_descr_ = { "@SCCP_Types.PDU_SCMG_message.affectedPC", &BITSTRING_ber_, &General__Types::BIT16_raw_, NULL, &PDU__SCMG__message_affectedPC_xer_, &BITSTRING_json_, &PDU__SCMG__message_affectedPC_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCMG__message_affectedPC_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCMG__message_smi_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCMG__message_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__SCMG__message
const TTCN_Typedescriptor_t PDU__SCMG__message_descr_ = { "@SCCP_Types.PDU_SCMG_message", NULL, &PDU__SCMG__message_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCMG__message_congLevel_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCMG__message_default_coding("RAW");
const TTCN_RAWdescriptor_t PDU__SCCP_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__SCCP
const TTCN_Typedescriptor_t PDU__SCCP_descr_ = { "@SCCP_Types.PDU_SCCP", NULL, &PDU__SCCP_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING PDU__SCCP_connrequest_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_connrefused_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_released_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_relcomp_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_dataform1_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_dataform2_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_dataack_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_udataserv_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_expdata_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_expdataack_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_resetreq_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_resconf_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_pduerror_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_inacttest_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_extudata_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_extudataserv_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_longudata_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_longudataserv_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_unitdata_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_connconfirm_default_coding("RAW");
UNIVERSAL_CHARSTRING PDU__SCCP_default_coding("RAW");
const XERdescriptor_t       states_xer_ = { {"states>\n", "states>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t states_descr_ = { "@SCCP_Types.states", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &states_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING states_default_coding("RAW");
const XERdescriptor_t       _T_idle_xer_ = { {"states>\n", "states>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t _T_idle_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t _T_idle_descr_ = { "@SCCP_Types.idle.<type>", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &_T_idle_xer_, &INTEGER_json_, &_T_idle_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
INTEGER const_idle;
const INTEGER& idle = const_idle;
INTEGER const_connection__pending__OG;
const INTEGER& connection__pending__OG = const_connection__pending__OG;
INTEGER const_connection__pending__IC;
const INTEGER& connection__pending__IC = const_connection__pending__IC;
INTEGER const_active;
const INTEGER& active = const_active;
INTEGER const_disconnect__pending;
const INTEGER& disconnect__pending = const_disconnect__pending;
INTEGER const_reset__bothway;
const INTEGER& reset__bothway = const_reset__bothway;
INTEGER const_reset__IC;
const INTEGER& reset__IC = const_reset__IC;
INTEGER const_wait__conn__confirm;
const INTEGER& wait__conn__confirm = const_wait__conn__confirm;
const XERdescriptor_t       sccp__buffer_buffer_xer_ = { {"buffer>\n", "buffer>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int sccp__buffer_buffer_oer_ext_arr_[0] = {};
const int sccp__buffer_buffer_oer_p_[0] = {};
const TTCN_OERdescriptor_t sccp__buffer_buffer_oer_ = { -1, TRUE, -1, FALSE, 0, 0, sccp__buffer_buffer_oer_ext_arr_, 0, sccp__buffer_buffer_oer_p_};
const TTCN_Typedescriptor_t sccp__buffer_buffer_descr_ = { "@SCCP_Types.sccp_buffer.buffer", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &sccp__buffer_buffer_xer_, &OCTETSTRING_json_, &sccp__buffer_buffer_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING sccp__buffer_buffer_default_coding("RAW");
const XERdescriptor_t       sccp__buffer_actlen_xer_ = { {"actlen>\n", "actlen>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t sccp__buffer_actlen_descr_ = { "@SCCP_Types.sccp_buffer.actlen", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &sccp__buffer_actlen_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING sccp__buffer_actlen_default_coding("RAW");
const XERdescriptor_t       sccp__buffer_maxlen_xer_ = { {"maxlen>\n", "maxlen>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t sccp__buffer_maxlen_descr_ = { "@SCCP_Types.sccp_buffer.maxlen", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &sccp__buffer_maxlen_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING sccp__buffer_maxlen_default_coding("RAW");
const TTCN_RAWdescriptor_t sccp__buffer_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 sccp__buffer
const TTCN_Typedescriptor_t sccp__buffer_descr_ = { "@SCCP_Types.sccp_buffer", NULL, &sccp__buffer_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING sccp__buffer_default_coding("RAW");
const XERdescriptor_t       ConnectionData_localReference_xer_ = { {"localReference>\n", "localReference>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ConnectionData_localReference_oer_ext_arr_[0] = {};
const int ConnectionData_localReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t ConnectionData_localReference_oer_ = { -1, TRUE, 3, FALSE, 0, 0, ConnectionData_localReference_oer_ext_arr_, 0, ConnectionData_localReference_oer_p_};
const TTCN_Typedescriptor_t ConnectionData_localReference_descr_ = { "@SCCP_Types.ConnectionData.localReference", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &ConnectionData_localReference_xer_, &OCTETSTRING_json_, &ConnectionData_localReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnectionData_localReference_default_coding("RAW");
const XERdescriptor_t       ConnectionData_remoteReference_xer_ = { {"remoteReference>\n", "remoteReference>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ConnectionData_remoteReference_oer_ext_arr_[0] = {};
const int ConnectionData_remoteReference_oer_p_[0] = {};
const TTCN_OERdescriptor_t ConnectionData_remoteReference_oer_ = { -1, TRUE, 3, FALSE, 0, 0, ConnectionData_remoteReference_oer_ext_arr_, 0, ConnectionData_remoteReference_oer_p_};
const TTCN_Typedescriptor_t ConnectionData_remoteReference_descr_ = { "@SCCP_Types.ConnectionData.remoteReference", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &ConnectionData_remoteReference_xer_, &OCTETSTRING_json_, &ConnectionData_remoteReference_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnectionData_remoteReference_default_coding("RAW");
const XERdescriptor_t       ConnectionData_state_xer_ = { {"state>\n", "state>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ConnectionData_state_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ConnectionData_state_descr_ = { "@SCCP_Types.ConnectionData.state", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ConnectionData_state_xer_, &INTEGER_json_, &ConnectionData_state_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnectionData_state_default_coding("RAW");
const XERdescriptor_t       ConnectionData_connectionId_xer_ = { {"connectionId>\n", "connectionId>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ConnectionData_connectionId_descr_ = { "@SCCP_Types.ConnectionData.connectionId", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ConnectionData_connectionId_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnectionData_connectionId_default_coding("RAW");
UNIVERSAL_CHARSTRING ConnectionData_reassembler__buffer_default_coding("RAW");
const TTCN_RAWdescriptor_t ConnectionData_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 ConnectionData
const TTCN_Typedescriptor_t ConnectionData_descr_ = { "@SCCP_Types.ConnectionData", NULL, &ConnectionData_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnectionData_default_coding("RAW");
const XERdescriptor_t       segmLocRef__states_xer_ = { {"segmLocRef_states>\n", "segmLocRef_states>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t segmLocRef__states_descr_ = { "@SCCP_Types.segmLocRef_states", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &segmLocRef__states_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING segmLocRef__states_default_coding("RAW");
const XERdescriptor_t       _T_segmLocRef__idle_xer_ = { {"segmLocRef_states>\n", "segmLocRef_states>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t _T_segmLocRef__idle_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t _T_segmLocRef__idle_descr_ = { "@SCCP_Types.segmLocRef_idle.<type>", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &_T_segmLocRef__idle_xer_, &INTEGER_json_, &_T_segmLocRef__idle_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
INTEGER const_segmLocRef__idle;
const INTEGER& segmLocRef__idle = const_segmLocRef__idle;
INTEGER const_segmLocRef__busy;
const INTEGER& segmLocRef__busy = const_segmLocRef__busy;
const XERdescriptor_t       segmLocRef_val_xer_ = { {"val>\n", "val>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int segmLocRef_val_oer_ext_arr_[0] = {};
const int segmLocRef_val_oer_p_[0] = {};
const TTCN_OERdescriptor_t segmLocRef_val_oer_ = { -1, TRUE, 3, FALSE, 0, 0, segmLocRef_val_oer_ext_arr_, 0, segmLocRef_val_oer_p_};
const TTCN_Typedescriptor_t segmLocRef_val_descr_ = { "@SCCP_Types.segmLocRef.val", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &segmLocRef_val_xer_, &OCTETSTRING_json_, &segmLocRef_val_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING segmLocRef_val_default_coding("RAW");
const XERdescriptor_t       segmLocRef_state_xer_ = { {"state>\n", "state>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t segmLocRef_state_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t segmLocRef_state_descr_ = { "@SCCP_Types.segmLocRef.state", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &segmLocRef_state_xer_, &INTEGER_json_, &segmLocRef_state_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING segmLocRef_state_default_coding("RAW");
const TTCN_RAWdescriptor_t segmLocRef_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 segmLocRef
const TTCN_Typedescriptor_t segmLocRef_descr_ = { "@SCCP_Types.segmLocRef", NULL, &segmLocRef_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING segmLocRef_default_coding("RAW");
const XERdescriptor_t       ClessRcvBuff_segmRemoteRef_xer_ = { {"segmRemoteRef>\n", "segmRemoteRef>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ClessRcvBuff_segmRemoteRef_oer_ext_arr_[0] = {};
const int ClessRcvBuff_segmRemoteRef_oer_p_[0] = {};
const TTCN_OERdescriptor_t ClessRcvBuff_segmRemoteRef_oer_ = { -1, TRUE, 3, FALSE, 0, 0, ClessRcvBuff_segmRemoteRef_oer_ext_arr_, 0, ClessRcvBuff_segmRemoteRef_oer_p_};
const TTCN_Typedescriptor_t ClessRcvBuff_segmRemoteRef_descr_ = { "@SCCP_Types.ClessRcvBuff.segmRemoteRef", &OCTETSTRING_ber_, &General__Types::OCT3_raw_, &OCTETSTRING_text_, &ClessRcvBuff_segmRemoteRef_xer_, &OCTETSTRING_json_, &ClessRcvBuff_segmRemoteRef_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClessRcvBuff_segmRemoteRef_default_coding("RAW");
const XERdescriptor_t       ClessRcvBuff_state_xer_ = { {"state>\n", "state>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ClessRcvBuff_state_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ClessRcvBuff_state_descr_ = { "@SCCP_Types.ClessRcvBuff.state", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ClessRcvBuff_state_xer_, &INTEGER_json_, &ClessRcvBuff_state_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClessRcvBuff_state_default_coding("RAW");
UNIVERSAL_CHARSTRING ClessRcvBuff_reassembler__buffer_default_coding("RAW");
const TTCN_RAWdescriptor_t ClessRcvBuff_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 ClessRcvBuff
const TTCN_Typedescriptor_t ClessRcvBuff_descr_ = { "@SCCP_Types.ClessRcvBuff", NULL, &ClessRcvBuff_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ClessRcvBuff_default_coding("RAW");
const XERdescriptor_t       SCCP__ServiceType_xer_ = { {"SCCP_ServiceType>\n", "SCCP_ServiceType>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SCCP__ServiceType_descr_ = { "@SCCP_Types.SCCP_ServiceType", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &SCCP__ServiceType_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SCCP__ServiceType_default_coding("RAW");
CHARSTRING const_mtp3__itu;
const CHARSTRING& mtp3__itu = const_mtp3__itu;
CHARSTRING const_mtp3__ansi;
const CHARSTRING& mtp3__ansi = const_mtp3__ansi;
CHARSTRING const_mtp3__ttc;
const CHARSTRING& mtp3__ttc = const_mtp3__ttc;
CHARSTRING const_mtp3b__itu;
const CHARSTRING& mtp3b__itu = const_mtp3b__itu;
CHARSTRING const_mtp3b__ansi;
const CHARSTRING& mtp3b__ansi = const_mtp3b__ansi;
CHARSTRING const_mtp3b__ttc;
const CHARSTRING& mtp3b__ttc = const_mtp3b__ttc;
CHARSTRING const_m3ua;
const CHARSTRING& m3ua = const_m3ua;
CHARSTRING const_mtp3__mpt;
const CHARSTRING& mtp3__mpt = const_mtp3__mpt;
UNIVERSAL_CHARSTRING MSC__SCCP__MTP3__parameters_sio_default_coding("RAW");
const XERdescriptor_t       MSC__SCCP__MTP3__parameters_opc_xer_ = { {"opc>\n", "opc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MSC__SCCP__MTP3__parameters_opc_descr_ = { "@SCCP_Types.MSC_SCCP_MTP3_parameters.opc", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MSC__SCCP__MTP3__parameters_opc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MSC__SCCP__MTP3__parameters_opc_default_coding("RAW");
const XERdescriptor_t       MSC__SCCP__MTP3__parameters_dpc_xer_ = { {"dpc>\n", "dpc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MSC__SCCP__MTP3__parameters_dpc_descr_ = { "@SCCP_Types.MSC_SCCP_MTP3_parameters.dpc", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MSC__SCCP__MTP3__parameters_dpc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MSC__SCCP__MTP3__parameters_dpc_default_coding("RAW");
const XERdescriptor_t       MSC__SCCP__MTP3__parameters_sls_xer_ = { {"sls>\n", "sls>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MSC__SCCP__MTP3__parameters_sls_descr_ = { "@SCCP_Types.MSC_SCCP_MTP3_parameters.sls", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MSC__SCCP__MTP3__parameters_sls_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MSC__SCCP__MTP3__parameters_sls_default_coding("RAW");
const XERdescriptor_t       MSC__SCCP__MTP3__parameters_sccp__serviceType_xer_ = { {"sccp_serviceType>\n", "sccp_serviceType>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MSC__SCCP__MTP3__parameters_sccp__serviceType_descr_ = { "@SCCP_Types.MSC_SCCP_MTP3_parameters.sccp_serviceType", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &MSC__SCCP__MTP3__parameters_sccp__serviceType_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MSC__SCCP__MTP3__parameters_sccp__serviceType_default_coding("RAW");
const TTCN_RAWdescriptor_t MSC__SCCP__MTP3__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 MSC__SCCP__MTP3__parameters
const TTCN_Typedescriptor_t MSC__SCCP__MTP3__parameters_descr_ = { "@SCCP_Types.MSC_SCCP_MTP3_parameters", NULL, &MSC__SCCP__MTP3__parameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       MSC__SCCP__MTP3__parameters_ssn_xer_ = { {"ssn>\n", "ssn>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MSC__SCCP__MTP3__parameters_ssn_descr_ = { "@SCCP_Types.MSC_SCCP_MTP3_parameters.ssn", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MSC__SCCP__MTP3__parameters_ssn_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MSC__SCCP__MTP3__parameters_ssn_default_coding("RAW");
UNIVERSAL_CHARSTRING MSC__SCCP__MTP3__parameters_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERreq__sccp_sio_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ASP__MTP3__TRANSFERreq__sccp_sio_xer_ = { {"sio>\n", "sio>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ASP__MTP3__TRANSFERreq__sccp_sio_oer_ext_arr_[0] = {};
const int ASP__MTP3__TRANSFERreq__sccp_sio_oer_p_[0] = {};
const TTCN_OERdescriptor_t ASP__MTP3__TRANSFERreq__sccp_sio_oer_ = { -1, TRUE, 1, FALSE, 0, 0, ASP__MTP3__TRANSFERreq__sccp_sio_oer_ext_arr_, 0, ASP__MTP3__TRANSFERreq__sccp_sio_oer_p_};
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq__sccp_sio_descr_ = { "@SCCP_Types.ASP_MTP3_TRANSFERreq_sccp.sio", &OCTETSTRING_ber_, &ASP__MTP3__TRANSFERreq__sccp_sio_raw_, &OCTETSTRING_text_, &ASP__MTP3__TRANSFERreq__sccp_sio_xer_, &OCTETSTRING_json_, &ASP__MTP3__TRANSFERreq__sccp_sio_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq__sccp_sio_default_coding("RAW");
const XERdescriptor_t       ASP__MTP3__TRANSFERreq__sccp_opc_xer_ = { {"opc>\n", "opc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq__sccp_opc_descr_ = { "@SCCP_Types.ASP_MTP3_TRANSFERreq_sccp.opc", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERreq__sccp_opc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq__sccp_opc_default_coding("RAW");
const XERdescriptor_t       ASP__MTP3__TRANSFERreq__sccp_dpc_xer_ = { {"dpc>\n", "dpc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq__sccp_dpc_descr_ = { "@SCCP_Types.ASP_MTP3_TRANSFERreq_sccp.dpc", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERreq__sccp_dpc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq__sccp_dpc_default_coding("RAW");
const XERdescriptor_t       ASP__MTP3__TRANSFERreq__sccp_sls_xer_ = { {"sls>\n", "sls>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq__sccp_sls_descr_ = { "@SCCP_Types.ASP_MTP3_TRANSFERreq_sccp.sls", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERreq__sccp_sls_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq__sccp_sls_default_coding("RAW");
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq__sccp_data_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERreq__sccp_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 ASP__MTP3__TRANSFERreq__sccp
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq__sccp_descr_ = { "@SCCP_Types.ASP_MTP3_TRANSFERreq_sccp", NULL, &ASP__MTP3__TRANSFERreq__sccp_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq__sccp_default_coding("RAW");
ASP__MTP3__TRANSFERreq__sccp_template template_tr__ASP__MTP3__TRANSFERreq__sccp;
const ASP__MTP3__TRANSFERreq__sccp_template& tr__ASP__MTP3__TRANSFERreq__sccp = template_tr__ASP__MTP3__TRANSFERreq__sccp;
TTCN_Module module_object("SCCP_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, set_module_param, NULL, log_module_param, 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 */

SCCP__field__AddressIndicator__itu::SCCP__field__AddressIndicator__itu()
{
}

SCCP__field__AddressIndicator__itu::SCCP__field__AddressIndicator__itu(const BITSTRING& par_pointCodeIndic,
    const BITSTRING& par_ssnIndicator,
    const BITSTRING& par_globalTitleIndic,
    const BITSTRING& par_routingIndicator,
    const BITSTRING& par_reserved)
  :   field_pointCodeIndic(par_pointCodeIndic),
  field_ssnIndicator(par_ssnIndicator),
  field_globalTitleIndic(par_globalTitleIndic),
  field_routingIndicator(par_routingIndicator),
  field_reserved(par_reserved)
{
}

SCCP__field__AddressIndicator__itu::SCCP__field__AddressIndicator__itu(const SCCP__field__AddressIndicator__itu& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_field_AddressIndicator_itu.");
if (other_value.pointCodeIndic().is_bound()) field_pointCodeIndic = other_value.pointCodeIndic();
else field_pointCodeIndic.clean_up();
if (other_value.ssnIndicator().is_bound()) field_ssnIndicator = other_value.ssnIndicator();
else field_ssnIndicator.clean_up();
if (other_value.globalTitleIndic().is_bound()) field_globalTitleIndic = other_value.globalTitleIndic();
else field_globalTitleIndic.clean_up();
if (other_value.routingIndicator().is_bound()) field_routingIndicator = other_value.routingIndicator();
else field_routingIndicator.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void SCCP__field__AddressIndicator__itu::clean_up()
{
field_pointCodeIndic.clean_up();
field_ssnIndicator.clean_up();
field_globalTitleIndic.clean_up();
field_routingIndicator.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__field__AddressIndicator__itu::get_descriptor() const { return &SCCP__field__AddressIndicator__itu_descr_; }
SCCP__field__AddressIndicator__itu& SCCP__field__AddressIndicator__itu::operator=(const SCCP__field__AddressIndicator__itu& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_field_AddressIndicator_itu.");
  if (other_value.pointCodeIndic().is_bound()) field_pointCodeIndic = other_value.pointCodeIndic();
  else field_pointCodeIndic.clean_up();
  if (other_value.ssnIndicator().is_bound()) field_ssnIndicator = other_value.ssnIndicator();
  else field_ssnIndicator.clean_up();
  if (other_value.globalTitleIndic().is_bound()) field_globalTitleIndic = other_value.globalTitleIndic();
  else field_globalTitleIndic.clean_up();
  if (other_value.routingIndicator().is_bound()) field_routingIndicator = other_value.routingIndicator();
  else field_routingIndicator.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

boolean SCCP__field__AddressIndicator__itu::operator==(const SCCP__field__AddressIndicator__itu& other_value) const
{
return field_pointCodeIndic==other_value.field_pointCodeIndic
  && field_ssnIndicator==other_value.field_ssnIndicator
  && field_globalTitleIndic==other_value.field_globalTitleIndic
  && field_routingIndicator==other_value.field_routingIndicator
  && field_reserved==other_value.field_reserved;
}

boolean SCCP__field__AddressIndicator__itu::is_bound() const
{
return (field_pointCodeIndic.is_bound())
  || (field_ssnIndicator.is_bound())
  || (field_globalTitleIndic.is_bound())
  || (field_routingIndicator.is_bound())
  || (field_reserved.is_bound());
}
boolean SCCP__field__AddressIndicator__itu::is_value() const
{
return field_pointCodeIndic.is_value()
  && field_ssnIndicator.is_value()
  && field_globalTitleIndic.is_value()
  && field_routingIndicator.is_value()
  && field_reserved.is_value();
}
void SCCP__field__AddressIndicator__itu::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ pointCodeIndic := ");
field_pointCodeIndic.log();
TTCN_Logger::log_event_str(", ssnIndicator := ");
field_ssnIndicator.log();
TTCN_Logger::log_event_str(", globalTitleIndic := ");
field_globalTitleIndic.log();
TTCN_Logger::log_event_str(", routingIndicator := ");
field_routingIndicator.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__field__AddressIndicator__itu::set_implicit_omit()
{
if (pointCodeIndic().is_bound()) pointCodeIndic().set_implicit_omit();
if (ssnIndicator().is_bound()) ssnIndicator().set_implicit_omit();
if (globalTitleIndic().is_bound()) globalTitleIndic().set_implicit_omit();
if (routingIndicator().is_bound()) routingIndicator().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCCP__field__AddressIndicator__itu::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 @SCCP_Types.SCCP_field_AddressIndicator_itu 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) pointCodeIndic().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ssnIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) globalTitleIndic().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) routingIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved().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(), "pointCodeIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointCodeIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssnIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssnIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globalTitleIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalTitleIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_field_AddressIndicator_itu: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_field_AddressIndicator_itu");
  }
}

void SCCP__field__AddressIndicator__itu::encode_text(Text_Buf& text_buf) const
{
field_pointCodeIndic.encode_text(text_buf);
field_ssnIndicator.encode_text(text_buf);
field_globalTitleIndic.encode_text(text_buf);
field_routingIndicator.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void SCCP__field__AddressIndicator__itu::decode_text(Text_Buf& text_buf)
{
field_pointCodeIndic.decode_text(text_buf);
field_ssnIndicator.decode_text(text_buf);
field_globalTitleIndic.decode_text(text_buf);
field_routingIndicator.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

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

int SCCP__field__AddressIndicator__itu::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  encoded_length += field_pointCodeIndic.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ssnIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_globalTitleIndic.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_routingIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct SCCP__field__AddressIndicator__itu_template::single_value_struct {
BITSTRING_template field_pointCodeIndic;
BITSTRING_template field_ssnIndicator;
BITSTRING_template field_globalTitleIndic;
BITSTRING_template field_routingIndicator;
BITSTRING_template field_reserved;
};

void SCCP__field__AddressIndicator__itu_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_pointCodeIndic = ANY_VALUE;
single_value->field_ssnIndicator = ANY_VALUE;
single_value->field_globalTitleIndic = ANY_VALUE;
single_value->field_routingIndicator = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
}
}
}

void SCCP__field__AddressIndicator__itu_template::copy_value(const SCCP__field__AddressIndicator__itu& other_value)
{
single_value = new single_value_struct;
if (other_value.pointCodeIndic().is_bound()) {
  single_value->field_pointCodeIndic = other_value.pointCodeIndic();
} else {
  single_value->field_pointCodeIndic.clean_up();
}
if (other_value.ssnIndicator().is_bound()) {
  single_value->field_ssnIndicator = other_value.ssnIndicator();
} else {
  single_value->field_ssnIndicator.clean_up();
}
if (other_value.globalTitleIndic().is_bound()) {
  single_value->field_globalTitleIndic = other_value.globalTitleIndic();
} else {
  single_value->field_globalTitleIndic.clean_up();
}
if (other_value.routingIndicator().is_bound()) {
  single_value->field_routingIndicator = other_value.routingIndicator();
} else {
  single_value->field_routingIndicator.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__AddressIndicator__itu_template::copy_template(const SCCP__field__AddressIndicator__itu_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.pointCodeIndic().get_selection()) {
single_value->field_pointCodeIndic = other_value.pointCodeIndic();
} else {
single_value->field_pointCodeIndic.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ssnIndicator().get_selection()) {
single_value->field_ssnIndicator = other_value.ssnIndicator();
} else {
single_value->field_ssnIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitleIndic().get_selection()) {
single_value->field_globalTitleIndic = other_value.globalTitleIndic();
} else {
single_value->field_globalTitleIndic.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingIndicator().get_selection()) {
single_value->field_routingIndicator = other_value.routingIndicator();
} else {
single_value->field_routingIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.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 SCCP__field__AddressIndicator__itu_template[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 SCCP__field__AddressIndicator__itu_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__AddressIndicator__itu_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 @SCCP_Types.SCCP_field_AddressIndicator_itu.");
break;
}
set_selection(other_value);
}

SCCP__field__AddressIndicator__itu_template::SCCP__field__AddressIndicator__itu_template()
{
}

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

SCCP__field__AddressIndicator__itu_template::SCCP__field__AddressIndicator__itu_template(const SCCP__field__AddressIndicator__itu& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__field__AddressIndicator__itu_template::match(const SCCP__field__AddressIndicator__itu& 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.pointCodeIndic().is_bound()) return FALSE;
if(!single_value->field_pointCodeIndic.match(other_value.pointCodeIndic(), legacy))return FALSE;
if(!other_value.ssnIndicator().is_bound()) return FALSE;
if(!single_value->field_ssnIndicator.match(other_value.ssnIndicator(), legacy))return FALSE;
if(!other_value.globalTitleIndic().is_bound()) return FALSE;
if(!single_value->field_globalTitleIndic.match(other_value.globalTitleIndic(), legacy))return FALSE;
if(!other_value.routingIndicator().is_bound()) return FALSE;
if(!single_value->field_routingIndicator.match(other_value.routingIndicator(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), 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 @SCCP_Types.SCCP_field_AddressIndicator_itu.");
}
return FALSE;
}

boolean SCCP__field__AddressIndicator__itu_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_pointCodeIndic.is_bound()
 || single_value->field_ssnIndicator.is_bound()
 || single_value->field_globalTitleIndic.is_bound()
 || single_value->field_routingIndicator.is_bound()
 || single_value->field_reserved.is_bound();
}

boolean SCCP__field__AddressIndicator__itu_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_pointCodeIndic.is_value()
 && single_value->field_ssnIndicator.is_value()
 && single_value->field_globalTitleIndic.is_value()
 && single_value->field_routingIndicator.is_value()
 && single_value->field_reserved.is_value();
}

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

SCCP__field__AddressIndicator__itu SCCP__field__AddressIndicator__itu_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 @SCCP_Types.SCCP_field_AddressIndicator_itu.");
SCCP__field__AddressIndicator__itu ret_val;
if (single_value->field_pointCodeIndic.is_bound()) {
ret_val.pointCodeIndic() = single_value->field_pointCodeIndic.valueof();
}
if (single_value->field_ssnIndicator.is_bound()) {
ret_val.ssnIndicator() = single_value->field_ssnIndicator.valueof();
}
if (single_value->field_globalTitleIndic.is_bound()) {
ret_val.globalTitleIndic() = single_value->field_globalTitleIndic.valueof();
}
if (single_value->field_routingIndicator.is_bound()) {
ret_val.routingIndicator() = single_value->field_routingIndicator.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

void SCCP__field__AddressIndicator__itu_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 @SCCP_Types.SCCP_field_AddressIndicator_itu.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__field__AddressIndicator__itu_template[list_length];
}

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

BITSTRING_template& SCCP__field__AddressIndicator__itu_template::pointCodeIndic()
{
set_specific();
return single_value->field_pointCodeIndic;
}

const BITSTRING_template& SCCP__field__AddressIndicator__itu_template::pointCodeIndic() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointCodeIndic of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_itu.");
return single_value->field_pointCodeIndic;
}

BITSTRING_template& SCCP__field__AddressIndicator__itu_template::ssnIndicator()
{
set_specific();
return single_value->field_ssnIndicator;
}

const BITSTRING_template& SCCP__field__AddressIndicator__itu_template::ssnIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssnIndicator of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_itu.");
return single_value->field_ssnIndicator;
}

BITSTRING_template& SCCP__field__AddressIndicator__itu_template::globalTitleIndic()
{
set_specific();
return single_value->field_globalTitleIndic;
}

const BITSTRING_template& SCCP__field__AddressIndicator__itu_template::globalTitleIndic() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitleIndic of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_itu.");
return single_value->field_globalTitleIndic;
}

BITSTRING_template& SCCP__field__AddressIndicator__itu_template::routingIndicator()
{
set_specific();
return single_value->field_routingIndicator;
}

const BITSTRING_template& SCCP__field__AddressIndicator__itu_template::routingIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingIndicator of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_itu.");
return single_value->field_routingIndicator;
}

BITSTRING_template& SCCP__field__AddressIndicator__itu_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__field__AddressIndicator__itu_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_itu.");
return single_value->field_reserved;
}

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

void SCCP__field__AddressIndicator__itu_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ pointCodeIndic := ");
single_value->field_pointCodeIndic.log();
TTCN_Logger::log_event_str(", ssnIndicator := ");
single_value->field_ssnIndicator.log();
TTCN_Logger::log_event_str(", globalTitleIndic := ");
single_value->field_globalTitleIndic.log();
TTCN_Logger::log_event_str(", routingIndicator := ");
single_value->field_routingIndicator.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.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 SCCP__field__AddressIndicator__itu_template::log_match(const SCCP__field__AddressIndicator__itu& 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_pointCodeIndic.match(match_value.pointCodeIndic(), legacy)){
TTCN_Logger::log_logmatch_info(".pointCodeIndic");
single_value->field_pointCodeIndic.log_match(match_value.pointCodeIndic(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ssnIndicator.match(match_value.ssnIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ssnIndicator");
single_value->field_ssnIndicator.log_match(match_value.ssnIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_globalTitleIndic.match(match_value.globalTitleIndic(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitleIndic");
single_value->field_globalTitleIndic.log_match(match_value.globalTitleIndic(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingIndicator.match(match_value.routingIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".routingIndicator");
single_value->field_routingIndicator.log_match(match_value.routingIndicator(), 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);
}
}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("{ pointCodeIndic := ");
single_value->field_pointCodeIndic.log_match(match_value.pointCodeIndic(), legacy);
TTCN_Logger::log_event_str(", ssnIndicator := ");
single_value->field_ssnIndicator.log_match(match_value.ssnIndicator(), legacy);
TTCN_Logger::log_event_str(", globalTitleIndic := ");
single_value->field_globalTitleIndic.log_match(match_value.globalTitleIndic(), legacy);
TTCN_Logger::log_event_str(", routingIndicator := ");
single_value->field_routingIndicator.log_match(match_value.routingIndicator(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), 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 SCCP__field__AddressIndicator__itu_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (pointCodeIndic().is_bound()) pointCodeIndic().set_implicit_omit();
if (ssnIndicator().is_bound()) ssnIndicator().set_implicit_omit();
if (globalTitleIndic().is_bound()) globalTitleIndic().set_implicit_omit();
if (routingIndicator().is_bound()) routingIndicator().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCCP__field__AddressIndicator__itu_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_pointCodeIndic.encode_text(text_buf);
single_value->field_ssnIndicator.encode_text(text_buf);
single_value->field_globalTitleIndic.encode_text(text_buf);
single_value->field_routingIndicator.encode_text(text_buf);
single_value->field_reserved.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 @SCCP_Types.SCCP_field_AddressIndicator_itu.");
}
}

void SCCP__field__AddressIndicator__itu_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_pointCodeIndic.decode_text(text_buf);
single_value->field_ssnIndicator.decode_text(text_buf);
single_value->field_globalTitleIndic.decode_text(text_buf);
single_value->field_routingIndicator.decode_text(text_buf);
single_value->field_reserved.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 SCCP__field__AddressIndicator__itu_template[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 @SCCP_Types.SCCP_field_AddressIndicator_itu.");
}
}

void SCCP__field__AddressIndicator__itu_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: {
    SCCP__field__AddressIndicator__itu_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 @SCCP_Types.SCCP_field_AddressIndicator_itu 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) pointCodeIndic().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ssnIndicator().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) globalTitleIndic().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) routingIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved().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(), "pointCodeIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointCodeIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ssnIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssnIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globalTitleIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalTitleIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_field_AddressIndicator_itu: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__field__AddressIndicator__itu_template* precondition = new SCCP__field__AddressIndicator__itu_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__field__AddressIndicator__itu_template* implied_template = new SCCP__field__AddressIndicator__itu_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__field__AddressIndicator__itu_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_field_AddressIndicator_itu");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__field__AddressIndicator__itu_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_pointCodeIndic.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_itu");
single_value->field_ssnIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_itu");
single_value->field_globalTitleIndic.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_itu");
single_value->field_routingIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_itu");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_itu");
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 : "@SCCP_Types.SCCP_field_AddressIndicator_itu");
}

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

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

SCCP__field__AddressIndicator__ansi::SCCP__field__AddressIndicator__ansi()
{
}

SCCP__field__AddressIndicator__ansi::SCCP__field__AddressIndicator__ansi(const BITSTRING& par_ssnIndicator,
    const BITSTRING& par_pointCodeIndic,
    const BITSTRING& par_globalTitleIndic,
    const BITSTRING& par_routingIndicator,
    const BITSTRING& par_reserved)
  :   field_ssnIndicator(par_ssnIndicator),
  field_pointCodeIndic(par_pointCodeIndic),
  field_globalTitleIndic(par_globalTitleIndic),
  field_routingIndicator(par_routingIndicator),
  field_reserved(par_reserved)
{
}

SCCP__field__AddressIndicator__ansi::SCCP__field__AddressIndicator__ansi(const SCCP__field__AddressIndicator__ansi& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
if (other_value.ssnIndicator().is_bound()) field_ssnIndicator = other_value.ssnIndicator();
else field_ssnIndicator.clean_up();
if (other_value.pointCodeIndic().is_bound()) field_pointCodeIndic = other_value.pointCodeIndic();
else field_pointCodeIndic.clean_up();
if (other_value.globalTitleIndic().is_bound()) field_globalTitleIndic = other_value.globalTitleIndic();
else field_globalTitleIndic.clean_up();
if (other_value.routingIndicator().is_bound()) field_routingIndicator = other_value.routingIndicator();
else field_routingIndicator.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void SCCP__field__AddressIndicator__ansi::clean_up()
{
field_ssnIndicator.clean_up();
field_pointCodeIndic.clean_up();
field_globalTitleIndic.clean_up();
field_routingIndicator.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__field__AddressIndicator__ansi::get_descriptor() const { return &SCCP__field__AddressIndicator__ansi_descr_; }
SCCP__field__AddressIndicator__ansi& SCCP__field__AddressIndicator__ansi::operator=(const SCCP__field__AddressIndicator__ansi& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
  if (other_value.ssnIndicator().is_bound()) field_ssnIndicator = other_value.ssnIndicator();
  else field_ssnIndicator.clean_up();
  if (other_value.pointCodeIndic().is_bound()) field_pointCodeIndic = other_value.pointCodeIndic();
  else field_pointCodeIndic.clean_up();
  if (other_value.globalTitleIndic().is_bound()) field_globalTitleIndic = other_value.globalTitleIndic();
  else field_globalTitleIndic.clean_up();
  if (other_value.routingIndicator().is_bound()) field_routingIndicator = other_value.routingIndicator();
  else field_routingIndicator.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

boolean SCCP__field__AddressIndicator__ansi::operator==(const SCCP__field__AddressIndicator__ansi& other_value) const
{
return field_ssnIndicator==other_value.field_ssnIndicator
  && field_pointCodeIndic==other_value.field_pointCodeIndic
  && field_globalTitleIndic==other_value.field_globalTitleIndic
  && field_routingIndicator==other_value.field_routingIndicator
  && field_reserved==other_value.field_reserved;
}

boolean SCCP__field__AddressIndicator__ansi::is_bound() const
{
return (field_ssnIndicator.is_bound())
  || (field_pointCodeIndic.is_bound())
  || (field_globalTitleIndic.is_bound())
  || (field_routingIndicator.is_bound())
  || (field_reserved.is_bound());
}
boolean SCCP__field__AddressIndicator__ansi::is_value() const
{
return field_ssnIndicator.is_value()
  && field_pointCodeIndic.is_value()
  && field_globalTitleIndic.is_value()
  && field_routingIndicator.is_value()
  && field_reserved.is_value();
}
void SCCP__field__AddressIndicator__ansi::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ssnIndicator := ");
field_ssnIndicator.log();
TTCN_Logger::log_event_str(", pointCodeIndic := ");
field_pointCodeIndic.log();
TTCN_Logger::log_event_str(", globalTitleIndic := ");
field_globalTitleIndic.log();
TTCN_Logger::log_event_str(", routingIndicator := ");
field_routingIndicator.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__field__AddressIndicator__ansi::set_implicit_omit()
{
if (ssnIndicator().is_bound()) ssnIndicator().set_implicit_omit();
if (pointCodeIndic().is_bound()) pointCodeIndic().set_implicit_omit();
if (globalTitleIndic().is_bound()) globalTitleIndic().set_implicit_omit();
if (routingIndicator().is_bound()) routingIndicator().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCCP__field__AddressIndicator__ansi::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 @SCCP_Types.SCCP_field_AddressIndicator_ansi 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) ssnIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pointCodeIndic().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) globalTitleIndic().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) routingIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved().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(), "ssnIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssnIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointCodeIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointCodeIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globalTitleIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalTitleIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_field_AddressIndicator_ansi: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
  }
}

void SCCP__field__AddressIndicator__ansi::encode_text(Text_Buf& text_buf) const
{
field_ssnIndicator.encode_text(text_buf);
field_pointCodeIndic.encode_text(text_buf);
field_globalTitleIndic.encode_text(text_buf);
field_routingIndicator.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void SCCP__field__AddressIndicator__ansi::decode_text(Text_Buf& text_buf)
{
field_ssnIndicator.decode_text(text_buf);
field_pointCodeIndic.decode_text(text_buf);
field_globalTitleIndic.decode_text(text_buf);
field_routingIndicator.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

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

int SCCP__field__AddressIndicator__ansi::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  encoded_length += field_ssnIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pointCodeIndic.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_globalTitleIndic.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_routingIndicator.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct SCCP__field__AddressIndicator__ansi_template::single_value_struct {
BITSTRING_template field_ssnIndicator;
BITSTRING_template field_pointCodeIndic;
BITSTRING_template field_globalTitleIndic;
BITSTRING_template field_routingIndicator;
BITSTRING_template field_reserved;
};

void SCCP__field__AddressIndicator__ansi_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_ssnIndicator = ANY_VALUE;
single_value->field_pointCodeIndic = ANY_VALUE;
single_value->field_globalTitleIndic = ANY_VALUE;
single_value->field_routingIndicator = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
}
}
}

void SCCP__field__AddressIndicator__ansi_template::copy_value(const SCCP__field__AddressIndicator__ansi& other_value)
{
single_value = new single_value_struct;
if (other_value.ssnIndicator().is_bound()) {
  single_value->field_ssnIndicator = other_value.ssnIndicator();
} else {
  single_value->field_ssnIndicator.clean_up();
}
if (other_value.pointCodeIndic().is_bound()) {
  single_value->field_pointCodeIndic = other_value.pointCodeIndic();
} else {
  single_value->field_pointCodeIndic.clean_up();
}
if (other_value.globalTitleIndic().is_bound()) {
  single_value->field_globalTitleIndic = other_value.globalTitleIndic();
} else {
  single_value->field_globalTitleIndic.clean_up();
}
if (other_value.routingIndicator().is_bound()) {
  single_value->field_routingIndicator = other_value.routingIndicator();
} else {
  single_value->field_routingIndicator.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__AddressIndicator__ansi_template::copy_template(const SCCP__field__AddressIndicator__ansi_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ssnIndicator().get_selection()) {
single_value->field_ssnIndicator = other_value.ssnIndicator();
} else {
single_value->field_ssnIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointCodeIndic().get_selection()) {
single_value->field_pointCodeIndic = other_value.pointCodeIndic();
} else {
single_value->field_pointCodeIndic.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitleIndic().get_selection()) {
single_value->field_globalTitleIndic = other_value.globalTitleIndic();
} else {
single_value->field_globalTitleIndic.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingIndicator().get_selection()) {
single_value->field_routingIndicator = other_value.routingIndicator();
} else {
single_value->field_routingIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.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 SCCP__field__AddressIndicator__ansi_template[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 SCCP__field__AddressIndicator__ansi_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__AddressIndicator__ansi_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 @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
break;
}
set_selection(other_value);
}

SCCP__field__AddressIndicator__ansi_template::SCCP__field__AddressIndicator__ansi_template()
{
}

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

SCCP__field__AddressIndicator__ansi_template::SCCP__field__AddressIndicator__ansi_template(const SCCP__field__AddressIndicator__ansi& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__field__AddressIndicator__ansi_template::match(const SCCP__field__AddressIndicator__ansi& 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.ssnIndicator().is_bound()) return FALSE;
if(!single_value->field_ssnIndicator.match(other_value.ssnIndicator(), legacy))return FALSE;
if(!other_value.pointCodeIndic().is_bound()) return FALSE;
if(!single_value->field_pointCodeIndic.match(other_value.pointCodeIndic(), legacy))return FALSE;
if(!other_value.globalTitleIndic().is_bound()) return FALSE;
if(!single_value->field_globalTitleIndic.match(other_value.globalTitleIndic(), legacy))return FALSE;
if(!other_value.routingIndicator().is_bound()) return FALSE;
if(!single_value->field_routingIndicator.match(other_value.routingIndicator(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), 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 @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
}
return FALSE;
}

boolean SCCP__field__AddressIndicator__ansi_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_ssnIndicator.is_bound()
 || single_value->field_pointCodeIndic.is_bound()
 || single_value->field_globalTitleIndic.is_bound()
 || single_value->field_routingIndicator.is_bound()
 || single_value->field_reserved.is_bound();
}

boolean SCCP__field__AddressIndicator__ansi_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ssnIndicator.is_value()
 && single_value->field_pointCodeIndic.is_value()
 && single_value->field_globalTitleIndic.is_value()
 && single_value->field_routingIndicator.is_value()
 && single_value->field_reserved.is_value();
}

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

SCCP__field__AddressIndicator__ansi SCCP__field__AddressIndicator__ansi_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 @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
SCCP__field__AddressIndicator__ansi ret_val;
if (single_value->field_ssnIndicator.is_bound()) {
ret_val.ssnIndicator() = single_value->field_ssnIndicator.valueof();
}
if (single_value->field_pointCodeIndic.is_bound()) {
ret_val.pointCodeIndic() = single_value->field_pointCodeIndic.valueof();
}
if (single_value->field_globalTitleIndic.is_bound()) {
ret_val.globalTitleIndic() = single_value->field_globalTitleIndic.valueof();
}
if (single_value->field_routingIndicator.is_bound()) {
ret_val.routingIndicator() = single_value->field_routingIndicator.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

void SCCP__field__AddressIndicator__ansi_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 @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__field__AddressIndicator__ansi_template[list_length];
}

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

BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::ssnIndicator()
{
set_specific();
return single_value->field_ssnIndicator;
}

const BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::ssnIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ssnIndicator of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
return single_value->field_ssnIndicator;
}

BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::pointCodeIndic()
{
set_specific();
return single_value->field_pointCodeIndic;
}

const BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::pointCodeIndic() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointCodeIndic of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
return single_value->field_pointCodeIndic;
}

BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::globalTitleIndic()
{
set_specific();
return single_value->field_globalTitleIndic;
}

const BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::globalTitleIndic() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitleIndic of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
return single_value->field_globalTitleIndic;
}

BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::routingIndicator()
{
set_specific();
return single_value->field_routingIndicator;
}

const BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::routingIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingIndicator of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
return single_value->field_routingIndicator;
}

BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__field__AddressIndicator__ansi_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
return single_value->field_reserved;
}

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

void SCCP__field__AddressIndicator__ansi_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ssnIndicator := ");
single_value->field_ssnIndicator.log();
TTCN_Logger::log_event_str(", pointCodeIndic := ");
single_value->field_pointCodeIndic.log();
TTCN_Logger::log_event_str(", globalTitleIndic := ");
single_value->field_globalTitleIndic.log();
TTCN_Logger::log_event_str(", routingIndicator := ");
single_value->field_routingIndicator.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.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 SCCP__field__AddressIndicator__ansi_template::log_match(const SCCP__field__AddressIndicator__ansi& 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_ssnIndicator.match(match_value.ssnIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".ssnIndicator");
single_value->field_ssnIndicator.log_match(match_value.ssnIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointCodeIndic.match(match_value.pointCodeIndic(), legacy)){
TTCN_Logger::log_logmatch_info(".pointCodeIndic");
single_value->field_pointCodeIndic.log_match(match_value.pointCodeIndic(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_globalTitleIndic.match(match_value.globalTitleIndic(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitleIndic");
single_value->field_globalTitleIndic.log_match(match_value.globalTitleIndic(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingIndicator.match(match_value.routingIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".routingIndicator");
single_value->field_routingIndicator.log_match(match_value.routingIndicator(), 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);
}
}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("{ ssnIndicator := ");
single_value->field_ssnIndicator.log_match(match_value.ssnIndicator(), legacy);
TTCN_Logger::log_event_str(", pointCodeIndic := ");
single_value->field_pointCodeIndic.log_match(match_value.pointCodeIndic(), legacy);
TTCN_Logger::log_event_str(", globalTitleIndic := ");
single_value->field_globalTitleIndic.log_match(match_value.globalTitleIndic(), legacy);
TTCN_Logger::log_event_str(", routingIndicator := ");
single_value->field_routingIndicator.log_match(match_value.routingIndicator(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), 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 SCCP__field__AddressIndicator__ansi_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (ssnIndicator().is_bound()) ssnIndicator().set_implicit_omit();
if (pointCodeIndic().is_bound()) pointCodeIndic().set_implicit_omit();
if (globalTitleIndic().is_bound()) globalTitleIndic().set_implicit_omit();
if (routingIndicator().is_bound()) routingIndicator().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCCP__field__AddressIndicator__ansi_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ssnIndicator.encode_text(text_buf);
single_value->field_pointCodeIndic.encode_text(text_buf);
single_value->field_globalTitleIndic.encode_text(text_buf);
single_value->field_routingIndicator.encode_text(text_buf);
single_value->field_reserved.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 @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
}
}

void SCCP__field__AddressIndicator__ansi_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_ssnIndicator.decode_text(text_buf);
single_value->field_pointCodeIndic.decode_text(text_buf);
single_value->field_globalTitleIndic.decode_text(text_buf);
single_value->field_routingIndicator.decode_text(text_buf);
single_value->field_reserved.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 SCCP__field__AddressIndicator__ansi_template[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 @SCCP_Types.SCCP_field_AddressIndicator_ansi.");
}
}

void SCCP__field__AddressIndicator__ansi_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: {
    SCCP__field__AddressIndicator__ansi_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 @SCCP_Types.SCCP_field_AddressIndicator_ansi 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) ssnIndicator().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pointCodeIndic().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) globalTitleIndic().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) routingIndicator().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved().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(), "ssnIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ssnIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointCodeIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointCodeIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "globalTitleIndic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalTitleIndic().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingIndicator")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingIndicator().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_field_AddressIndicator_ansi: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__field__AddressIndicator__ansi_template* precondition = new SCCP__field__AddressIndicator__ansi_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__field__AddressIndicator__ansi_template* implied_template = new SCCP__field__AddressIndicator__ansi_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__field__AddressIndicator__ansi_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__field__AddressIndicator__ansi_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_ssnIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
single_value->field_pointCodeIndic.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
single_value->field_globalTitleIndic.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
single_value->field_routingIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
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 : "@SCCP_Types.SCCP_field_AddressIndicator_ansi");
}

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

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

SCCP__field__GlobalTitle__NoA::SCCP__field__GlobalTitle__NoA()
{
}

SCCP__field__GlobalTitle__NoA::SCCP__field__GlobalTitle__NoA(const BITSTRING& par_natureOfAddress,
    const BITSTRING& par_oddeven,
    const HEXSTRING& par_globalTitleAddress)
  :   field_natureOfAddress(par_natureOfAddress),
  field_oddeven(par_oddeven),
  field_globalTitleAddress(par_globalTitleAddress)
{
}

SCCP__field__GlobalTitle__NoA::SCCP__field__GlobalTitle__NoA(const SCCP__field__GlobalTitle__NoA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
if (other_value.natureOfAddress().is_bound()) field_natureOfAddress = other_value.natureOfAddress();
else field_natureOfAddress.clean_up();
if (other_value.oddeven().is_bound()) field_oddeven = other_value.oddeven();
else field_oddeven.clean_up();
if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
else field_globalTitleAddress.clean_up();
}

void SCCP__field__GlobalTitle__NoA::clean_up()
{
field_natureOfAddress.clean_up();
field_oddeven.clean_up();
field_globalTitleAddress.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__field__GlobalTitle__NoA::get_descriptor() const { return &SCCP__field__GlobalTitle__NoA_descr_; }
SCCP__field__GlobalTitle__NoA& SCCP__field__GlobalTitle__NoA::operator=(const SCCP__field__GlobalTitle__NoA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
  if (other_value.natureOfAddress().is_bound()) field_natureOfAddress = other_value.natureOfAddress();
  else field_natureOfAddress.clean_up();
  if (other_value.oddeven().is_bound()) field_oddeven = other_value.oddeven();
  else field_oddeven.clean_up();
  if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
  else field_globalTitleAddress.clean_up();
}
return *this;
}

boolean SCCP__field__GlobalTitle__NoA::operator==(const SCCP__field__GlobalTitle__NoA& other_value) const
{
return field_natureOfAddress==other_value.field_natureOfAddress
  && field_oddeven==other_value.field_oddeven
  && field_globalTitleAddress==other_value.field_globalTitleAddress;
}

boolean SCCP__field__GlobalTitle__NoA::is_bound() const
{
return (field_natureOfAddress.is_bound())
  || (field_oddeven.is_bound())
  || (field_globalTitleAddress.is_bound());
}
boolean SCCP__field__GlobalTitle__NoA::is_value() const
{
return field_natureOfAddress.is_value()
  && field_oddeven.is_value()
  && field_globalTitleAddress.is_value();
}
void SCCP__field__GlobalTitle__NoA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ natureOfAddress := ");
field_natureOfAddress.log();
TTCN_Logger::log_event_str(", oddeven := ");
field_oddeven.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
field_globalTitleAddress.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__field__GlobalTitle__NoA::set_implicit_omit()
{
if (natureOfAddress().is_bound()) natureOfAddress().set_implicit_omit();
if (oddeven().is_bound()) oddeven().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

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

void SCCP__field__GlobalTitle__NoA::encode_text(Text_Buf& text_buf) const
{
field_natureOfAddress.encode_text(text_buf);
field_oddeven.encode_text(text_buf);
field_globalTitleAddress.encode_text(text_buf);
}

void SCCP__field__GlobalTitle__NoA::decode_text(Text_Buf& text_buf)
{
field_natureOfAddress.decode_text(text_buf);
field_oddeven.decode_text(text_buf);
field_globalTitleAddress.decode_text(text_buf);
}

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

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

struct SCCP__field__GlobalTitle__NoA_template::single_value_struct {
BITSTRING_template field_natureOfAddress;
BITSTRING_template field_oddeven;
HEXSTRING_template field_globalTitleAddress;
};

void SCCP__field__GlobalTitle__NoA_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_natureOfAddress = ANY_VALUE;
single_value->field_oddeven = ANY_VALUE;
single_value->field_globalTitleAddress = ANY_VALUE;
}
}
}

void SCCP__field__GlobalTitle__NoA_template::copy_value(const SCCP__field__GlobalTitle__NoA& other_value)
{
single_value = new single_value_struct;
if (other_value.natureOfAddress().is_bound()) {
  single_value->field_natureOfAddress = other_value.natureOfAddress();
} else {
  single_value->field_natureOfAddress.clean_up();
}
if (other_value.oddeven().is_bound()) {
  single_value->field_oddeven = other_value.oddeven();
} else {
  single_value->field_oddeven.clean_up();
}
if (other_value.globalTitleAddress().is_bound()) {
  single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
  single_value->field_globalTitleAddress.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__GlobalTitle__NoA_template::copy_template(const SCCP__field__GlobalTitle__NoA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.natureOfAddress().get_selection()) {
single_value->field_natureOfAddress = other_value.natureOfAddress();
} else {
single_value->field_natureOfAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oddeven().get_selection()) {
single_value->field_oddeven = other_value.oddeven();
} else {
single_value->field_oddeven.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitleAddress().get_selection()) {
single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__NoA_template[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 SCCP__field__GlobalTitle__NoA_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__GlobalTitle__NoA_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 @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
break;
}
set_selection(other_value);
}

SCCP__field__GlobalTitle__NoA_template::SCCP__field__GlobalTitle__NoA_template()
{
}

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

SCCP__field__GlobalTitle__NoA_template::SCCP__field__GlobalTitle__NoA_template(const SCCP__field__GlobalTitle__NoA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__field__GlobalTitle__NoA_template::match(const SCCP__field__GlobalTitle__NoA& 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.natureOfAddress().is_bound()) return FALSE;
if(!single_value->field_natureOfAddress.match(other_value.natureOfAddress(), legacy))return FALSE;
if(!other_value.oddeven().is_bound()) return FALSE;
if(!single_value->field_oddeven.match(other_value.oddeven(), legacy))return FALSE;
if(!other_value.globalTitleAddress().is_bound()) return FALSE;
if(!single_value->field_globalTitleAddress.match(other_value.globalTitleAddress(), 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 @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
}
return FALSE;
}

boolean SCCP__field__GlobalTitle__NoA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_natureOfAddress.is_bound()
 || single_value->field_oddeven.is_bound()
 || single_value->field_globalTitleAddress.is_bound();
}

boolean SCCP__field__GlobalTitle__NoA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_natureOfAddress.is_value()
 && single_value->field_oddeven.is_value()
 && single_value->field_globalTitleAddress.is_value();
}

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

SCCP__field__GlobalTitle__NoA SCCP__field__GlobalTitle__NoA_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 @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
SCCP__field__GlobalTitle__NoA ret_val;
if (single_value->field_natureOfAddress.is_bound()) {
ret_val.natureOfAddress() = single_value->field_natureOfAddress.valueof();
}
if (single_value->field_oddeven.is_bound()) {
ret_val.oddeven() = single_value->field_oddeven.valueof();
}
if (single_value->field_globalTitleAddress.is_bound()) {
ret_val.globalTitleAddress() = single_value->field_globalTitleAddress.valueof();
}
return ret_val;
}

void SCCP__field__GlobalTitle__NoA_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 @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__field__GlobalTitle__NoA_template[list_length];
}

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

BITSTRING_template& SCCP__field__GlobalTitle__NoA_template::natureOfAddress()
{
set_specific();
return single_value->field_natureOfAddress;
}

const BITSTRING_template& SCCP__field__GlobalTitle__NoA_template::natureOfAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field natureOfAddress of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
return single_value->field_natureOfAddress;
}

BITSTRING_template& SCCP__field__GlobalTitle__NoA_template::oddeven()
{
set_specific();
return single_value->field_oddeven;
}

const BITSTRING_template& SCCP__field__GlobalTitle__NoA_template::oddeven() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oddeven of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
return single_value->field_oddeven;
}

HEXSTRING_template& SCCP__field__GlobalTitle__NoA_template::globalTitleAddress()
{
set_specific();
return single_value->field_globalTitleAddress;
}

const HEXSTRING_template& SCCP__field__GlobalTitle__NoA_template::globalTitleAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitleAddress of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
return single_value->field_globalTitleAddress;
}

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

void SCCP__field__GlobalTitle__NoA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ natureOfAddress := ");
single_value->field_natureOfAddress.log();
TTCN_Logger::log_event_str(", oddeven := ");
single_value->field_oddeven.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__NoA_template::log_match(const SCCP__field__GlobalTitle__NoA& 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_natureOfAddress.match(match_value.natureOfAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".natureOfAddress");
single_value->field_natureOfAddress.log_match(match_value.natureOfAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oddeven.match(match_value.oddeven(), legacy)){
TTCN_Logger::log_logmatch_info(".oddeven");
single_value->field_oddeven.log_match(match_value.oddeven(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_globalTitleAddress.match(match_value.globalTitleAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitleAddress");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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("{ natureOfAddress := ");
single_value->field_natureOfAddress.log_match(match_value.natureOfAddress(), legacy);
TTCN_Logger::log_event_str(", oddeven := ");
single_value->field_oddeven.log_match(match_value.oddeven(), legacy);
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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 SCCP__field__GlobalTitle__NoA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (natureOfAddress().is_bound()) natureOfAddress().set_implicit_omit();
if (oddeven().is_bound()) oddeven().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

void SCCP__field__GlobalTitle__NoA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_natureOfAddress.encode_text(text_buf);
single_value->field_oddeven.encode_text(text_buf);
single_value->field_globalTitleAddress.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 @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
}
}

void SCCP__field__GlobalTitle__NoA_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_natureOfAddress.decode_text(text_buf);
single_value->field_oddeven.decode_text(text_buf);
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__NoA_template[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 @SCCP_Types.SCCP_field_GlobalTitle_NoA.");
}
}

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

void SCCP__field__GlobalTitle__NoA_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_natureOfAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_NoA");
single_value->field_oddeven.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_NoA");
single_value->field_globalTitleAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_NoA");
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 : "@SCCP_Types.SCCP_field_GlobalTitle_NoA");
}

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

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

SCCP__field__GlobalTitle__TT::SCCP__field__GlobalTitle__TT()
{
}

SCCP__field__GlobalTitle__TT::SCCP__field__GlobalTitle__TT(const OCTETSTRING& par_translationType,
    const HEXSTRING& par_globalTitleAddress)
  :   field_translationType(par_translationType),
  field_globalTitleAddress(par_globalTitleAddress)
{
}

SCCP__field__GlobalTitle__TT::SCCP__field__GlobalTitle__TT(const SCCP__field__GlobalTitle__TT& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_TT.");
if (other_value.translationType().is_bound()) field_translationType = other_value.translationType();
else field_translationType.clean_up();
if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
else field_globalTitleAddress.clean_up();
}

void SCCP__field__GlobalTitle__TT::clean_up()
{
field_translationType.clean_up();
field_globalTitleAddress.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__field__GlobalTitle__TT::get_descriptor() const { return &SCCP__field__GlobalTitle__TT_descr_; }
SCCP__field__GlobalTitle__TT& SCCP__field__GlobalTitle__TT::operator=(const SCCP__field__GlobalTitle__TT& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_TT.");
  if (other_value.translationType().is_bound()) field_translationType = other_value.translationType();
  else field_translationType.clean_up();
  if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
  else field_globalTitleAddress.clean_up();
}
return *this;
}

boolean SCCP__field__GlobalTitle__TT::operator==(const SCCP__field__GlobalTitle__TT& other_value) const
{
return field_translationType==other_value.field_translationType
  && field_globalTitleAddress==other_value.field_globalTitleAddress;
}

boolean SCCP__field__GlobalTitle__TT::is_bound() const
{
return (field_translationType.is_bound())
  || (field_globalTitleAddress.is_bound());
}
boolean SCCP__field__GlobalTitle__TT::is_value() const
{
return field_translationType.is_value()
  && field_globalTitleAddress.is_value();
}
void SCCP__field__GlobalTitle__TT::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ translationType := ");
field_translationType.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
field_globalTitleAddress.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__field__GlobalTitle__TT::set_implicit_omit()
{
if (translationType().is_bound()) translationType().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

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

void SCCP__field__GlobalTitle__TT::encode_text(Text_Buf& text_buf) const
{
field_translationType.encode_text(text_buf);
field_globalTitleAddress.encode_text(text_buf);
}

void SCCP__field__GlobalTitle__TT::decode_text(Text_Buf& text_buf)
{
field_translationType.decode_text(text_buf);
field_globalTitleAddress.decode_text(text_buf);
}

void SCCP__field__GlobalTitle__TT::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 SCCP__field__GlobalTitle__TT::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 SCCP__field__GlobalTitle__TT::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_translationType.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, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_globalTitleAddress.RAW_decode(HEXSTRING_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct SCCP__field__GlobalTitle__TT_template::single_value_struct {
OCTETSTRING_template field_translationType;
HEXSTRING_template field_globalTitleAddress;
};

void SCCP__field__GlobalTitle__TT_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_translationType = ANY_VALUE;
single_value->field_globalTitleAddress = ANY_VALUE;
}
}
}

void SCCP__field__GlobalTitle__TT_template::copy_value(const SCCP__field__GlobalTitle__TT& other_value)
{
single_value = new single_value_struct;
if (other_value.translationType().is_bound()) {
  single_value->field_translationType = other_value.translationType();
} else {
  single_value->field_translationType.clean_up();
}
if (other_value.globalTitleAddress().is_bound()) {
  single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
  single_value->field_globalTitleAddress.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__GlobalTitle__TT_template::copy_template(const SCCP__field__GlobalTitle__TT_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.translationType().get_selection()) {
single_value->field_translationType = other_value.translationType();
} else {
single_value->field_translationType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitleAddress().get_selection()) {
single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__TT_template[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 SCCP__field__GlobalTitle__TT_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__GlobalTitle__TT_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 @SCCP_Types.SCCP_field_GlobalTitle_TT.");
break;
}
set_selection(other_value);
}

SCCP__field__GlobalTitle__TT_template::SCCP__field__GlobalTitle__TT_template()
{
}

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

SCCP__field__GlobalTitle__TT_template::SCCP__field__GlobalTitle__TT_template(const SCCP__field__GlobalTitle__TT& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__field__GlobalTitle__TT_template::match(const SCCP__field__GlobalTitle__TT& 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.translationType().is_bound()) return FALSE;
if(!single_value->field_translationType.match(other_value.translationType(), legacy))return FALSE;
if(!other_value.globalTitleAddress().is_bound()) return FALSE;
if(!single_value->field_globalTitleAddress.match(other_value.globalTitleAddress(), 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 @SCCP_Types.SCCP_field_GlobalTitle_TT.");
}
return FALSE;
}

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

boolean SCCP__field__GlobalTitle__TT_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_translationType.is_value()
 && single_value->field_globalTitleAddress.is_value();
}

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

SCCP__field__GlobalTitle__TT SCCP__field__GlobalTitle__TT_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 @SCCP_Types.SCCP_field_GlobalTitle_TT.");
SCCP__field__GlobalTitle__TT ret_val;
if (single_value->field_translationType.is_bound()) {
ret_val.translationType() = single_value->field_translationType.valueof();
}
if (single_value->field_globalTitleAddress.is_bound()) {
ret_val.globalTitleAddress() = single_value->field_globalTitleAddress.valueof();
}
return ret_val;
}

void SCCP__field__GlobalTitle__TT_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 @SCCP_Types.SCCP_field_GlobalTitle_TT.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__field__GlobalTitle__TT_template[list_length];
}

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

OCTETSTRING_template& SCCP__field__GlobalTitle__TT_template::translationType()
{
set_specific();
return single_value->field_translationType;
}

const OCTETSTRING_template& SCCP__field__GlobalTitle__TT_template::translationType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field translationType of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_TT.");
return single_value->field_translationType;
}

HEXSTRING_template& SCCP__field__GlobalTitle__TT_template::globalTitleAddress()
{
set_specific();
return single_value->field_globalTitleAddress;
}

const HEXSTRING_template& SCCP__field__GlobalTitle__TT_template::globalTitleAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitleAddress of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_TT.");
return single_value->field_globalTitleAddress;
}

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

void SCCP__field__GlobalTitle__TT_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ translationType := ");
single_value->field_translationType.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__TT_template::log_match(const SCCP__field__GlobalTitle__TT& 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_translationType.match(match_value.translationType(), legacy)){
TTCN_Logger::log_logmatch_info(".translationType");
single_value->field_translationType.log_match(match_value.translationType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_globalTitleAddress.match(match_value.globalTitleAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitleAddress");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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("{ translationType := ");
single_value->field_translationType.log_match(match_value.translationType(), legacy);
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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 SCCP__field__GlobalTitle__TT_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (translationType().is_bound()) translationType().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

void SCCP__field__GlobalTitle__TT_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_translationType.encode_text(text_buf);
single_value->field_globalTitleAddress.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 @SCCP_Types.SCCP_field_GlobalTitle_TT.");
}
}

void SCCP__field__GlobalTitle__TT_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_translationType.decode_text(text_buf);
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__TT_template[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 @SCCP_Types.SCCP_field_GlobalTitle_TT.");
}
}

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

void SCCP__field__GlobalTitle__TT_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_translationType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_TT");
single_value->field_globalTitleAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_TT");
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 : "@SCCP_Types.SCCP_field_GlobalTitle_TT");
}

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

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

SCCP__field__GlobalTitle__TT__NP__ES::SCCP__field__GlobalTitle__TT__NP__ES()
{
}

SCCP__field__GlobalTitle__TT__NP__ES::SCCP__field__GlobalTitle__TT__NP__ES(const OCTETSTRING& par_translationType,
    const BITSTRING& par_encodingScheme,
    const BITSTRING& par_numberingPlan,
    const HEXSTRING& par_globalTitleAddress)
  :   field_translationType(par_translationType),
  field_encodingScheme(par_encodingScheme),
  field_numberingPlan(par_numberingPlan),
  field_globalTitleAddress(par_globalTitleAddress)
{
}

SCCP__field__GlobalTitle__TT__NP__ES::SCCP__field__GlobalTitle__TT__NP__ES(const SCCP__field__GlobalTitle__TT__NP__ES& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
if (other_value.translationType().is_bound()) field_translationType = other_value.translationType();
else field_translationType.clean_up();
if (other_value.encodingScheme().is_bound()) field_encodingScheme = other_value.encodingScheme();
else field_encodingScheme.clean_up();
if (other_value.numberingPlan().is_bound()) field_numberingPlan = other_value.numberingPlan();
else field_numberingPlan.clean_up();
if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
else field_globalTitleAddress.clean_up();
}

void SCCP__field__GlobalTitle__TT__NP__ES::clean_up()
{
field_translationType.clean_up();
field_encodingScheme.clean_up();
field_numberingPlan.clean_up();
field_globalTitleAddress.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__field__GlobalTitle__TT__NP__ES::get_descriptor() const { return &SCCP__field__GlobalTitle__TT__NP__ES_descr_; }
SCCP__field__GlobalTitle__TT__NP__ES& SCCP__field__GlobalTitle__TT__NP__ES::operator=(const SCCP__field__GlobalTitle__TT__NP__ES& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
  if (other_value.translationType().is_bound()) field_translationType = other_value.translationType();
  else field_translationType.clean_up();
  if (other_value.encodingScheme().is_bound()) field_encodingScheme = other_value.encodingScheme();
  else field_encodingScheme.clean_up();
  if (other_value.numberingPlan().is_bound()) field_numberingPlan = other_value.numberingPlan();
  else field_numberingPlan.clean_up();
  if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
  else field_globalTitleAddress.clean_up();
}
return *this;
}

boolean SCCP__field__GlobalTitle__TT__NP__ES::operator==(const SCCP__field__GlobalTitle__TT__NP__ES& other_value) const
{
return field_translationType==other_value.field_translationType
  && field_encodingScheme==other_value.field_encodingScheme
  && field_numberingPlan==other_value.field_numberingPlan
  && field_globalTitleAddress==other_value.field_globalTitleAddress;
}

boolean SCCP__field__GlobalTitle__TT__NP__ES::is_bound() const
{
return (field_translationType.is_bound())
  || (field_encodingScheme.is_bound())
  || (field_numberingPlan.is_bound())
  || (field_globalTitleAddress.is_bound());
}
boolean SCCP__field__GlobalTitle__TT__NP__ES::is_value() const
{
return field_translationType.is_value()
  && field_encodingScheme.is_value()
  && field_numberingPlan.is_value()
  && field_globalTitleAddress.is_value();
}
void SCCP__field__GlobalTitle__TT__NP__ES::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ translationType := ");
field_translationType.log();
TTCN_Logger::log_event_str(", encodingScheme := ");
field_encodingScheme.log();
TTCN_Logger::log_event_str(", numberingPlan := ");
field_numberingPlan.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
field_globalTitleAddress.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__field__GlobalTitle__TT__NP__ES::set_implicit_omit()
{
if (translationType().is_bound()) translationType().set_implicit_omit();
if (encodingScheme().is_bound()) encodingScheme().set_implicit_omit();
if (numberingPlan().is_bound()) numberingPlan().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

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

void SCCP__field__GlobalTitle__TT__NP__ES::encode_text(Text_Buf& text_buf) const
{
field_translationType.encode_text(text_buf);
field_encodingScheme.encode_text(text_buf);
field_numberingPlan.encode_text(text_buf);
field_globalTitleAddress.encode_text(text_buf);
}

void SCCP__field__GlobalTitle__TT__NP__ES::decode_text(Text_Buf& text_buf)
{
field_translationType.decode_text(text_buf);
field_encodingScheme.decode_text(text_buf);
field_numberingPlan.decode_text(text_buf);
field_globalTitleAddress.decode_text(text_buf);
}

void SCCP__field__GlobalTitle__TT__NP__ES::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 SCCP__field__GlobalTitle__TT__NP__ES::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 SCCP__field__GlobalTitle__TT__NP__ES::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_translationType.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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_encodingScheme.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_numberingPlan.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_globalTitleAddress.RAW_decode(HEXSTRING_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__field__GlobalTitle__TT__NP__ES::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::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, HEXSTRING_descr_.raw);
  encoded_length += field_translationType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_encodingScheme.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_numberingPlan.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_globalTitleAddress.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct SCCP__field__GlobalTitle__TT__NP__ES_template::single_value_struct {
OCTETSTRING_template field_translationType;
BITSTRING_template field_encodingScheme;
BITSTRING_template field_numberingPlan;
HEXSTRING_template field_globalTitleAddress;
};

void SCCP__field__GlobalTitle__TT__NP__ES_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_translationType = ANY_VALUE;
single_value->field_encodingScheme = ANY_VALUE;
single_value->field_numberingPlan = ANY_VALUE;
single_value->field_globalTitleAddress = ANY_VALUE;
}
}
}

void SCCP__field__GlobalTitle__TT__NP__ES_template::copy_value(const SCCP__field__GlobalTitle__TT__NP__ES& other_value)
{
single_value = new single_value_struct;
if (other_value.translationType().is_bound()) {
  single_value->field_translationType = other_value.translationType();
} else {
  single_value->field_translationType.clean_up();
}
if (other_value.encodingScheme().is_bound()) {
  single_value->field_encodingScheme = other_value.encodingScheme();
} else {
  single_value->field_encodingScheme.clean_up();
}
if (other_value.numberingPlan().is_bound()) {
  single_value->field_numberingPlan = other_value.numberingPlan();
} else {
  single_value->field_numberingPlan.clean_up();
}
if (other_value.globalTitleAddress().is_bound()) {
  single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
  single_value->field_globalTitleAddress.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__GlobalTitle__TT__NP__ES_template::copy_template(const SCCP__field__GlobalTitle__TT__NP__ES_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.translationType().get_selection()) {
single_value->field_translationType = other_value.translationType();
} else {
single_value->field_translationType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.encodingScheme().get_selection()) {
single_value->field_encodingScheme = other_value.encodingScheme();
} else {
single_value->field_encodingScheme.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.numberingPlan().get_selection()) {
single_value->field_numberingPlan = other_value.numberingPlan();
} else {
single_value->field_numberingPlan.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitleAddress().get_selection()) {
single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__TT__NP__ES_template[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 SCCP__field__GlobalTitle__TT__NP__ES_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__GlobalTitle__TT__NP__ES_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 @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
break;
}
set_selection(other_value);
}

SCCP__field__GlobalTitle__TT__NP__ES_template::SCCP__field__GlobalTitle__TT__NP__ES_template()
{
}

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

SCCP__field__GlobalTitle__TT__NP__ES_template::SCCP__field__GlobalTitle__TT__NP__ES_template(const SCCP__field__GlobalTitle__TT__NP__ES& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__field__GlobalTitle__TT__NP__ES_template::match(const SCCP__field__GlobalTitle__TT__NP__ES& 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.translationType().is_bound()) return FALSE;
if(!single_value->field_translationType.match(other_value.translationType(), legacy))return FALSE;
if(!other_value.encodingScheme().is_bound()) return FALSE;
if(!single_value->field_encodingScheme.match(other_value.encodingScheme(), legacy))return FALSE;
if(!other_value.numberingPlan().is_bound()) return FALSE;
if(!single_value->field_numberingPlan.match(other_value.numberingPlan(), legacy))return FALSE;
if(!other_value.globalTitleAddress().is_bound()) return FALSE;
if(!single_value->field_globalTitleAddress.match(other_value.globalTitleAddress(), 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 @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
}
return FALSE;
}

boolean SCCP__field__GlobalTitle__TT__NP__ES_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_translationType.is_bound()
 || single_value->field_encodingScheme.is_bound()
 || single_value->field_numberingPlan.is_bound()
 || single_value->field_globalTitleAddress.is_bound();
}

boolean SCCP__field__GlobalTitle__TT__NP__ES_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_translationType.is_value()
 && single_value->field_encodingScheme.is_value()
 && single_value->field_numberingPlan.is_value()
 && single_value->field_globalTitleAddress.is_value();
}

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

SCCP__field__GlobalTitle__TT__NP__ES SCCP__field__GlobalTitle__TT__NP__ES_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 @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
SCCP__field__GlobalTitle__TT__NP__ES ret_val;
if (single_value->field_translationType.is_bound()) {
ret_val.translationType() = single_value->field_translationType.valueof();
}
if (single_value->field_encodingScheme.is_bound()) {
ret_val.encodingScheme() = single_value->field_encodingScheme.valueof();
}
if (single_value->field_numberingPlan.is_bound()) {
ret_val.numberingPlan() = single_value->field_numberingPlan.valueof();
}
if (single_value->field_globalTitleAddress.is_bound()) {
ret_val.globalTitleAddress() = single_value->field_globalTitleAddress.valueof();
}
return ret_val;
}

void SCCP__field__GlobalTitle__TT__NP__ES_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 @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__field__GlobalTitle__TT__NP__ES_template[list_length];
}

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

OCTETSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::translationType()
{
set_specific();
return single_value->field_translationType;
}

const OCTETSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::translationType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field translationType of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
return single_value->field_translationType;
}

BITSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::encodingScheme()
{
set_specific();
return single_value->field_encodingScheme;
}

const BITSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::encodingScheme() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field encodingScheme of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
return single_value->field_encodingScheme;
}

BITSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::numberingPlan()
{
set_specific();
return single_value->field_numberingPlan;
}

const BITSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::numberingPlan() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field numberingPlan of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
return single_value->field_numberingPlan;
}

HEXSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::globalTitleAddress()
{
set_specific();
return single_value->field_globalTitleAddress;
}

const HEXSTRING_template& SCCP__field__GlobalTitle__TT__NP__ES_template::globalTitleAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitleAddress of a non-specific template of type @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
return single_value->field_globalTitleAddress;
}

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

void SCCP__field__GlobalTitle__TT__NP__ES_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ translationType := ");
single_value->field_translationType.log();
TTCN_Logger::log_event_str(", encodingScheme := ");
single_value->field_encodingScheme.log();
TTCN_Logger::log_event_str(", numberingPlan := ");
single_value->field_numberingPlan.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__TT__NP__ES_template::log_match(const SCCP__field__GlobalTitle__TT__NP__ES& 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_translationType.match(match_value.translationType(), legacy)){
TTCN_Logger::log_logmatch_info(".translationType");
single_value->field_translationType.log_match(match_value.translationType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_encodingScheme.match(match_value.encodingScheme(), legacy)){
TTCN_Logger::log_logmatch_info(".encodingScheme");
single_value->field_encodingScheme.log_match(match_value.encodingScheme(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_numberingPlan.match(match_value.numberingPlan(), legacy)){
TTCN_Logger::log_logmatch_info(".numberingPlan");
single_value->field_numberingPlan.log_match(match_value.numberingPlan(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_globalTitleAddress.match(match_value.globalTitleAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitleAddress");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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("{ translationType := ");
single_value->field_translationType.log_match(match_value.translationType(), legacy);
TTCN_Logger::log_event_str(", encodingScheme := ");
single_value->field_encodingScheme.log_match(match_value.encodingScheme(), legacy);
TTCN_Logger::log_event_str(", numberingPlan := ");
single_value->field_numberingPlan.log_match(match_value.numberingPlan(), legacy);
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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 SCCP__field__GlobalTitle__TT__NP__ES_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (translationType().is_bound()) translationType().set_implicit_omit();
if (encodingScheme().is_bound()) encodingScheme().set_implicit_omit();
if (numberingPlan().is_bound()) numberingPlan().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

void SCCP__field__GlobalTitle__TT__NP__ES_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_translationType.encode_text(text_buf);
single_value->field_encodingScheme.encode_text(text_buf);
single_value->field_numberingPlan.encode_text(text_buf);
single_value->field_globalTitleAddress.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 @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
}
}

void SCCP__field__GlobalTitle__TT__NP__ES_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_translationType.decode_text(text_buf);
single_value->field_encodingScheme.decode_text(text_buf);
single_value->field_numberingPlan.decode_text(text_buf);
single_value->field_globalTitleAddress.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 SCCP__field__GlobalTitle__TT__NP__ES_template[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 @SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES.");
}
}

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

void SCCP__field__GlobalTitle__TT__NP__ES_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_translationType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES");
single_value->field_encodingScheme.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES");
single_value->field_numberingPlan.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES");
single_value->field_globalTitleAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES");
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 : "@SCCP_Types.SCCP_field_GlobalTitle_TT_NP_ES");
}

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

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

SCCP__field__SignallingPointCode__TT__NP__ES__NoA::SCCP__field__SignallingPointCode__TT__NP__ES__NoA()
{
}

SCCP__field__SignallingPointCode__TT__NP__ES__NoA::SCCP__field__SignallingPointCode__TT__NP__ES__NoA(const OCTETSTRING& par_translationType,
    const BITSTRING& par_encodingScheme,
    const BITSTRING& par_numberingPlan,
    const BITSTRING& par_natureOfAddress,
    const BITSTRING& par_reserved,
    const HEXSTRING& par_globalTitleAddress)
  :   field_translationType(par_translationType),
  field_encodingScheme(par_encodingScheme),
  field_numberingPlan(par_numberingPlan),
  field_natureOfAddress(par_natureOfAddress),
  field_reserved(par_reserved),
  field_globalTitleAddress(par_globalTitleAddress)
{
}

SCCP__field__SignallingPointCode__TT__NP__ES__NoA::SCCP__field__SignallingPointCode__TT__NP__ES__NoA(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
if (other_value.translationType().is_bound()) field_translationType = other_value.translationType();
else field_translationType.clean_up();
if (other_value.encodingScheme().is_bound()) field_encodingScheme = other_value.encodingScheme();
else field_encodingScheme.clean_up();
if (other_value.numberingPlan().is_bound()) field_numberingPlan = other_value.numberingPlan();
else field_numberingPlan.clean_up();
if (other_value.natureOfAddress().is_bound()) field_natureOfAddress = other_value.natureOfAddress();
else field_natureOfAddress.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
else field_globalTitleAddress.clean_up();
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA::clean_up()
{
field_translationType.clean_up();
field_encodingScheme.clean_up();
field_numberingPlan.clean_up();
field_natureOfAddress.clean_up();
field_reserved.clean_up();
field_globalTitleAddress.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__field__SignallingPointCode__TT__NP__ES__NoA::get_descriptor() const { return &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_; }
SCCP__field__SignallingPointCode__TT__NP__ES__NoA& SCCP__field__SignallingPointCode__TT__NP__ES__NoA::operator=(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
  if (other_value.translationType().is_bound()) field_translationType = other_value.translationType();
  else field_translationType.clean_up();
  if (other_value.encodingScheme().is_bound()) field_encodingScheme = other_value.encodingScheme();
  else field_encodingScheme.clean_up();
  if (other_value.numberingPlan().is_bound()) field_numberingPlan = other_value.numberingPlan();
  else field_numberingPlan.clean_up();
  if (other_value.natureOfAddress().is_bound()) field_natureOfAddress = other_value.natureOfAddress();
  else field_natureOfAddress.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.globalTitleAddress().is_bound()) field_globalTitleAddress = other_value.globalTitleAddress();
  else field_globalTitleAddress.clean_up();
}
return *this;
}

boolean SCCP__field__SignallingPointCode__TT__NP__ES__NoA::operator==(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& other_value) const
{
return field_translationType==other_value.field_translationType
  && field_encodingScheme==other_value.field_encodingScheme
  && field_numberingPlan==other_value.field_numberingPlan
  && field_natureOfAddress==other_value.field_natureOfAddress
  && field_reserved==other_value.field_reserved
  && field_globalTitleAddress==other_value.field_globalTitleAddress;
}

boolean SCCP__field__SignallingPointCode__TT__NP__ES__NoA::is_bound() const
{
return (field_translationType.is_bound())
  || (field_encodingScheme.is_bound())
  || (field_numberingPlan.is_bound())
  || (field_natureOfAddress.is_bound())
  || (field_reserved.is_bound())
  || (field_globalTitleAddress.is_bound());
}
boolean SCCP__field__SignallingPointCode__TT__NP__ES__NoA::is_value() const
{
return field_translationType.is_value()
  && field_encodingScheme.is_value()
  && field_numberingPlan.is_value()
  && field_natureOfAddress.is_value()
  && field_reserved.is_value()
  && field_globalTitleAddress.is_value();
}
void SCCP__field__SignallingPointCode__TT__NP__ES__NoA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ translationType := ");
field_translationType.log();
TTCN_Logger::log_event_str(", encodingScheme := ");
field_encodingScheme.log();
TTCN_Logger::log_event_str(", numberingPlan := ");
field_numberingPlan.log();
TTCN_Logger::log_event_str(", natureOfAddress := ");
field_natureOfAddress.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
field_globalTitleAddress.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA::set_implicit_omit()
{
if (translationType().is_bound()) translationType().set_implicit_omit();
if (encodingScheme().is_bound()) encodingScheme().set_implicit_omit();
if (numberingPlan().is_bound()) numberingPlan().set_implicit_omit();
if (natureOfAddress().is_bound()) natureOfAddress().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA 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) translationType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) encodingScheme().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) numberingPlan().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) natureOfAddress().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) globalTitleAddress().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(), "translationType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          translationType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "encodingScheme")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          encodingScheme().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "numberingPlan")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberingPlan().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "natureOfAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          natureOfAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "globalTitleAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalTitleAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
  }
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA::encode_text(Text_Buf& text_buf) const
{
field_translationType.encode_text(text_buf);
field_encodingScheme.encode_text(text_buf);
field_numberingPlan.encode_text(text_buf);
field_natureOfAddress.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_globalTitleAddress.encode_text(text_buf);
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA::decode_text(Text_Buf& text_buf)
{
field_translationType.decode_text(text_buf);
field_encodingScheme.decode_text(text_buf);
field_numberingPlan.decode_text(text_buf);
field_natureOfAddress.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_globalTitleAddress.decode_text(text_buf);
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA::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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA::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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA::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_translationType.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::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_encodingScheme.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_numberingPlan.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT7_descr_.raw->forceomit);
  decoded_field_length = field_natureOfAddress.RAW_decode(General__Types::BIT7_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, HEXSTRING_descr_.raw->forceomit);
  decoded_field_length = field_globalTitleAddress.RAW_decode(HEXSTRING_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__field__SignallingPointCode__TT__NP__ES__NoA::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, HEXSTRING_descr_.raw);
  encoded_length += field_translationType.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_encodingScheme.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_numberingPlan.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_natureOfAddress.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_globalTitleAddress.RAW_encode(HEXSTRING_descr_, *myleaf.body.node.nodes[5]);
  return myleaf.length = encoded_length;
}

struct SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::single_value_struct {
OCTETSTRING_template field_translationType;
BITSTRING_template field_encodingScheme;
BITSTRING_template field_numberingPlan;
BITSTRING_template field_natureOfAddress;
BITSTRING_template field_reserved;
HEXSTRING_template field_globalTitleAddress;
};

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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_translationType = ANY_VALUE;
single_value->field_encodingScheme = ANY_VALUE;
single_value->field_numberingPlan = ANY_VALUE;
single_value->field_natureOfAddress = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_globalTitleAddress = ANY_VALUE;
}
}
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::copy_value(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& other_value)
{
single_value = new single_value_struct;
if (other_value.translationType().is_bound()) {
  single_value->field_translationType = other_value.translationType();
} else {
  single_value->field_translationType.clean_up();
}
if (other_value.encodingScheme().is_bound()) {
  single_value->field_encodingScheme = other_value.encodingScheme();
} else {
  single_value->field_encodingScheme.clean_up();
}
if (other_value.numberingPlan().is_bound()) {
  single_value->field_numberingPlan = other_value.numberingPlan();
} else {
  single_value->field_numberingPlan.clean_up();
}
if (other_value.natureOfAddress().is_bound()) {
  single_value->field_natureOfAddress = other_value.natureOfAddress();
} else {
  single_value->field_natureOfAddress.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.globalTitleAddress().is_bound()) {
  single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
  single_value->field_globalTitleAddress.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::copy_template(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.translationType().get_selection()) {
single_value->field_translationType = other_value.translationType();
} else {
single_value->field_translationType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.encodingScheme().get_selection()) {
single_value->field_encodingScheme = other_value.encodingScheme();
} else {
single_value->field_encodingScheme.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.numberingPlan().get_selection()) {
single_value->field_numberingPlan = other_value.numberingPlan();
} else {
single_value->field_numberingPlan.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.natureOfAddress().get_selection()) {
single_value->field_natureOfAddress = other_value.natureOfAddress();
} else {
single_value->field_natureOfAddress.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.globalTitleAddress().get_selection()) {
single_value->field_globalTitleAddress = other_value.globalTitleAddress();
} else {
single_value->field_globalTitleAddress.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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template[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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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 @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
break;
}
set_selection(other_value);
}

SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template()
{
}

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

SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::match(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& 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.translationType().is_bound()) return FALSE;
if(!single_value->field_translationType.match(other_value.translationType(), legacy))return FALSE;
if(!other_value.encodingScheme().is_bound()) return FALSE;
if(!single_value->field_encodingScheme.match(other_value.encodingScheme(), legacy))return FALSE;
if(!other_value.numberingPlan().is_bound()) return FALSE;
if(!single_value->field_numberingPlan.match(other_value.numberingPlan(), legacy))return FALSE;
if(!other_value.natureOfAddress().is_bound()) return FALSE;
if(!single_value->field_natureOfAddress.match(other_value.natureOfAddress(), 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.globalTitleAddress().is_bound()) return FALSE;
if(!single_value->field_globalTitleAddress.match(other_value.globalTitleAddress(), 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 @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
}
return FALSE;
}

boolean SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_translationType.is_bound()
 || single_value->field_encodingScheme.is_bound()
 || single_value->field_numberingPlan.is_bound()
 || single_value->field_natureOfAddress.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_globalTitleAddress.is_bound();
}

boolean SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_translationType.is_value()
 && single_value->field_encodingScheme.is_value()
 && single_value->field_numberingPlan.is_value()
 && single_value->field_natureOfAddress.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_globalTitleAddress.is_value();
}

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

SCCP__field__SignallingPointCode__TT__NP__ES__NoA SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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 @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
SCCP__field__SignallingPointCode__TT__NP__ES__NoA ret_val;
if (single_value->field_translationType.is_bound()) {
ret_val.translationType() = single_value->field_translationType.valueof();
}
if (single_value->field_encodingScheme.is_bound()) {
ret_val.encodingScheme() = single_value->field_encodingScheme.valueof();
}
if (single_value->field_numberingPlan.is_bound()) {
ret_val.numberingPlan() = single_value->field_numberingPlan.valueof();
}
if (single_value->field_natureOfAddress.is_bound()) {
ret_val.natureOfAddress() = single_value->field_natureOfAddress.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_globalTitleAddress.is_bound()) {
ret_val.globalTitleAddress() = single_value->field_globalTitleAddress.valueof();
}
return ret_val;
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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 @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template[list_length];
}

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

OCTETSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::translationType()
{
set_specific();
return single_value->field_translationType;
}

const OCTETSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::translationType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field translationType of a non-specific template of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
return single_value->field_translationType;
}

BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::encodingScheme()
{
set_specific();
return single_value->field_encodingScheme;
}

const BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::encodingScheme() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field encodingScheme of a non-specific template of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
return single_value->field_encodingScheme;
}

BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::numberingPlan()
{
set_specific();
return single_value->field_numberingPlan;
}

const BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::numberingPlan() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field numberingPlan of a non-specific template of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
return single_value->field_numberingPlan;
}

BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::natureOfAddress()
{
set_specific();
return single_value->field_natureOfAddress;
}

const BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::natureOfAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field natureOfAddress of a non-specific template of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
return single_value->field_natureOfAddress;
}

BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
return single_value->field_reserved;
}

HEXSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::globalTitleAddress()
{
set_specific();
return single_value->field_globalTitleAddress;
}

const HEXSTRING_template& SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::globalTitleAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitleAddress of a non-specific template of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
return single_value->field_globalTitleAddress;
}

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

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ translationType := ");
single_value->field_translationType.log();
TTCN_Logger::log_event_str(", encodingScheme := ");
single_value->field_encodingScheme.log();
TTCN_Logger::log_event_str(", numberingPlan := ");
single_value->field_numberingPlan.log();
TTCN_Logger::log_event_str(", natureOfAddress := ");
single_value->field_natureOfAddress.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::log_match(const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& 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_translationType.match(match_value.translationType(), legacy)){
TTCN_Logger::log_logmatch_info(".translationType");
single_value->field_translationType.log_match(match_value.translationType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_encodingScheme.match(match_value.encodingScheme(), legacy)){
TTCN_Logger::log_logmatch_info(".encodingScheme");
single_value->field_encodingScheme.log_match(match_value.encodingScheme(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_numberingPlan.match(match_value.numberingPlan(), legacy)){
TTCN_Logger::log_logmatch_info(".numberingPlan");
single_value->field_numberingPlan.log_match(match_value.numberingPlan(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_natureOfAddress.match(match_value.natureOfAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".natureOfAddress");
single_value->field_natureOfAddress.log_match(match_value.natureOfAddress(), 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_globalTitleAddress.match(match_value.globalTitleAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitleAddress");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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("{ translationType := ");
single_value->field_translationType.log_match(match_value.translationType(), legacy);
TTCN_Logger::log_event_str(", encodingScheme := ");
single_value->field_encodingScheme.log_match(match_value.encodingScheme(), legacy);
TTCN_Logger::log_event_str(", numberingPlan := ");
single_value->field_numberingPlan.log_match(match_value.numberingPlan(), legacy);
TTCN_Logger::log_event_str(", natureOfAddress := ");
single_value->field_natureOfAddress.log_match(match_value.natureOfAddress(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", globalTitleAddress := ");
single_value->field_globalTitleAddress.log_match(match_value.globalTitleAddress(), 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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (translationType().is_bound()) translationType().set_implicit_omit();
if (encodingScheme().is_bound()) encodingScheme().set_implicit_omit();
if (numberingPlan().is_bound()) numberingPlan().set_implicit_omit();
if (natureOfAddress().is_bound()) natureOfAddress().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (globalTitleAddress().is_bound()) globalTitleAddress().set_implicit_omit();
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_translationType.encode_text(text_buf);
single_value->field_encodingScheme.encode_text(text_buf);
single_value->field_numberingPlan.encode_text(text_buf);
single_value->field_natureOfAddress.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_globalTitleAddress.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 @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
}
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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_translationType.decode_text(text_buf);
single_value->field_encodingScheme.decode_text(text_buf);
single_value->field_numberingPlan.decode_text(text_buf);
single_value->field_natureOfAddress.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_globalTitleAddress.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 SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template[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 @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA.");
}
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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: {
    SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA 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) translationType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) encodingScheme().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) numberingPlan().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) natureOfAddress().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) globalTitleAddress().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(), "translationType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          translationType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "encodingScheme")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          encodingScheme().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "numberingPlan")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          numberingPlan().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "natureOfAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          natureOfAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "globalTitleAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          globalTitleAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template* precondition = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template* implied_template = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__field__SignallingPointCode__TT__NP__ES__NoA_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_translationType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
single_value->field_encodingScheme.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
single_value->field_numberingPlan.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
single_value->field_natureOfAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
single_value->field_globalTitleAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
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 : "@SCCP_Types.SCCP_field_SignallingPointCode_TT_NP_ES_NoA");
}

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

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

void SCCP__field__GlobalTitle__itu::copy_value(const SCCP__field__GlobalTitle__itu& other_value)
{
switch (other_value.union_selection) {
case ALT_gti0001:
field_gti0001 = new SCCP__field__GlobalTitle__NoA(*other_value.field_gti0001);
break;
case ALT_gti0010:
field_gti0010 = new SCCP__field__GlobalTitle__TT(*other_value.field_gti0010);
break;
case ALT_gti0011:
field_gti0011 = new SCCP__field__GlobalTitle__TT__NP__ES(*other_value.field_gti0011);
break;
case ALT_gti0100:
field_gti0100 = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA(*other_value.field_gti0100);
break;
default:
TTCN_error("Assignment of an unbound union value of type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean SCCP__field__GlobalTitle__itu::operator==(const SCCP__field__GlobalTitle__itu& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_gti0001:
return *field_gti0001 == *other_value.field_gti0001;
case ALT_gti0010:
return *field_gti0010 == *other_value.field_gti0010;
case ALT_gti0011:
return *field_gti0011 == *other_value.field_gti0011;
case ALT_gti0100:
return *field_gti0100 == *other_value.field_gti0100;
default:
return FALSE;
}
}

SCCP__field__GlobalTitle__NoA& SCCP__field__GlobalTitle__itu::gti0001()
{
if (union_selection != ALT_gti0001) {
clean_up();
field_gti0001 = new SCCP__field__GlobalTitle__NoA;
union_selection = ALT_gti0001;
}
return *field_gti0001;
}

const SCCP__field__GlobalTitle__NoA& SCCP__field__GlobalTitle__itu::gti0001() const
{
if (union_selection != ALT_gti0001) TTCN_error("Using non-selected field gti0001 in a value of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *field_gti0001;
}

SCCP__field__GlobalTitle__TT& SCCP__field__GlobalTitle__itu::gti0010()
{
if (union_selection != ALT_gti0010) {
clean_up();
field_gti0010 = new SCCP__field__GlobalTitle__TT;
union_selection = ALT_gti0010;
}
return *field_gti0010;
}

const SCCP__field__GlobalTitle__TT& SCCP__field__GlobalTitle__itu::gti0010() const
{
if (union_selection != ALT_gti0010) TTCN_error("Using non-selected field gti0010 in a value of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *field_gti0010;
}

SCCP__field__GlobalTitle__TT__NP__ES& SCCP__field__GlobalTitle__itu::gti0011()
{
if (union_selection != ALT_gti0011) {
clean_up();
field_gti0011 = new SCCP__field__GlobalTitle__TT__NP__ES;
union_selection = ALT_gti0011;
}
return *field_gti0011;
}

const SCCP__field__GlobalTitle__TT__NP__ES& SCCP__field__GlobalTitle__itu::gti0011() const
{
if (union_selection != ALT_gti0011) TTCN_error("Using non-selected field gti0011 in a value of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *field_gti0011;
}

SCCP__field__SignallingPointCode__TT__NP__ES__NoA& SCCP__field__GlobalTitle__itu::gti0100()
{
if (union_selection != ALT_gti0100) {
clean_up();
field_gti0100 = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA;
union_selection = ALT_gti0100;
}
return *field_gti0100;
}

const SCCP__field__SignallingPointCode__TT__NP__ES__NoA& SCCP__field__GlobalTitle__itu::gti0100() const
{
if (union_selection != ALT_gti0100) TTCN_error("Using non-selected field gti0100 in a value of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *field_gti0100;
}

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

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

boolean SCCP__field__GlobalTitle__itu::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_gti0001: return field_gti0001->is_value();
case ALT_gti0010: return field_gti0010->is_value();
case ALT_gti0011: return field_gti0011->is_value();
case ALT_gti0100: return field_gti0100->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void SCCP__field__GlobalTitle__itu::clean_up()
{
switch (union_selection) {
case ALT_gti0001:
  delete field_gti0001;
  break;
case ALT_gti0010:
  delete field_gti0010;
  break;
case ALT_gti0011:
  delete field_gti0011;
  break;
case ALT_gti0100:
  delete field_gti0100;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void SCCP__field__GlobalTitle__itu::log() const
{
switch (union_selection) {
case ALT_gti0001:
TTCN_Logger::log_event_str("{ gti0001 := ");
field_gti0001->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gti0010:
TTCN_Logger::log_event_str("{ gti0010 := ");
field_gti0010->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gti0011:
TTCN_Logger::log_event_str("{ gti0011 := ");
field_gti0011->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gti0100:
TTCN_Logger::log_event_str("{ gti0100 := ");
field_gti0100->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void SCCP__field__GlobalTitle__itu::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "gti0001")) {
    gti0001().set_param(*mp_last);
    if (!gti0001().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gti0010")) {
    gti0010().set_param(*mp_last);
    if (!gti0010().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gti0011")) {
    gti0011().set_param(*mp_last);
    if (!gti0011().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gti0100")) {
    gti0100().set_param(*mp_last);
    if (!gti0100().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @SCCP_Types.SCCP_field_GlobalTitle_itu.", last_name);
}

void SCCP__field__GlobalTitle__itu::set_implicit_omit()
{
switch (union_selection) {
case ALT_gti0001:
field_gti0001->set_implicit_omit(); break;
case ALT_gti0010:
field_gti0010->set_implicit_omit(); break;
case ALT_gti0011:
field_gti0011->set_implicit_omit(); break;
case ALT_gti0100:
field_gti0100->set_implicit_omit(); break;
default: break;
}
}

void SCCP__field__GlobalTitle__itu::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_gti0001:
field_gti0001->encode_text(text_buf);
break;
case ALT_gti0010:
field_gti0010->encode_text(text_buf);
break;
case ALT_gti0011:
field_gti0011->encode_text(text_buf);
break;
case ALT_gti0100:
field_gti0100->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
}

void SCCP__field__GlobalTitle__itu::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_gti0001:
gti0001().decode_text(text_buf);
break;
case ALT_gti0010:
gti0010().decode_text(text_buf);
break;
case ALT_gti0011:
gti0011().decode_text(text_buf);
break;
case ALT_gti0100:
gti0100().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
}

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

void SCCP__field__GlobalTitle__itu::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 SCCP__field__GlobalTitle__itu::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit)
{
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int starting_pos=p_buf.get_pos_bit();
  if(sel_field!=-1){
    switch(sel_field){
    case 0: {
      RAW_Force_Omit field_force_omit(0, force_omit, SCCP__field__GlobalTitle__NoA_descr_.raw->forceomit);
      decoded_length = gti0001().RAW_decode(SCCP__field__GlobalTitle__NoA_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 1: {
      RAW_Force_Omit field_force_omit(1, force_omit, SCCP__field__GlobalTitle__TT_descr_.raw->forceomit);
      decoded_length = gti0010().RAW_decode(SCCP__field__GlobalTitle__TT_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 2: {
      RAW_Force_Omit field_force_omit(2, force_omit, SCCP__field__GlobalTitle__TT__NP__ES_descr_.raw->forceomit);
      decoded_length = gti0011().RAW_decode(SCCP__field__GlobalTitle__TT__NP__ES_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_.raw->forceomit);
      decoded_length = gti0100().RAW_decode(SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__field__GlobalTitle__NoA_descr_.raw->forceomit);
      decoded_length = gti0001().RAW_decode(SCCP__field__GlobalTitle__NoA_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__field__GlobalTitle__TT_descr_.raw->forceomit);
      decoded_length = gti0010().RAW_decode(SCCP__field__GlobalTitle__TT_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__field__GlobalTitle__TT__NP__ES_descr_.raw->forceomit);
      decoded_length = gti0011().RAW_decode(SCCP__field__GlobalTitle__TT__NP__ES_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_.raw->forceomit);
      decoded_length = gti0100().RAW_decode(SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int SCCP__field__GlobalTitle__itu::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  memset(myleaf.body.node.nodes, 0, 4 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_gti0001:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SCCP__field__GlobalTitle__NoA_descr_.raw);
    encoded_length = field_gti0001->RAW_encode(SCCP__field__GlobalTitle__NoA_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SCCP__field__GlobalTitle__NoA_descr_;
    break;
  case ALT_gti0010:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, SCCP__field__GlobalTitle__TT_descr_.raw);
    encoded_length = field_gti0010->RAW_encode(SCCP__field__GlobalTitle__TT_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &SCCP__field__GlobalTitle__TT_descr_;
    break;
  case ALT_gti0011:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, SCCP__field__GlobalTitle__TT__NP__ES_descr_.raw);
    encoded_length = field_gti0011->RAW_encode(SCCP__field__GlobalTitle__TT__NP__ES_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &SCCP__field__GlobalTitle__TT__NP__ES_descr_;
    break;
  case ALT_gti0100:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_.raw);
    encoded_length = field_gti0100->RAW_encode(SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &SCCP__field__SignallingPointCode__TT__NP__ES__NoA_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void SCCP__field__GlobalTitle__itu_template::copy_value(const SCCP__field__GlobalTitle__itu& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
single_value.field_gti0001 = new SCCP__field__GlobalTitle__NoA_template(other_value.gti0001());
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template(other_value.gti0010());
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
single_value.field_gti0011 = new SCCP__field__GlobalTitle__TT__NP__ES_template(other_value.gti0011());
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
single_value.field_gti0100 = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template(other_value.gti0100());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__GlobalTitle__itu_template::copy_template(const SCCP__field__GlobalTitle__itu_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
single_value.field_gti0001 = new SCCP__field__GlobalTitle__NoA_template(*other_value.single_value.field_gti0001);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template(*other_value.single_value.field_gti0010);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
single_value.field_gti0011 = new SCCP__field__GlobalTitle__TT__NP__ES_template(*other_value.single_value.field_gti0011);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
single_value.field_gti0100 = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template(*other_value.single_value.field_gti0100);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
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 SCCP__field__GlobalTitle__itu_template[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 SCCP__field__GlobalTitle__itu_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__GlobalTitle__itu_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
set_selection(other_value);
}

SCCP__field__GlobalTitle__itu_template::SCCP__field__GlobalTitle__itu_template()
{
}

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

SCCP__field__GlobalTitle__itu_template::SCCP__field__GlobalTitle__itu_template(const SCCP__field__GlobalTitle__itu& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void SCCP__field__GlobalTitle__itu_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
delete single_value.field_gti0001;
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
delete single_value.field_gti0010;
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
delete single_value.field_gti0011;
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
delete single_value.field_gti0100;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

boolean SCCP__field__GlobalTitle__itu_template::match(const SCCP__field__GlobalTitle__itu& 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:
{
SCCP__field__GlobalTitle__itu::union_selection_type value_selection = other_value.get_selection();
if (value_selection == SCCP__field__GlobalTitle__itu::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
return single_value.field_gti0001->match(other_value.gti0001(), legacy);
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
return single_value.field_gti0010->match(other_value.gti0010(), legacy);
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
return single_value.field_gti0011->match(other_value.gti0011(), legacy);
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
return single_value.field_gti0100->match(other_value.gti0100(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
return FALSE;
}

boolean SCCP__field__GlobalTitle__itu_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
return single_value.field_gti0001->is_value();
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
return single_value.field_gti0010->is_value();
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
return single_value.field_gti0011->is_value();
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
return single_value.field_gti0100->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
}

SCCP__field__GlobalTitle__itu SCCP__field__GlobalTitle__itu_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
SCCP__field__GlobalTitle__itu ret_val;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
ret_val.gti0001() = single_value.field_gti0001->valueof();
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
ret_val.gti0010() = single_value.field_gti0010->valueof();
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
ret_val.gti0011() = single_value.field_gti0011->valueof();
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
ret_val.gti0100() = single_value.field_gti0100->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
return ret_val;
}

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

SCCP__field__GlobalTitle__NoA_template& SCCP__field__GlobalTitle__itu_template::gti0001()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0001) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gti0001 = new SCCP__field__GlobalTitle__NoA_template(ANY_VALUE);
else single_value.field_gti0001 = new SCCP__field__GlobalTitle__NoA_template;
single_value.union_selection = SCCP__field__GlobalTitle__itu::ALT_gti0001;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gti0001;
}

const SCCP__field__GlobalTitle__NoA_template& SCCP__field__GlobalTitle__itu_template::gti0001() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gti0001 in a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
if (single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0001) TTCN_error("Accessing non-selected field gti0001 in a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *single_value.field_gti0001;
}

SCCP__field__GlobalTitle__TT_template& SCCP__field__GlobalTitle__itu_template::gti0010()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0010) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template(ANY_VALUE);
else single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template;
single_value.union_selection = SCCP__field__GlobalTitle__itu::ALT_gti0010;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gti0010;
}

const SCCP__field__GlobalTitle__TT_template& SCCP__field__GlobalTitle__itu_template::gti0010() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gti0010 in a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
if (single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0010) TTCN_error("Accessing non-selected field gti0010 in a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *single_value.field_gti0010;
}

SCCP__field__GlobalTitle__TT__NP__ES_template& SCCP__field__GlobalTitle__itu_template::gti0011()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0011) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gti0011 = new SCCP__field__GlobalTitle__TT__NP__ES_template(ANY_VALUE);
else single_value.field_gti0011 = new SCCP__field__GlobalTitle__TT__NP__ES_template;
single_value.union_selection = SCCP__field__GlobalTitle__itu::ALT_gti0011;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gti0011;
}

const SCCP__field__GlobalTitle__TT__NP__ES_template& SCCP__field__GlobalTitle__itu_template::gti0011() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gti0011 in a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
if (single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0011) TTCN_error("Accessing non-selected field gti0011 in a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *single_value.field_gti0011;
}

SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template& SCCP__field__GlobalTitle__itu_template::gti0100()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0100) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gti0100 = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template(ANY_VALUE);
else single_value.field_gti0100 = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template;
single_value.union_selection = SCCP__field__GlobalTitle__itu::ALT_gti0100;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gti0100;
}

const SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template& SCCP__field__GlobalTitle__itu_template::gti0100() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gti0100 in a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
if (single_value.union_selection != SCCP__field__GlobalTitle__itu::ALT_gti0100) TTCN_error("Accessing non-selected field gti0100 in a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
return *single_value.field_gti0100;
}

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

void SCCP__field__GlobalTitle__itu_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
TTCN_Logger::log_event_str("{ gti0001 := ");
single_value.field_gti0001->log();
TTCN_Logger::log_event_str(" }");
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
TTCN_Logger::log_event_str("{ gti0010 := ");
single_value.field_gti0010->log();
TTCN_Logger::log_event_str(" }");
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
TTCN_Logger::log_event_str("{ gti0011 := ");
single_value.field_gti0011->log();
TTCN_Logger::log_event_str(" }");
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
TTCN_Logger::log_event_str("{ gti0100 := ");
single_value.field_gti0100->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SCCP__field__GlobalTitle__itu_template::log_match(const SCCP__field__GlobalTitle__itu& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gti0001");
single_value.field_gti0001->log_match(match_value.gti0001(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gti0001 := ");
single_value.field_gti0001->log_match(match_value.gti0001(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gti0010");
single_value.field_gti0010->log_match(match_value.gti0010(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gti0010 := ");
single_value.field_gti0010->log_match(match_value.gti0010(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gti0011");
single_value.field_gti0011->log_match(match_value.gti0011(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gti0011 := ");
single_value.field_gti0011->log_match(match_value.gti0011(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gti0100");
single_value.field_gti0100->log_match(match_value.gti0100(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gti0100 := ");
single_value.field_gti0100->log_match(match_value.gti0100(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SCCP__field__GlobalTitle__itu_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
single_value.field_gti0001->set_implicit_omit(); break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
single_value.field_gti0010->set_implicit_omit(); break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
single_value.field_gti0011->set_implicit_omit(); break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
single_value.field_gti0100->set_implicit_omit(); break;
default: break;
}
}

void SCCP__field__GlobalTitle__itu_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
single_value.field_gti0001->encode_text(text_buf);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
single_value.field_gti0010->encode_text(text_buf);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
single_value.field_gti0011->encode_text(text_buf);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
single_value.field_gti0100->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
}

void SCCP__field__GlobalTitle__itu_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = SCCP__field__GlobalTitle__itu::UNBOUND_VALUE;
SCCP__field__GlobalTitle__itu::union_selection_type new_selection = (SCCP__field__GlobalTitle__itu::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
single_value.field_gti0001 = new SCCP__field__GlobalTitle__NoA_template;
single_value.field_gti0001->decode_text(text_buf);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template;
single_value.field_gti0010->decode_text(text_buf);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
single_value.field_gti0011 = new SCCP__field__GlobalTitle__TT__NP__ES_template;
single_value.field_gti0011->decode_text(text_buf);
break;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
single_value.field_gti0100 = new SCCP__field__SignallingPointCode__TT__NP__ES__NoA_template;
single_value.field_gti0100->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SCCP__field__GlobalTitle__itu_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
}

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

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

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

void SCCP__field__GlobalTitle__itu_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__itu::ALT_gti0001:
single_value.field_gti0001->check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_itu");
return;
case SCCP__field__GlobalTitle__itu::ALT_gti0010:
single_value.field_gti0010->check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_itu");
return;
case SCCP__field__GlobalTitle__itu::ALT_gti0011:
single_value.field_gti0011->check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_itu");
return;
case SCCP__field__GlobalTitle__itu::ALT_gti0100:
single_value.field_gti0100->check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_field_GlobalTitle_itu");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @SCCP_Types.SCCP_field_GlobalTitle_itu.");
}
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 : "@SCCP_Types.SCCP_field_GlobalTitle_itu");
}

void SCCP__field__GlobalTitle__ansi::copy_value(const SCCP__field__GlobalTitle__ansi& other_value)
{
switch (other_value.union_selection) {
case ALT_gti0001:
field_gti0001 = new SCCP__field__GlobalTitle__TT__NP__ES(*other_value.field_gti0001);
break;
case ALT_gti0010:
field_gti0010 = new SCCP__field__GlobalTitle__TT(*other_value.field_gti0010);
break;
default:
TTCN_error("Assignment of an unbound union value of type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean SCCP__field__GlobalTitle__ansi::operator==(const SCCP__field__GlobalTitle__ansi& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_gti0001:
return *field_gti0001 == *other_value.field_gti0001;
case ALT_gti0010:
return *field_gti0010 == *other_value.field_gti0010;
default:
return FALSE;
}
}

SCCP__field__GlobalTitle__TT__NP__ES& SCCP__field__GlobalTitle__ansi::gti0001()
{
if (union_selection != ALT_gti0001) {
clean_up();
field_gti0001 = new SCCP__field__GlobalTitle__TT__NP__ES;
union_selection = ALT_gti0001;
}
return *field_gti0001;
}

const SCCP__field__GlobalTitle__TT__NP__ES& SCCP__field__GlobalTitle__ansi::gti0001() const
{
if (union_selection != ALT_gti0001) TTCN_error("Using non-selected field gti0001 in a value of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
return *field_gti0001;
}

SCCP__field__GlobalTitle__TT& SCCP__field__GlobalTitle__ansi::gti0010()
{
if (union_selection != ALT_gti0010) {
clean_up();
field_gti0010 = new SCCP__field__GlobalTitle__TT;
union_selection = ALT_gti0010;
}
return *field_gti0010;
}

const SCCP__field__GlobalTitle__TT& SCCP__field__GlobalTitle__ansi::gti0010() const
{
if (union_selection != ALT_gti0010) TTCN_error("Using non-selected field gti0010 in a value of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
return *field_gti0010;
}

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

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

boolean SCCP__field__GlobalTitle__ansi::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_gti0001: return field_gti0001->is_value();
case ALT_gti0010: return field_gti0010->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void SCCP__field__GlobalTitle__ansi::clean_up()
{
switch (union_selection) {
case ALT_gti0001:
  delete field_gti0001;
  break;
case ALT_gti0010:
  delete field_gti0010;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void SCCP__field__GlobalTitle__ansi::log() const
{
switch (union_selection) {
case ALT_gti0001:
TTCN_Logger::log_event_str("{ gti0001 := ");
field_gti0001->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_gti0010:
TTCN_Logger::log_event_str("{ gti0010 := ");
field_gti0010->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void SCCP__field__GlobalTitle__ansi::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "gti0001")) {
    gti0001().set_param(*mp_last);
    if (!gti0001().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "gti0010")) {
    gti0010().set_param(*mp_last);
    if (!gti0010().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @SCCP_Types.SCCP_field_GlobalTitle_ansi.", last_name);
}

void SCCP__field__GlobalTitle__ansi::set_implicit_omit()
{
switch (union_selection) {
case ALT_gti0001:
field_gti0001->set_implicit_omit(); break;
case ALT_gti0010:
field_gti0010->set_implicit_omit(); break;
default: break;
}
}

void SCCP__field__GlobalTitle__ansi::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_gti0001:
field_gti0001->encode_text(text_buf);
break;
case ALT_gti0010:
field_gti0010->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
}

void SCCP__field__GlobalTitle__ansi::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_gti0001:
gti0001().decode_text(text_buf);
break;
case ALT_gti0010:
gti0010().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
}

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

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

int SCCP__field__GlobalTitle__ansi::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  memset(myleaf.body.node.nodes, 0, 2 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_gti0001:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SCCP__field__GlobalTitle__TT__NP__ES_descr_.raw);
    encoded_length = field_gti0001->RAW_encode(SCCP__field__GlobalTitle__TT__NP__ES_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SCCP__field__GlobalTitle__TT__NP__ES_descr_;
    break;
  case ALT_gti0010:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, SCCP__field__GlobalTitle__TT_descr_.raw);
    encoded_length = field_gti0010->RAW_encode(SCCP__field__GlobalTitle__TT_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &SCCP__field__GlobalTitle__TT_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void SCCP__field__GlobalTitle__ansi_template::copy_value(const SCCP__field__GlobalTitle__ansi& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
single_value.field_gti0001 = new SCCP__field__GlobalTitle__TT__NP__ES_template(other_value.gti0001());
break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template(other_value.gti0010());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__field__GlobalTitle__ansi_template::copy_template(const SCCP__field__GlobalTitle__ansi_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
single_value.field_gti0001 = new SCCP__field__GlobalTitle__TT__NP__ES_template(*other_value.single_value.field_gti0001);
break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template(*other_value.single_value.field_gti0010);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
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 SCCP__field__GlobalTitle__ansi_template[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 SCCP__field__GlobalTitle__ansi_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__field__GlobalTitle__ansi_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
set_selection(other_value);
}

SCCP__field__GlobalTitle__ansi_template::SCCP__field__GlobalTitle__ansi_template()
{
}

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

SCCP__field__GlobalTitle__ansi_template::SCCP__field__GlobalTitle__ansi_template(const SCCP__field__GlobalTitle__ansi& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean SCCP__field__GlobalTitle__ansi_template::match(const SCCP__field__GlobalTitle__ansi& 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:
{
SCCP__field__GlobalTitle__ansi::union_selection_type value_selection = other_value.get_selection();
if (value_selection == SCCP__field__GlobalTitle__ansi::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
return single_value.field_gti0001->match(other_value.gti0001(), legacy);
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
return single_value.field_gti0010->match(other_value.gti0010(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
return FALSE;
}

boolean SCCP__field__GlobalTitle__ansi_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
return single_value.field_gti0001->is_value();
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
return single_value.field_gti0010->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
}

SCCP__field__GlobalTitle__ansi SCCP__field__GlobalTitle__ansi_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
SCCP__field__GlobalTitle__ansi ret_val;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
ret_val.gti0001() = single_value.field_gti0001->valueof();
break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
ret_val.gti0010() = single_value.field_gti0010->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
return ret_val;
}

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

SCCP__field__GlobalTitle__TT__NP__ES_template& SCCP__field__GlobalTitle__ansi_template::gti0001()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SCCP__field__GlobalTitle__ansi::ALT_gti0001) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gti0001 = new SCCP__field__GlobalTitle__TT__NP__ES_template(ANY_VALUE);
else single_value.field_gti0001 = new SCCP__field__GlobalTitle__TT__NP__ES_template;
single_value.union_selection = SCCP__field__GlobalTitle__ansi::ALT_gti0001;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gti0001;
}

const SCCP__field__GlobalTitle__TT__NP__ES_template& SCCP__field__GlobalTitle__ansi_template::gti0001() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gti0001 in a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
if (single_value.union_selection != SCCP__field__GlobalTitle__ansi::ALT_gti0001) TTCN_error("Accessing non-selected field gti0001 in a template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
return *single_value.field_gti0001;
}

SCCP__field__GlobalTitle__TT_template& SCCP__field__GlobalTitle__ansi_template::gti0010()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SCCP__field__GlobalTitle__ansi::ALT_gti0010) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template(ANY_VALUE);
else single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template;
single_value.union_selection = SCCP__field__GlobalTitle__ansi::ALT_gti0010;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_gti0010;
}

const SCCP__field__GlobalTitle__TT_template& SCCP__field__GlobalTitle__ansi_template::gti0010() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gti0010 in a non-specific template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
if (single_value.union_selection != SCCP__field__GlobalTitle__ansi::ALT_gti0010) TTCN_error("Accessing non-selected field gti0010 in a template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
return *single_value.field_gti0010;
}

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

void SCCP__field__GlobalTitle__ansi_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
TTCN_Logger::log_event_str("{ gti0001 := ");
single_value.field_gti0001->log();
TTCN_Logger::log_event_str(" }");
break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
TTCN_Logger::log_event_str("{ gti0010 := ");
single_value.field_gti0010->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SCCP__field__GlobalTitle__ansi_template::log_match(const SCCP__field__GlobalTitle__ansi& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gti0001");
single_value.field_gti0001->log_match(match_value.gti0001(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gti0001 := ");
single_value.field_gti0001->log_match(match_value.gti0001(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".gti0010");
single_value.field_gti0010->log_match(match_value.gti0010(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ gti0010 := ");
single_value.field_gti0010->log_match(match_value.gti0010(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SCCP__field__GlobalTitle__ansi_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
single_value.field_gti0001->set_implicit_omit(); break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
single_value.field_gti0010->set_implicit_omit(); break;
default: break;
}
}

void SCCP__field__GlobalTitle__ansi_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
single_value.field_gti0001->encode_text(text_buf);
break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
single_value.field_gti0010->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
}

void SCCP__field__GlobalTitle__ansi_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = SCCP__field__GlobalTitle__ansi::UNBOUND_VALUE;
SCCP__field__GlobalTitle__ansi::union_selection_type new_selection = (SCCP__field__GlobalTitle__ansi::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
single_value.field_gti0001 = new SCCP__field__GlobalTitle__TT__NP__ES_template;
single_value.field_gti0001->decode_text(text_buf);
break;
case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
single_value.field_gti0010 = new SCCP__field__GlobalTitle__TT_template;
single_value.field_gti0010->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SCCP__field__GlobalTitle__ansi_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @SCCP_Types.SCCP_field_GlobalTitle_ansi.");
}
}

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

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

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

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

SCCP__param__EndOfOptionalParams::SCCP__param__EndOfOptionalParams()
{
}

SCCP__param__EndOfOptionalParams::SCCP__param__EndOfOptionalParams(const INTEGER& par_paramName)
  :   field_paramName(par_paramName)
{
}

SCCP__param__EndOfOptionalParams::SCCP__param__EndOfOptionalParams(const SCCP__param__EndOfOptionalParams& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_EndOfOptionalParams.");
if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
else field_paramName.clean_up();
}

void SCCP__param__EndOfOptionalParams::clean_up()
{
field_paramName.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__EndOfOptionalParams::get_descriptor() const { return &SCCP__param__EndOfOptionalParams_descr_; }
SCCP__param__EndOfOptionalParams& SCCP__param__EndOfOptionalParams::operator=(const SCCP__param__EndOfOptionalParams& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_EndOfOptionalParams.");
  if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
  else field_paramName.clean_up();
}
return *this;
}

boolean SCCP__param__EndOfOptionalParams::operator==(const SCCP__param__EndOfOptionalParams& other_value) const
{
return field_paramName==other_value.field_paramName;
}

boolean SCCP__param__EndOfOptionalParams::is_bound() const
{
return (field_paramName.is_bound());
}
boolean SCCP__param__EndOfOptionalParams::is_value() const
{
return field_paramName.is_value();
}
void SCCP__param__EndOfOptionalParams::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramName := ");
field_paramName.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__EndOfOptionalParams::set_implicit_omit()
{
if (paramName().is_bound()) paramName().set_implicit_omit();
}

void SCCP__param__EndOfOptionalParams::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @SCCP_Types.SCCP_param_EndOfOptionalParams 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) paramName().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(), "paramName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_param_EndOfOptionalParams: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_param_EndOfOptionalParams");
  }
}

void SCCP__param__EndOfOptionalParams::encode_text(Text_Buf& text_buf) const
{
field_paramName.encode_text(text_buf);
}

void SCCP__param__EndOfOptionalParams::decode_text(Text_Buf& text_buf)
{
field_paramName.decode_text(text_buf);
}

void SCCP__param__EndOfOptionalParams::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 SCCP__param__EndOfOptionalParams::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 SCCP__param__EndOfOptionalParams::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, SCCP__field__ParameterName_descr_.raw->forceomit);
  decoded_field_length = field_paramName.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct SCCP__param__EndOfOptionalParams_template::single_value_struct {
INTEGER_template field_paramName;
};

void SCCP__param__EndOfOptionalParams_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_paramName = ANY_VALUE;
}
}
}

void SCCP__param__EndOfOptionalParams_template::copy_value(const SCCP__param__EndOfOptionalParams& other_value)
{
single_value = new single_value_struct;
if (other_value.paramName().is_bound()) {
  single_value->field_paramName = other_value.paramName();
} else {
  single_value->field_paramName.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__EndOfOptionalParams_template::copy_template(const SCCP__param__EndOfOptionalParams_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramName().get_selection()) {
single_value->field_paramName = other_value.paramName();
} else {
single_value->field_paramName.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 SCCP__param__EndOfOptionalParams_template[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 SCCP__param__EndOfOptionalParams_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__EndOfOptionalParams_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 @SCCP_Types.SCCP_param_EndOfOptionalParams.");
break;
}
set_selection(other_value);
}

SCCP__param__EndOfOptionalParams_template::SCCP__param__EndOfOptionalParams_template()
{
}

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

SCCP__param__EndOfOptionalParams_template::SCCP__param__EndOfOptionalParams_template(const SCCP__param__EndOfOptionalParams& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__EndOfOptionalParams_template::match(const SCCP__param__EndOfOptionalParams& 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.paramName().is_bound()) return FALSE;
if(!single_value->field_paramName.match(other_value.paramName(), 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 @SCCP_Types.SCCP_param_EndOfOptionalParams.");
}
return FALSE;
}

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

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

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

SCCP__param__EndOfOptionalParams SCCP__param__EndOfOptionalParams_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 @SCCP_Types.SCCP_param_EndOfOptionalParams.");
SCCP__param__EndOfOptionalParams ret_val;
if (single_value->field_paramName.is_bound()) {
ret_val.paramName() = single_value->field_paramName.valueof();
}
return ret_val;
}

void SCCP__param__EndOfOptionalParams_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 @SCCP_Types.SCCP_param_EndOfOptionalParams.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__EndOfOptionalParams_template[list_length];
}

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

INTEGER_template& SCCP__param__EndOfOptionalParams_template::paramName()
{
set_specific();
return single_value->field_paramName;
}

const INTEGER_template& SCCP__param__EndOfOptionalParams_template::paramName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramName of a non-specific template of type @SCCP_Types.SCCP_param_EndOfOptionalParams.");
return single_value->field_paramName;
}

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

void SCCP__param__EndOfOptionalParams_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramName := ");
single_value->field_paramName.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 SCCP__param__EndOfOptionalParams_template::log_match(const SCCP__param__EndOfOptionalParams& 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_paramName.match(match_value.paramName(), legacy)){
TTCN_Logger::log_logmatch_info(".paramName");
single_value->field_paramName.log_match(match_value.paramName(), 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("{ paramName := ");
single_value->field_paramName.log_match(match_value.paramName(), 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 SCCP__param__EndOfOptionalParams_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramName().is_bound()) paramName().set_implicit_omit();
}

void SCCP__param__EndOfOptionalParams_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramName.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 @SCCP_Types.SCCP_param_EndOfOptionalParams.");
}
}

void SCCP__param__EndOfOptionalParams_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_paramName.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 SCCP__param__EndOfOptionalParams_template[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 @SCCP_Types.SCCP_param_EndOfOptionalParams.");
}
}

void SCCP__param__EndOfOptionalParams_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: {
    SCCP__param__EndOfOptionalParams_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @SCCP_Types.SCCP_param_EndOfOptionalParams 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) paramName().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(), "paramName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_param_EndOfOptionalParams: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__param__EndOfOptionalParams_template* precondition = new SCCP__param__EndOfOptionalParams_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__param__EndOfOptionalParams_template* implied_template = new SCCP__param__EndOfOptionalParams_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__param__EndOfOptionalParams_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_param_EndOfOptionalParams");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__param__EndOfOptionalParams_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_paramName.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_EndOfOptionalParams");
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 : "@SCCP_Types.SCCP_param_EndOfOptionalParams");
}

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

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

SCCP__param__CPartyAddressEnc::SCCP__param__CPartyAddressEnc()
{
}

SCCP__param__CPartyAddressEnc::SCCP__param__CPartyAddressEnc(const INTEGER& par_paramLength,
    const OCTETSTRING& par_addr)
  :   field_paramLength(par_paramLength),
  field_addr(par_addr)
{
}

SCCP__param__CPartyAddressEnc::SCCP__param__CPartyAddressEnc(const SCCP__param__CPartyAddressEnc& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_CPartyAddressEnc.");
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.addr().is_bound()) field_addr = other_value.addr();
else field_addr.clean_up();
}

void SCCP__param__CPartyAddressEnc::clean_up()
{
field_paramLength.clean_up();
field_addr.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__CPartyAddressEnc::get_descriptor() const { return &SCCP__param__CPartyAddressEnc_descr_; }
SCCP__param__CPartyAddressEnc& SCCP__param__CPartyAddressEnc::operator=(const SCCP__param__CPartyAddressEnc& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_CPartyAddressEnc.");
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.addr().is_bound()) field_addr = other_value.addr();
  else field_addr.clean_up();
}
return *this;
}

boolean SCCP__param__CPartyAddressEnc::operator==(const SCCP__param__CPartyAddressEnc& other_value) const
{
return field_paramLength==other_value.field_paramLength
  && field_addr==other_value.field_addr;
}

boolean SCCP__param__CPartyAddressEnc::is_bound() const
{
return (field_paramLength.is_bound())
  || (field_addr.is_bound());
}
boolean SCCP__param__CPartyAddressEnc::is_value() const
{
return field_paramLength.is_value()
  && field_addr.is_value();
}
void SCCP__param__CPartyAddressEnc::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", addr := ");
field_addr.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__CPartyAddressEnc::set_implicit_omit()
{
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (addr().is_bound()) addr().set_implicit_omit();
}

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

void SCCP__param__CPartyAddressEnc::encode_text(Text_Buf& text_buf) const
{
field_paramLength.encode_text(text_buf);
field_addr.encode_text(text_buf);
}

void SCCP__param__CPartyAddressEnc::decode_text(Text_Buf& text_buf)
{
field_paramLength.decode_text(text_buf);
field_addr.decode_text(text_buf);
}

void SCCP__param__CPartyAddressEnc::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 SCCP__param__CPartyAddressEnc::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 SCCP__param__CPartyAddressEnc::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__CPartyAddressEnc_paramLength_descr_.raw->forceomit);
  decoded_field_length = field_paramLength.RAW_decode(SCCP__param__CPartyAddressEnc_paramLength_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_paramLength.convert_to_Integer(SCCP__param__CPartyAddressEnc_paramLength_descr_);
  field_paramLength = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__CPartyAddressEnc__addr_descr_.raw->forceomit);
  decoded_field_length = field_addr.RAW_decode(SCCP__CPartyAddressEnc__addr_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct SCCP__param__CPartyAddressEnc_template::single_value_struct {
INTEGER_template field_paramLength;
OCTETSTRING_template field_addr;
};

void SCCP__param__CPartyAddressEnc_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_paramLength = ANY_VALUE;
single_value->field_addr = ANY_VALUE;
}
}
}

void SCCP__param__CPartyAddressEnc_template::copy_value(const SCCP__param__CPartyAddressEnc& other_value)
{
single_value = new single_value_struct;
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.addr().is_bound()) {
  single_value->field_addr = other_value.addr();
} else {
  single_value->field_addr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__CPartyAddressEnc_template::copy_template(const SCCP__param__CPartyAddressEnc_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.addr().get_selection()) {
single_value->field_addr = other_value.addr();
} else {
single_value->field_addr.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 SCCP__param__CPartyAddressEnc_template[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 SCCP__param__CPartyAddressEnc_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__CPartyAddressEnc_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 @SCCP_Types.SCCP_param_CPartyAddressEnc.");
break;
}
set_selection(other_value);
}

SCCP__param__CPartyAddressEnc_template::SCCP__param__CPartyAddressEnc_template()
{
}

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

SCCP__param__CPartyAddressEnc_template::SCCP__param__CPartyAddressEnc_template(const SCCP__param__CPartyAddressEnc& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__CPartyAddressEnc_template::match(const SCCP__param__CPartyAddressEnc& 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.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.addr().is_bound()) return FALSE;
if(!single_value->field_addr.match(other_value.addr(), 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 @SCCP_Types.SCCP_param_CPartyAddressEnc.");
}
return FALSE;
}

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

boolean SCCP__param__CPartyAddressEnc_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramLength.is_value()
 && single_value->field_addr.is_value();
}

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

SCCP__param__CPartyAddressEnc SCCP__param__CPartyAddressEnc_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 @SCCP_Types.SCCP_param_CPartyAddressEnc.");
SCCP__param__CPartyAddressEnc ret_val;
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_addr.is_bound()) {
ret_val.addr() = single_value->field_addr.valueof();
}
return ret_val;
}

void SCCP__param__CPartyAddressEnc_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 @SCCP_Types.SCCP_param_CPartyAddressEnc.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__CPartyAddressEnc_template[list_length];
}

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

INTEGER_template& SCCP__param__CPartyAddressEnc_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__CPartyAddressEnc_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddressEnc.");
return single_value->field_paramLength;
}

OCTETSTRING_template& SCCP__param__CPartyAddressEnc_template::addr()
{
set_specific();
return single_value->field_addr;
}

const OCTETSTRING_template& SCCP__param__CPartyAddressEnc_template::addr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addr of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddressEnc.");
return single_value->field_addr;
}

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

void SCCP__param__CPartyAddressEnc_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", addr := ");
single_value->field_addr.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 SCCP__param__CPartyAddressEnc_template::log_match(const SCCP__param__CPartyAddressEnc& 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_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_addr.match(match_value.addr(), legacy)){
TTCN_Logger::log_logmatch_info(".addr");
single_value->field_addr.log_match(match_value.addr(), 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("{ paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", addr := ");
single_value->field_addr.log_match(match_value.addr(), 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 SCCP__param__CPartyAddressEnc_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (addr().is_bound()) addr().set_implicit_omit();
}

void SCCP__param__CPartyAddressEnc_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramLength.encode_text(text_buf);
single_value->field_addr.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 @SCCP_Types.SCCP_param_CPartyAddressEnc.");
}
}

void SCCP__param__CPartyAddressEnc_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_paramLength.decode_text(text_buf);
single_value->field_addr.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 SCCP__param__CPartyAddressEnc_template[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 @SCCP_Types.SCCP_param_CPartyAddressEnc.");
}
}

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

void SCCP__param__CPartyAddressEnc_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_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddressEnc");
single_value->field_addr.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddressEnc");
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 : "@SCCP_Types.SCCP_param_CPartyAddressEnc");
}

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

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

SCCP__param__CPartyAddress__itu::SCCP__param__CPartyAddress__itu()
{
}

SCCP__param__CPartyAddress__itu::SCCP__param__CPartyAddress__itu(const SCCP__field__AddressIndicator__itu& par_addressIndicator,
    const OPTIONAL< BITSTRING >& par_signPointCode,
    const OPTIONAL< INTEGER >& par_subsystemNumber,
    const OPTIONAL< SCCP__field__GlobalTitle__itu >& par_globalTitle)
  :   field_addressIndicator(par_addressIndicator),
  field_signPointCode(par_signPointCode),
  field_subsystemNumber(par_subsystemNumber),
  field_globalTitle(par_globalTitle)
{
}

SCCP__param__CPartyAddress__itu::SCCP__param__CPartyAddress__itu(const SCCP__param__CPartyAddress__itu& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_itu.");
if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
else field_addressIndicator.clean_up();
if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
else field_signPointCode.clean_up();
if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
else field_subsystemNumber.clean_up();
if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
else field_globalTitle.clean_up();
}

void SCCP__param__CPartyAddress__itu::clean_up()
{
field_addressIndicator.clean_up();
field_signPointCode.clean_up();
field_subsystemNumber.clean_up();
field_globalTitle.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__CPartyAddress__itu::get_descriptor() const { return &SCCP__param__CPartyAddress__itu_descr_; }
SCCP__param__CPartyAddress__itu& SCCP__param__CPartyAddress__itu::operator=(const SCCP__param__CPartyAddress__itu& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_itu.");
  if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
  else field_addressIndicator.clean_up();
  if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
  else field_signPointCode.clean_up();
  if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
  else field_subsystemNumber.clean_up();
  if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
  else field_globalTitle.clean_up();
}
return *this;
}

boolean SCCP__param__CPartyAddress__itu::operator==(const SCCP__param__CPartyAddress__itu& other_value) const
{
return field_addressIndicator==other_value.field_addressIndicator
  && field_signPointCode==other_value.field_signPointCode
  && field_subsystemNumber==other_value.field_subsystemNumber
  && field_globalTitle==other_value.field_globalTitle;
}

boolean SCCP__param__CPartyAddress__itu::is_bound() const
{
return (field_addressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_bound())
  || (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_bound())
  || (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_bound());
}
boolean SCCP__param__CPartyAddress__itu::is_value() const
{
return field_addressIndicator.is_value()
  && (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_value())
  && (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_value())
  && (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_value());
}
int SCCP__param__CPartyAddress__itu::size_of() const
{
  int ret_val = 1;
  if (field_signPointCode.ispresent()) ret_val++;
  if (field_subsystemNumber.ispresent()) ret_val++;
  if (field_globalTitle.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__param__CPartyAddress__itu::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ addressIndicator := ");
field_addressIndicator.log();
TTCN_Logger::log_event_str(", signPointCode := ");
field_signPointCode.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
field_subsystemNumber.log();
TTCN_Logger::log_event_str(", globalTitle := ");
field_globalTitle.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__CPartyAddress__itu::set_implicit_omit()
{
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

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

void SCCP__param__CPartyAddress__itu::encode_text(Text_Buf& text_buf) const
{
field_addressIndicator.encode_text(text_buf);
field_signPointCode.encode_text(text_buf);
field_subsystemNumber.encode_text(text_buf);
field_globalTitle.encode_text(text_buf);
}

void SCCP__param__CPartyAddress__itu::decode_text(Text_Buf& text_buf)
{
field_addressIndicator.decode_text(text_buf);
field_signPointCode.decode_text(text_buf);
field_subsystemNumber.decode_text(text_buf);
field_globalTitle.decode_text(text_buf);
}

void SCCP__param__CPartyAddress__itu::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 SCCP__param__CPartyAddress__itu::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 SCCP__param__CPartyAddress__itu::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__field__AddressIndicator__itu_descr_.raw->forceomit);
  decoded_field_length = field_addressIndicator.RAW_decode(SCCP__field__AddressIndicator__itu_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_addressIndicator.pointCodeIndic() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_signPointCode = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__CPartyAddress__itu_signPointCode_descr_.raw->forceomit);
  decoded_field_length = field_signPointCode().RAW_decode(SCCP__param__CPartyAddress__itu_signPointCode_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_signPointCode = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_signPointCode=OMIT_VALUE;
  if (limit > 0 && field_addressIndicator.ssnIndicator() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_subsystemNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__CPartyAddress__itu_subsystemNumber_descr_.raw->forceomit);
  decoded_field_length = field_subsystemNumber().RAW_decode(SCCP__param__CPartyAddress__itu_subsystemNumber_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_subsystemNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_subsystemNumber=OMIT_VALUE;
  if (field_addressIndicator.globalTitleIndic() ==  bs_1) selected_field = 0;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_2) selected_field = 1;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_3) selected_field = 2;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_4) selected_field = 3;
  else selected_field = -1;
  if (limit > 0 && (field_addressIndicator.globalTitleIndic() ==  bs_1 || field_addressIndicator.globalTitleIndic() ==  bs_2 || field_addressIndicator.globalTitleIndic() ==  bs_3 || field_addressIndicator.globalTitleIndic() ==  bs_4)&& selected_field!=-1){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_globalTitle = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__CPartyAddress__itu_globalTitle_descr_.raw->forceomit);
  decoded_field_length = field_globalTitle().RAW_decode(SCCP__param__CPartyAddress__itu_globalTitle_descr_, p_buf, limit, local_top_order, TRUE, selected_field, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_globalTitle = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_globalTitle=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__param__CPartyAddress__itu::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, SCCP__field__AddressIndicator__itu_descr_.raw);
  if (field_signPointCode.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__CPartyAddress__itu_signPointCode_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_subsystemNumber.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__CPartyAddress__itu_subsystemNumber_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_globalTitle.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__CPartyAddress__itu_globalTitle_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_addressIndicator.RAW_encode(SCCP__field__AddressIndicator__itu_descr_, *myleaf.body.node.nodes[0]);
  if (field_signPointCode.ispresent()) {
  encoded_length += field_signPointCode().RAW_encode(SCCP__param__CPartyAddress__itu_signPointCode_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_subsystemNumber.ispresent()) {
  encoded_length += field_subsystemNumber().RAW_encode(SCCP__param__CPartyAddress__itu_subsystemNumber_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_globalTitle.ispresent()) {
  encoded_length += field_globalTitle().RAW_encode(SCCP__param__CPartyAddress__itu_globalTitle_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_signPointCode.ispresent() && (field_addressIndicator.pointCodeIndic() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_subsystemNumber.ispresent() && (field_addressIndicator.ssnIndicator() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent() && (field_addressIndicator.globalTitleIndic() !=  bs_1 && field_addressIndicator.globalTitleIndic() !=  bs_2 && field_addressIndicator.globalTitleIndic() !=  bs_3 && field_addressIndicator.globalTitleIndic() !=  bs_4)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+2;
  int new_pos1[]={0,2};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+2;
  int new_pos2[]={0,2};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos3;
  pr_pos3.level=myleaf.curr_pos.level+2;
  int new_pos3[]={0,2};
  pr_pos3.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos3);
  temp_leaf = myleaf.get_node(pr_pos3);
  if(temp_leaf != NULL){
   bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos3.pos);
  }
  free_tree_pos(pr_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent()) {
  switch (field_globalTitle().get_selection()) {
  case SCCP__field__GlobalTitle__itu::ALT_gti0001:
  if (field_addressIndicator.globalTitleIndic() !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0010:
  if (field_addressIndicator.globalTitleIndic() !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0011:
  if (field_addressIndicator.globalTitleIndic() !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0100:
  if (field_addressIndicator.globalTitleIndic() !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  }
  return myleaf.length = encoded_length;
}

struct SCCP__param__CPartyAddress__itu_template::single_value_struct {
SCCP__field__AddressIndicator__itu_template field_addressIndicator;
BITSTRING_template field_signPointCode;
INTEGER_template field_subsystemNumber;
SCCP__field__GlobalTitle__itu_template field_globalTitle;
};

void SCCP__param__CPartyAddress__itu_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_addressIndicator = ANY_VALUE;
single_value->field_signPointCode = ANY_OR_OMIT;
single_value->field_subsystemNumber = ANY_OR_OMIT;
single_value->field_globalTitle = ANY_OR_OMIT;
}
}
}

void SCCP__param__CPartyAddress__itu_template::copy_value(const SCCP__param__CPartyAddress__itu& other_value)
{
single_value = new single_value_struct;
if (other_value.addressIndicator().is_bound()) {
  single_value->field_addressIndicator = other_value.addressIndicator();
} else {
  single_value->field_addressIndicator.clean_up();
}
if (other_value.signPointCode().is_bound()) {
  if (other_value.signPointCode().ispresent()) single_value->field_signPointCode = other_value.signPointCode()();
  else single_value->field_signPointCode = OMIT_VALUE;
} else {
  single_value->field_signPointCode.clean_up();
}
if (other_value.subsystemNumber().is_bound()) {
  if (other_value.subsystemNumber().ispresent()) single_value->field_subsystemNumber = other_value.subsystemNumber()();
  else single_value->field_subsystemNumber = OMIT_VALUE;
} else {
  single_value->field_subsystemNumber.clean_up();
}
if (other_value.globalTitle().is_bound()) {
  if (other_value.globalTitle().ispresent()) single_value->field_globalTitle = other_value.globalTitle()();
  else single_value->field_globalTitle = OMIT_VALUE;
} else {
  single_value->field_globalTitle.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__CPartyAddress__itu_template::copy_template(const SCCP__param__CPartyAddress__itu_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.addressIndicator().get_selection()) {
single_value->field_addressIndicator = other_value.addressIndicator();
} else {
single_value->field_addressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.signPointCode().get_selection()) {
single_value->field_signPointCode = other_value.signPointCode();
} else {
single_value->field_signPointCode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.subsystemNumber().get_selection()) {
single_value->field_subsystemNumber = other_value.subsystemNumber();
} else {
single_value->field_subsystemNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitle().get_selection()) {
single_value->field_globalTitle = other_value.globalTitle();
} else {
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__itu_template[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 SCCP__param__CPartyAddress__itu_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__CPartyAddress__itu_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 @SCCP_Types.SCCP_param_CPartyAddress_itu.");
break;
}
set_selection(other_value);
}

SCCP__param__CPartyAddress__itu_template::SCCP__param__CPartyAddress__itu_template()
{
}

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

SCCP__param__CPartyAddress__itu_template::SCCP__param__CPartyAddress__itu_template(const SCCP__param__CPartyAddress__itu& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__CPartyAddress__itu_template::match(const SCCP__param__CPartyAddress__itu& 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.addressIndicator().is_bound()) return FALSE;
if(!single_value->field_addressIndicator.match(other_value.addressIndicator(), legacy))return FALSE;
if(!other_value.signPointCode().is_bound()) return FALSE;
if((other_value.signPointCode().ispresent() ? !single_value->field_signPointCode.match((const BITSTRING&)other_value.signPointCode(), legacy) : !single_value->field_signPointCode.match_omit(legacy)))return FALSE;
if(!other_value.subsystemNumber().is_bound()) return FALSE;
if((other_value.subsystemNumber().ispresent() ? !single_value->field_subsystemNumber.match((const INTEGER&)other_value.subsystemNumber(), legacy) : !single_value->field_subsystemNumber.match_omit(legacy)))return FALSE;
if(!other_value.globalTitle().is_bound()) return FALSE;
if((other_value.globalTitle().ispresent() ? !single_value->field_globalTitle.match((const SCCP__field__GlobalTitle__itu&)other_value.globalTitle(), legacy) : !single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_itu.");
}
return FALSE;
}

boolean SCCP__param__CPartyAddress__itu_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_addressIndicator.is_bound()
 || (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_bound())
 || (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_bound())
 || (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_bound());
}

boolean SCCP__param__CPartyAddress__itu_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_addressIndicator.is_value()
 && (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_value())
 && (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_value())
 && (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_value());
}

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

SCCP__param__CPartyAddress__itu SCCP__param__CPartyAddress__itu_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 @SCCP_Types.SCCP_param_CPartyAddress_itu.");
SCCP__param__CPartyAddress__itu ret_val;
if (single_value->field_addressIndicator.is_bound()) {
ret_val.addressIndicator() = single_value->field_addressIndicator.valueof();
}
if (single_value->field_signPointCode.is_omit()) ret_val.signPointCode() = OMIT_VALUE;
else if (single_value->field_signPointCode.is_bound()) {
ret_val.signPointCode() = single_value->field_signPointCode.valueof();
}
if (single_value->field_subsystemNumber.is_omit()) ret_val.subsystemNumber() = OMIT_VALUE;
else if (single_value->field_subsystemNumber.is_bound()) {
ret_val.subsystemNumber() = single_value->field_subsystemNumber.valueof();
}
if (single_value->field_globalTitle.is_omit()) ret_val.globalTitle() = OMIT_VALUE;
else if (single_value->field_globalTitle.is_bound()) {
ret_val.globalTitle() = single_value->field_globalTitle.valueof();
}
return ret_val;
}

void SCCP__param__CPartyAddress__itu_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 @SCCP_Types.SCCP_param_CPartyAddress_itu.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__CPartyAddress__itu_template[list_length];
}

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

SCCP__field__AddressIndicator__itu_template& SCCP__param__CPartyAddress__itu_template::addressIndicator()
{
set_specific();
return single_value->field_addressIndicator;
}

const SCCP__field__AddressIndicator__itu_template& SCCP__param__CPartyAddress__itu_template::addressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addressIndicator of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_itu.");
return single_value->field_addressIndicator;
}

BITSTRING_template& SCCP__param__CPartyAddress__itu_template::signPointCode()
{
set_specific();
return single_value->field_signPointCode;
}

const BITSTRING_template& SCCP__param__CPartyAddress__itu_template::signPointCode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field signPointCode of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_itu.");
return single_value->field_signPointCode;
}

INTEGER_template& SCCP__param__CPartyAddress__itu_template::subsystemNumber()
{
set_specific();
return single_value->field_subsystemNumber;
}

const INTEGER_template& SCCP__param__CPartyAddress__itu_template::subsystemNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field subsystemNumber of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_itu.");
return single_value->field_subsystemNumber;
}

SCCP__field__GlobalTitle__itu_template& SCCP__param__CPartyAddress__itu_template::globalTitle()
{
set_specific();
return single_value->field_globalTitle;
}

const SCCP__field__GlobalTitle__itu_template& SCCP__param__CPartyAddress__itu_template::globalTitle() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitle of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_itu.");
return single_value->field_globalTitle;
}

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

void SCCP__param__CPartyAddress__itu_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ addressIndicator := ");
single_value->field_addressIndicator.log();
TTCN_Logger::log_event_str(", signPointCode := ");
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(", globalTitle := ");
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__itu_template::log_match(const SCCP__param__CPartyAddress__itu& 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_addressIndicator.match(match_value.addressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".addressIndicator");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.signPointCode().ispresent()){
if(!single_value->field_signPointCode.match(match_value.signPointCode(), legacy)){
TTCN_Logger::log_logmatch_info(".signPointCode");
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_signPointCode.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".signPointCode := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.subsystemNumber().ispresent()){
if(!single_value->field_subsystemNumber.match(match_value.subsystemNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".subsystemNumber");
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_subsystemNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".subsystemNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.globalTitle().ispresent()){
if(!single_value->field_globalTitle.match(match_value.globalTitle(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitle");
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_globalTitle.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".globalTitle := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_globalTitle.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("{ addressIndicator := ");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::log_event_str(", signPointCode := ");
if (match_value.signPointCode().ispresent()) {
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_signPointCode.log();
if (single_value->field_signPointCode.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", subsystemNumber := ");
if (match_value.subsystemNumber().ispresent()) {
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_subsystemNumber.log();
if (single_value->field_subsystemNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", globalTitle := ");
if (match_value.globalTitle().ispresent()) {
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_globalTitle.log();
if (single_value->field_globalTitle.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 SCCP__param__CPartyAddress__itu_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

void SCCP__param__CPartyAddress__itu_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_addressIndicator.encode_text(text_buf);
single_value->field_signPointCode.encode_text(text_buf);
single_value->field_subsystemNumber.encode_text(text_buf);
single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_itu.");
}
}

void SCCP__param__CPartyAddress__itu_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_addressIndicator.decode_text(text_buf);
single_value->field_signPointCode.decode_text(text_buf);
single_value->field_subsystemNumber.decode_text(text_buf);
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__itu_template[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 @SCCP_Types.SCCP_param_CPartyAddress_itu.");
}
}

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

void SCCP__param__CPartyAddress__itu_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_addressIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_itu");
single_value->field_signPointCode.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_itu");
single_value->field_subsystemNumber.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_itu");
single_value->field_globalTitle.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_itu");
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 : "@SCCP_Types.SCCP_param_CPartyAddress_itu");
}

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

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

SCCP__param__CPartyAddress__ansi::SCCP__param__CPartyAddress__ansi()
{
}

SCCP__param__CPartyAddress__ansi::SCCP__param__CPartyAddress__ansi(const SCCP__field__AddressIndicator__ansi& par_addressIndicator,
    const OPTIONAL< INTEGER >& par_subsystemNumber,
    const OPTIONAL< BITSTRING >& par_signPointCode,
    const OPTIONAL< SCCP__field__GlobalTitle__ansi >& par_globalTitle)
  :   field_addressIndicator(par_addressIndicator),
  field_subsystemNumber(par_subsystemNumber),
  field_signPointCode(par_signPointCode),
  field_globalTitle(par_globalTitle)
{
}

SCCP__param__CPartyAddress__ansi::SCCP__param__CPartyAddress__ansi(const SCCP__param__CPartyAddress__ansi& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
else field_addressIndicator.clean_up();
if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
else field_subsystemNumber.clean_up();
if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
else field_signPointCode.clean_up();
if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
else field_globalTitle.clean_up();
}

void SCCP__param__CPartyAddress__ansi::clean_up()
{
field_addressIndicator.clean_up();
field_subsystemNumber.clean_up();
field_signPointCode.clean_up();
field_globalTitle.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__CPartyAddress__ansi::get_descriptor() const { return &SCCP__param__CPartyAddress__ansi_descr_; }
SCCP__param__CPartyAddress__ansi& SCCP__param__CPartyAddress__ansi::operator=(const SCCP__param__CPartyAddress__ansi& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
  if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
  else field_addressIndicator.clean_up();
  if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
  else field_subsystemNumber.clean_up();
  if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
  else field_signPointCode.clean_up();
  if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
  else field_globalTitle.clean_up();
}
return *this;
}

boolean SCCP__param__CPartyAddress__ansi::operator==(const SCCP__param__CPartyAddress__ansi& other_value) const
{
return field_addressIndicator==other_value.field_addressIndicator
  && field_subsystemNumber==other_value.field_subsystemNumber
  && field_signPointCode==other_value.field_signPointCode
  && field_globalTitle==other_value.field_globalTitle;
}

boolean SCCP__param__CPartyAddress__ansi::is_bound() const
{
return (field_addressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_bound())
  || (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_bound())
  || (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_bound());
}
boolean SCCP__param__CPartyAddress__ansi::is_value() const
{
return field_addressIndicator.is_value()
  && (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_value())
  && (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_value())
  && (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_value());
}
int SCCP__param__CPartyAddress__ansi::size_of() const
{
  int ret_val = 1;
  if (field_subsystemNumber.ispresent()) ret_val++;
  if (field_signPointCode.ispresent()) ret_val++;
  if (field_globalTitle.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__param__CPartyAddress__ansi::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ addressIndicator := ");
field_addressIndicator.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
field_subsystemNumber.log();
TTCN_Logger::log_event_str(", signPointCode := ");
field_signPointCode.log();
TTCN_Logger::log_event_str(", globalTitle := ");
field_globalTitle.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__CPartyAddress__ansi::set_implicit_omit()
{
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

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

void SCCP__param__CPartyAddress__ansi::encode_text(Text_Buf& text_buf) const
{
field_addressIndicator.encode_text(text_buf);
field_subsystemNumber.encode_text(text_buf);
field_signPointCode.encode_text(text_buf);
field_globalTitle.encode_text(text_buf);
}

void SCCP__param__CPartyAddress__ansi::decode_text(Text_Buf& text_buf)
{
field_addressIndicator.decode_text(text_buf);
field_subsystemNumber.decode_text(text_buf);
field_signPointCode.decode_text(text_buf);
field_globalTitle.decode_text(text_buf);
}

void SCCP__param__CPartyAddress__ansi::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 SCCP__param__CPartyAddress__ansi::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 SCCP__param__CPartyAddress__ansi::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__field__AddressIndicator__ansi_descr_.raw->forceomit);
  decoded_field_length = field_addressIndicator.RAW_decode(SCCP__field__AddressIndicator__ansi_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_addressIndicator.ssnIndicator() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_subsystemNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__CPartyAddress__ansi_subsystemNumber_descr_.raw->forceomit);
  decoded_field_length = field_subsystemNumber().RAW_decode(SCCP__param__CPartyAddress__ansi_subsystemNumber_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_subsystemNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_subsystemNumber=OMIT_VALUE;
  if (limit > 0 && field_addressIndicator.pointCodeIndic() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_signPointCode = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__CPartyAddress__ansi_signPointCode_descr_.raw->forceomit);
  decoded_field_length = field_signPointCode().RAW_decode(SCCP__param__CPartyAddress__ansi_signPointCode_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_signPointCode = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_signPointCode=OMIT_VALUE;
  if (field_addressIndicator.globalTitleIndic() ==  bs_1) selected_field = 0;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_2) selected_field = 1;
  else selected_field = -1;
  if (limit > 0 && (field_addressIndicator.globalTitleIndic() ==  bs_1 || field_addressIndicator.globalTitleIndic() ==  bs_2)&& selected_field!=-1){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_globalTitle = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__CPartyAddress__ansi_globalTitle_descr_.raw->forceomit);
  decoded_field_length = field_globalTitle().RAW_decode(SCCP__param__CPartyAddress__ansi_globalTitle_descr_, p_buf, limit, local_top_order, TRUE, selected_field, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_globalTitle = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_globalTitle=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__param__CPartyAddress__ansi::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, SCCP__field__AddressIndicator__ansi_descr_.raw);
  if (field_subsystemNumber.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__CPartyAddress__ansi_subsystemNumber_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_signPointCode.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__CPartyAddress__ansi_signPointCode_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_globalTitle.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__CPartyAddress__ansi_globalTitle_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_addressIndicator.RAW_encode(SCCP__field__AddressIndicator__ansi_descr_, *myleaf.body.node.nodes[0]);
  if (field_subsystemNumber.ispresent()) {
  encoded_length += field_subsystemNumber().RAW_encode(SCCP__param__CPartyAddress__ansi_subsystemNumber_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_signPointCode.ispresent()) {
  encoded_length += field_signPointCode().RAW_encode(SCCP__param__CPartyAddress__ansi_signPointCode_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_globalTitle.ispresent()) {
  encoded_length += field_globalTitle().RAW_encode(SCCP__param__CPartyAddress__ansi_globalTitle_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_subsystemNumber.ispresent() && (field_addressIndicator.ssnIndicator() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_signPointCode.ispresent() && (field_addressIndicator.pointCodeIndic() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent() && (field_addressIndicator.globalTitleIndic() !=  bs_1 && field_addressIndicator.globalTitleIndic() !=  bs_2)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+2;
  int new_pos1[]={0,2};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent()) {
  switch (field_globalTitle().get_selection()) {
  case SCCP__field__GlobalTitle__ansi::ALT_gti0001:
  if (field_addressIndicator.globalTitleIndic() !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__ansi::ALT_gti0010:
  if (field_addressIndicator.globalTitleIndic() !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  }
  return myleaf.length = encoded_length;
}

struct SCCP__param__CPartyAddress__ansi_template::single_value_struct {
SCCP__field__AddressIndicator__ansi_template field_addressIndicator;
INTEGER_template field_subsystemNumber;
BITSTRING_template field_signPointCode;
SCCP__field__GlobalTitle__ansi_template field_globalTitle;
};

void SCCP__param__CPartyAddress__ansi_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_addressIndicator = ANY_VALUE;
single_value->field_subsystemNumber = ANY_OR_OMIT;
single_value->field_signPointCode = ANY_OR_OMIT;
single_value->field_globalTitle = ANY_OR_OMIT;
}
}
}

void SCCP__param__CPartyAddress__ansi_template::copy_value(const SCCP__param__CPartyAddress__ansi& other_value)
{
single_value = new single_value_struct;
if (other_value.addressIndicator().is_bound()) {
  single_value->field_addressIndicator = other_value.addressIndicator();
} else {
  single_value->field_addressIndicator.clean_up();
}
if (other_value.subsystemNumber().is_bound()) {
  if (other_value.subsystemNumber().ispresent()) single_value->field_subsystemNumber = other_value.subsystemNumber()();
  else single_value->field_subsystemNumber = OMIT_VALUE;
} else {
  single_value->field_subsystemNumber.clean_up();
}
if (other_value.signPointCode().is_bound()) {
  if (other_value.signPointCode().ispresent()) single_value->field_signPointCode = other_value.signPointCode()();
  else single_value->field_signPointCode = OMIT_VALUE;
} else {
  single_value->field_signPointCode.clean_up();
}
if (other_value.globalTitle().is_bound()) {
  if (other_value.globalTitle().ispresent()) single_value->field_globalTitle = other_value.globalTitle()();
  else single_value->field_globalTitle = OMIT_VALUE;
} else {
  single_value->field_globalTitle.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__CPartyAddress__ansi_template::copy_template(const SCCP__param__CPartyAddress__ansi_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.addressIndicator().get_selection()) {
single_value->field_addressIndicator = other_value.addressIndicator();
} else {
single_value->field_addressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.subsystemNumber().get_selection()) {
single_value->field_subsystemNumber = other_value.subsystemNumber();
} else {
single_value->field_subsystemNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.signPointCode().get_selection()) {
single_value->field_signPointCode = other_value.signPointCode();
} else {
single_value->field_signPointCode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitle().get_selection()) {
single_value->field_globalTitle = other_value.globalTitle();
} else {
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ansi_template[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 SCCP__param__CPartyAddress__ansi_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__CPartyAddress__ansi_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 @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
break;
}
set_selection(other_value);
}

SCCP__param__CPartyAddress__ansi_template::SCCP__param__CPartyAddress__ansi_template()
{
}

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

SCCP__param__CPartyAddress__ansi_template::SCCP__param__CPartyAddress__ansi_template(const SCCP__param__CPartyAddress__ansi& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__CPartyAddress__ansi_template::match(const SCCP__param__CPartyAddress__ansi& 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.addressIndicator().is_bound()) return FALSE;
if(!single_value->field_addressIndicator.match(other_value.addressIndicator(), legacy))return FALSE;
if(!other_value.subsystemNumber().is_bound()) return FALSE;
if((other_value.subsystemNumber().ispresent() ? !single_value->field_subsystemNumber.match((const INTEGER&)other_value.subsystemNumber(), legacy) : !single_value->field_subsystemNumber.match_omit(legacy)))return FALSE;
if(!other_value.signPointCode().is_bound()) return FALSE;
if((other_value.signPointCode().ispresent() ? !single_value->field_signPointCode.match((const BITSTRING&)other_value.signPointCode(), legacy) : !single_value->field_signPointCode.match_omit(legacy)))return FALSE;
if(!other_value.globalTitle().is_bound()) return FALSE;
if((other_value.globalTitle().ispresent() ? !single_value->field_globalTitle.match((const SCCP__field__GlobalTitle__ansi&)other_value.globalTitle(), legacy) : !single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
}
return FALSE;
}

boolean SCCP__param__CPartyAddress__ansi_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_addressIndicator.is_bound()
 || (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_bound())
 || (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_bound())
 || (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_bound());
}

boolean SCCP__param__CPartyAddress__ansi_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_addressIndicator.is_value()
 && (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_value())
 && (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_value())
 && (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_value());
}

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

SCCP__param__CPartyAddress__ansi SCCP__param__CPartyAddress__ansi_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 @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
SCCP__param__CPartyAddress__ansi ret_val;
if (single_value->field_addressIndicator.is_bound()) {
ret_val.addressIndicator() = single_value->field_addressIndicator.valueof();
}
if (single_value->field_subsystemNumber.is_omit()) ret_val.subsystemNumber() = OMIT_VALUE;
else if (single_value->field_subsystemNumber.is_bound()) {
ret_val.subsystemNumber() = single_value->field_subsystemNumber.valueof();
}
if (single_value->field_signPointCode.is_omit()) ret_val.signPointCode() = OMIT_VALUE;
else if (single_value->field_signPointCode.is_bound()) {
ret_val.signPointCode() = single_value->field_signPointCode.valueof();
}
if (single_value->field_globalTitle.is_omit()) ret_val.globalTitle() = OMIT_VALUE;
else if (single_value->field_globalTitle.is_bound()) {
ret_val.globalTitle() = single_value->field_globalTitle.valueof();
}
return ret_val;
}

void SCCP__param__CPartyAddress__ansi_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 @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__CPartyAddress__ansi_template[list_length];
}

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

SCCP__field__AddressIndicator__ansi_template& SCCP__param__CPartyAddress__ansi_template::addressIndicator()
{
set_specific();
return single_value->field_addressIndicator;
}

const SCCP__field__AddressIndicator__ansi_template& SCCP__param__CPartyAddress__ansi_template::addressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addressIndicator of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
return single_value->field_addressIndicator;
}

INTEGER_template& SCCP__param__CPartyAddress__ansi_template::subsystemNumber()
{
set_specific();
return single_value->field_subsystemNumber;
}

const INTEGER_template& SCCP__param__CPartyAddress__ansi_template::subsystemNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field subsystemNumber of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
return single_value->field_subsystemNumber;
}

BITSTRING_template& SCCP__param__CPartyAddress__ansi_template::signPointCode()
{
set_specific();
return single_value->field_signPointCode;
}

const BITSTRING_template& SCCP__param__CPartyAddress__ansi_template::signPointCode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field signPointCode of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
return single_value->field_signPointCode;
}

SCCP__field__GlobalTitle__ansi_template& SCCP__param__CPartyAddress__ansi_template::globalTitle()
{
set_specific();
return single_value->field_globalTitle;
}

const SCCP__field__GlobalTitle__ansi_template& SCCP__param__CPartyAddress__ansi_template::globalTitle() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitle of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
return single_value->field_globalTitle;
}

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

void SCCP__param__CPartyAddress__ansi_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ addressIndicator := ");
single_value->field_addressIndicator.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(", signPointCode := ");
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(", globalTitle := ");
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ansi_template::log_match(const SCCP__param__CPartyAddress__ansi& 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_addressIndicator.match(match_value.addressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".addressIndicator");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.subsystemNumber().ispresent()){
if(!single_value->field_subsystemNumber.match(match_value.subsystemNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".subsystemNumber");
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_subsystemNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".subsystemNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.signPointCode().ispresent()){
if(!single_value->field_signPointCode.match(match_value.signPointCode(), legacy)){
TTCN_Logger::log_logmatch_info(".signPointCode");
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_signPointCode.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".signPointCode := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.globalTitle().ispresent()){
if(!single_value->field_globalTitle.match(match_value.globalTitle(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitle");
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_globalTitle.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".globalTitle := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_globalTitle.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("{ addressIndicator := ");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::log_event_str(", subsystemNumber := ");
if (match_value.subsystemNumber().ispresent()) {
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_subsystemNumber.log();
if (single_value->field_subsystemNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", signPointCode := ");
if (match_value.signPointCode().ispresent()) {
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_signPointCode.log();
if (single_value->field_signPointCode.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", globalTitle := ");
if (match_value.globalTitle().ispresent()) {
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_globalTitle.log();
if (single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ansi_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

void SCCP__param__CPartyAddress__ansi_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_addressIndicator.encode_text(text_buf);
single_value->field_subsystemNumber.encode_text(text_buf);
single_value->field_signPointCode.encode_text(text_buf);
single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
}
}

void SCCP__param__CPartyAddress__ansi_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_addressIndicator.decode_text(text_buf);
single_value->field_subsystemNumber.decode_text(text_buf);
single_value->field_signPointCode.decode_text(text_buf);
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ansi_template[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 @SCCP_Types.SCCP_param_CPartyAddress_ansi.");
}
}

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

void SCCP__param__CPartyAddress__ansi_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_addressIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ansi");
single_value->field_subsystemNumber.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ansi");
single_value->field_signPointCode.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ansi");
single_value->field_globalTitle.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ansi");
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 : "@SCCP_Types.SCCP_param_CPartyAddress_ansi");
}

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

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

SCCP__param__CPartyAddress__ttc::SCCP__param__CPartyAddress__ttc()
{
}

SCCP__param__CPartyAddress__ttc::SCCP__param__CPartyAddress__ttc(const SCCP__field__AddressIndicator__itu& par_addressIndicator,
    const OPTIONAL< BITSTRING >& par_signPointCode,
    const OPTIONAL< INTEGER >& par_subsystemNumber,
    const OPTIONAL< SCCP__field__GlobalTitle__itu >& par_globalTitle)
  :   field_addressIndicator(par_addressIndicator),
  field_signPointCode(par_signPointCode),
  field_subsystemNumber(par_subsystemNumber),
  field_globalTitle(par_globalTitle)
{
}

SCCP__param__CPartyAddress__ttc::SCCP__param__CPartyAddress__ttc(const SCCP__param__CPartyAddress__ttc& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
else field_addressIndicator.clean_up();
if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
else field_signPointCode.clean_up();
if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
else field_subsystemNumber.clean_up();
if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
else field_globalTitle.clean_up();
}

void SCCP__param__CPartyAddress__ttc::clean_up()
{
field_addressIndicator.clean_up();
field_signPointCode.clean_up();
field_subsystemNumber.clean_up();
field_globalTitle.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__CPartyAddress__ttc::get_descriptor() const { return &SCCP__param__CPartyAddress__ttc_descr_; }
SCCP__param__CPartyAddress__ttc& SCCP__param__CPartyAddress__ttc::operator=(const SCCP__param__CPartyAddress__ttc& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
  if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
  else field_addressIndicator.clean_up();
  if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
  else field_signPointCode.clean_up();
  if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
  else field_subsystemNumber.clean_up();
  if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
  else field_globalTitle.clean_up();
}
return *this;
}

boolean SCCP__param__CPartyAddress__ttc::operator==(const SCCP__param__CPartyAddress__ttc& other_value) const
{
return field_addressIndicator==other_value.field_addressIndicator
  && field_signPointCode==other_value.field_signPointCode
  && field_subsystemNumber==other_value.field_subsystemNumber
  && field_globalTitle==other_value.field_globalTitle;
}

boolean SCCP__param__CPartyAddress__ttc::is_bound() const
{
return (field_addressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_bound())
  || (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_bound())
  || (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_bound());
}
boolean SCCP__param__CPartyAddress__ttc::is_value() const
{
return field_addressIndicator.is_value()
  && (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_value())
  && (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_value())
  && (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_value());
}
int SCCP__param__CPartyAddress__ttc::size_of() const
{
  int ret_val = 1;
  if (field_signPointCode.ispresent()) ret_val++;
  if (field_subsystemNumber.ispresent()) ret_val++;
  if (field_globalTitle.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__param__CPartyAddress__ttc::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ addressIndicator := ");
field_addressIndicator.log();
TTCN_Logger::log_event_str(", signPointCode := ");
field_signPointCode.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
field_subsystemNumber.log();
TTCN_Logger::log_event_str(", globalTitle := ");
field_globalTitle.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__CPartyAddress__ttc::set_implicit_omit()
{
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

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

void SCCP__param__CPartyAddress__ttc::encode_text(Text_Buf& text_buf) const
{
field_addressIndicator.encode_text(text_buf);
field_signPointCode.encode_text(text_buf);
field_subsystemNumber.encode_text(text_buf);
field_globalTitle.encode_text(text_buf);
}

void SCCP__param__CPartyAddress__ttc::decode_text(Text_Buf& text_buf)
{
field_addressIndicator.decode_text(text_buf);
field_signPointCode.decode_text(text_buf);
field_subsystemNumber.decode_text(text_buf);
field_globalTitle.decode_text(text_buf);
}

void SCCP__param__CPartyAddress__ttc::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 SCCP__param__CPartyAddress__ttc::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 SCCP__param__CPartyAddress__ttc::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__field__AddressIndicator__itu_descr_.raw->forceomit);
  decoded_field_length = field_addressIndicator.RAW_decode(SCCP__field__AddressIndicator__itu_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_addressIndicator.pointCodeIndic() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_signPointCode = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__CPartyAddress__ttc_signPointCode_descr_.raw->forceomit);
  decoded_field_length = field_signPointCode().RAW_decode(SCCP__param__CPartyAddress__ttc_signPointCode_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_signPointCode = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_signPointCode=OMIT_VALUE;
  if (limit > 0 && field_addressIndicator.ssnIndicator() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_subsystemNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__CPartyAddress__ttc_subsystemNumber_descr_.raw->forceomit);
  decoded_field_length = field_subsystemNumber().RAW_decode(SCCP__param__CPartyAddress__ttc_subsystemNumber_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_subsystemNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_subsystemNumber=OMIT_VALUE;
  if (field_addressIndicator.globalTitleIndic() ==  bs_1) selected_field = 0;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_2) selected_field = 1;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_3) selected_field = 2;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_4) selected_field = 3;
  else selected_field = -1;
  if (limit > 0 && (field_addressIndicator.globalTitleIndic() ==  bs_1 || field_addressIndicator.globalTitleIndic() ==  bs_2 || field_addressIndicator.globalTitleIndic() ==  bs_3 || field_addressIndicator.globalTitleIndic() ==  bs_4)&& selected_field!=-1){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_globalTitle = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__CPartyAddress__ttc_globalTitle_descr_.raw->forceomit);
  decoded_field_length = field_globalTitle().RAW_decode(SCCP__param__CPartyAddress__ttc_globalTitle_descr_, p_buf, limit, local_top_order, TRUE, selected_field, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_globalTitle = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_globalTitle=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__param__CPartyAddress__ttc::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, SCCP__field__AddressIndicator__itu_descr_.raw);
  if (field_signPointCode.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__CPartyAddress__ttc_signPointCode_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_subsystemNumber.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__CPartyAddress__ttc_subsystemNumber_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_globalTitle.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__CPartyAddress__ttc_globalTitle_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_addressIndicator.RAW_encode(SCCP__field__AddressIndicator__itu_descr_, *myleaf.body.node.nodes[0]);
  if (field_signPointCode.ispresent()) {
  encoded_length += field_signPointCode().RAW_encode(SCCP__param__CPartyAddress__ttc_signPointCode_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_subsystemNumber.ispresent()) {
  encoded_length += field_subsystemNumber().RAW_encode(SCCP__param__CPartyAddress__ttc_subsystemNumber_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_globalTitle.ispresent()) {
  encoded_length += field_globalTitle().RAW_encode(SCCP__param__CPartyAddress__ttc_globalTitle_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_signPointCode.ispresent() && (field_addressIndicator.pointCodeIndic() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_subsystemNumber.ispresent() && (field_addressIndicator.ssnIndicator() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent() && (field_addressIndicator.globalTitleIndic() !=  bs_1 && field_addressIndicator.globalTitleIndic() !=  bs_2 && field_addressIndicator.globalTitleIndic() !=  bs_3 && field_addressIndicator.globalTitleIndic() !=  bs_4)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+2;
  int new_pos1[]={0,2};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+2;
  int new_pos2[]={0,2};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos3;
  pr_pos3.level=myleaf.curr_pos.level+2;
  int new_pos3[]={0,2};
  pr_pos3.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos3);
  temp_leaf = myleaf.get_node(pr_pos3);
  if(temp_leaf != NULL){
   bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos3.pos);
  }
  free_tree_pos(pr_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent()) {
  switch (field_globalTitle().get_selection()) {
  case SCCP__field__GlobalTitle__itu::ALT_gti0001:
  if (field_addressIndicator.globalTitleIndic() !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0010:
  if (field_addressIndicator.globalTitleIndic() !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0011:
  if (field_addressIndicator.globalTitleIndic() !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0100:
  if (field_addressIndicator.globalTitleIndic() !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  }
  return myleaf.length = encoded_length;
}

struct SCCP__param__CPartyAddress__ttc_template::single_value_struct {
SCCP__field__AddressIndicator__itu_template field_addressIndicator;
BITSTRING_template field_signPointCode;
INTEGER_template field_subsystemNumber;
SCCP__field__GlobalTitle__itu_template field_globalTitle;
};

void SCCP__param__CPartyAddress__ttc_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_addressIndicator = ANY_VALUE;
single_value->field_signPointCode = ANY_OR_OMIT;
single_value->field_subsystemNumber = ANY_OR_OMIT;
single_value->field_globalTitle = ANY_OR_OMIT;
}
}
}

void SCCP__param__CPartyAddress__ttc_template::copy_value(const SCCP__param__CPartyAddress__ttc& other_value)
{
single_value = new single_value_struct;
if (other_value.addressIndicator().is_bound()) {
  single_value->field_addressIndicator = other_value.addressIndicator();
} else {
  single_value->field_addressIndicator.clean_up();
}
if (other_value.signPointCode().is_bound()) {
  if (other_value.signPointCode().ispresent()) single_value->field_signPointCode = other_value.signPointCode()();
  else single_value->field_signPointCode = OMIT_VALUE;
} else {
  single_value->field_signPointCode.clean_up();
}
if (other_value.subsystemNumber().is_bound()) {
  if (other_value.subsystemNumber().ispresent()) single_value->field_subsystemNumber = other_value.subsystemNumber()();
  else single_value->field_subsystemNumber = OMIT_VALUE;
} else {
  single_value->field_subsystemNumber.clean_up();
}
if (other_value.globalTitle().is_bound()) {
  if (other_value.globalTitle().ispresent()) single_value->field_globalTitle = other_value.globalTitle()();
  else single_value->field_globalTitle = OMIT_VALUE;
} else {
  single_value->field_globalTitle.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__CPartyAddress__ttc_template::copy_template(const SCCP__param__CPartyAddress__ttc_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.addressIndicator().get_selection()) {
single_value->field_addressIndicator = other_value.addressIndicator();
} else {
single_value->field_addressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.signPointCode().get_selection()) {
single_value->field_signPointCode = other_value.signPointCode();
} else {
single_value->field_signPointCode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.subsystemNumber().get_selection()) {
single_value->field_subsystemNumber = other_value.subsystemNumber();
} else {
single_value->field_subsystemNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitle().get_selection()) {
single_value->field_globalTitle = other_value.globalTitle();
} else {
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ttc_template[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 SCCP__param__CPartyAddress__ttc_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__CPartyAddress__ttc_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 @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
break;
}
set_selection(other_value);
}

SCCP__param__CPartyAddress__ttc_template::SCCP__param__CPartyAddress__ttc_template()
{
}

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

SCCP__param__CPartyAddress__ttc_template::SCCP__param__CPartyAddress__ttc_template(const SCCP__param__CPartyAddress__ttc& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__CPartyAddress__ttc_template::match(const SCCP__param__CPartyAddress__ttc& 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.addressIndicator().is_bound()) return FALSE;
if(!single_value->field_addressIndicator.match(other_value.addressIndicator(), legacy))return FALSE;
if(!other_value.signPointCode().is_bound()) return FALSE;
if((other_value.signPointCode().ispresent() ? !single_value->field_signPointCode.match((const BITSTRING&)other_value.signPointCode(), legacy) : !single_value->field_signPointCode.match_omit(legacy)))return FALSE;
if(!other_value.subsystemNumber().is_bound()) return FALSE;
if((other_value.subsystemNumber().ispresent() ? !single_value->field_subsystemNumber.match((const INTEGER&)other_value.subsystemNumber(), legacy) : !single_value->field_subsystemNumber.match_omit(legacy)))return FALSE;
if(!other_value.globalTitle().is_bound()) return FALSE;
if((other_value.globalTitle().ispresent() ? !single_value->field_globalTitle.match((const SCCP__field__GlobalTitle__itu&)other_value.globalTitle(), legacy) : !single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
}
return FALSE;
}

boolean SCCP__param__CPartyAddress__ttc_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_addressIndicator.is_bound()
 || (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_bound())
 || (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_bound())
 || (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_bound());
}

boolean SCCP__param__CPartyAddress__ttc_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_addressIndicator.is_value()
 && (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_value())
 && (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_value())
 && (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_value());
}

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

SCCP__param__CPartyAddress__ttc SCCP__param__CPartyAddress__ttc_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 @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
SCCP__param__CPartyAddress__ttc ret_val;
if (single_value->field_addressIndicator.is_bound()) {
ret_val.addressIndicator() = single_value->field_addressIndicator.valueof();
}
if (single_value->field_signPointCode.is_omit()) ret_val.signPointCode() = OMIT_VALUE;
else if (single_value->field_signPointCode.is_bound()) {
ret_val.signPointCode() = single_value->field_signPointCode.valueof();
}
if (single_value->field_subsystemNumber.is_omit()) ret_val.subsystemNumber() = OMIT_VALUE;
else if (single_value->field_subsystemNumber.is_bound()) {
ret_val.subsystemNumber() = single_value->field_subsystemNumber.valueof();
}
if (single_value->field_globalTitle.is_omit()) ret_val.globalTitle() = OMIT_VALUE;
else if (single_value->field_globalTitle.is_bound()) {
ret_val.globalTitle() = single_value->field_globalTitle.valueof();
}
return ret_val;
}

void SCCP__param__CPartyAddress__ttc_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 @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__CPartyAddress__ttc_template[list_length];
}

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

SCCP__field__AddressIndicator__itu_template& SCCP__param__CPartyAddress__ttc_template::addressIndicator()
{
set_specific();
return single_value->field_addressIndicator;
}

const SCCP__field__AddressIndicator__itu_template& SCCP__param__CPartyAddress__ttc_template::addressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addressIndicator of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
return single_value->field_addressIndicator;
}

BITSTRING_template& SCCP__param__CPartyAddress__ttc_template::signPointCode()
{
set_specific();
return single_value->field_signPointCode;
}

const BITSTRING_template& SCCP__param__CPartyAddress__ttc_template::signPointCode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field signPointCode of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
return single_value->field_signPointCode;
}

INTEGER_template& SCCP__param__CPartyAddress__ttc_template::subsystemNumber()
{
set_specific();
return single_value->field_subsystemNumber;
}

const INTEGER_template& SCCP__param__CPartyAddress__ttc_template::subsystemNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field subsystemNumber of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
return single_value->field_subsystemNumber;
}

SCCP__field__GlobalTitle__itu_template& SCCP__param__CPartyAddress__ttc_template::globalTitle()
{
set_specific();
return single_value->field_globalTitle;
}

const SCCP__field__GlobalTitle__itu_template& SCCP__param__CPartyAddress__ttc_template::globalTitle() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitle of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
return single_value->field_globalTitle;
}

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

void SCCP__param__CPartyAddress__ttc_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ addressIndicator := ");
single_value->field_addressIndicator.log();
TTCN_Logger::log_event_str(", signPointCode := ");
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(", globalTitle := ");
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ttc_template::log_match(const SCCP__param__CPartyAddress__ttc& 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_addressIndicator.match(match_value.addressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".addressIndicator");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.signPointCode().ispresent()){
if(!single_value->field_signPointCode.match(match_value.signPointCode(), legacy)){
TTCN_Logger::log_logmatch_info(".signPointCode");
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_signPointCode.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".signPointCode := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.subsystemNumber().ispresent()){
if(!single_value->field_subsystemNumber.match(match_value.subsystemNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".subsystemNumber");
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_subsystemNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".subsystemNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.globalTitle().ispresent()){
if(!single_value->field_globalTitle.match(match_value.globalTitle(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitle");
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_globalTitle.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".globalTitle := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_globalTitle.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("{ addressIndicator := ");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::log_event_str(", signPointCode := ");
if (match_value.signPointCode().ispresent()) {
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_signPointCode.log();
if (single_value->field_signPointCode.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", subsystemNumber := ");
if (match_value.subsystemNumber().ispresent()) {
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_subsystemNumber.log();
if (single_value->field_subsystemNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", globalTitle := ");
if (match_value.globalTitle().ispresent()) {
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_globalTitle.log();
if (single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ttc_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

void SCCP__param__CPartyAddress__ttc_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_addressIndicator.encode_text(text_buf);
single_value->field_signPointCode.encode_text(text_buf);
single_value->field_subsystemNumber.encode_text(text_buf);
single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
}
}

void SCCP__param__CPartyAddress__ttc_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_addressIndicator.decode_text(text_buf);
single_value->field_signPointCode.decode_text(text_buf);
single_value->field_subsystemNumber.decode_text(text_buf);
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__ttc_template[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 @SCCP_Types.SCCP_param_CPartyAddress_ttc.");
}
}

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

void SCCP__param__CPartyAddress__ttc_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_addressIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ttc");
single_value->field_signPointCode.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ttc");
single_value->field_subsystemNumber.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ttc");
single_value->field_globalTitle.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_ttc");
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 : "@SCCP_Types.SCCP_param_CPartyAddress_ttc");
}

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

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

SCCP__param__CPartyAddress__mpt::SCCP__param__CPartyAddress__mpt()
{
}

SCCP__param__CPartyAddress__mpt::SCCP__param__CPartyAddress__mpt(const SCCP__field__AddressIndicator__itu& par_addressIndicator,
    const OPTIONAL< BITSTRING >& par_signPointCode,
    const OPTIONAL< INTEGER >& par_subsystemNumber,
    const OPTIONAL< SCCP__field__GlobalTitle__itu >& par_globalTitle)
  :   field_addressIndicator(par_addressIndicator),
  field_signPointCode(par_signPointCode),
  field_subsystemNumber(par_subsystemNumber),
  field_globalTitle(par_globalTitle)
{
}

SCCP__param__CPartyAddress__mpt::SCCP__param__CPartyAddress__mpt(const SCCP__param__CPartyAddress__mpt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
else field_addressIndicator.clean_up();
if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
else field_signPointCode.clean_up();
if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
else field_subsystemNumber.clean_up();
if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
else field_globalTitle.clean_up();
}

void SCCP__param__CPartyAddress__mpt::clean_up()
{
field_addressIndicator.clean_up();
field_signPointCode.clean_up();
field_subsystemNumber.clean_up();
field_globalTitle.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__CPartyAddress__mpt::get_descriptor() const { return &SCCP__param__CPartyAddress__mpt_descr_; }
SCCP__param__CPartyAddress__mpt& SCCP__param__CPartyAddress__mpt::operator=(const SCCP__param__CPartyAddress__mpt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
  if (other_value.addressIndicator().is_bound()) field_addressIndicator = other_value.addressIndicator();
  else field_addressIndicator.clean_up();
  if (other_value.signPointCode().is_bound()) field_signPointCode = other_value.signPointCode();
  else field_signPointCode.clean_up();
  if (other_value.subsystemNumber().is_bound()) field_subsystemNumber = other_value.subsystemNumber();
  else field_subsystemNumber.clean_up();
  if (other_value.globalTitle().is_bound()) field_globalTitle = other_value.globalTitle();
  else field_globalTitle.clean_up();
}
return *this;
}

boolean SCCP__param__CPartyAddress__mpt::operator==(const SCCP__param__CPartyAddress__mpt& other_value) const
{
return field_addressIndicator==other_value.field_addressIndicator
  && field_signPointCode==other_value.field_signPointCode
  && field_subsystemNumber==other_value.field_subsystemNumber
  && field_globalTitle==other_value.field_globalTitle;
}

boolean SCCP__param__CPartyAddress__mpt::is_bound() const
{
return (field_addressIndicator.is_bound())
  || (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_bound())
  || (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_bound())
  || (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_bound());
}
boolean SCCP__param__CPartyAddress__mpt::is_value() const
{
return field_addressIndicator.is_value()
  && (OPTIONAL_OMIT == field_signPointCode.get_selection() || field_signPointCode.is_value())
  && (OPTIONAL_OMIT == field_subsystemNumber.get_selection() || field_subsystemNumber.is_value())
  && (OPTIONAL_OMIT == field_globalTitle.get_selection() || field_globalTitle.is_value());
}
int SCCP__param__CPartyAddress__mpt::size_of() const
{
  int ret_val = 1;
  if (field_signPointCode.ispresent()) ret_val++;
  if (field_subsystemNumber.ispresent()) ret_val++;
  if (field_globalTitle.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__param__CPartyAddress__mpt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ addressIndicator := ");
field_addressIndicator.log();
TTCN_Logger::log_event_str(", signPointCode := ");
field_signPointCode.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
field_subsystemNumber.log();
TTCN_Logger::log_event_str(", globalTitle := ");
field_globalTitle.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__CPartyAddress__mpt::set_implicit_omit()
{
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

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

void SCCP__param__CPartyAddress__mpt::encode_text(Text_Buf& text_buf) const
{
field_addressIndicator.encode_text(text_buf);
field_signPointCode.encode_text(text_buf);
field_subsystemNumber.encode_text(text_buf);
field_globalTitle.encode_text(text_buf);
}

void SCCP__param__CPartyAddress__mpt::decode_text(Text_Buf& text_buf)
{
field_addressIndicator.decode_text(text_buf);
field_signPointCode.decode_text(text_buf);
field_subsystemNumber.decode_text(text_buf);
field_globalTitle.decode_text(text_buf);
}

void SCCP__param__CPartyAddress__mpt::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 SCCP__param__CPartyAddress__mpt::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 SCCP__param__CPartyAddress__mpt::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__field__AddressIndicator__itu_descr_.raw->forceomit);
  decoded_field_length = field_addressIndicator.RAW_decode(SCCP__field__AddressIndicator__itu_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && field_addressIndicator.pointCodeIndic() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_signPointCode = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__CPartyAddress__mpt_signPointCode_descr_.raw->forceomit);
  decoded_field_length = field_signPointCode().RAW_decode(SCCP__param__CPartyAddress__mpt_signPointCode_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_signPointCode = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_signPointCode=OMIT_VALUE;
  if (limit > 0 && field_addressIndicator.ssnIndicator() ==  bs_0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_subsystemNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__CPartyAddress__mpt_subsystemNumber_descr_.raw->forceomit);
  decoded_field_length = field_subsystemNumber().RAW_decode(SCCP__param__CPartyAddress__mpt_subsystemNumber_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_subsystemNumber = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_subsystemNumber=OMIT_VALUE;
  if (field_addressIndicator.globalTitleIndic() ==  bs_1) selected_field = 0;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_2) selected_field = 1;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_3) selected_field = 2;
  else if (field_addressIndicator.globalTitleIndic() ==  bs_4) selected_field = 3;
  else selected_field = -1;
  if (limit > 0 && (field_addressIndicator.globalTitleIndic() ==  bs_1 || field_addressIndicator.globalTitleIndic() ==  bs_2 || field_addressIndicator.globalTitleIndic() ==  bs_3 || field_addressIndicator.globalTitleIndic() ==  bs_4)&& selected_field!=-1){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_globalTitle = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__CPartyAddress__mpt_globalTitle_descr_.raw->forceomit);
  decoded_field_length = field_globalTitle().RAW_decode(SCCP__param__CPartyAddress__mpt_globalTitle_descr_, p_buf, limit, local_top_order, TRUE, selected_field, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_globalTitle = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_globalTitle=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__param__CPartyAddress__mpt::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, SCCP__field__AddressIndicator__itu_descr_.raw);
  if (field_signPointCode.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__CPartyAddress__mpt_signPointCode_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_subsystemNumber.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__CPartyAddress__mpt_subsystemNumber_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_globalTitle.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__CPartyAddress__mpt_globalTitle_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_addressIndicator.RAW_encode(SCCP__field__AddressIndicator__itu_descr_, *myleaf.body.node.nodes[0]);
  if (field_signPointCode.ispresent()) {
  encoded_length += field_signPointCode().RAW_encode(SCCP__param__CPartyAddress__mpt_signPointCode_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_subsystemNumber.ispresent()) {
  encoded_length += field_subsystemNumber().RAW_encode(SCCP__param__CPartyAddress__mpt_subsystemNumber_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_globalTitle.ispresent()) {
  encoded_length += field_globalTitle().RAW_encode(SCCP__param__CPartyAddress__mpt_globalTitle_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_signPointCode.ispresent() && (field_addressIndicator.pointCodeIndic() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_subsystemNumber.ispresent() && (field_addressIndicator.ssnIndicator() !=  bs_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,1};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_0.RAW_encode(General__Types::BIT1_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent() && (field_addressIndicator.globalTitleIndic() !=  bs_1 && field_addressIndicator.globalTitleIndic() !=  bs_2 && field_addressIndicator.globalTitleIndic() !=  bs_3 && field_addressIndicator.globalTitleIndic() !=  bs_4)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={0,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos1;
  pr_pos1.level=myleaf.curr_pos.level+2;
  int new_pos1[]={0,2};
  pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos1);
  temp_leaf = myleaf.get_node(pr_pos1);
  if(temp_leaf != NULL){
   bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos2;
  pr_pos2.level=myleaf.curr_pos.level+2;
  int new_pos2[]={0,2};
  pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos2);
  temp_leaf = myleaf.get_node(pr_pos2);
  if(temp_leaf != NULL){
   bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else  {
  RAW_enc_tr_pos pr_pos3;
  pr_pos3.level=myleaf.curr_pos.level+2;
  int new_pos3[]={0,2};
  pr_pos3.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos3);
  temp_leaf = myleaf.get_node(pr_pos3);
  if(temp_leaf != NULL){
   bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos3.pos);
  }
  free_tree_pos(pr_pos2.pos);
  }
  free_tree_pos(pr_pos1.pos);
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_globalTitle.ispresent()) {
  switch (field_globalTitle().get_selection()) {
  case SCCP__field__GlobalTitle__itu::ALT_gti0001:
  if (field_addressIndicator.globalTitleIndic() !=  bs_1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_1.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0010:
  if (field_addressIndicator.globalTitleIndic() !=  bs_2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_2.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0011:
  if (field_addressIndicator.globalTitleIndic() !=  bs_3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_3.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SCCP__field__GlobalTitle__itu::ALT_gti0100:
  if (field_addressIndicator.globalTitleIndic() !=  bs_4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
     bs_4.RAW_encode(General__Types::BIT4_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  }
  return myleaf.length = encoded_length;
}

struct SCCP__param__CPartyAddress__mpt_template::single_value_struct {
SCCP__field__AddressIndicator__itu_template field_addressIndicator;
BITSTRING_template field_signPointCode;
INTEGER_template field_subsystemNumber;
SCCP__field__GlobalTitle__itu_template field_globalTitle;
};

void SCCP__param__CPartyAddress__mpt_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_addressIndicator = ANY_VALUE;
single_value->field_signPointCode = ANY_OR_OMIT;
single_value->field_subsystemNumber = ANY_OR_OMIT;
single_value->field_globalTitle = ANY_OR_OMIT;
}
}
}

void SCCP__param__CPartyAddress__mpt_template::copy_value(const SCCP__param__CPartyAddress__mpt& other_value)
{
single_value = new single_value_struct;
if (other_value.addressIndicator().is_bound()) {
  single_value->field_addressIndicator = other_value.addressIndicator();
} else {
  single_value->field_addressIndicator.clean_up();
}
if (other_value.signPointCode().is_bound()) {
  if (other_value.signPointCode().ispresent()) single_value->field_signPointCode = other_value.signPointCode()();
  else single_value->field_signPointCode = OMIT_VALUE;
} else {
  single_value->field_signPointCode.clean_up();
}
if (other_value.subsystemNumber().is_bound()) {
  if (other_value.subsystemNumber().ispresent()) single_value->field_subsystemNumber = other_value.subsystemNumber()();
  else single_value->field_subsystemNumber = OMIT_VALUE;
} else {
  single_value->field_subsystemNumber.clean_up();
}
if (other_value.globalTitle().is_bound()) {
  if (other_value.globalTitle().ispresent()) single_value->field_globalTitle = other_value.globalTitle()();
  else single_value->field_globalTitle = OMIT_VALUE;
} else {
  single_value->field_globalTitle.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__CPartyAddress__mpt_template::copy_template(const SCCP__param__CPartyAddress__mpt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.addressIndicator().get_selection()) {
single_value->field_addressIndicator = other_value.addressIndicator();
} else {
single_value->field_addressIndicator.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.signPointCode().get_selection()) {
single_value->field_signPointCode = other_value.signPointCode();
} else {
single_value->field_signPointCode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.subsystemNumber().get_selection()) {
single_value->field_subsystemNumber = other_value.subsystemNumber();
} else {
single_value->field_subsystemNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.globalTitle().get_selection()) {
single_value->field_globalTitle = other_value.globalTitle();
} else {
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__mpt_template[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 SCCP__param__CPartyAddress__mpt_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__CPartyAddress__mpt_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 @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
break;
}
set_selection(other_value);
}

SCCP__param__CPartyAddress__mpt_template::SCCP__param__CPartyAddress__mpt_template()
{
}

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

SCCP__param__CPartyAddress__mpt_template::SCCP__param__CPartyAddress__mpt_template(const SCCP__param__CPartyAddress__mpt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__CPartyAddress__mpt_template::match(const SCCP__param__CPartyAddress__mpt& 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.addressIndicator().is_bound()) return FALSE;
if(!single_value->field_addressIndicator.match(other_value.addressIndicator(), legacy))return FALSE;
if(!other_value.signPointCode().is_bound()) return FALSE;
if((other_value.signPointCode().ispresent() ? !single_value->field_signPointCode.match((const BITSTRING&)other_value.signPointCode(), legacy) : !single_value->field_signPointCode.match_omit(legacy)))return FALSE;
if(!other_value.subsystemNumber().is_bound()) return FALSE;
if((other_value.subsystemNumber().ispresent() ? !single_value->field_subsystemNumber.match((const INTEGER&)other_value.subsystemNumber(), legacy) : !single_value->field_subsystemNumber.match_omit(legacy)))return FALSE;
if(!other_value.globalTitle().is_bound()) return FALSE;
if((other_value.globalTitle().ispresent() ? !single_value->field_globalTitle.match((const SCCP__field__GlobalTitle__itu&)other_value.globalTitle(), legacy) : !single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
}
return FALSE;
}

boolean SCCP__param__CPartyAddress__mpt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_addressIndicator.is_bound()
 || (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_bound())
 || (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_bound())
 || (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_bound());
}

boolean SCCP__param__CPartyAddress__mpt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_addressIndicator.is_value()
 && (single_value->field_signPointCode.is_omit() || single_value->field_signPointCode.is_value())
 && (single_value->field_subsystemNumber.is_omit() || single_value->field_subsystemNumber.is_value())
 && (single_value->field_globalTitle.is_omit() || single_value->field_globalTitle.is_value());
}

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

SCCP__param__CPartyAddress__mpt SCCP__param__CPartyAddress__mpt_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 @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
SCCP__param__CPartyAddress__mpt ret_val;
if (single_value->field_addressIndicator.is_bound()) {
ret_val.addressIndicator() = single_value->field_addressIndicator.valueof();
}
if (single_value->field_signPointCode.is_omit()) ret_val.signPointCode() = OMIT_VALUE;
else if (single_value->field_signPointCode.is_bound()) {
ret_val.signPointCode() = single_value->field_signPointCode.valueof();
}
if (single_value->field_subsystemNumber.is_omit()) ret_val.subsystemNumber() = OMIT_VALUE;
else if (single_value->field_subsystemNumber.is_bound()) {
ret_val.subsystemNumber() = single_value->field_subsystemNumber.valueof();
}
if (single_value->field_globalTitle.is_omit()) ret_val.globalTitle() = OMIT_VALUE;
else if (single_value->field_globalTitle.is_bound()) {
ret_val.globalTitle() = single_value->field_globalTitle.valueof();
}
return ret_val;
}

void SCCP__param__CPartyAddress__mpt_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 @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__CPartyAddress__mpt_template[list_length];
}

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

SCCP__field__AddressIndicator__itu_template& SCCP__param__CPartyAddress__mpt_template::addressIndicator()
{
set_specific();
return single_value->field_addressIndicator;
}

const SCCP__field__AddressIndicator__itu_template& SCCP__param__CPartyAddress__mpt_template::addressIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addressIndicator of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
return single_value->field_addressIndicator;
}

BITSTRING_template& SCCP__param__CPartyAddress__mpt_template::signPointCode()
{
set_specific();
return single_value->field_signPointCode;
}

const BITSTRING_template& SCCP__param__CPartyAddress__mpt_template::signPointCode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field signPointCode of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
return single_value->field_signPointCode;
}

INTEGER_template& SCCP__param__CPartyAddress__mpt_template::subsystemNumber()
{
set_specific();
return single_value->field_subsystemNumber;
}

const INTEGER_template& SCCP__param__CPartyAddress__mpt_template::subsystemNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field subsystemNumber of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
return single_value->field_subsystemNumber;
}

SCCP__field__GlobalTitle__itu_template& SCCP__param__CPartyAddress__mpt_template::globalTitle()
{
set_specific();
return single_value->field_globalTitle;
}

const SCCP__field__GlobalTitle__itu_template& SCCP__param__CPartyAddress__mpt_template::globalTitle() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field globalTitle of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
return single_value->field_globalTitle;
}

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

void SCCP__param__CPartyAddress__mpt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ addressIndicator := ");
single_value->field_addressIndicator.log();
TTCN_Logger::log_event_str(", signPointCode := ");
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(", subsystemNumber := ");
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(", globalTitle := ");
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__mpt_template::log_match(const SCCP__param__CPartyAddress__mpt& 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_addressIndicator.match(match_value.addressIndicator(), legacy)){
TTCN_Logger::log_logmatch_info(".addressIndicator");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.signPointCode().ispresent()){
if(!single_value->field_signPointCode.match(match_value.signPointCode(), legacy)){
TTCN_Logger::log_logmatch_info(".signPointCode");
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_signPointCode.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".signPointCode := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_signPointCode.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.subsystemNumber().ispresent()){
if(!single_value->field_subsystemNumber.match(match_value.subsystemNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".subsystemNumber");
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_subsystemNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".subsystemNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_subsystemNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.globalTitle().ispresent()){
if(!single_value->field_globalTitle.match(match_value.globalTitle(), legacy)){
TTCN_Logger::log_logmatch_info(".globalTitle");
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_globalTitle.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".globalTitle := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_globalTitle.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("{ addressIndicator := ");
single_value->field_addressIndicator.log_match(match_value.addressIndicator(), legacy);
TTCN_Logger::log_event_str(", signPointCode := ");
if (match_value.signPointCode().ispresent()) {
single_value->field_signPointCode.log_match(match_value.signPointCode(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_signPointCode.log();
if (single_value->field_signPointCode.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", subsystemNumber := ");
if (match_value.subsystemNumber().ispresent()) {
single_value->field_subsystemNumber.log_match(match_value.subsystemNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_subsystemNumber.log();
if (single_value->field_subsystemNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", globalTitle := ");
if (match_value.globalTitle().ispresent()) {
single_value->field_globalTitle.log_match(match_value.globalTitle(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_globalTitle.log();
if (single_value->field_globalTitle.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 SCCP__param__CPartyAddress__mpt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (addressIndicator().is_bound()) addressIndicator().set_implicit_omit();
if (!signPointCode().is_bound()) signPointCode() = OMIT_VALUE;
else signPointCode().set_implicit_omit();
if (!subsystemNumber().is_bound()) subsystemNumber() = OMIT_VALUE;
else subsystemNumber().set_implicit_omit();
if (!globalTitle().is_bound()) globalTitle() = OMIT_VALUE;
else globalTitle().set_implicit_omit();
}

void SCCP__param__CPartyAddress__mpt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_addressIndicator.encode_text(text_buf);
single_value->field_signPointCode.encode_text(text_buf);
single_value->field_subsystemNumber.encode_text(text_buf);
single_value->field_globalTitle.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 @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
}
}

void SCCP__param__CPartyAddress__mpt_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_addressIndicator.decode_text(text_buf);
single_value->field_signPointCode.decode_text(text_buf);
single_value->field_subsystemNumber.decode_text(text_buf);
single_value->field_globalTitle.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 SCCP__param__CPartyAddress__mpt_template[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 @SCCP_Types.SCCP_param_CPartyAddress_mpt.");
}
}

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

void SCCP__param__CPartyAddress__mpt_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_addressIndicator.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_mpt");
single_value->field_signPointCode.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_mpt");
single_value->field_subsystemNumber.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_mpt");
single_value->field_globalTitle.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddress_mpt");
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 : "@SCCP_Types.SCCP_param_CPartyAddress_mpt");
}

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

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

SCCP__param__CPartyAddressEnc__opt::SCCP__param__CPartyAddressEnc__opt()
{
}

SCCP__param__CPartyAddressEnc__opt::SCCP__param__CPartyAddressEnc__opt(const INTEGER& par_paramName,
    const INTEGER& par_paramLength,
    const OCTETSTRING& par_addr)
  :   field_paramName(par_paramName),
  field_paramLength(par_paramLength),
  field_addr(par_addr)
{
}

SCCP__param__CPartyAddressEnc__opt::SCCP__param__CPartyAddressEnc__opt(const SCCP__param__CPartyAddressEnc__opt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
else field_paramName.clean_up();
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.addr().is_bound()) field_addr = other_value.addr();
else field_addr.clean_up();
}

void SCCP__param__CPartyAddressEnc__opt::clean_up()
{
field_paramName.clean_up();
field_paramLength.clean_up();
field_addr.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__CPartyAddressEnc__opt::get_descriptor() const { return &SCCP__param__CPartyAddressEnc__opt_descr_; }
SCCP__param__CPartyAddressEnc__opt& SCCP__param__CPartyAddressEnc__opt::operator=(const SCCP__param__CPartyAddressEnc__opt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
  if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
  else field_paramName.clean_up();
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.addr().is_bound()) field_addr = other_value.addr();
  else field_addr.clean_up();
}
return *this;
}

boolean SCCP__param__CPartyAddressEnc__opt::operator==(const SCCP__param__CPartyAddressEnc__opt& other_value) const
{
return field_paramName==other_value.field_paramName
  && field_paramLength==other_value.field_paramLength
  && field_addr==other_value.field_addr;
}

boolean SCCP__param__CPartyAddressEnc__opt::is_bound() const
{
return (field_paramName.is_bound())
  || (field_paramLength.is_bound())
  || (field_addr.is_bound());
}
boolean SCCP__param__CPartyAddressEnc__opt::is_value() const
{
return field_paramName.is_value()
  && field_paramLength.is_value()
  && field_addr.is_value();
}
void SCCP__param__CPartyAddressEnc__opt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramName := ");
field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", addr := ");
field_addr.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__CPartyAddressEnc__opt::set_implicit_omit()
{
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (addr().is_bound()) addr().set_implicit_omit();
}

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

void SCCP__param__CPartyAddressEnc__opt::encode_text(Text_Buf& text_buf) const
{
field_paramName.encode_text(text_buf);
field_paramLength.encode_text(text_buf);
field_addr.encode_text(text_buf);
}

void SCCP__param__CPartyAddressEnc__opt::decode_text(Text_Buf& text_buf)
{
field_paramName.decode_text(text_buf);
field_paramLength.decode_text(text_buf);
field_addr.decode_text(text_buf);
}

void SCCP__param__CPartyAddressEnc__opt::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 SCCP__param__CPartyAddressEnc__opt::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 SCCP__param__CPartyAddressEnc__opt::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, SCCP__field__ParameterName_descr_.raw->forceomit);
  decoded_field_length = field_paramName.RAW_decode(SCCP__field__ParameterName_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, SCCP__param__CPartyAddressEnc__opt_paramLength_descr_.raw->forceomit);
  decoded_field_length = field_paramLength.RAW_decode(SCCP__param__CPartyAddressEnc__opt_paramLength_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_paramLength.convert_to_Integer(SCCP__param__CPartyAddressEnc__opt_paramLength_descr_);
  field_paramLength = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__CPartyAddressEnc__addr_descr_.raw->forceomit);
  decoded_field_length = field_addr.RAW_decode(SCCP__CPartyAddressEnc__addr_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 SCCP__param__CPartyAddressEnc__opt::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, SCCP__field__ParameterName_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__CPartyAddressEnc__opt_paramLength_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__CPartyAddressEnc__addr_descr_.raw);
  encoded_length += field_paramName.RAW_encode(SCCP__field__ParameterName_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &SCCP__param__CPartyAddressEnc__opt_paramLength_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_addr.RAW_encode(SCCP__CPartyAddressEnc__addr_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct SCCP__param__CPartyAddressEnc__opt_template::single_value_struct {
INTEGER_template field_paramName;
INTEGER_template field_paramLength;
OCTETSTRING_template field_addr;
};

void SCCP__param__CPartyAddressEnc__opt_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_paramName = ANY_VALUE;
single_value->field_paramLength = ANY_VALUE;
single_value->field_addr = ANY_VALUE;
}
}
}

void SCCP__param__CPartyAddressEnc__opt_template::copy_value(const SCCP__param__CPartyAddressEnc__opt& other_value)
{
single_value = new single_value_struct;
if (other_value.paramName().is_bound()) {
  single_value->field_paramName = other_value.paramName();
} else {
  single_value->field_paramName.clean_up();
}
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.addr().is_bound()) {
  single_value->field_addr = other_value.addr();
} else {
  single_value->field_addr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__CPartyAddressEnc__opt_template::copy_template(const SCCP__param__CPartyAddressEnc__opt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramName().get_selection()) {
single_value->field_paramName = other_value.paramName();
} else {
single_value->field_paramName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.addr().get_selection()) {
single_value->field_addr = other_value.addr();
} else {
single_value->field_addr.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 SCCP__param__CPartyAddressEnc__opt_template[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 SCCP__param__CPartyAddressEnc__opt_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__CPartyAddressEnc__opt_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 @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
break;
}
set_selection(other_value);
}

SCCP__param__CPartyAddressEnc__opt_template::SCCP__param__CPartyAddressEnc__opt_template()
{
}

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

SCCP__param__CPartyAddressEnc__opt_template::SCCP__param__CPartyAddressEnc__opt_template(const SCCP__param__CPartyAddressEnc__opt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__CPartyAddressEnc__opt_template::match(const SCCP__param__CPartyAddressEnc__opt& 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.paramName().is_bound()) return FALSE;
if(!single_value->field_paramName.match(other_value.paramName(), legacy))return FALSE;
if(!other_value.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.addr().is_bound()) return FALSE;
if(!single_value->field_addr.match(other_value.addr(), 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 @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
}
return FALSE;
}

boolean SCCP__param__CPartyAddressEnc__opt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_paramName.is_bound()
 || single_value->field_paramLength.is_bound()
 || single_value->field_addr.is_bound();
}

boolean SCCP__param__CPartyAddressEnc__opt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramName.is_value()
 && single_value->field_paramLength.is_value()
 && single_value->field_addr.is_value();
}

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

SCCP__param__CPartyAddressEnc__opt SCCP__param__CPartyAddressEnc__opt_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 @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
SCCP__param__CPartyAddressEnc__opt ret_val;
if (single_value->field_paramName.is_bound()) {
ret_val.paramName() = single_value->field_paramName.valueof();
}
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_addr.is_bound()) {
ret_val.addr() = single_value->field_addr.valueof();
}
return ret_val;
}

void SCCP__param__CPartyAddressEnc__opt_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 @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__CPartyAddressEnc__opt_template[list_length];
}

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

INTEGER_template& SCCP__param__CPartyAddressEnc__opt_template::paramName()
{
set_specific();
return single_value->field_paramName;
}

const INTEGER_template& SCCP__param__CPartyAddressEnc__opt_template::paramName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramName of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
return single_value->field_paramName;
}

INTEGER_template& SCCP__param__CPartyAddressEnc__opt_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__CPartyAddressEnc__opt_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
return single_value->field_paramLength;
}

OCTETSTRING_template& SCCP__param__CPartyAddressEnc__opt_template::addr()
{
set_specific();
return single_value->field_addr;
}

const OCTETSTRING_template& SCCP__param__CPartyAddressEnc__opt_template::addr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field addr of a non-specific template of type @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
return single_value->field_addr;
}

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

void SCCP__param__CPartyAddressEnc__opt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramName := ");
single_value->field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", addr := ");
single_value->field_addr.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 SCCP__param__CPartyAddressEnc__opt_template::log_match(const SCCP__param__CPartyAddressEnc__opt& 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_paramName.match(match_value.paramName(), legacy)){
TTCN_Logger::log_logmatch_info(".paramName");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_addr.match(match_value.addr(), legacy)){
TTCN_Logger::log_logmatch_info(".addr");
single_value->field_addr.log_match(match_value.addr(), 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("{ paramName := ");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", addr := ");
single_value->field_addr.log_match(match_value.addr(), 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 SCCP__param__CPartyAddressEnc__opt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (addr().is_bound()) addr().set_implicit_omit();
}

void SCCP__param__CPartyAddressEnc__opt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramName.encode_text(text_buf);
single_value->field_paramLength.encode_text(text_buf);
single_value->field_addr.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 @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
}
}

void SCCP__param__CPartyAddressEnc__opt_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_paramName.decode_text(text_buf);
single_value->field_paramLength.decode_text(text_buf);
single_value->field_addr.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 SCCP__param__CPartyAddressEnc__opt_template[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 @SCCP_Types.SCCP_param_CPartyAddressEnc_opt.");
}
}

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

void SCCP__param__CPartyAddressEnc__opt_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_paramName.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt");
single_value->field_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt");
single_value->field_addr.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt");
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 : "@SCCP_Types.SCCP_param_CPartyAddressEnc_opt");
}

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

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

SCCP__param__ProtocolClass::SCCP__param__ProtocolClass()
{
}

SCCP__param__ProtocolClass::SCCP__param__ProtocolClass(const BITSTRING& par_class_,
    const BITSTRING& par_messageHandling)
  :   field_class_(par_class_),
  field_messageHandling(par_messageHandling)
{
}

SCCP__param__ProtocolClass::SCCP__param__ProtocolClass(const SCCP__param__ProtocolClass& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_ProtocolClass.");
if (other_value.class_().is_bound()) field_class_ = other_value.class_();
else field_class_.clean_up();
if (other_value.messageHandling().is_bound()) field_messageHandling = other_value.messageHandling();
else field_messageHandling.clean_up();
}

void SCCP__param__ProtocolClass::clean_up()
{
field_class_.clean_up();
field_messageHandling.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__ProtocolClass::get_descriptor() const { return &SCCP__param__ProtocolClass_descr_; }
SCCP__param__ProtocolClass& SCCP__param__ProtocolClass::operator=(const SCCP__param__ProtocolClass& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_ProtocolClass.");
  if (other_value.class_().is_bound()) field_class_ = other_value.class_();
  else field_class_.clean_up();
  if (other_value.messageHandling().is_bound()) field_messageHandling = other_value.messageHandling();
  else field_messageHandling.clean_up();
}
return *this;
}

boolean SCCP__param__ProtocolClass::operator==(const SCCP__param__ProtocolClass& other_value) const
{
return field_class_==other_value.field_class_
  && field_messageHandling==other_value.field_messageHandling;
}

boolean SCCP__param__ProtocolClass::is_bound() const
{
return (field_class_.is_bound())
  || (field_messageHandling.is_bound());
}
boolean SCCP__param__ProtocolClass::is_value() const
{
return field_class_.is_value()
  && field_messageHandling.is_value();
}
void SCCP__param__ProtocolClass::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ class := ");
field_class_.log();
TTCN_Logger::log_event_str(", messageHandling := ");
field_messageHandling.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__ProtocolClass::set_implicit_omit()
{
if (class_().is_bound()) class_().set_implicit_omit();
if (messageHandling().is_bound()) messageHandling().set_implicit_omit();
}

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

void SCCP__param__ProtocolClass::encode_text(Text_Buf& text_buf) const
{
field_class_.encode_text(text_buf);
field_messageHandling.encode_text(text_buf);
}

void SCCP__param__ProtocolClass::decode_text(Text_Buf& text_buf)
{
field_class_.decode_text(text_buf);
field_messageHandling.decode_text(text_buf);
}

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

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

struct SCCP__param__ProtocolClass_template::single_value_struct {
BITSTRING_template field_class_;
BITSTRING_template field_messageHandling;
};

void SCCP__param__ProtocolClass_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_class_ = ANY_VALUE;
single_value->field_messageHandling = ANY_VALUE;
}
}
}

void SCCP__param__ProtocolClass_template::copy_value(const SCCP__param__ProtocolClass& other_value)
{
single_value = new single_value_struct;
if (other_value.class_().is_bound()) {
  single_value->field_class_ = other_value.class_();
} else {
  single_value->field_class_.clean_up();
}
if (other_value.messageHandling().is_bound()) {
  single_value->field_messageHandling = other_value.messageHandling();
} else {
  single_value->field_messageHandling.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__ProtocolClass_template::copy_template(const SCCP__param__ProtocolClass_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.class_().get_selection()) {
single_value->field_class_ = other_value.class_();
} else {
single_value->field_class_.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.messageHandling().get_selection()) {
single_value->field_messageHandling = other_value.messageHandling();
} else {
single_value->field_messageHandling.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 SCCP__param__ProtocolClass_template[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 SCCP__param__ProtocolClass_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__ProtocolClass_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 @SCCP_Types.SCCP_param_ProtocolClass.");
break;
}
set_selection(other_value);
}

SCCP__param__ProtocolClass_template::SCCP__param__ProtocolClass_template()
{
}

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

SCCP__param__ProtocolClass_template::SCCP__param__ProtocolClass_template(const SCCP__param__ProtocolClass& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__ProtocolClass_template::match(const SCCP__param__ProtocolClass& 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.class_().is_bound()) return FALSE;
if(!single_value->field_class_.match(other_value.class_(), legacy))return FALSE;
if(!other_value.messageHandling().is_bound()) return FALSE;
if(!single_value->field_messageHandling.match(other_value.messageHandling(), 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 @SCCP_Types.SCCP_param_ProtocolClass.");
}
return FALSE;
}

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

boolean SCCP__param__ProtocolClass_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_class_.is_value()
 && single_value->field_messageHandling.is_value();
}

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

SCCP__param__ProtocolClass SCCP__param__ProtocolClass_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 @SCCP_Types.SCCP_param_ProtocolClass.");
SCCP__param__ProtocolClass ret_val;
if (single_value->field_class_.is_bound()) {
ret_val.class_() = single_value->field_class_.valueof();
}
if (single_value->field_messageHandling.is_bound()) {
ret_val.messageHandling() = single_value->field_messageHandling.valueof();
}
return ret_val;
}

void SCCP__param__ProtocolClass_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 @SCCP_Types.SCCP_param_ProtocolClass.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__ProtocolClass_template[list_length];
}

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

BITSTRING_template& SCCP__param__ProtocolClass_template::class_()
{
set_specific();
return single_value->field_class_;
}

const BITSTRING_template& SCCP__param__ProtocolClass_template::class_() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field class of a non-specific template of type @SCCP_Types.SCCP_param_ProtocolClass.");
return single_value->field_class_;
}

BITSTRING_template& SCCP__param__ProtocolClass_template::messageHandling()
{
set_specific();
return single_value->field_messageHandling;
}

const BITSTRING_template& SCCP__param__ProtocolClass_template::messageHandling() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageHandling of a non-specific template of type @SCCP_Types.SCCP_param_ProtocolClass.");
return single_value->field_messageHandling;
}

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

void SCCP__param__ProtocolClass_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ class := ");
single_value->field_class_.log();
TTCN_Logger::log_event_str(", messageHandling := ");
single_value->field_messageHandling.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 SCCP__param__ProtocolClass_template::log_match(const SCCP__param__ProtocolClass& 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_class_.match(match_value.class_(), legacy)){
TTCN_Logger::log_logmatch_info(".class");
single_value->field_class_.log_match(match_value.class_(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_messageHandling.match(match_value.messageHandling(), legacy)){
TTCN_Logger::log_logmatch_info(".messageHandling");
single_value->field_messageHandling.log_match(match_value.messageHandling(), 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("{ class := ");
single_value->field_class_.log_match(match_value.class_(), legacy);
TTCN_Logger::log_event_str(", messageHandling := ");
single_value->field_messageHandling.log_match(match_value.messageHandling(), 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 SCCP__param__ProtocolClass_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (class_().is_bound()) class_().set_implicit_omit();
if (messageHandling().is_bound()) messageHandling().set_implicit_omit();
}

void SCCP__param__ProtocolClass_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_class_.encode_text(text_buf);
single_value->field_messageHandling.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 @SCCP_Types.SCCP_param_ProtocolClass.");
}
}

void SCCP__param__ProtocolClass_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_class_.decode_text(text_buf);
single_value->field_messageHandling.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 SCCP__param__ProtocolClass_template[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 @SCCP_Types.SCCP_param_ProtocolClass.");
}
}

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

void SCCP__param__ProtocolClass_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_class_.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_ProtocolClass");
single_value->field_messageHandling.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_ProtocolClass");
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 : "@SCCP_Types.SCCP_param_ProtocolClass");
}

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

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

SCCP__param__SegmentingReassembl::SCCP__param__SegmentingReassembl()
{
}

SCCP__param__SegmentingReassembl::SCCP__param__SegmentingReassembl(const BITSTRING& par_more,
    const BITSTRING& par_reserved)
  :   field_more(par_more),
  field_reserved(par_reserved)
{
}

SCCP__param__SegmentingReassembl::SCCP__param__SegmentingReassembl(const SCCP__param__SegmentingReassembl& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_SegmentingReassembl.");
if (other_value.more().is_bound()) field_more = other_value.more();
else field_more.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void SCCP__param__SegmentingReassembl::clean_up()
{
field_more.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__SegmentingReassembl::get_descriptor() const { return &SCCP__param__SegmentingReassembl_descr_; }
SCCP__param__SegmentingReassembl& SCCP__param__SegmentingReassembl::operator=(const SCCP__param__SegmentingReassembl& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_SegmentingReassembl.");
  if (other_value.more().is_bound()) field_more = other_value.more();
  else field_more.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

boolean SCCP__param__SegmentingReassembl::operator==(const SCCP__param__SegmentingReassembl& other_value) const
{
return field_more==other_value.field_more
  && field_reserved==other_value.field_reserved;
}

boolean SCCP__param__SegmentingReassembl::is_bound() const
{
return (field_more.is_bound())
  || (field_reserved.is_bound());
}
boolean SCCP__param__SegmentingReassembl::is_value() const
{
return field_more.is_value()
  && field_reserved.is_value();
}
void SCCP__param__SegmentingReassembl::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ more := ");
field_more.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__SegmentingReassembl::set_implicit_omit()
{
if (more().is_bound()) more().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

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

void SCCP__param__SegmentingReassembl::encode_text(Text_Buf& text_buf) const
{
field_more.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void SCCP__param__SegmentingReassembl::decode_text(Text_Buf& text_buf)
{
field_more.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

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

struct SCCP__param__SegmentingReassembl_template::single_value_struct {
BITSTRING_template field_more;
BITSTRING_template field_reserved;
};

void SCCP__param__SegmentingReassembl_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_more = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
}
}
}

void SCCP__param__SegmentingReassembl_template::copy_value(const SCCP__param__SegmentingReassembl& other_value)
{
single_value = new single_value_struct;
if (other_value.more().is_bound()) {
  single_value->field_more = other_value.more();
} else {
  single_value->field_more.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__SegmentingReassembl_template::copy_template(const SCCP__param__SegmentingReassembl_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.more().get_selection()) {
single_value->field_more = other_value.more();
} else {
single_value->field_more.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.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 SCCP__param__SegmentingReassembl_template[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 SCCP__param__SegmentingReassembl_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__SegmentingReassembl_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 @SCCP_Types.SCCP_param_SegmentingReassembl.");
break;
}
set_selection(other_value);
}

SCCP__param__SegmentingReassembl_template::SCCP__param__SegmentingReassembl_template()
{
}

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

SCCP__param__SegmentingReassembl_template::SCCP__param__SegmentingReassembl_template(const SCCP__param__SegmentingReassembl& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__SegmentingReassembl_template::match(const SCCP__param__SegmentingReassembl& 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.more().is_bound()) return FALSE;
if(!single_value->field_more.match(other_value.more(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), 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 @SCCP_Types.SCCP_param_SegmentingReassembl.");
}
return FALSE;
}

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

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

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

SCCP__param__SegmentingReassembl SCCP__param__SegmentingReassembl_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 @SCCP_Types.SCCP_param_SegmentingReassembl.");
SCCP__param__SegmentingReassembl ret_val;
if (single_value->field_more.is_bound()) {
ret_val.more() = single_value->field_more.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

void SCCP__param__SegmentingReassembl_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 @SCCP_Types.SCCP_param_SegmentingReassembl.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__SegmentingReassembl_template[list_length];
}

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

BITSTRING_template& SCCP__param__SegmentingReassembl_template::more()
{
set_specific();
return single_value->field_more;
}

const BITSTRING_template& SCCP__param__SegmentingReassembl_template::more() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field more of a non-specific template of type @SCCP_Types.SCCP_param_SegmentingReassembl.");
return single_value->field_more;
}

BITSTRING_template& SCCP__param__SegmentingReassembl_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__param__SegmentingReassembl_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_param_SegmentingReassembl.");
return single_value->field_reserved;
}

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

void SCCP__param__SegmentingReassembl_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ more := ");
single_value->field_more.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.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 SCCP__param__SegmentingReassembl_template::log_match(const SCCP__param__SegmentingReassembl& 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_more.match(match_value.more(), legacy)){
TTCN_Logger::log_logmatch_info(".more");
single_value->field_more.log_match(match_value.more(), 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);
}
}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("{ more := ");
single_value->field_more.log_match(match_value.more(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), 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 SCCP__param__SegmentingReassembl_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (more().is_bound()) more().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCCP__param__SegmentingReassembl_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_more.encode_text(text_buf);
single_value->field_reserved.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 @SCCP_Types.SCCP_param_SegmentingReassembl.");
}
}

void SCCP__param__SegmentingReassembl_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_more.decode_text(text_buf);
single_value->field_reserved.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 SCCP__param__SegmentingReassembl_template[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 @SCCP_Types.SCCP_param_SegmentingReassembl.");
}
}

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

void SCCP__param__SegmentingReassembl_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_more.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_SegmentingReassembl");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_SegmentingReassembl");
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 : "@SCCP_Types.SCCP_param_SegmentingReassembl");
}

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

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

SCCP__param__RecSeqNumber::SCCP__param__RecSeqNumber()
{
}

SCCP__param__RecSeqNumber::SCCP__param__RecSeqNumber(const BITSTRING& par_reserved,
    const BITSTRING& par_pr)
  :   field_reserved(par_reserved),
  field_pr(par_pr)
{
}

SCCP__param__RecSeqNumber::SCCP__param__RecSeqNumber(const SCCP__param__RecSeqNumber& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_RecSeqNumber.");
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.pr().is_bound()) field_pr = other_value.pr();
else field_pr.clean_up();
}

void SCCP__param__RecSeqNumber::clean_up()
{
field_reserved.clean_up();
field_pr.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__RecSeqNumber::get_descriptor() const { return &SCCP__param__RecSeqNumber_descr_; }
SCCP__param__RecSeqNumber& SCCP__param__RecSeqNumber::operator=(const SCCP__param__RecSeqNumber& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_RecSeqNumber.");
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.pr().is_bound()) field_pr = other_value.pr();
  else field_pr.clean_up();
}
return *this;
}

boolean SCCP__param__RecSeqNumber::operator==(const SCCP__param__RecSeqNumber& other_value) const
{
return field_reserved==other_value.field_reserved
  && field_pr==other_value.field_pr;
}

boolean SCCP__param__RecSeqNumber::is_bound() const
{
return (field_reserved.is_bound())
  || (field_pr.is_bound());
}
boolean SCCP__param__RecSeqNumber::is_value() const
{
return field_reserved.is_value()
  && field_pr.is_value();
}
void SCCP__param__RecSeqNumber::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", pr := ");
field_pr.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__RecSeqNumber::set_implicit_omit()
{
if (reserved().is_bound()) reserved().set_implicit_omit();
if (pr().is_bound()) pr().set_implicit_omit();
}

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

void SCCP__param__RecSeqNumber::encode_text(Text_Buf& text_buf) const
{
field_reserved.encode_text(text_buf);
field_pr.encode_text(text_buf);
}

void SCCP__param__RecSeqNumber::decode_text(Text_Buf& text_buf)
{
field_reserved.decode_text(text_buf);
field_pr.decode_text(text_buf);
}

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

struct SCCP__param__RecSeqNumber_template::single_value_struct {
BITSTRING_template field_reserved;
BITSTRING_template field_pr;
};

void SCCP__param__RecSeqNumber_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_reserved = ANY_VALUE;
single_value->field_pr = ANY_VALUE;
}
}
}

void SCCP__param__RecSeqNumber_template::copy_value(const SCCP__param__RecSeqNumber& other_value)
{
single_value = new single_value_struct;
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.pr().is_bound()) {
  single_value->field_pr = other_value.pr();
} else {
  single_value->field_pr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__RecSeqNumber_template::copy_template(const SCCP__param__RecSeqNumber_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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.pr().get_selection()) {
single_value->field_pr = other_value.pr();
} else {
single_value->field_pr.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 SCCP__param__RecSeqNumber_template[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 SCCP__param__RecSeqNumber_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__RecSeqNumber_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 @SCCP_Types.SCCP_param_RecSeqNumber.");
break;
}
set_selection(other_value);
}

SCCP__param__RecSeqNumber_template::SCCP__param__RecSeqNumber_template()
{
}

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

SCCP__param__RecSeqNumber_template::SCCP__param__RecSeqNumber_template(const SCCP__param__RecSeqNumber& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__RecSeqNumber_template::match(const SCCP__param__RecSeqNumber& 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.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.pr().is_bound()) return FALSE;
if(!single_value->field_pr.match(other_value.pr(), 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 @SCCP_Types.SCCP_param_RecSeqNumber.");
}
return FALSE;
}

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

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

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

SCCP__param__RecSeqNumber SCCP__param__RecSeqNumber_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 @SCCP_Types.SCCP_param_RecSeqNumber.");
SCCP__param__RecSeqNumber ret_val;
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_pr.is_bound()) {
ret_val.pr() = single_value->field_pr.valueof();
}
return ret_val;
}

void SCCP__param__RecSeqNumber_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 @SCCP_Types.SCCP_param_RecSeqNumber.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__RecSeqNumber_template[list_length];
}

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

BITSTRING_template& SCCP__param__RecSeqNumber_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__param__RecSeqNumber_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_param_RecSeqNumber.");
return single_value->field_reserved;
}

BITSTRING_template& SCCP__param__RecSeqNumber_template::pr()
{
set_specific();
return single_value->field_pr;
}

const BITSTRING_template& SCCP__param__RecSeqNumber_template::pr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pr of a non-specific template of type @SCCP_Types.SCCP_param_RecSeqNumber.");
return single_value->field_pr;
}

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

void SCCP__param__RecSeqNumber_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", pr := ");
single_value->field_pr.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 SCCP__param__RecSeqNumber_template::log_match(const SCCP__param__RecSeqNumber& 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_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_pr.match(match_value.pr(), legacy)){
TTCN_Logger::log_logmatch_info(".pr");
single_value->field_pr.log_match(match_value.pr(), 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("{ reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", pr := ");
single_value->field_pr.log_match(match_value.pr(), 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 SCCP__param__RecSeqNumber_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (reserved().is_bound()) reserved().set_implicit_omit();
if (pr().is_bound()) pr().set_implicit_omit();
}

void SCCP__param__RecSeqNumber_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_reserved.encode_text(text_buf);
single_value->field_pr.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 @SCCP_Types.SCCP_param_RecSeqNumber.");
}
}

void SCCP__param__RecSeqNumber_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_reserved.decode_text(text_buf);
single_value->field_pr.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 SCCP__param__RecSeqNumber_template[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 @SCCP_Types.SCCP_param_RecSeqNumber.");
}
}

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

void SCCP__param__RecSeqNumber_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_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_RecSeqNumber");
single_value->field_pr.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_RecSeqNumber");
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 : "@SCCP_Types.SCCP_param_RecSeqNumber");
}

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

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

SCCP__param__SequencingSegmenting::SCCP__param__SequencingSegmenting()
{
}

SCCP__param__SequencingSegmenting::SCCP__param__SequencingSegmenting(const BITSTRING& par_reserved,
    const BITSTRING& par_p__s,
    const BITSTRING& par_more,
    const BITSTRING& par_pr)
  :   field_reserved(par_reserved),
  field_p__s(par_p__s),
  field_more(par_more),
  field_pr(par_pr)
{
}

SCCP__param__SequencingSegmenting::SCCP__param__SequencingSegmenting(const SCCP__param__SequencingSegmenting& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_SequencingSegmenting.");
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.p__s().is_bound()) field_p__s = other_value.p__s();
else field_p__s.clean_up();
if (other_value.more().is_bound()) field_more = other_value.more();
else field_more.clean_up();
if (other_value.pr().is_bound()) field_pr = other_value.pr();
else field_pr.clean_up();
}

void SCCP__param__SequencingSegmenting::clean_up()
{
field_reserved.clean_up();
field_p__s.clean_up();
field_more.clean_up();
field_pr.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__SequencingSegmenting::get_descriptor() const { return &SCCP__param__SequencingSegmenting_descr_; }
SCCP__param__SequencingSegmenting& SCCP__param__SequencingSegmenting::operator=(const SCCP__param__SequencingSegmenting& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_SequencingSegmenting.");
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.p__s().is_bound()) field_p__s = other_value.p__s();
  else field_p__s.clean_up();
  if (other_value.more().is_bound()) field_more = other_value.more();
  else field_more.clean_up();
  if (other_value.pr().is_bound()) field_pr = other_value.pr();
  else field_pr.clean_up();
}
return *this;
}

boolean SCCP__param__SequencingSegmenting::operator==(const SCCP__param__SequencingSegmenting& other_value) const
{
return field_reserved==other_value.field_reserved
  && field_p__s==other_value.field_p__s
  && field_more==other_value.field_more
  && field_pr==other_value.field_pr;
}

boolean SCCP__param__SequencingSegmenting::is_bound() const
{
return (field_reserved.is_bound())
  || (field_p__s.is_bound())
  || (field_more.is_bound())
  || (field_pr.is_bound());
}
boolean SCCP__param__SequencingSegmenting::is_value() const
{
return field_reserved.is_value()
  && field_p__s.is_value()
  && field_more.is_value()
  && field_pr.is_value();
}
void SCCP__param__SequencingSegmenting::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", p_s := ");
field_p__s.log();
TTCN_Logger::log_event_str(", more := ");
field_more.log();
TTCN_Logger::log_event_str(", pr := ");
field_pr.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__SequencingSegmenting::set_implicit_omit()
{
if (reserved().is_bound()) reserved().set_implicit_omit();
if (p__s().is_bound()) p__s().set_implicit_omit();
if (more().is_bound()) more().set_implicit_omit();
if (pr().is_bound()) pr().set_implicit_omit();
}

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

void SCCP__param__SequencingSegmenting::encode_text(Text_Buf& text_buf) const
{
field_reserved.encode_text(text_buf);
field_p__s.encode_text(text_buf);
field_more.encode_text(text_buf);
field_pr.encode_text(text_buf);
}

void SCCP__param__SequencingSegmenting::decode_text(Text_Buf& text_buf)
{
field_reserved.decode_text(text_buf);
field_p__s.decode_text(text_buf);
field_more.decode_text(text_buf);
field_pr.decode_text(text_buf);
}

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

int SCCP__param__SequencingSegmenting::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::BIT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT7_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT7_descr_.raw);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_p__s.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_more.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_pr.RAW_encode(General__Types::BIT7_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct SCCP__param__SequencingSegmenting_template::single_value_struct {
BITSTRING_template field_reserved;
BITSTRING_template field_p__s;
BITSTRING_template field_more;
BITSTRING_template field_pr;
};

void SCCP__param__SequencingSegmenting_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_reserved = ANY_VALUE;
single_value->field_p__s = ANY_VALUE;
single_value->field_more = ANY_VALUE;
single_value->field_pr = ANY_VALUE;
}
}
}

void SCCP__param__SequencingSegmenting_template::copy_value(const SCCP__param__SequencingSegmenting& other_value)
{
single_value = new single_value_struct;
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.p__s().is_bound()) {
  single_value->field_p__s = other_value.p__s();
} else {
  single_value->field_p__s.clean_up();
}
if (other_value.more().is_bound()) {
  single_value->field_more = other_value.more();
} else {
  single_value->field_more.clean_up();
}
if (other_value.pr().is_bound()) {
  single_value->field_pr = other_value.pr();
} else {
  single_value->field_pr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__SequencingSegmenting_template::copy_template(const SCCP__param__SequencingSegmenting_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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.p__s().get_selection()) {
single_value->field_p__s = other_value.p__s();
} else {
single_value->field_p__s.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.more().get_selection()) {
single_value->field_more = other_value.more();
} else {
single_value->field_more.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pr().get_selection()) {
single_value->field_pr = other_value.pr();
} else {
single_value->field_pr.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 SCCP__param__SequencingSegmenting_template[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 SCCP__param__SequencingSegmenting_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__SequencingSegmenting_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 @SCCP_Types.SCCP_param_SequencingSegmenting.");
break;
}
set_selection(other_value);
}

SCCP__param__SequencingSegmenting_template::SCCP__param__SequencingSegmenting_template()
{
}

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

SCCP__param__SequencingSegmenting_template::SCCP__param__SequencingSegmenting_template(const SCCP__param__SequencingSegmenting& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__SequencingSegmenting_template::match(const SCCP__param__SequencingSegmenting& 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.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.p__s().is_bound()) return FALSE;
if(!single_value->field_p__s.match(other_value.p__s(), legacy))return FALSE;
if(!other_value.more().is_bound()) return FALSE;
if(!single_value->field_more.match(other_value.more(), legacy))return FALSE;
if(!other_value.pr().is_bound()) return FALSE;
if(!single_value->field_pr.match(other_value.pr(), 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 @SCCP_Types.SCCP_param_SequencingSegmenting.");
}
return FALSE;
}

boolean SCCP__param__SequencingSegmenting_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_reserved.is_bound()
 || single_value->field_p__s.is_bound()
 || single_value->field_more.is_bound()
 || single_value->field_pr.is_bound();
}

boolean SCCP__param__SequencingSegmenting_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_reserved.is_value()
 && single_value->field_p__s.is_value()
 && single_value->field_more.is_value()
 && single_value->field_pr.is_value();
}

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

SCCP__param__SequencingSegmenting SCCP__param__SequencingSegmenting_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 @SCCP_Types.SCCP_param_SequencingSegmenting.");
SCCP__param__SequencingSegmenting ret_val;
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_p__s.is_bound()) {
ret_val.p__s() = single_value->field_p__s.valueof();
}
if (single_value->field_more.is_bound()) {
ret_val.more() = single_value->field_more.valueof();
}
if (single_value->field_pr.is_bound()) {
ret_val.pr() = single_value->field_pr.valueof();
}
return ret_val;
}

void SCCP__param__SequencingSegmenting_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 @SCCP_Types.SCCP_param_SequencingSegmenting.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__SequencingSegmenting_template[list_length];
}

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

BITSTRING_template& SCCP__param__SequencingSegmenting_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__param__SequencingSegmenting_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_param_SequencingSegmenting.");
return single_value->field_reserved;
}

BITSTRING_template& SCCP__param__SequencingSegmenting_template::p__s()
{
set_specific();
return single_value->field_p__s;
}

const BITSTRING_template& SCCP__param__SequencingSegmenting_template::p__s() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_s of a non-specific template of type @SCCP_Types.SCCP_param_SequencingSegmenting.");
return single_value->field_p__s;
}

BITSTRING_template& SCCP__param__SequencingSegmenting_template::more()
{
set_specific();
return single_value->field_more;
}

const BITSTRING_template& SCCP__param__SequencingSegmenting_template::more() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field more of a non-specific template of type @SCCP_Types.SCCP_param_SequencingSegmenting.");
return single_value->field_more;
}

BITSTRING_template& SCCP__param__SequencingSegmenting_template::pr()
{
set_specific();
return single_value->field_pr;
}

const BITSTRING_template& SCCP__param__SequencingSegmenting_template::pr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pr of a non-specific template of type @SCCP_Types.SCCP_param_SequencingSegmenting.");
return single_value->field_pr;
}

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

void SCCP__param__SequencingSegmenting_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", p_s := ");
single_value->field_p__s.log();
TTCN_Logger::log_event_str(", more := ");
single_value->field_more.log();
TTCN_Logger::log_event_str(", pr := ");
single_value->field_pr.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 SCCP__param__SequencingSegmenting_template::log_match(const SCCP__param__SequencingSegmenting& 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_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_p__s.match(match_value.p__s(), legacy)){
TTCN_Logger::log_logmatch_info(".p_s");
single_value->field_p__s.log_match(match_value.p__s(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_more.match(match_value.more(), legacy)){
TTCN_Logger::log_logmatch_info(".more");
single_value->field_more.log_match(match_value.more(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pr.match(match_value.pr(), legacy)){
TTCN_Logger::log_logmatch_info(".pr");
single_value->field_pr.log_match(match_value.pr(), 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("{ reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", p_s := ");
single_value->field_p__s.log_match(match_value.p__s(), legacy);
TTCN_Logger::log_event_str(", more := ");
single_value->field_more.log_match(match_value.more(), legacy);
TTCN_Logger::log_event_str(", pr := ");
single_value->field_pr.log_match(match_value.pr(), 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 SCCP__param__SequencingSegmenting_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (reserved().is_bound()) reserved().set_implicit_omit();
if (p__s().is_bound()) p__s().set_implicit_omit();
if (more().is_bound()) more().set_implicit_omit();
if (pr().is_bound()) pr().set_implicit_omit();
}

void SCCP__param__SequencingSegmenting_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_reserved.encode_text(text_buf);
single_value->field_p__s.encode_text(text_buf);
single_value->field_more.encode_text(text_buf);
single_value->field_pr.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 @SCCP_Types.SCCP_param_SequencingSegmenting.");
}
}

void SCCP__param__SequencingSegmenting_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_reserved.decode_text(text_buf);
single_value->field_p__s.decode_text(text_buf);
single_value->field_more.decode_text(text_buf);
single_value->field_pr.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 SCCP__param__SequencingSegmenting_template[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 @SCCP_Types.SCCP_param_SequencingSegmenting.");
}
}

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

void SCCP__param__SequencingSegmenting_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_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_SequencingSegmenting");
single_value->field_p__s.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_SequencingSegmenting");
single_value->field_more.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_SequencingSegmenting");
single_value->field_pr.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_SequencingSegmenting");
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 : "@SCCP_Types.SCCP_param_SequencingSegmenting");
}

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

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

SCCP__param__Credit__opt::SCCP__param__Credit__opt()
{
}

SCCP__param__Credit__opt::SCCP__param__Credit__opt(const INTEGER& par_paramName,
    const INTEGER& par_paramLength,
    const OCTETSTRING& par_credit)
  :   field_paramName(par_paramName),
  field_paramLength(par_paramLength),
  field_credit(par_credit)
{
}

SCCP__param__Credit__opt::SCCP__param__Credit__opt(const SCCP__param__Credit__opt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_Credit_opt.");
if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
else field_paramName.clean_up();
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.credit().is_bound()) field_credit = other_value.credit();
else field_credit.clean_up();
}

void SCCP__param__Credit__opt::clean_up()
{
field_paramName.clean_up();
field_paramLength.clean_up();
field_credit.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__Credit__opt::get_descriptor() const { return &SCCP__param__Credit__opt_descr_; }
SCCP__param__Credit__opt& SCCP__param__Credit__opt::operator=(const SCCP__param__Credit__opt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_Credit_opt.");
  if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
  else field_paramName.clean_up();
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.credit().is_bound()) field_credit = other_value.credit();
  else field_credit.clean_up();
}
return *this;
}

boolean SCCP__param__Credit__opt::operator==(const SCCP__param__Credit__opt& other_value) const
{
return field_paramName==other_value.field_paramName
  && field_paramLength==other_value.field_paramLength
  && field_credit==other_value.field_credit;
}

boolean SCCP__param__Credit__opt::is_bound() const
{
return (field_paramName.is_bound())
  || (field_paramLength.is_bound())
  || (field_credit.is_bound());
}
boolean SCCP__param__Credit__opt::is_value() const
{
return field_paramName.is_value()
  && field_paramLength.is_value()
  && field_credit.is_value();
}
void SCCP__param__Credit__opt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramName := ");
field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", credit := ");
field_credit.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__Credit__opt::set_implicit_omit()
{
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (credit().is_bound()) credit().set_implicit_omit();
}

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

void SCCP__param__Credit__opt::encode_text(Text_Buf& text_buf) const
{
field_paramName.encode_text(text_buf);
field_paramLength.encode_text(text_buf);
field_credit.encode_text(text_buf);
}

void SCCP__param__Credit__opt::decode_text(Text_Buf& text_buf)
{
field_paramName.decode_text(text_buf);
field_paramLength.decode_text(text_buf);
field_credit.decode_text(text_buf);
}

void SCCP__param__Credit__opt::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 SCCP__param__Credit__opt::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 SCCP__param__Credit__opt::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, SCCP__field__ParameterName_descr_.raw->forceomit);
  decoded_field_length = field_paramName.RAW_decode(SCCP__field__ParameterName_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::LIN1_descr_.raw->forceomit);
  decoded_field_length = field_paramLength.RAW_decode(General__Types::LIN1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_credit.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__param__Credit__opt::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, SCCP__field__ParameterName_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::LIN1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::OCT1_descr_.raw);
  encoded_length += field_paramName.RAW_encode(SCCP__field__ParameterName_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_paramLength.RAW_encode(General__Types::LIN1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_credit.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct SCCP__param__Credit__opt_template::single_value_struct {
INTEGER_template field_paramName;
INTEGER_template field_paramLength;
OCTETSTRING_template field_credit;
};

void SCCP__param__Credit__opt_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_paramName = ANY_VALUE;
single_value->field_paramLength = ANY_VALUE;
single_value->field_credit = ANY_VALUE;
}
}
}

void SCCP__param__Credit__opt_template::copy_value(const SCCP__param__Credit__opt& other_value)
{
single_value = new single_value_struct;
if (other_value.paramName().is_bound()) {
  single_value->field_paramName = other_value.paramName();
} else {
  single_value->field_paramName.clean_up();
}
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.credit().is_bound()) {
  single_value->field_credit = other_value.credit();
} else {
  single_value->field_credit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__Credit__opt_template::copy_template(const SCCP__param__Credit__opt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramName().get_selection()) {
single_value->field_paramName = other_value.paramName();
} else {
single_value->field_paramName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.credit().get_selection()) {
single_value->field_credit = other_value.credit();
} else {
single_value->field_credit.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 SCCP__param__Credit__opt_template[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 SCCP__param__Credit__opt_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__Credit__opt_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 @SCCP_Types.SCCP_param_Credit_opt.");
break;
}
set_selection(other_value);
}

SCCP__param__Credit__opt_template::SCCP__param__Credit__opt_template()
{
}

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

SCCP__param__Credit__opt_template::SCCP__param__Credit__opt_template(const SCCP__param__Credit__opt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__Credit__opt_template::match(const SCCP__param__Credit__opt& 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.paramName().is_bound()) return FALSE;
if(!single_value->field_paramName.match(other_value.paramName(), legacy))return FALSE;
if(!other_value.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.credit().is_bound()) return FALSE;
if(!single_value->field_credit.match(other_value.credit(), 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 @SCCP_Types.SCCP_param_Credit_opt.");
}
return FALSE;
}

boolean SCCP__param__Credit__opt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_paramName.is_bound()
 || single_value->field_paramLength.is_bound()
 || single_value->field_credit.is_bound();
}

boolean SCCP__param__Credit__opt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramName.is_value()
 && single_value->field_paramLength.is_value()
 && single_value->field_credit.is_value();
}

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

SCCP__param__Credit__opt SCCP__param__Credit__opt_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 @SCCP_Types.SCCP_param_Credit_opt.");
SCCP__param__Credit__opt ret_val;
if (single_value->field_paramName.is_bound()) {
ret_val.paramName() = single_value->field_paramName.valueof();
}
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_credit.is_bound()) {
ret_val.credit() = single_value->field_credit.valueof();
}
return ret_val;
}

void SCCP__param__Credit__opt_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 @SCCP_Types.SCCP_param_Credit_opt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__Credit__opt_template[list_length];
}

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

INTEGER_template& SCCP__param__Credit__opt_template::paramName()
{
set_specific();
return single_value->field_paramName;
}

const INTEGER_template& SCCP__param__Credit__opt_template::paramName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramName of a non-specific template of type @SCCP_Types.SCCP_param_Credit_opt.");
return single_value->field_paramName;
}

INTEGER_template& SCCP__param__Credit__opt_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__Credit__opt_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_Credit_opt.");
return single_value->field_paramLength;
}

OCTETSTRING_template& SCCP__param__Credit__opt_template::credit()
{
set_specific();
return single_value->field_credit;
}

const OCTETSTRING_template& SCCP__param__Credit__opt_template::credit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field credit of a non-specific template of type @SCCP_Types.SCCP_param_Credit_opt.");
return single_value->field_credit;
}

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

void SCCP__param__Credit__opt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramName := ");
single_value->field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", credit := ");
single_value->field_credit.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 SCCP__param__Credit__opt_template::log_match(const SCCP__param__Credit__opt& 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_paramName.match(match_value.paramName(), legacy)){
TTCN_Logger::log_logmatch_info(".paramName");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_credit.match(match_value.credit(), legacy)){
TTCN_Logger::log_logmatch_info(".credit");
single_value->field_credit.log_match(match_value.credit(), 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("{ paramName := ");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", credit := ");
single_value->field_credit.log_match(match_value.credit(), 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 SCCP__param__Credit__opt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (credit().is_bound()) credit().set_implicit_omit();
}

void SCCP__param__Credit__opt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramName.encode_text(text_buf);
single_value->field_paramLength.encode_text(text_buf);
single_value->field_credit.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 @SCCP_Types.SCCP_param_Credit_opt.");
}
}

void SCCP__param__Credit__opt_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_paramName.decode_text(text_buf);
single_value->field_paramLength.decode_text(text_buf);
single_value->field_credit.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 SCCP__param__Credit__opt_template[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 @SCCP_Types.SCCP_param_Credit_opt.");
}
}

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

void SCCP__param__Credit__opt_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_paramName.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Credit_opt");
single_value->field_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Credit_opt");
single_value->field_credit.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Credit_opt");
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 : "@SCCP_Types.SCCP_param_Credit_opt");
}

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

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

SCCP__param__Data::SCCP__param__Data()
{
}

SCCP__param__Data::SCCP__param__Data(const INTEGER& par_paramLength,
    const OCTETSTRING& par_data)
  :   field_paramLength(par_paramLength),
  field_data(par_data)
{
}

SCCP__param__Data::SCCP__param__Data(const SCCP__param__Data& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_Data.");
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void SCCP__param__Data::clean_up()
{
field_paramLength.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__Data::get_descriptor() const { return &SCCP__param__Data_descr_; }
SCCP__param__Data& SCCP__param__Data::operator=(const SCCP__param__Data& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_Data.");
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean SCCP__param__Data::operator==(const SCCP__param__Data& other_value) const
{
return field_paramLength==other_value.field_paramLength
  && field_data==other_value.field_data;
}

boolean SCCP__param__Data::is_bound() const
{
return (field_paramLength.is_bound())
  || (field_data.is_bound());
}
boolean SCCP__param__Data::is_value() const
{
return field_paramLength.is_value()
  && field_data.is_value();
}
void SCCP__param__Data::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__Data::set_implicit_omit()
{
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void SCCP__param__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 (2<param.get_size()) {
      param.error("record value of type @SCCP_Types.SCCP_param_Data 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) paramLength().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paramLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.SCCP_param_Data: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_param_Data");
  }
}

void SCCP__param__Data::encode_text(Text_Buf& text_buf) const
{
field_paramLength.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void SCCP__param__Data::decode_text(Text_Buf& text_buf)
{
field_paramLength.decode_text(text_buf);
field_data.decode_text(text_buf);
}

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

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

struct SCCP__param__Data_template::single_value_struct {
INTEGER_template field_paramLength;
OCTETSTRING_template field_data;
};

void SCCP__param__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_paramLength = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void SCCP__param__Data_template::copy_value(const SCCP__param__Data& other_value)
{
single_value = new single_value_struct;
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__Data_template::copy_template(const SCCP__param__Data_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 SCCP__param__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 SCCP__param__Data_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__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 @SCCP_Types.SCCP_param_Data.");
break;
}
set_selection(other_value);
}

SCCP__param__Data_template::SCCP__param__Data_template()
{
}

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

SCCP__param__Data_template::SCCP__param__Data_template(const SCCP__param__Data& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

SCCP__param__Data_template& SCCP__param__Data_template::operator=(const OPTIONAL<SCCP__param__Data>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SCCP__param__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 @SCCP_Types.SCCP_param_Data.");
}
return *this;
}

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

boolean SCCP__param__Data_template::match(const SCCP__param__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.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.SCCP_param_Data.");
}
return FALSE;
}

boolean SCCP__param__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_paramLength.is_bound()
 || single_value->field_data.is_bound();
}

boolean SCCP__param__Data_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramLength.is_value()
 && single_value->field_data.is_value();
}

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

SCCP__param__Data SCCP__param__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 @SCCP_Types.SCCP_param_Data.");
SCCP__param__Data ret_val;
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void SCCP__param__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 @SCCP_Types.SCCP_param_Data.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__Data_template[list_length];
}

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

INTEGER_template& SCCP__param__Data_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__Data_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_Data.");
return single_value->field_paramLength;
}

OCTETSTRING_template& SCCP__param__Data_template::data()
{
set_specific();
return single_value->field_data;
}

const OCTETSTRING_template& SCCP__param__Data_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.SCCP_param_Data.");
return single_value->field_data;
}

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

void SCCP__param__Data_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 SCCP__param__Data_template::log_match(const SCCP__param__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_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 SCCP__param__Data_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void SCCP__param__Data_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramLength.encode_text(text_buf);
single_value->field_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 @SCCP_Types.SCCP_param_Data.");
}
}

void SCCP__param__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_paramLength.decode_text(text_buf);
single_value->field_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 SCCP__param__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 @SCCP_Types.SCCP_param_Data.");
}
}

void SCCP__param__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: {
    SCCP__param__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 (2<param.get_size()) {
      param.error("record template of type @SCCP_Types.SCCP_param_Data 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) paramLength().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paramLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.SCCP_param_Data: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__param__Data_template* precondition = new SCCP__param__Data_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__param__Data_template* implied_template = new SCCP__param__Data_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__param__Data_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_param_Data");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__param__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_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Data");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_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 : "@SCCP_Types.SCCP_param_Data");
}

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

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

SCCP__param__Data__opt::SCCP__param__Data__opt()
{
}

SCCP__param__Data__opt::SCCP__param__Data__opt(const INTEGER& par_paramName,
    const INTEGER& par_paramLength,
    const OCTETSTRING& par_data)
  :   field_paramName(par_paramName),
  field_paramLength(par_paramLength),
  field_data(par_data)
{
}

SCCP__param__Data__opt::SCCP__param__Data__opt(const SCCP__param__Data__opt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_Data_opt.");
if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
else field_paramName.clean_up();
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void SCCP__param__Data__opt::clean_up()
{
field_paramName.clean_up();
field_paramLength.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__Data__opt::get_descriptor() const { return &SCCP__param__Data__opt_descr_; }
SCCP__param__Data__opt& SCCP__param__Data__opt::operator=(const SCCP__param__Data__opt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_Data_opt.");
  if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
  else field_paramName.clean_up();
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean SCCP__param__Data__opt::operator==(const SCCP__param__Data__opt& other_value) const
{
return field_paramName==other_value.field_paramName
  && field_paramLength==other_value.field_paramLength
  && field_data==other_value.field_data;
}

boolean SCCP__param__Data__opt::is_bound() const
{
return (field_paramName.is_bound())
  || (field_paramLength.is_bound())
  || (field_data.is_bound());
}
boolean SCCP__param__Data__opt::is_value() const
{
return field_paramName.is_value()
  && field_paramLength.is_value()
  && field_data.is_value();
}
void SCCP__param__Data__opt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramName := ");
field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__Data__opt::set_implicit_omit()
{
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

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

void SCCP__param__Data__opt::encode_text(Text_Buf& text_buf) const
{
field_paramName.encode_text(text_buf);
field_paramLength.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void SCCP__param__Data__opt::decode_text(Text_Buf& text_buf)
{
field_paramName.decode_text(text_buf);
field_paramLength.decode_text(text_buf);
field_data.decode_text(text_buf);
}

void SCCP__param__Data__opt::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 SCCP__param__Data__opt::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 SCCP__param__Data__opt::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, SCCP__field__ParameterName_descr_.raw->forceomit);
  decoded_field_length = field_paramName.RAW_decode(SCCP__field__ParameterName_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, SCCP__param__Data__opt_paramLength_descr_.raw->forceomit);
  decoded_field_length = field_paramLength.RAW_decode(SCCP__param__Data__opt_paramLength_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_paramLength.convert_to_Integer(SCCP__param__Data__opt_paramLength_descr_);
  field_paramLength = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::OCTN_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(General__Types::OCTN_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct SCCP__param__Data__opt_template::single_value_struct {
INTEGER_template field_paramName;
INTEGER_template field_paramLength;
OCTETSTRING_template field_data;
};

void SCCP__param__Data__opt_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_paramName = ANY_VALUE;
single_value->field_paramLength = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void SCCP__param__Data__opt_template::copy_value(const SCCP__param__Data__opt& other_value)
{
single_value = new single_value_struct;
if (other_value.paramName().is_bound()) {
  single_value->field_paramName = other_value.paramName();
} else {
  single_value->field_paramName.clean_up();
}
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__Data__opt_template::copy_template(const SCCP__param__Data__opt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramName().get_selection()) {
single_value->field_paramName = other_value.paramName();
} else {
single_value->field_paramName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 SCCP__param__Data__opt_template[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 SCCP__param__Data__opt_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__Data__opt_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 @SCCP_Types.SCCP_param_Data_opt.");
break;
}
set_selection(other_value);
}

SCCP__param__Data__opt_template::SCCP__param__Data__opt_template()
{
}

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

SCCP__param__Data__opt_template::SCCP__param__Data__opt_template(const SCCP__param__Data__opt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__Data__opt_template::match(const SCCP__param__Data__opt& 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.paramName().is_bound()) return FALSE;
if(!single_value->field_paramName.match(other_value.paramName(), legacy))return FALSE;
if(!other_value.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.SCCP_param_Data_opt.");
}
return FALSE;
}

boolean SCCP__param__Data__opt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_paramName.is_bound()
 || single_value->field_paramLength.is_bound()
 || single_value->field_data.is_bound();
}

boolean SCCP__param__Data__opt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramName.is_value()
 && single_value->field_paramLength.is_value()
 && single_value->field_data.is_value();
}

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

SCCP__param__Data__opt SCCP__param__Data__opt_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 @SCCP_Types.SCCP_param_Data_opt.");
SCCP__param__Data__opt ret_val;
if (single_value->field_paramName.is_bound()) {
ret_val.paramName() = single_value->field_paramName.valueof();
}
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void SCCP__param__Data__opt_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 @SCCP_Types.SCCP_param_Data_opt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__Data__opt_template[list_length];
}

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

INTEGER_template& SCCP__param__Data__opt_template::paramName()
{
set_specific();
return single_value->field_paramName;
}

const INTEGER_template& SCCP__param__Data__opt_template::paramName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramName of a non-specific template of type @SCCP_Types.SCCP_param_Data_opt.");
return single_value->field_paramName;
}

INTEGER_template& SCCP__param__Data__opt_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__Data__opt_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_Data_opt.");
return single_value->field_paramLength;
}

OCTETSTRING_template& SCCP__param__Data__opt_template::data()
{
set_specific();
return single_value->field_data;
}

const OCTETSTRING_template& SCCP__param__Data__opt_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.SCCP_param_Data_opt.");
return single_value->field_data;
}

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

void SCCP__param__Data__opt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramName := ");
single_value->field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 SCCP__param__Data__opt_template::log_match(const SCCP__param__Data__opt& 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_paramName.match(match_value.paramName(), legacy)){
TTCN_Logger::log_logmatch_info(".paramName");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ paramName := ");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 SCCP__param__Data__opt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void SCCP__param__Data__opt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramName.encode_text(text_buf);
single_value->field_paramLength.encode_text(text_buf);
single_value->field_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 @SCCP_Types.SCCP_param_Data_opt.");
}
}

void SCCP__param__Data__opt_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_paramName.decode_text(text_buf);
single_value->field_paramLength.decode_text(text_buf);
single_value->field_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 SCCP__param__Data__opt_template[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 @SCCP_Types.SCCP_param_Data_opt.");
}
}

void SCCP__param__Data__opt_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: {
    SCCP__param__Data__opt_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 @SCCP_Types.SCCP_param_Data_opt 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) paramName().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) paramLength().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) 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(), "paramName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paramLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.SCCP_param_Data_opt: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__param__Data__opt_template* precondition = new SCCP__param__Data__opt_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__param__Data__opt_template* implied_template = new SCCP__param__Data__opt_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__param__Data__opt_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_param_Data_opt");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__param__Data__opt_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_paramName.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Data_opt");
single_value->field_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Data_opt");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Data_opt");
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 : "@SCCP_Types.SCCP_param_Data_opt");
}

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

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

SCCP__param__Segmentation__opt::SCCP__param__Segmentation__opt()
{
}

SCCP__param__Segmentation__opt::SCCP__param__Segmentation__opt(const INTEGER& par_paramName,
    const INTEGER& par_paramLength,
    const BITSTRING& par_remainingSegment,
    const BITSTRING& par_reserved,
    const BITSTRING& par_class_,
    const BITSTRING& par_firstSegm,
    const OCTETSTRING& par_segmLocalRef)
  :   field_paramName(par_paramName),
  field_paramLength(par_paramLength),
  field_remainingSegment(par_remainingSegment),
  field_reserved(par_reserved),
  field_class_(par_class_),
  field_firstSegm(par_firstSegm),
  field_segmLocalRef(par_segmLocalRef)
{
}

SCCP__param__Segmentation__opt::SCCP__param__Segmentation__opt(const SCCP__param__Segmentation__opt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_Segmentation_opt.");
if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
else field_paramName.clean_up();
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.remainingSegment().is_bound()) field_remainingSegment = other_value.remainingSegment();
else field_remainingSegment.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.class_().is_bound()) field_class_ = other_value.class_();
else field_class_.clean_up();
if (other_value.firstSegm().is_bound()) field_firstSegm = other_value.firstSegm();
else field_firstSegm.clean_up();
if (other_value.segmLocalRef().is_bound()) field_segmLocalRef = other_value.segmLocalRef();
else field_segmLocalRef.clean_up();
}

void SCCP__param__Segmentation__opt::clean_up()
{
field_paramName.clean_up();
field_paramLength.clean_up();
field_remainingSegment.clean_up();
field_reserved.clean_up();
field_class_.clean_up();
field_firstSegm.clean_up();
field_segmLocalRef.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__Segmentation__opt::get_descriptor() const { return &SCCP__param__Segmentation__opt_descr_; }
SCCP__param__Segmentation__opt& SCCP__param__Segmentation__opt::operator=(const SCCP__param__Segmentation__opt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_Segmentation_opt.");
  if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
  else field_paramName.clean_up();
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.remainingSegment().is_bound()) field_remainingSegment = other_value.remainingSegment();
  else field_remainingSegment.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.class_().is_bound()) field_class_ = other_value.class_();
  else field_class_.clean_up();
  if (other_value.firstSegm().is_bound()) field_firstSegm = other_value.firstSegm();
  else field_firstSegm.clean_up();
  if (other_value.segmLocalRef().is_bound()) field_segmLocalRef = other_value.segmLocalRef();
  else field_segmLocalRef.clean_up();
}
return *this;
}

boolean SCCP__param__Segmentation__opt::operator==(const SCCP__param__Segmentation__opt& other_value) const
{
return field_paramName==other_value.field_paramName
  && field_paramLength==other_value.field_paramLength
  && field_remainingSegment==other_value.field_remainingSegment
  && field_reserved==other_value.field_reserved
  && field_class_==other_value.field_class_
  && field_firstSegm==other_value.field_firstSegm
  && field_segmLocalRef==other_value.field_segmLocalRef;
}

boolean SCCP__param__Segmentation__opt::is_bound() const
{
return (field_paramName.is_bound())
  || (field_paramLength.is_bound())
  || (field_remainingSegment.is_bound())
  || (field_reserved.is_bound())
  || (field_class_.is_bound())
  || (field_firstSegm.is_bound())
  || (field_segmLocalRef.is_bound());
}
boolean SCCP__param__Segmentation__opt::is_value() const
{
return field_paramName.is_value()
  && field_paramLength.is_value()
  && field_remainingSegment.is_value()
  && field_reserved.is_value()
  && field_class_.is_value()
  && field_firstSegm.is_value()
  && field_segmLocalRef.is_value();
}
void SCCP__param__Segmentation__opt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramName := ");
field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", remainingSegment := ");
field_remainingSegment.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", class := ");
field_class_.log();
TTCN_Logger::log_event_str(", firstSegm := ");
field_firstSegm.log();
TTCN_Logger::log_event_str(", segmLocalRef := ");
field_segmLocalRef.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__Segmentation__opt::set_implicit_omit()
{
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (remainingSegment().is_bound()) remainingSegment().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (class_().is_bound()) class_().set_implicit_omit();
if (firstSegm().is_bound()) firstSegm().set_implicit_omit();
if (segmLocalRef().is_bound()) segmLocalRef().set_implicit_omit();
}

void SCCP__param__Segmentation__opt::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @SCCP_Types.SCCP_param_Segmentation_opt 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) paramName().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) paramLength().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) remainingSegment().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) class_().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) firstSegm().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) segmLocalRef().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(), "paramName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paramLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "remainingSegment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          remainingSegment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "class")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          class_().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "firstSegm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          firstSegm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "segmLocalRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          segmLocalRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_param_Segmentation_opt: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_param_Segmentation_opt");
  }
}

void SCCP__param__Segmentation__opt::encode_text(Text_Buf& text_buf) const
{
field_paramName.encode_text(text_buf);
field_paramLength.encode_text(text_buf);
field_remainingSegment.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_class_.encode_text(text_buf);
field_firstSegm.encode_text(text_buf);
field_segmLocalRef.encode_text(text_buf);
}

void SCCP__param__Segmentation__opt::decode_text(Text_Buf& text_buf)
{
field_paramName.decode_text(text_buf);
field_paramLength.decode_text(text_buf);
field_remainingSegment.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_class_.decode_text(text_buf);
field_firstSegm.decode_text(text_buf);
field_segmLocalRef.decode_text(text_buf);
}

void SCCP__param__Segmentation__opt::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 SCCP__param__Segmentation__opt::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 SCCP__param__Segmentation__opt::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, SCCP__field__ParameterName_descr_.raw->forceomit);
  decoded_field_length = field_paramName.RAW_decode(SCCP__field__ParameterName_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::LIN1_descr_.raw->forceomit);
  decoded_field_length = field_paramLength.RAW_decode(General__Types::LIN1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_remainingSegment.RAW_decode(General__Types::BIT4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT2_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(General__Types::BIT2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_class_.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_firstSegm.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::OCT3_descr_.raw->forceomit);
  decoded_field_length = field_segmLocalRef.RAW_decode(General__Types::OCT3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__param__Segmentation__opt::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, SCCP__field__ParameterName_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::LIN1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT2_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::OCT3_descr_.raw);
  encoded_length += field_paramName.RAW_encode(SCCP__field__ParameterName_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_paramLength.RAW_encode(General__Types::LIN1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_remainingSegment.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_class_.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_firstSegm.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_segmLocalRef.RAW_encode(General__Types::OCT3_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct SCCP__param__Segmentation__opt_template::single_value_struct {
INTEGER_template field_paramName;
INTEGER_template field_paramLength;
BITSTRING_template field_remainingSegment;
BITSTRING_template field_reserved;
BITSTRING_template field_class_;
BITSTRING_template field_firstSegm;
OCTETSTRING_template field_segmLocalRef;
};

void SCCP__param__Segmentation__opt_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_paramName = ANY_VALUE;
single_value->field_paramLength = ANY_VALUE;
single_value->field_remainingSegment = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_class_ = ANY_VALUE;
single_value->field_firstSegm = ANY_VALUE;
single_value->field_segmLocalRef = ANY_VALUE;
}
}
}

void SCCP__param__Segmentation__opt_template::copy_value(const SCCP__param__Segmentation__opt& other_value)
{
single_value = new single_value_struct;
if (other_value.paramName().is_bound()) {
  single_value->field_paramName = other_value.paramName();
} else {
  single_value->field_paramName.clean_up();
}
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.remainingSegment().is_bound()) {
  single_value->field_remainingSegment = other_value.remainingSegment();
} else {
  single_value->field_remainingSegment.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.class_().is_bound()) {
  single_value->field_class_ = other_value.class_();
} else {
  single_value->field_class_.clean_up();
}
if (other_value.firstSegm().is_bound()) {
  single_value->field_firstSegm = other_value.firstSegm();
} else {
  single_value->field_firstSegm.clean_up();
}
if (other_value.segmLocalRef().is_bound()) {
  single_value->field_segmLocalRef = other_value.segmLocalRef();
} else {
  single_value->field_segmLocalRef.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__Segmentation__opt_template::copy_template(const SCCP__param__Segmentation__opt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramName().get_selection()) {
single_value->field_paramName = other_value.paramName();
} else {
single_value->field_paramName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.remainingSegment().get_selection()) {
single_value->field_remainingSegment = other_value.remainingSegment();
} else {
single_value->field_remainingSegment.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.class_().get_selection()) {
single_value->field_class_ = other_value.class_();
} else {
single_value->field_class_.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.firstSegm().get_selection()) {
single_value->field_firstSegm = other_value.firstSegm();
} else {
single_value->field_firstSegm.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.segmLocalRef().get_selection()) {
single_value->field_segmLocalRef = other_value.segmLocalRef();
} else {
single_value->field_segmLocalRef.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 SCCP__param__Segmentation__opt_template[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 SCCP__param__Segmentation__opt_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__Segmentation__opt_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 @SCCP_Types.SCCP_param_Segmentation_opt.");
break;
}
set_selection(other_value);
}

SCCP__param__Segmentation__opt_template::SCCP__param__Segmentation__opt_template()
{
}

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

SCCP__param__Segmentation__opt_template::SCCP__param__Segmentation__opt_template(const SCCP__param__Segmentation__opt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__Segmentation__opt_template::match(const SCCP__param__Segmentation__opt& 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.paramName().is_bound()) return FALSE;
if(!single_value->field_paramName.match(other_value.paramName(), legacy))return FALSE;
if(!other_value.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.remainingSegment().is_bound()) return FALSE;
if(!single_value->field_remainingSegment.match(other_value.remainingSegment(), 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.class_().is_bound()) return FALSE;
if(!single_value->field_class_.match(other_value.class_(), legacy))return FALSE;
if(!other_value.firstSegm().is_bound()) return FALSE;
if(!single_value->field_firstSegm.match(other_value.firstSegm(), legacy))return FALSE;
if(!other_value.segmLocalRef().is_bound()) return FALSE;
if(!single_value->field_segmLocalRef.match(other_value.segmLocalRef(), 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 @SCCP_Types.SCCP_param_Segmentation_opt.");
}
return FALSE;
}

boolean SCCP__param__Segmentation__opt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_paramName.is_bound()
 || single_value->field_paramLength.is_bound()
 || single_value->field_remainingSegment.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_class_.is_bound()
 || single_value->field_firstSegm.is_bound()
 || single_value->field_segmLocalRef.is_bound();
}

boolean SCCP__param__Segmentation__opt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramName.is_value()
 && single_value->field_paramLength.is_value()
 && single_value->field_remainingSegment.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_class_.is_value()
 && single_value->field_firstSegm.is_value()
 && single_value->field_segmLocalRef.is_value();
}

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

SCCP__param__Segmentation__opt SCCP__param__Segmentation__opt_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 @SCCP_Types.SCCP_param_Segmentation_opt.");
SCCP__param__Segmentation__opt ret_val;
if (single_value->field_paramName.is_bound()) {
ret_val.paramName() = single_value->field_paramName.valueof();
}
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_remainingSegment.is_bound()) {
ret_val.remainingSegment() = single_value->field_remainingSegment.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_class_.is_bound()) {
ret_val.class_() = single_value->field_class_.valueof();
}
if (single_value->field_firstSegm.is_bound()) {
ret_val.firstSegm() = single_value->field_firstSegm.valueof();
}
if (single_value->field_segmLocalRef.is_bound()) {
ret_val.segmLocalRef() = single_value->field_segmLocalRef.valueof();
}
return ret_val;
}

void SCCP__param__Segmentation__opt_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 @SCCP_Types.SCCP_param_Segmentation_opt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__Segmentation__opt_template[list_length];
}

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

INTEGER_template& SCCP__param__Segmentation__opt_template::paramName()
{
set_specific();
return single_value->field_paramName;
}

const INTEGER_template& SCCP__param__Segmentation__opt_template::paramName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramName of a non-specific template of type @SCCP_Types.SCCP_param_Segmentation_opt.");
return single_value->field_paramName;
}

INTEGER_template& SCCP__param__Segmentation__opt_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__Segmentation__opt_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_Segmentation_opt.");
return single_value->field_paramLength;
}

BITSTRING_template& SCCP__param__Segmentation__opt_template::remainingSegment()
{
set_specific();
return single_value->field_remainingSegment;
}

const BITSTRING_template& SCCP__param__Segmentation__opt_template::remainingSegment() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field remainingSegment of a non-specific template of type @SCCP_Types.SCCP_param_Segmentation_opt.");
return single_value->field_remainingSegment;
}

BITSTRING_template& SCCP__param__Segmentation__opt_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__param__Segmentation__opt_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_param_Segmentation_opt.");
return single_value->field_reserved;
}

BITSTRING_template& SCCP__param__Segmentation__opt_template::class_()
{
set_specific();
return single_value->field_class_;
}

const BITSTRING_template& SCCP__param__Segmentation__opt_template::class_() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field class of a non-specific template of type @SCCP_Types.SCCP_param_Segmentation_opt.");
return single_value->field_class_;
}

BITSTRING_template& SCCP__param__Segmentation__opt_template::firstSegm()
{
set_specific();
return single_value->field_firstSegm;
}

const BITSTRING_template& SCCP__param__Segmentation__opt_template::firstSegm() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field firstSegm of a non-specific template of type @SCCP_Types.SCCP_param_Segmentation_opt.");
return single_value->field_firstSegm;
}

OCTETSTRING_template& SCCP__param__Segmentation__opt_template::segmLocalRef()
{
set_specific();
return single_value->field_segmLocalRef;
}

const OCTETSTRING_template& SCCP__param__Segmentation__opt_template::segmLocalRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field segmLocalRef of a non-specific template of type @SCCP_Types.SCCP_param_Segmentation_opt.");
return single_value->field_segmLocalRef;
}

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

void SCCP__param__Segmentation__opt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramName := ");
single_value->field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", remainingSegment := ");
single_value->field_remainingSegment.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", class := ");
single_value->field_class_.log();
TTCN_Logger::log_event_str(", firstSegm := ");
single_value->field_firstSegm.log();
TTCN_Logger::log_event_str(", segmLocalRef := ");
single_value->field_segmLocalRef.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 SCCP__param__Segmentation__opt_template::log_match(const SCCP__param__Segmentation__opt& 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_paramName.match(match_value.paramName(), legacy)){
TTCN_Logger::log_logmatch_info(".paramName");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_remainingSegment.match(match_value.remainingSegment(), legacy)){
TTCN_Logger::log_logmatch_info(".remainingSegment");
single_value->field_remainingSegment.log_match(match_value.remainingSegment(), 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_class_.match(match_value.class_(), legacy)){
TTCN_Logger::log_logmatch_info(".class");
single_value->field_class_.log_match(match_value.class_(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_firstSegm.match(match_value.firstSegm(), legacy)){
TTCN_Logger::log_logmatch_info(".firstSegm");
single_value->field_firstSegm.log_match(match_value.firstSegm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_segmLocalRef.match(match_value.segmLocalRef(), legacy)){
TTCN_Logger::log_logmatch_info(".segmLocalRef");
single_value->field_segmLocalRef.log_match(match_value.segmLocalRef(), 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("{ paramName := ");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", remainingSegment := ");
single_value->field_remainingSegment.log_match(match_value.remainingSegment(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", class := ");
single_value->field_class_.log_match(match_value.class_(), legacy);
TTCN_Logger::log_event_str(", firstSegm := ");
single_value->field_firstSegm.log_match(match_value.firstSegm(), legacy);
TTCN_Logger::log_event_str(", segmLocalRef := ");
single_value->field_segmLocalRef.log_match(match_value.segmLocalRef(), 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 SCCP__param__Segmentation__opt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (remainingSegment().is_bound()) remainingSegment().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (class_().is_bound()) class_().set_implicit_omit();
if (firstSegm().is_bound()) firstSegm().set_implicit_omit();
if (segmLocalRef().is_bound()) segmLocalRef().set_implicit_omit();
}

void SCCP__param__Segmentation__opt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramName.encode_text(text_buf);
single_value->field_paramLength.encode_text(text_buf);
single_value->field_remainingSegment.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_class_.encode_text(text_buf);
single_value->field_firstSegm.encode_text(text_buf);
single_value->field_segmLocalRef.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 @SCCP_Types.SCCP_param_Segmentation_opt.");
}
}

void SCCP__param__Segmentation__opt_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_paramName.decode_text(text_buf);
single_value->field_paramLength.decode_text(text_buf);
single_value->field_remainingSegment.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_class_.decode_text(text_buf);
single_value->field_firstSegm.decode_text(text_buf);
single_value->field_segmLocalRef.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 SCCP__param__Segmentation__opt_template[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 @SCCP_Types.SCCP_param_Segmentation_opt.");
}
}

void SCCP__param__Segmentation__opt_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: {
    SCCP__param__Segmentation__opt_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @SCCP_Types.SCCP_param_Segmentation_opt 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) paramName().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) paramLength().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) remainingSegment().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) class_().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) firstSegm().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) segmLocalRef().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(), "paramName")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramName().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paramLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "remainingSegment")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          remainingSegment().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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(), "class")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          class_().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "firstSegm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          firstSegm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "segmLocalRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          segmLocalRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_param_Segmentation_opt: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__param__Segmentation__opt_template* precondition = new SCCP__param__Segmentation__opt_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__param__Segmentation__opt_template* implied_template = new SCCP__param__Segmentation__opt_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__param__Segmentation__opt_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_param_Segmentation_opt");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__param__Segmentation__opt_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_paramName.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Segmentation_opt");
single_value->field_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Segmentation_opt");
single_value->field_remainingSegment.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Segmentation_opt");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Segmentation_opt");
single_value->field_class_.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Segmentation_opt");
single_value->field_firstSegm.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Segmentation_opt");
single_value->field_segmLocalRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Segmentation_opt");
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 : "@SCCP_Types.SCCP_param_Segmentation_opt");
}

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

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

SCCP__param__HopCounter__opt::SCCP__param__HopCounter__opt()
{
}

SCCP__param__HopCounter__opt::SCCP__param__HopCounter__opt(const INTEGER& par_paramName,
    const INTEGER& par_paramLength,
    const INTEGER& par_counter)
  :   field_paramName(par_paramName),
  field_paramLength(par_paramLength),
  field_counter(par_counter)
{
}

SCCP__param__HopCounter__opt::SCCP__param__HopCounter__opt(const SCCP__param__HopCounter__opt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_HopCounter_opt.");
if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
else field_paramName.clean_up();
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.counter().is_bound()) field_counter = other_value.counter();
else field_counter.clean_up();
}

void SCCP__param__HopCounter__opt::clean_up()
{
field_paramName.clean_up();
field_paramLength.clean_up();
field_counter.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__HopCounter__opt::get_descriptor() const { return &SCCP__param__HopCounter__opt_descr_; }
SCCP__param__HopCounter__opt& SCCP__param__HopCounter__opt::operator=(const SCCP__param__HopCounter__opt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_HopCounter_opt.");
  if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
  else field_paramName.clean_up();
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.counter().is_bound()) field_counter = other_value.counter();
  else field_counter.clean_up();
}
return *this;
}

boolean SCCP__param__HopCounter__opt::operator==(const SCCP__param__HopCounter__opt& other_value) const
{
return field_paramName==other_value.field_paramName
  && field_paramLength==other_value.field_paramLength
  && field_counter==other_value.field_counter;
}

boolean SCCP__param__HopCounter__opt::is_bound() const
{
return (field_paramName.is_bound())
  || (field_paramLength.is_bound())
  || (field_counter.is_bound());
}
boolean SCCP__param__HopCounter__opt::is_value() const
{
return field_paramName.is_value()
  && field_paramLength.is_value()
  && field_counter.is_value();
}
void SCCP__param__HopCounter__opt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramName := ");
field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", counter := ");
field_counter.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__HopCounter__opt::set_implicit_omit()
{
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (counter().is_bound()) counter().set_implicit_omit();
}

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

void SCCP__param__HopCounter__opt::encode_text(Text_Buf& text_buf) const
{
field_paramName.encode_text(text_buf);
field_paramLength.encode_text(text_buf);
field_counter.encode_text(text_buf);
}

void SCCP__param__HopCounter__opt::decode_text(Text_Buf& text_buf)
{
field_paramName.decode_text(text_buf);
field_paramLength.decode_text(text_buf);
field_counter.decode_text(text_buf);
}

void SCCP__param__HopCounter__opt::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 SCCP__param__HopCounter__opt::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 SCCP__param__HopCounter__opt::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, SCCP__field__ParameterName_descr_.raw->forceomit);
  decoded_field_length = field_paramName.RAW_decode(SCCP__field__ParameterName_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, SCCP__param__HopCounter__opt_paramLength_descr_.raw->forceomit);
  decoded_field_length = field_paramLength.RAW_decode(SCCP__param__HopCounter__opt_paramLength_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_paramLength.convert_to_Integer(SCCP__param__HopCounter__opt_paramLength_descr_);
  field_paramLength = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__HopCounter_descr_.raw->forceomit);
  decoded_field_length = field_counter.RAW_decode(SCCP__param__HopCounter_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 SCCP__param__HopCounter__opt::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, SCCP__field__ParameterName_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__HopCounter__opt_paramLength_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__HopCounter_descr_.raw);
  encoded_length += field_paramName.RAW_encode(SCCP__field__ParameterName_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &SCCP__param__HopCounter__opt_paramLength_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_counter.RAW_encode(SCCP__param__HopCounter_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct SCCP__param__HopCounter__opt_template::single_value_struct {
INTEGER_template field_paramName;
INTEGER_template field_paramLength;
INTEGER_template field_counter;
};

void SCCP__param__HopCounter__opt_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_paramName = ANY_VALUE;
single_value->field_paramLength = ANY_VALUE;
single_value->field_counter = ANY_VALUE;
}
}
}

void SCCP__param__HopCounter__opt_template::copy_value(const SCCP__param__HopCounter__opt& other_value)
{
single_value = new single_value_struct;
if (other_value.paramName().is_bound()) {
  single_value->field_paramName = other_value.paramName();
} else {
  single_value->field_paramName.clean_up();
}
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.counter().is_bound()) {
  single_value->field_counter = other_value.counter();
} else {
  single_value->field_counter.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__HopCounter__opt_template::copy_template(const SCCP__param__HopCounter__opt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramName().get_selection()) {
single_value->field_paramName = other_value.paramName();
} else {
single_value->field_paramName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.counter().get_selection()) {
single_value->field_counter = other_value.counter();
} else {
single_value->field_counter.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 SCCP__param__HopCounter__opt_template[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 SCCP__param__HopCounter__opt_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__HopCounter__opt_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 @SCCP_Types.SCCP_param_HopCounter_opt.");
break;
}
set_selection(other_value);
}

SCCP__param__HopCounter__opt_template::SCCP__param__HopCounter__opt_template()
{
}

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

SCCP__param__HopCounter__opt_template::SCCP__param__HopCounter__opt_template(const SCCP__param__HopCounter__opt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__HopCounter__opt_template::match(const SCCP__param__HopCounter__opt& 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.paramName().is_bound()) return FALSE;
if(!single_value->field_paramName.match(other_value.paramName(), legacy))return FALSE;
if(!other_value.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.counter().is_bound()) return FALSE;
if(!single_value->field_counter.match(other_value.counter(), 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 @SCCP_Types.SCCP_param_HopCounter_opt.");
}
return FALSE;
}

boolean SCCP__param__HopCounter__opt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_paramName.is_bound()
 || single_value->field_paramLength.is_bound()
 || single_value->field_counter.is_bound();
}

boolean SCCP__param__HopCounter__opt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramName.is_value()
 && single_value->field_paramLength.is_value()
 && single_value->field_counter.is_value();
}

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

SCCP__param__HopCounter__opt SCCP__param__HopCounter__opt_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 @SCCP_Types.SCCP_param_HopCounter_opt.");
SCCP__param__HopCounter__opt ret_val;
if (single_value->field_paramName.is_bound()) {
ret_val.paramName() = single_value->field_paramName.valueof();
}
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_counter.is_bound()) {
ret_val.counter() = single_value->field_counter.valueof();
}
return ret_val;
}

void SCCP__param__HopCounter__opt_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 @SCCP_Types.SCCP_param_HopCounter_opt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__HopCounter__opt_template[list_length];
}

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

INTEGER_template& SCCP__param__HopCounter__opt_template::paramName()
{
set_specific();
return single_value->field_paramName;
}

const INTEGER_template& SCCP__param__HopCounter__opt_template::paramName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramName of a non-specific template of type @SCCP_Types.SCCP_param_HopCounter_opt.");
return single_value->field_paramName;
}

INTEGER_template& SCCP__param__HopCounter__opt_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__HopCounter__opt_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_HopCounter_opt.");
return single_value->field_paramLength;
}

INTEGER_template& SCCP__param__HopCounter__opt_template::counter()
{
set_specific();
return single_value->field_counter;
}

const INTEGER_template& SCCP__param__HopCounter__opt_template::counter() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field counter of a non-specific template of type @SCCP_Types.SCCP_param_HopCounter_opt.");
return single_value->field_counter;
}

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

void SCCP__param__HopCounter__opt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramName := ");
single_value->field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", counter := ");
single_value->field_counter.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 SCCP__param__HopCounter__opt_template::log_match(const SCCP__param__HopCounter__opt& 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_paramName.match(match_value.paramName(), legacy)){
TTCN_Logger::log_logmatch_info(".paramName");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_counter.match(match_value.counter(), legacy)){
TTCN_Logger::log_logmatch_info(".counter");
single_value->field_counter.log_match(match_value.counter(), 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("{ paramName := ");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", counter := ");
single_value->field_counter.log_match(match_value.counter(), 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 SCCP__param__HopCounter__opt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (counter().is_bound()) counter().set_implicit_omit();
}

void SCCP__param__HopCounter__opt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramName.encode_text(text_buf);
single_value->field_paramLength.encode_text(text_buf);
single_value->field_counter.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 @SCCP_Types.SCCP_param_HopCounter_opt.");
}
}

void SCCP__param__HopCounter__opt_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_paramName.decode_text(text_buf);
single_value->field_paramLength.decode_text(text_buf);
single_value->field_counter.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 SCCP__param__HopCounter__opt_template[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 @SCCP_Types.SCCP_param_HopCounter_opt.");
}
}

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

void SCCP__param__HopCounter__opt_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_paramName.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_HopCounter_opt");
single_value->field_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_HopCounter_opt");
single_value->field_counter.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_HopCounter_opt");
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 : "@SCCP_Types.SCCP_param_HopCounter_opt");
}

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

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

SCCP__param__Importance__opt::SCCP__param__Importance__opt()
{
}

SCCP__param__Importance__opt::SCCP__param__Importance__opt(const INTEGER& par_paramName,
    const INTEGER& par_paramLength,
    const INTEGER& par_importance,
    const BITSTRING& par_reserved)
  :   field_paramName(par_paramName),
  field_paramLength(par_paramLength),
  field_importance(par_importance),
  field_reserved(par_reserved)
{
}

SCCP__param__Importance__opt::SCCP__param__Importance__opt(const SCCP__param__Importance__opt& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_Importance_opt.");
if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
else field_paramName.clean_up();
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.importance().is_bound()) field_importance = other_value.importance();
else field_importance.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void SCCP__param__Importance__opt::clean_up()
{
field_paramName.clean_up();
field_paramLength.clean_up();
field_importance.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__Importance__opt::get_descriptor() const { return &SCCP__param__Importance__opt_descr_; }
SCCP__param__Importance__opt& SCCP__param__Importance__opt::operator=(const SCCP__param__Importance__opt& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_Importance_opt.");
  if (other_value.paramName().is_bound()) field_paramName = other_value.paramName();
  else field_paramName.clean_up();
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.importance().is_bound()) field_importance = other_value.importance();
  else field_importance.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

boolean SCCP__param__Importance__opt::operator==(const SCCP__param__Importance__opt& other_value) const
{
return field_paramName==other_value.field_paramName
  && field_paramLength==other_value.field_paramLength
  && field_importance==other_value.field_importance
  && field_reserved==other_value.field_reserved;
}

boolean SCCP__param__Importance__opt::is_bound() const
{
return (field_paramName.is_bound())
  || (field_paramLength.is_bound())
  || (field_importance.is_bound())
  || (field_reserved.is_bound());
}
boolean SCCP__param__Importance__opt::is_value() const
{
return field_paramName.is_value()
  && field_paramLength.is_value()
  && field_importance.is_value()
  && field_reserved.is_value();
}
void SCCP__param__Importance__opt::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramName := ");
field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", importance := ");
field_importance.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__Importance__opt::set_implicit_omit()
{
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (importance().is_bound()) importance().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

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

void SCCP__param__Importance__opt::encode_text(Text_Buf& text_buf) const
{
field_paramName.encode_text(text_buf);
field_paramLength.encode_text(text_buf);
field_importance.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void SCCP__param__Importance__opt::decode_text(Text_Buf& text_buf)
{
field_paramName.decode_text(text_buf);
field_paramLength.decode_text(text_buf);
field_importance.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

void SCCP__param__Importance__opt::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 SCCP__param__Importance__opt::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 SCCP__param__Importance__opt::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, SCCP__field__ParameterName_descr_.raw->forceomit);
  decoded_field_length = field_paramName.RAW_decode(SCCP__field__ParameterName_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::LIN1_descr_.raw->forceomit);
  decoded_field_length = field_paramLength.RAW_decode(General__Types::LIN1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__field__Importance_descr_.raw->forceomit);
  decoded_field_length = field_importance.RAW_decode(SCCP__field__Importance_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(General__Types::BIT5_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__param__Importance__opt::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, SCCP__field__ParameterName_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::LIN1_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__field__Importance_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT5_descr_.raw);
  encoded_length += field_paramName.RAW_encode(SCCP__field__ParameterName_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_paramLength.RAW_encode(General__Types::LIN1_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_importance.RAW_encode(SCCP__field__Importance_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_reserved.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct SCCP__param__Importance__opt_template::single_value_struct {
INTEGER_template field_paramName;
INTEGER_template field_paramLength;
INTEGER_template field_importance;
BITSTRING_template field_reserved;
};

void SCCP__param__Importance__opt_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_paramName = ANY_VALUE;
single_value->field_paramLength = ANY_VALUE;
single_value->field_importance = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
}
}
}

void SCCP__param__Importance__opt_template::copy_value(const SCCP__param__Importance__opt& other_value)
{
single_value = new single_value_struct;
if (other_value.paramName().is_bound()) {
  single_value->field_paramName = other_value.paramName();
} else {
  single_value->field_paramName.clean_up();
}
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.importance().is_bound()) {
  single_value->field_importance = other_value.importance();
} else {
  single_value->field_importance.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__Importance__opt_template::copy_template(const SCCP__param__Importance__opt_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramName().get_selection()) {
single_value->field_paramName = other_value.paramName();
} else {
single_value->field_paramName.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.importance().get_selection()) {
single_value->field_importance = other_value.importance();
} else {
single_value->field_importance.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.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 SCCP__param__Importance__opt_template[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 SCCP__param__Importance__opt_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__Importance__opt_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 @SCCP_Types.SCCP_param_Importance_opt.");
break;
}
set_selection(other_value);
}

SCCP__param__Importance__opt_template::SCCP__param__Importance__opt_template()
{
}

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

SCCP__param__Importance__opt_template::SCCP__param__Importance__opt_template(const SCCP__param__Importance__opt& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__Importance__opt_template::match(const SCCP__param__Importance__opt& 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.paramName().is_bound()) return FALSE;
if(!single_value->field_paramName.match(other_value.paramName(), legacy))return FALSE;
if(!other_value.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.importance().is_bound()) return FALSE;
if(!single_value->field_importance.match(other_value.importance(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), 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 @SCCP_Types.SCCP_param_Importance_opt.");
}
return FALSE;
}

boolean SCCP__param__Importance__opt_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_paramName.is_bound()
 || single_value->field_paramLength.is_bound()
 || single_value->field_importance.is_bound()
 || single_value->field_reserved.is_bound();
}

boolean SCCP__param__Importance__opt_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramName.is_value()
 && single_value->field_paramLength.is_value()
 && single_value->field_importance.is_value()
 && single_value->field_reserved.is_value();
}

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

SCCP__param__Importance__opt SCCP__param__Importance__opt_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 @SCCP_Types.SCCP_param_Importance_opt.");
SCCP__param__Importance__opt ret_val;
if (single_value->field_paramName.is_bound()) {
ret_val.paramName() = single_value->field_paramName.valueof();
}
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_importance.is_bound()) {
ret_val.importance() = single_value->field_importance.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

void SCCP__param__Importance__opt_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 @SCCP_Types.SCCP_param_Importance_opt.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__Importance__opt_template[list_length];
}

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

INTEGER_template& SCCP__param__Importance__opt_template::paramName()
{
set_specific();
return single_value->field_paramName;
}

const INTEGER_template& SCCP__param__Importance__opt_template::paramName() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramName of a non-specific template of type @SCCP_Types.SCCP_param_Importance_opt.");
return single_value->field_paramName;
}

INTEGER_template& SCCP__param__Importance__opt_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__Importance__opt_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_Importance_opt.");
return single_value->field_paramLength;
}

INTEGER_template& SCCP__param__Importance__opt_template::importance()
{
set_specific();
return single_value->field_importance;
}

const INTEGER_template& SCCP__param__Importance__opt_template::importance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field importance of a non-specific template of type @SCCP_Types.SCCP_param_Importance_opt.");
return single_value->field_importance;
}

BITSTRING_template& SCCP__param__Importance__opt_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCCP__param__Importance__opt_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCCP_param_Importance_opt.");
return single_value->field_reserved;
}

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

void SCCP__param__Importance__opt_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramName := ");
single_value->field_paramName.log();
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", importance := ");
single_value->field_importance.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.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 SCCP__param__Importance__opt_template::log_match(const SCCP__param__Importance__opt& 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_paramName.match(match_value.paramName(), legacy)){
TTCN_Logger::log_logmatch_info(".paramName");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_importance.match(match_value.importance(), legacy)){
TTCN_Logger::log_logmatch_info(".importance");
single_value->field_importance.log_match(match_value.importance(), 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);
}
}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("{ paramName := ");
single_value->field_paramName.log_match(match_value.paramName(), legacy);
TTCN_Logger::log_event_str(", paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", importance := ");
single_value->field_importance.log_match(match_value.importance(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), 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 SCCP__param__Importance__opt_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramName().is_bound()) paramName().set_implicit_omit();
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (importance().is_bound()) importance().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCCP__param__Importance__opt_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramName.encode_text(text_buf);
single_value->field_paramLength.encode_text(text_buf);
single_value->field_importance.encode_text(text_buf);
single_value->field_reserved.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 @SCCP_Types.SCCP_param_Importance_opt.");
}
}

void SCCP__param__Importance__opt_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_paramName.decode_text(text_buf);
single_value->field_paramLength.decode_text(text_buf);
single_value->field_importance.decode_text(text_buf);
single_value->field_reserved.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 SCCP__param__Importance__opt_template[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 @SCCP_Types.SCCP_param_Importance_opt.");
}
}

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

void SCCP__param__Importance__opt_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_paramName.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Importance_opt");
single_value->field_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Importance_opt");
single_value->field_importance.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Importance_opt");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_Importance_opt");
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 : "@SCCP_Types.SCCP_param_Importance_opt");
}

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

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

SCCP__param__LongData::SCCP__param__LongData()
{
}

SCCP__param__LongData::SCCP__param__LongData(const INTEGER& par_paramLength,
    const OCTETSTRING& par_data)
  :   field_paramLength(par_paramLength),
  field_data(par_data)
{
}

SCCP__param__LongData::SCCP__param__LongData(const SCCP__param__LongData& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_param_LongData.");
if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
else field_paramLength.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void SCCP__param__LongData::clean_up()
{
field_paramLength.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__param__LongData::get_descriptor() const { return &SCCP__param__LongData_descr_; }
SCCP__param__LongData& SCCP__param__LongData::operator=(const SCCP__param__LongData& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_param_LongData.");
  if (other_value.paramLength().is_bound()) field_paramLength = other_value.paramLength();
  else field_paramLength.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean SCCP__param__LongData::operator==(const SCCP__param__LongData& other_value) const
{
return field_paramLength==other_value.field_paramLength
  && field_data==other_value.field_data;
}

boolean SCCP__param__LongData::is_bound() const
{
return (field_paramLength.is_bound())
  || (field_data.is_bound());
}
boolean SCCP__param__LongData::is_value() const
{
return field_paramLength.is_value()
  && field_data.is_value();
}
void SCCP__param__LongData::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ paramLength := ");
field_paramLength.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__param__LongData::set_implicit_omit()
{
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void SCCP__param__LongData::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 @SCCP_Types.SCCP_param_LongData 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) paramLength().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paramLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.SCCP_param_LongData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_param_LongData");
  }
}

void SCCP__param__LongData::encode_text(Text_Buf& text_buf) const
{
field_paramLength.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void SCCP__param__LongData::decode_text(Text_Buf& text_buf)
{
field_paramLength.decode_text(text_buf);
field_data.decode_text(text_buf);
}

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

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

struct SCCP__param__LongData_template::single_value_struct {
INTEGER_template field_paramLength;
OCTETSTRING_template field_data;
};

void SCCP__param__LongData_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_paramLength = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void SCCP__param__LongData_template::copy_value(const SCCP__param__LongData& other_value)
{
single_value = new single_value_struct;
if (other_value.paramLength().is_bound()) {
  single_value->field_paramLength = other_value.paramLength();
} else {
  single_value->field_paramLength.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__param__LongData_template::copy_template(const SCCP__param__LongData_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.paramLength().get_selection()) {
single_value->field_paramLength = other_value.paramLength();
} else {
single_value->field_paramLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 SCCP__param__LongData_template[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 SCCP__param__LongData_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__param__LongData_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 @SCCP_Types.SCCP_param_LongData.");
break;
}
set_selection(other_value);
}

SCCP__param__LongData_template::SCCP__param__LongData_template()
{
}

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

SCCP__param__LongData_template::SCCP__param__LongData_template(const SCCP__param__LongData& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__param__LongData_template::match(const SCCP__param__LongData& 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.paramLength().is_bound()) return FALSE;
if(!single_value->field_paramLength.match(other_value.paramLength(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.SCCP_param_LongData.");
}
return FALSE;
}

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

boolean SCCP__param__LongData_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_paramLength.is_value()
 && single_value->field_data.is_value();
}

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

SCCP__param__LongData SCCP__param__LongData_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 @SCCP_Types.SCCP_param_LongData.");
SCCP__param__LongData ret_val;
if (single_value->field_paramLength.is_bound()) {
ret_val.paramLength() = single_value->field_paramLength.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void SCCP__param__LongData_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 @SCCP_Types.SCCP_param_LongData.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__param__LongData_template[list_length];
}

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

INTEGER_template& SCCP__param__LongData_template::paramLength()
{
set_specific();
return single_value->field_paramLength;
}

const INTEGER_template& SCCP__param__LongData_template::paramLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field paramLength of a non-specific template of type @SCCP_Types.SCCP_param_LongData.");
return single_value->field_paramLength;
}

OCTETSTRING_template& SCCP__param__LongData_template::data()
{
set_specific();
return single_value->field_data;
}

const OCTETSTRING_template& SCCP__param__LongData_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.SCCP_param_LongData.");
return single_value->field_data;
}

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

void SCCP__param__LongData_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ paramLength := ");
single_value->field_paramLength.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 SCCP__param__LongData_template::log_match(const SCCP__param__LongData& 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_paramLength.match(match_value.paramLength(), legacy)){
TTCN_Logger::log_logmatch_info(".paramLength");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ paramLength := ");
single_value->field_paramLength.log_match(match_value.paramLength(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 SCCP__param__LongData_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (paramLength().is_bound()) paramLength().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void SCCP__param__LongData_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_paramLength.encode_text(text_buf);
single_value->field_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 @SCCP_Types.SCCP_param_LongData.");
}
}

void SCCP__param__LongData_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_paramLength.decode_text(text_buf);
single_value->field_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 SCCP__param__LongData_template[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 @SCCP_Types.SCCP_param_LongData.");
}
}

void SCCP__param__LongData_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: {
    SCCP__param__LongData_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 @SCCP_Types.SCCP_param_LongData 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) paramLength().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "paramLength")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          paramLength().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.SCCP_param_LongData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__param__LongData_template* precondition = new SCCP__param__LongData_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__param__LongData_template* implied_template = new SCCP__param__LongData_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__param__LongData_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_param_LongData");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__param__LongData_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_paramLength.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_LongData");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_param_LongData");
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 : "@SCCP_Types.SCCP_param_LongData");
}

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

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

SCMG__param__FormatId::SCMG__param__FormatId()
{
enum_value = UNBOUND_VALUE;
}

SCMG__param__FormatId::SCMG__param__FormatId(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @SCCP_Types.SCMG_param_FormatId with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

SCMG__param__FormatId::SCMG__param__FormatId(enum_type other_value)
{
enum_value = other_value;
}

SCMG__param__FormatId::SCMG__param__FormatId(const SCMG__param__FormatId& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
enum_value = other_value.enum_value;
}

SCMG__param__FormatId& SCMG__param__FormatId::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @SCCP_Types.SCMG_param_FormatId.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

SCMG__param__FormatId& SCMG__param__FormatId::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

SCMG__param__FormatId& SCMG__param__FormatId::operator=(const SCMG__param__FormatId& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
enum_value = other_value.enum_value;
return *this;
}

boolean SCMG__param__FormatId::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @SCCP_Types.SCMG_param_FormatId comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean SCMG__param__FormatId::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return enum_value == other_value;
}

boolean SCMG__param__FormatId::operator==(const SCMG__param__FormatId& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return enum_value == other_value.enum_value;
}

boolean SCMG__param__FormatId::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @SCCP_Types.SCMG_param_FormatId comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean SCMG__param__FormatId::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return enum_value < other_value;
}

boolean SCMG__param__FormatId::operator<(const SCMG__param__FormatId& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return enum_value < other_value.enum_value;
}

boolean SCMG__param__FormatId::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @SCCP_Types.SCMG_param_FormatId comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean SCMG__param__FormatId::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return enum_value > other_value;
}

boolean SCMG__param__FormatId::operator>(const SCMG__param__FormatId& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return enum_value > other_value.enum_value;
}

const char *SCMG__param__FormatId::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case sSAallowed: return "sSAallowed";
case sSPprohib: return "sSPprohib";
case sSTstaTest: return "sSTstaTest";
case sORoutReq: return "sORoutReq";
case sORoutGrant: return "sORoutGrant";
case sSCcongest: return "sSCcongest";
default:
return "<unknown>";
}
}

SCMG__param__FormatId::enum_type SCMG__param__FormatId::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "sSAallowed")) return sSAallowed;
if (!strcmp(str_par, "sSPprohib")) return sSPprohib;
if (!strcmp(str_par, "sSTstaTest")) return sSTstaTest;
if (!strcmp(str_par, "sORoutReq")) return sORoutReq;
if (!strcmp(str_par, "sORoutGrant")) return sORoutGrant;
if (!strcmp(str_par, "sSCcongest")) return sSCcongest;
}
return UNKNOWN_VALUE;
}

boolean SCMG__param__FormatId::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return TRUE;
default:
return FALSE;
}
}

int SCMG__param__FormatId::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @SCCP_Types.SCMG_param_FormatId.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int SCMG__param__FormatId::enum2int(const SCMG__param__FormatId& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @SCCP_Types.SCMG_param_FormatId.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void SCMG__param__FormatId::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @SCCP_Types.SCMG_param_FormatId.", int_val);
enum_value = (enum_type)int_val;
}

SCMG__param__FormatId::operator SCMG__param__FormatId::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return enum_value;
}

void SCMG__param__FormatId::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void SCMG__param__FormatId::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@SCCP_Types.SCMG_param_FormatId");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @SCCP_Types.SCMG_param_FormatId.");
  }
}

void SCMG__param__FormatId::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
text_buf.push_int(enum_value);
}

void SCMG__param__FormatId::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @SCCP_Types.SCMG_param_FormatId.", enum_value);
}

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

void SCMG__param__FormatId::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 SCMG__param__FormatId::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int SCMG__param__FormatId::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void SCMG__param__FormatId_template::copy_template(const SCMG__param__FormatId_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
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 SCMG__param__FormatId_template[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 SCMG__param__FormatId_template(*other_value.implication_.precondition);
implication_.implied_template = new SCMG__param__FormatId_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 enumerated type @SCCP_Types.SCMG_param_FormatId.");
}
}

SCMG__param__FormatId_template::SCMG__param__FormatId_template()
{
}

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

SCMG__param__FormatId_template::SCMG__param__FormatId_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!SCMG__param__FormatId::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @SCCP_Types.SCMG_param_FormatId with unknown numeric value %d.", other_value);
single_value = (SCMG__param__FormatId::enum_type)other_value;
}

SCMG__param__FormatId_template::SCMG__param__FormatId_template(SCMG__param__FormatId::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

SCMG__param__FormatId_template::SCMG__param__FormatId_template(const SCMG__param__FormatId& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == SCMG__param__FormatId::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId.");
single_value = other_value.enum_value;
}

SCMG__param__FormatId_template::SCMG__param__FormatId_template(const OPTIONAL<SCMG__param__FormatId>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (SCMG__param__FormatId::enum_type)(const SCMG__param__FormatId&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @SCCP_Types.SCMG_param_FormatId from an unbound optional field.");
}
}

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

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

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

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

boolean SCMG__param__FormatId_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean SCMG__param__FormatId_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != SCMG__param__FormatId::UNBOUND_VALUE;
}

void SCMG__param__FormatId_template::clean_up()
{
switch (template_selection) {
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;
}

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

SCMG__param__FormatId_template& SCMG__param__FormatId_template::operator=(int other_value)
{
if (!SCMG__param__FormatId::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @SCCP_Types.SCMG_param_FormatId.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (SCMG__param__FormatId::enum_type)other_value;
return *this;
}

SCMG__param__FormatId_template& SCMG__param__FormatId_template::operator=(SCMG__param__FormatId::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

SCMG__param__FormatId_template& SCMG__param__FormatId_template::operator=(const SCMG__param__FormatId& other_value)
{
if (other_value.enum_value == SCMG__param__FormatId::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @SCCP_Types.SCMG_param_FormatId to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

SCMG__param__FormatId_template& SCMG__param__FormatId_template::operator=(const OPTIONAL<SCMG__param__FormatId>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (SCMG__param__FormatId::enum_type)(const SCMG__param__FormatId&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @SCCP_Types.SCMG_param_FormatId.");
}
return *this;
}

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

boolean SCMG__param__FormatId_template::match(SCMG__param__FormatId::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
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)) 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 enumerated type @SCCP_Types.SCMG_param_FormatId.");
}
return FALSE;
}

boolean SCMG__param__FormatId_template::match(const SCMG__param__FormatId& other_value, boolean) const
{
if (other_value.enum_value == SCMG__param__FormatId::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @SCCP_Types.SCMG_param_FormatId with an unbound value.");
return match(other_value.enum_value);
}

SCMG__param__FormatId::enum_type SCMG__param__FormatId_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @SCCP_Types.SCMG_param_FormatId.");
return single_value;
}

void SCMG__param__FormatId_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:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCMG__param__FormatId_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @SCCP_Types.SCMG_param_FormatId.");
}
}

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

void SCMG__param__FormatId_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(SCMG__param__FormatId::enum_to_str(single_value), single_value);
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 elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_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 SCMG__param__FormatId_template::log_match(const SCMG__param__FormatId& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void SCMG__param__FormatId_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
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 elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @SCCP_Types.SCMG_param_FormatId.");
}
}

void SCMG__param__FormatId_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (SCMG__param__FormatId::enum_type)text_buf.pull_int().get_val();
if (!SCMG__param__FormatId::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @SCCP_Types.SCMG_param_FormatId.", single_value);
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 SCMG__param__FormatId_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @SCCP_Types.SCMG_param_FormatId.");
}
}

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

boolean SCMG__param__FormatId_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 SCMG__param__FormatId_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    SCMG__param__FormatId_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    SCMG__param__FormatId::enum_type enum_val = SCMG__param__FormatId::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!SCMG__param__FormatId::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @SCCP_Types.SCMG_param_FormatId.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    SCMG__param__FormatId_template* precondition = new SCMG__param__FormatId_template;
    precondition->set_param(*m_p->get_elem(0));
    SCMG__param__FormatId_template* implied_template = new SCMG__param__FormatId_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = SCMG__param__FormatId_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@SCCP_Types.SCMG_param_FormatId");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCMG__param__FormatId_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_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
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 : "@SCCP_Types.SCMG_param_FormatId");
}

SCMG__param__MultiplIndicator::SCMG__param__MultiplIndicator()
{
}

SCMG__param__MultiplIndicator::SCMG__param__MultiplIndicator(const BITSTRING& par_smi,
    const BITSTRING& par_reserved)
  :   field_smi(par_smi),
  field_reserved(par_reserved)
{
}

SCMG__param__MultiplIndicator::SCMG__param__MultiplIndicator(const SCMG__param__MultiplIndicator& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCMG_param_MultiplIndicator.");
if (other_value.smi().is_bound()) field_smi = other_value.smi();
else field_smi.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void SCMG__param__MultiplIndicator::clean_up()
{
field_smi.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* SCMG__param__MultiplIndicator::get_descriptor() const { return &SCMG__param__MultiplIndicator_descr_; }
SCMG__param__MultiplIndicator& SCMG__param__MultiplIndicator::operator=(const SCMG__param__MultiplIndicator& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCMG_param_MultiplIndicator.");
  if (other_value.smi().is_bound()) field_smi = other_value.smi();
  else field_smi.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

boolean SCMG__param__MultiplIndicator::operator==(const SCMG__param__MultiplIndicator& other_value) const
{
return field_smi==other_value.field_smi
  && field_reserved==other_value.field_reserved;
}

boolean SCMG__param__MultiplIndicator::is_bound() const
{
return (field_smi.is_bound())
  || (field_reserved.is_bound());
}
boolean SCMG__param__MultiplIndicator::is_value() const
{
return field_smi.is_value()
  && field_reserved.is_value();
}
void SCMG__param__MultiplIndicator::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ smi := ");
field_smi.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void SCMG__param__MultiplIndicator::set_implicit_omit()
{
if (smi().is_bound()) smi().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

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

void SCMG__param__MultiplIndicator::encode_text(Text_Buf& text_buf) const
{
field_smi.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void SCMG__param__MultiplIndicator::decode_text(Text_Buf& text_buf)
{
field_smi.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

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

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

struct SCMG__param__MultiplIndicator_template::single_value_struct {
BITSTRING_template field_smi;
BITSTRING_template field_reserved;
};

void SCMG__param__MultiplIndicator_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_smi = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
}
}
}

void SCMG__param__MultiplIndicator_template::copy_value(const SCMG__param__MultiplIndicator& other_value)
{
single_value = new single_value_struct;
if (other_value.smi().is_bound()) {
  single_value->field_smi = other_value.smi();
} else {
  single_value->field_smi.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCMG__param__MultiplIndicator_template::copy_template(const SCMG__param__MultiplIndicator_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.smi().get_selection()) {
single_value->field_smi = other_value.smi();
} else {
single_value->field_smi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.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 SCMG__param__MultiplIndicator_template[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 SCMG__param__MultiplIndicator_template(*other_value.implication_.precondition);
implication_.implied_template = new SCMG__param__MultiplIndicator_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 @SCCP_Types.SCMG_param_MultiplIndicator.");
break;
}
set_selection(other_value);
}

SCMG__param__MultiplIndicator_template::SCMG__param__MultiplIndicator_template()
{
}

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

SCMG__param__MultiplIndicator_template::SCMG__param__MultiplIndicator_template(const SCMG__param__MultiplIndicator& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCMG__param__MultiplIndicator_template::match(const SCMG__param__MultiplIndicator& 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.smi().is_bound()) return FALSE;
if(!single_value->field_smi.match(other_value.smi(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), 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 @SCCP_Types.SCMG_param_MultiplIndicator.");
}
return FALSE;
}

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

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

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

SCMG__param__MultiplIndicator SCMG__param__MultiplIndicator_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 @SCCP_Types.SCMG_param_MultiplIndicator.");
SCMG__param__MultiplIndicator ret_val;
if (single_value->field_smi.is_bound()) {
ret_val.smi() = single_value->field_smi.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

void SCMG__param__MultiplIndicator_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 @SCCP_Types.SCMG_param_MultiplIndicator.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCMG__param__MultiplIndicator_template[list_length];
}

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

BITSTRING_template& SCMG__param__MultiplIndicator_template::smi()
{
set_specific();
return single_value->field_smi;
}

const BITSTRING_template& SCMG__param__MultiplIndicator_template::smi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field smi of a non-specific template of type @SCCP_Types.SCMG_param_MultiplIndicator.");
return single_value->field_smi;
}

BITSTRING_template& SCMG__param__MultiplIndicator_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCMG__param__MultiplIndicator_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCMG_param_MultiplIndicator.");
return single_value->field_reserved;
}

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

void SCMG__param__MultiplIndicator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ smi := ");
single_value->field_smi.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.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 SCMG__param__MultiplIndicator_template::log_match(const SCMG__param__MultiplIndicator& 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_smi.match(match_value.smi(), legacy)){
TTCN_Logger::log_logmatch_info(".smi");
single_value->field_smi.log_match(match_value.smi(), 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);
}
}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("{ smi := ");
single_value->field_smi.log_match(match_value.smi(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), 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 SCMG__param__MultiplIndicator_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (smi().is_bound()) smi().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCMG__param__MultiplIndicator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_smi.encode_text(text_buf);
single_value->field_reserved.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 @SCCP_Types.SCMG_param_MultiplIndicator.");
}
}

void SCMG__param__MultiplIndicator_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_smi.decode_text(text_buf);
single_value->field_reserved.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 SCMG__param__MultiplIndicator_template[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 @SCCP_Types.SCMG_param_MultiplIndicator.");
}
}

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

void SCMG__param__MultiplIndicator_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_smi.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCMG_param_MultiplIndicator");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCMG_param_MultiplIndicator");
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 : "@SCCP_Types.SCMG_param_MultiplIndicator");
}

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

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

SCMG__param__CongestionLevel::SCMG__param__CongestionLevel()
{
}

SCMG__param__CongestionLevel::SCMG__param__CongestionLevel(const BITSTRING& par_congLevel,
    const BITSTRING& par_reserved)
  :   field_congLevel(par_congLevel),
  field_reserved(par_reserved)
{
}

SCMG__param__CongestionLevel::SCMG__param__CongestionLevel(const SCMG__param__CongestionLevel& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCMG_param_CongestionLevel.");
if (other_value.congLevel().is_bound()) field_congLevel = other_value.congLevel();
else field_congLevel.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
}

void SCMG__param__CongestionLevel::clean_up()
{
field_congLevel.clean_up();
field_reserved.clean_up();
}

const TTCN_Typedescriptor_t* SCMG__param__CongestionLevel::get_descriptor() const { return &SCMG__param__CongestionLevel_descr_; }
SCMG__param__CongestionLevel& SCMG__param__CongestionLevel::operator=(const SCMG__param__CongestionLevel& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCMG_param_CongestionLevel.");
  if (other_value.congLevel().is_bound()) field_congLevel = other_value.congLevel();
  else field_congLevel.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
}
return *this;
}

boolean SCMG__param__CongestionLevel::operator==(const SCMG__param__CongestionLevel& other_value) const
{
return field_congLevel==other_value.field_congLevel
  && field_reserved==other_value.field_reserved;
}

boolean SCMG__param__CongestionLevel::is_bound() const
{
return (field_congLevel.is_bound())
  || (field_reserved.is_bound());
}
boolean SCMG__param__CongestionLevel::is_value() const
{
return field_congLevel.is_value()
  && field_reserved.is_value();
}
void SCMG__param__CongestionLevel::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ congLevel := ");
field_congLevel.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(" }");
}

void SCMG__param__CongestionLevel::set_implicit_omit()
{
if (congLevel().is_bound()) congLevel().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

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

void SCMG__param__CongestionLevel::encode_text(Text_Buf& text_buf) const
{
field_congLevel.encode_text(text_buf);
field_reserved.encode_text(text_buf);
}

void SCMG__param__CongestionLevel::decode_text(Text_Buf& text_buf)
{
field_congLevel.decode_text(text_buf);
field_reserved.decode_text(text_buf);
}

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

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

struct SCMG__param__CongestionLevel_template::single_value_struct {
BITSTRING_template field_congLevel;
BITSTRING_template field_reserved;
};

void SCMG__param__CongestionLevel_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_congLevel = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
}
}
}

void SCMG__param__CongestionLevel_template::copy_value(const SCMG__param__CongestionLevel& other_value)
{
single_value = new single_value_struct;
if (other_value.congLevel().is_bound()) {
  single_value->field_congLevel = other_value.congLevel();
} else {
  single_value->field_congLevel.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCMG__param__CongestionLevel_template::copy_template(const SCMG__param__CongestionLevel_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.congLevel().get_selection()) {
single_value->field_congLevel = other_value.congLevel();
} else {
single_value->field_congLevel.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.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 SCMG__param__CongestionLevel_template[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 SCMG__param__CongestionLevel_template(*other_value.implication_.precondition);
implication_.implied_template = new SCMG__param__CongestionLevel_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 @SCCP_Types.SCMG_param_CongestionLevel.");
break;
}
set_selection(other_value);
}

SCMG__param__CongestionLevel_template::SCMG__param__CongestionLevel_template()
{
}

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

SCMG__param__CongestionLevel_template::SCMG__param__CongestionLevel_template(const SCMG__param__CongestionLevel& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCMG__param__CongestionLevel_template::match(const SCMG__param__CongestionLevel& 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.congLevel().is_bound()) return FALSE;
if(!single_value->field_congLevel.match(other_value.congLevel(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), 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 @SCCP_Types.SCMG_param_CongestionLevel.");
}
return FALSE;
}

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

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

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

SCMG__param__CongestionLevel SCMG__param__CongestionLevel_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 @SCCP_Types.SCMG_param_CongestionLevel.");
SCMG__param__CongestionLevel ret_val;
if (single_value->field_congLevel.is_bound()) {
ret_val.congLevel() = single_value->field_congLevel.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
return ret_val;
}

void SCMG__param__CongestionLevel_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 @SCCP_Types.SCMG_param_CongestionLevel.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCMG__param__CongestionLevel_template[list_length];
}

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

BITSTRING_template& SCMG__param__CongestionLevel_template::congLevel()
{
set_specific();
return single_value->field_congLevel;
}

const BITSTRING_template& SCMG__param__CongestionLevel_template::congLevel() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field congLevel of a non-specific template of type @SCCP_Types.SCMG_param_CongestionLevel.");
return single_value->field_congLevel;
}

BITSTRING_template& SCMG__param__CongestionLevel_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const BITSTRING_template& SCMG__param__CongestionLevel_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @SCCP_Types.SCMG_param_CongestionLevel.");
return single_value->field_reserved;
}

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

void SCMG__param__CongestionLevel_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ congLevel := ");
single_value->field_congLevel.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.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 SCMG__param__CongestionLevel_template::log_match(const SCMG__param__CongestionLevel& 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_congLevel.match(match_value.congLevel(), legacy)){
TTCN_Logger::log_logmatch_info(".congLevel");
single_value->field_congLevel.log_match(match_value.congLevel(), 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);
}
}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("{ congLevel := ");
single_value->field_congLevel.log_match(match_value.congLevel(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), 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 SCMG__param__CongestionLevel_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (congLevel().is_bound()) congLevel().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
}

void SCMG__param__CongestionLevel_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_congLevel.encode_text(text_buf);
single_value->field_reserved.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 @SCCP_Types.SCMG_param_CongestionLevel.");
}
}

void SCMG__param__CongestionLevel_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_congLevel.decode_text(text_buf);
single_value->field_reserved.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 SCMG__param__CongestionLevel_template[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 @SCCP_Types.SCMG_param_CongestionLevel.");
}
}

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

void SCMG__param__CongestionLevel_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_congLevel.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCMG_param_CongestionLevel");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCMG_param_CongestionLevel");
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 : "@SCCP_Types.SCMG_param_CongestionLevel");
}

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

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

SCCP__ConnReq__optionalPart::SCCP__ConnReq__optionalPart()
{
}

SCCP__ConnReq__optionalPart::SCCP__ConnReq__optionalPart(const OPTIONAL< SCCP__param__Credit__opt >& par_credit,
    const OPTIONAL< SCCP__param__CPartyAddressEnc__opt >& par_callingPAddress,
    const OPTIONAL< SCCP__param__Data__opt >& par_data,
    const OPTIONAL< SCCP__param__HopCounter__opt >& par_hopCounter,
    const OPTIONAL< SCCP__param__Importance__opt >& par_importance)
  :   field_credit(par_credit),
  field_callingPAddress(par_callingPAddress),
  field_data(par_data),
  field_hopCounter(par_hopCounter),
  field_importance(par_importance)
{
}

SCCP__ConnReq__optionalPart::SCCP__ConnReq__optionalPart(const SCCP__ConnReq__optionalPart& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_ConnReq_optionalPart.");
if (other_value.credit().is_bound()) field_credit = other_value.credit();
else field_credit.clean_up();
if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
else field_callingPAddress.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
if (other_value.hopCounter().is_bound()) field_hopCounter = other_value.hopCounter();
else field_hopCounter.clean_up();
if (other_value.importance().is_bound()) field_importance = other_value.importance();
else field_importance.clean_up();
}

void SCCP__ConnReq__optionalPart::clean_up()
{
field_credit.clean_up();
field_callingPAddress.clean_up();
field_data.clean_up();
field_hopCounter.clean_up();
field_importance.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__ConnReq__optionalPart::get_descriptor() const { return &SCCP__ConnReq__optionalPart_descr_; }
SCCP__ConnReq__optionalPart& SCCP__ConnReq__optionalPart::operator=(const SCCP__ConnReq__optionalPart& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_ConnReq_optionalPart.");
  if (other_value.credit().is_bound()) field_credit = other_value.credit();
  else field_credit.clean_up();
  if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
  else field_callingPAddress.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
  if (other_value.hopCounter().is_bound()) field_hopCounter = other_value.hopCounter();
  else field_hopCounter.clean_up();
  if (other_value.importance().is_bound()) field_importance = other_value.importance();
  else field_importance.clean_up();
}
return *this;
}

boolean SCCP__ConnReq__optionalPart::operator==(const SCCP__ConnReq__optionalPart& other_value) const
{
return field_credit==other_value.field_credit
  && field_callingPAddress==other_value.field_callingPAddress
  && field_data==other_value.field_data
  && field_hopCounter==other_value.field_hopCounter
  && field_importance==other_value.field_importance;
}

boolean SCCP__ConnReq__optionalPart::is_bound() const
{
return (OPTIONAL_OMIT == field_credit.get_selection() || field_credit.is_bound())
  || (OPTIONAL_OMIT == field_callingPAddress.get_selection() || field_callingPAddress.is_bound())
  || (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_bound())
  || (OPTIONAL_OMIT == field_hopCounter.get_selection() || field_hopCounter.is_bound())
  || (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_bound());
}
boolean SCCP__ConnReq__optionalPart::is_value() const
{
return (OPTIONAL_OMIT == field_credit.get_selection() || field_credit.is_value())
  && (OPTIONAL_OMIT == field_callingPAddress.get_selection() || field_callingPAddress.is_value())
  && (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_value())
  && (OPTIONAL_OMIT == field_hopCounter.get_selection() || field_hopCounter.is_value())
  && (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_value());
}
int SCCP__ConnReq__optionalPart::size_of() const
{
  int ret_val = 0;
  if (field_credit.ispresent()) ret_val++;
  if (field_callingPAddress.ispresent()) ret_val++;
  if (field_data.ispresent()) ret_val++;
  if (field_hopCounter.ispresent()) ret_val++;
  if (field_importance.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__ConnReq__optionalPart::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ credit := ");
field_credit.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(", hopCounter := ");
field_hopCounter.log();
TTCN_Logger::log_event_str(", importance := ");
field_importance.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__ConnReq__optionalPart::set_implicit_omit()
{
if (!credit().is_bound()) credit() = OMIT_VALUE;
else credit().set_implicit_omit();
if (!callingPAddress().is_bound()) callingPAddress() = OMIT_VALUE;
else callingPAddress().set_implicit_omit();
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!hopCounter().is_bound()) hopCounter() = OMIT_VALUE;
else hopCounter().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__ConnReq__optionalPart::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 @SCCP_Types.SCCP_ConnReq_optionalPart 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) credit().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) hopCounter().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) importance().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(), "credit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          credit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "hopCounter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hopCounter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "importance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          importance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_ConnReq_optionalPart: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@SCCP_Types.SCCP_ConnReq_optionalPart");
  }
}

void SCCP__ConnReq__optionalPart::encode_text(Text_Buf& text_buf) const
{
field_credit.encode_text(text_buf);
field_callingPAddress.encode_text(text_buf);
field_data.encode_text(text_buf);
field_hopCounter.encode_text(text_buf);
field_importance.encode_text(text_buf);
}

void SCCP__ConnReq__optionalPart::decode_text(Text_Buf& text_buf)
{
field_credit.decode_text(text_buf);
field_callingPAddress.decode_text(text_buf);
field_data.decode_text(text_buf);
field_hopCounter.decode_text(text_buf);
field_importance.decode_text(text_buf);
}

void SCCP__ConnReq__optionalPart::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 SCCP__ConnReq__optionalPart::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 SCCP__ConnReq__optionalPart::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));
field_credit = OMIT_VALUE;
field_callingPAddress = OMIT_VALUE;
field_data = OMIT_VALUE;
field_hopCounter = OMIT_VALUE;
field_importance = 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 (SCCP__param__Credit__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Credit__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 9) {
RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__Credit__opt_descr_.raw->forceomit);
int decoded_field_length = field_credit().RAW_decode(SCCP__param__Credit__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_credit.ispresent() && field_credit().paramName() == 9)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_credit = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__CPartyAddressEnc__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__CPartyAddressEnc__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 4) {
RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__CPartyAddressEnc__opt_descr_.raw->forceomit);
int decoded_field_length = field_callingPAddress().RAW_decode(SCCP__param__CPartyAddressEnc__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_callingPAddress.ispresent() && field_callingPAddress().paramName() == 4)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_callingPAddress = OMIT_VALUE;
}
}
}
if (field_map[2] == 0 && (force_omit == NULL || !(*force_omit)(2))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 15) {
RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__Data__opt_descr_.raw->forceomit);
int decoded_field_length = field_data().RAW_decode(SCCP__param__Data__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length > 0 && (field_data.ispresent() && field_data().paramName() == 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_data = OMIT_VALUE;
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__HopCounter__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__HopCounter__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 17) {
RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__HopCounter__opt_descr_.raw->forceomit);
int decoded_field_length = field_hopCounter().RAW_decode(SCCP__param__HopCounter__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_hopCounter.ispresent() && field_hopCounter().paramName() == 17)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_hopCounter = OMIT_VALUE;
}
}
}
if (field_map[4] == 0 && (force_omit == NULL || !(*force_omit)(4))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 18) {
RAW_Force_Omit field_4_force_omit(4, force_omit, SCCP__param__Importance__opt_descr_.raw->forceomit);
int decoded_field_length = field_importance().RAW_decode(SCCP__param__Importance__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
if (decoded_field_length > 0 && (field_importance.ispresent() && field_importance().paramName() == 18)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[4] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_importance = OMIT_VALUE;
}
}
}
break;
}
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__ConnReq__optionalPart::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_credit.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__Credit__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_callingPAddress.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__CPartyAddressEnc__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_data.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__Data__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_hopCounter.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__HopCounter__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_importance.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SCCP__param__Importance__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_credit.ispresent()) {
  encoded_length += field_credit().RAW_encode(SCCP__param__Credit__opt_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_callingPAddress.ispresent()) {
  encoded_length += field_callingPAddress().RAW_encode(SCCP__param__CPartyAddressEnc__opt_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_data.ispresent()) {
  encoded_length += field_data().RAW_encode(SCCP__param__Data__opt_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_hopCounter.ispresent()) {
  encoded_length += field_hopCounter().RAW_encode(SCCP__param__HopCounter__opt_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_importance.ispresent()) {
  encoded_length += field_importance().RAW_encode(SCCP__param__Importance__opt_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_credit.ispresent() && (!field_credit.ispresent() || field_credit().paramName() != 9)) {
  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){
  INTEGER new_val = 9;
  new_val.RAW_encode(SCCP__field__ParameterName_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_callingPAddress.ispresent() && (!field_callingPAddress.ispresent() || field_callingPAddress().paramName() != 4)) {
  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){
  INTEGER new_val = 4;
  new_val.RAW_encode(SCCP__field__ParameterName_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_data.ispresent() && (!field_data.ispresent() || field_data().paramName() != 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){
  INTEGER new_val = 15;
  new_val.RAW_encode(SCCP__field__ParameterName_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_hopCounter.ispresent() && (!field_hopCounter.ispresent() || field_hopCounter().paramName() != 17)) {
  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){
  INTEGER new_val = 17;
  new_val.RAW_encode(SCCP__field__ParameterName_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_importance.ispresent() && (!field_importance.ispresent() || field_importance().paramName() != 18)) {
  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){
  INTEGER new_val = 18;
  new_val.RAW_encode(SCCP__field__ParameterName_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 SCCP__ConnReq__optionalPart_template::single_value_struct {
SCCP__param__Credit__opt_template field_credit;
SCCP__param__CPartyAddressEnc__opt_template field_callingPAddress;
SCCP__param__Data__opt_template field_data;
SCCP__param__HopCounter__opt_template field_hopCounter;
SCCP__param__Importance__opt_template field_importance;
};

void SCCP__ConnReq__optionalPart_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_credit = ANY_OR_OMIT;
single_value->field_callingPAddress = ANY_OR_OMIT;
single_value->field_data = ANY_OR_OMIT;
single_value->field_hopCounter = ANY_OR_OMIT;
single_value->field_importance = ANY_OR_OMIT;
}
}
}

void SCCP__ConnReq__optionalPart_template::copy_value(const SCCP__ConnReq__optionalPart& other_value)
{
single_value = new single_value_struct;
if (other_value.credit().is_bound()) {
  if (other_value.credit().ispresent()) single_value->field_credit = other_value.credit()();
  else single_value->field_credit = OMIT_VALUE;
} else {
  single_value->field_credit.clean_up();
}
if (other_value.callingPAddress().is_bound()) {
  if (other_value.callingPAddress().ispresent()) single_value->field_callingPAddress = other_value.callingPAddress()();
  else single_value->field_callingPAddress = OMIT_VALUE;
} else {
  single_value->field_callingPAddress.clean_up();
}
if (other_value.data().is_bound()) {
  if (other_value.data().ispresent()) single_value->field_data = other_value.data()();
  else single_value->field_data = OMIT_VALUE;
} else {
  single_value->field_data.clean_up();
}
if (other_value.hopCounter().is_bound()) {
  if (other_value.hopCounter().ispresent()) single_value->field_hopCounter = other_value.hopCounter()();
  else single_value->field_hopCounter = OMIT_VALUE;
} else {
  single_value->field_hopCounter.clean_up();
}
if (other_value.importance().is_bound()) {
  if (other_value.importance().ispresent()) single_value->field_importance = other_value.importance()();
  else single_value->field_importance = OMIT_VALUE;
} else {
  single_value->field_importance.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__ConnReq__optionalPart_template::copy_template(const SCCP__ConnReq__optionalPart_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.credit().get_selection()) {
single_value->field_credit = other_value.credit();
} else {
single_value->field_credit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.callingPAddress().get_selection()) {
single_value->field_callingPAddress = other_value.callingPAddress();
} else {
single_value->field_callingPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.hopCounter().get_selection()) {
single_value->field_hopCounter = other_value.hopCounter();
} else {
single_value->field_hopCounter.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.importance().get_selection()) {
single_value->field_importance = other_value.importance();
} else {
single_value->field_importance.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 SCCP__ConnReq__optionalPart_template[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 SCCP__ConnReq__optionalPart_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__ConnReq__optionalPart_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 @SCCP_Types.SCCP_ConnReq_optionalPart.");
break;
}
set_selection(other_value);
}

SCCP__ConnReq__optionalPart_template::SCCP__ConnReq__optionalPart_template()
{
}

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

SCCP__ConnReq__optionalPart_template::SCCP__ConnReq__optionalPart_template(const SCCP__ConnReq__optionalPart& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__ConnReq__optionalPart_template::match(const SCCP__ConnReq__optionalPart& 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.credit().is_bound()) return FALSE;
if((other_value.credit().ispresent() ? !single_value->field_credit.match((const SCCP__param__Credit__opt&)other_value.credit(), legacy) : !single_value->field_credit.match_omit(legacy)))return FALSE;
if(!other_value.callingPAddress().is_bound()) return FALSE;
if((other_value.callingPAddress().ispresent() ? !single_value->field_callingPAddress.match((const SCCP__param__CPartyAddressEnc__opt&)other_value.callingPAddress(), legacy) : !single_value->field_callingPAddress.match_omit(legacy)))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if((other_value.data().ispresent() ? !single_value->field_data.match((const SCCP__param__Data__opt&)other_value.data(), legacy) : !single_value->field_data.match_omit(legacy)))return FALSE;
if(!other_value.hopCounter().is_bound()) return FALSE;
if((other_value.hopCounter().ispresent() ? !single_value->field_hopCounter.match((const SCCP__param__HopCounter__opt&)other_value.hopCounter(), legacy) : !single_value->field_hopCounter.match_omit(legacy)))return FALSE;
if(!other_value.importance().is_bound()) return FALSE;
if((other_value.importance().ispresent() ? !single_value->field_importance.match((const SCCP__param__Importance__opt&)other_value.importance(), legacy) : !single_value->field_importance.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 @SCCP_Types.SCCP_ConnReq_optionalPart.");
}
return FALSE;
}

boolean SCCP__ConnReq__optionalPart_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_credit.is_omit() || single_value->field_credit.is_bound())
 || (single_value->field_callingPAddress.is_omit() || single_value->field_callingPAddress.is_bound())
 || (single_value->field_data.is_omit() || single_value->field_data.is_bound())
 || (single_value->field_hopCounter.is_omit() || single_value->field_hopCounter.is_bound())
 || (single_value->field_importance.is_omit() || single_value->field_importance.is_bound());
}

boolean SCCP__ConnReq__optionalPart_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_credit.is_omit() || single_value->field_credit.is_value())
 && (single_value->field_callingPAddress.is_omit() || single_value->field_callingPAddress.is_value())
 && (single_value->field_data.is_omit() || single_value->field_data.is_value())
 && (single_value->field_hopCounter.is_omit() || single_value->field_hopCounter.is_value())
 && (single_value->field_importance.is_omit() || single_value->field_importance.is_value());
}

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

SCCP__ConnReq__optionalPart SCCP__ConnReq__optionalPart_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 @SCCP_Types.SCCP_ConnReq_optionalPart.");
SCCP__ConnReq__optionalPart ret_val;
if (single_value->field_credit.is_omit()) ret_val.credit() = OMIT_VALUE;
else if (single_value->field_credit.is_bound()) {
ret_val.credit() = single_value->field_credit.valueof();
}
if (single_value->field_callingPAddress.is_omit()) ret_val.callingPAddress() = OMIT_VALUE;
else if (single_value->field_callingPAddress.is_bound()) {
ret_val.callingPAddress() = single_value->field_callingPAddress.valueof();
}
if (single_value->field_data.is_omit()) ret_val.data() = OMIT_VALUE;
else if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
if (single_value->field_hopCounter.is_omit()) ret_val.hopCounter() = OMIT_VALUE;
else if (single_value->field_hopCounter.is_bound()) {
ret_val.hopCounter() = single_value->field_hopCounter.valueof();
}
if (single_value->field_importance.is_omit()) ret_val.importance() = OMIT_VALUE;
else if (single_value->field_importance.is_bound()) {
ret_val.importance() = single_value->field_importance.valueof();
}
return ret_val;
}

void SCCP__ConnReq__optionalPart_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 @SCCP_Types.SCCP_ConnReq_optionalPart.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__ConnReq__optionalPart_template[list_length];
}

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

SCCP__param__Credit__opt_template& SCCP__ConnReq__optionalPart_template::credit()
{
set_specific();
return single_value->field_credit;
}

const SCCP__param__Credit__opt_template& SCCP__ConnReq__optionalPart_template::credit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field credit of a non-specific template of type @SCCP_Types.SCCP_ConnReq_optionalPart.");
return single_value->field_credit;
}

SCCP__param__CPartyAddressEnc__opt_template& SCCP__ConnReq__optionalPart_template::callingPAddress()
{
set_specific();
return single_value->field_callingPAddress;
}

const SCCP__param__CPartyAddressEnc__opt_template& SCCP__ConnReq__optionalPart_template::callingPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field callingPAddress of a non-specific template of type @SCCP_Types.SCCP_ConnReq_optionalPart.");
return single_value->field_callingPAddress;
}

SCCP__param__Data__opt_template& SCCP__ConnReq__optionalPart_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data__opt_template& SCCP__ConnReq__optionalPart_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.SCCP_ConnReq_optionalPart.");
return single_value->field_data;
}

SCCP__param__HopCounter__opt_template& SCCP__ConnReq__optionalPart_template::hopCounter()
{
set_specific();
return single_value->field_hopCounter;
}

const SCCP__param__HopCounter__opt_template& SCCP__ConnReq__optionalPart_template::hopCounter() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hopCounter of a non-specific template of type @SCCP_Types.SCCP_ConnReq_optionalPart.");
return single_value->field_hopCounter;
}

SCCP__param__Importance__opt_template& SCCP__ConnReq__optionalPart_template::importance()
{
set_specific();
return single_value->field_importance;
}

const SCCP__param__Importance__opt_template& SCCP__ConnReq__optionalPart_template::importance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field importance of a non-specific template of type @SCCP_Types.SCCP_ConnReq_optionalPart.");
return single_value->field_importance;
}

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

void SCCP__ConnReq__optionalPart_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ credit := ");
single_value->field_credit.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
single_value->field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log();
TTCN_Logger::log_event_str(", hopCounter := ");
single_value->field_hopCounter.log();
TTCN_Logger::log_event_str(", importance := ");
single_value->field_importance.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 SCCP__ConnReq__optionalPart_template::log_match(const SCCP__ConnReq__optionalPart& 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.credit().ispresent()){
if(!single_value->field_credit.match(match_value.credit(), legacy)){
TTCN_Logger::log_logmatch_info(".credit");
single_value->field_credit.log_match(match_value.credit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_credit.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".credit := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_credit.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.callingPAddress().ispresent()){
if(!single_value->field_callingPAddress.match(match_value.callingPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".callingPAddress");
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_callingPAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".callingPAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_callingPAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.data().ispresent()){
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.hopCounter().ispresent()){
if(!single_value->field_hopCounter.match(match_value.hopCounter(), legacy)){
TTCN_Logger::log_logmatch_info(".hopCounter");
single_value->field_hopCounter.log_match(match_value.hopCounter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_hopCounter.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".hopCounter := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_hopCounter.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.importance().ispresent()){
if(!single_value->field_importance.match(match_value.importance(), legacy)){
TTCN_Logger::log_logmatch_info(".importance");
single_value->field_importance.log_match(match_value.importance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_importance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".importance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_importance.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("{ credit := ");
if (match_value.credit().ispresent()) {
single_value->field_credit.log_match(match_value.credit(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_credit.log();
if (single_value->field_credit.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", callingPAddress := ");
if (match_value.callingPAddress().ispresent()) {
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_callingPAddress.log();
if (single_value->field_callingPAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", data := ");
if (match_value.data().ispresent()) {
single_value->field_data.log_match(match_value.data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_data.log();
if (single_value->field_data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", hopCounter := ");
if (match_value.hopCounter().ispresent()) {
single_value->field_hopCounter.log_match(match_value.hopCounter(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_hopCounter.log();
if (single_value->field_hopCounter.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", importance := ");
if (match_value.importance().ispresent()) {
single_value->field_importance.log_match(match_value.importance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_importance.log();
if (single_value->field_importance.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 SCCP__ConnReq__optionalPart_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!credit().is_bound()) credit() = OMIT_VALUE;
else credit().set_implicit_omit();
if (!callingPAddress().is_bound()) callingPAddress() = OMIT_VALUE;
else callingPAddress().set_implicit_omit();
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!hopCounter().is_bound()) hopCounter() = OMIT_VALUE;
else hopCounter().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__ConnReq__optionalPart_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_credit.encode_text(text_buf);
single_value->field_callingPAddress.encode_text(text_buf);
single_value->field_data.encode_text(text_buf);
single_value->field_hopCounter.encode_text(text_buf);
single_value->field_importance.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 @SCCP_Types.SCCP_ConnReq_optionalPart.");
}
}

void SCCP__ConnReq__optionalPart_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_credit.decode_text(text_buf);
single_value->field_callingPAddress.decode_text(text_buf);
single_value->field_data.decode_text(text_buf);
single_value->field_hopCounter.decode_text(text_buf);
single_value->field_importance.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 SCCP__ConnReq__optionalPart_template[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 @SCCP_Types.SCCP_ConnReq_optionalPart.");
}
}

void SCCP__ConnReq__optionalPart_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: {
    SCCP__ConnReq__optionalPart_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 @SCCP_Types.SCCP_ConnReq_optionalPart 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) credit().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) hopCounter().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) importance().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(), "credit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          credit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "hopCounter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hopCounter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "importance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          importance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_ConnReq_optionalPart: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__ConnReq__optionalPart_template* precondition = new SCCP__ConnReq__optionalPart_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__ConnReq__optionalPart_template* implied_template = new SCCP__ConnReq__optionalPart_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__ConnReq__optionalPart_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@SCCP_Types.SCCP_ConnReq_optionalPart");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__ConnReq__optionalPart_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_credit.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnReq_optionalPart");
single_value->field_callingPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnReq_optionalPart");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnReq_optionalPart");
single_value->field_hopCounter.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnReq_optionalPart");
single_value->field_importance.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnReq_optionalPart");
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 : "@SCCP_Types.SCCP_ConnReq_optionalPart");
}

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

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

PDU__SCCP__ConnectionRequest::PDU__SCCP__ConnectionRequest()
{
}

PDU__SCCP__ConnectionRequest::PDU__SCCP__ConnectionRequest(const INTEGER& par_messageType,
    const OCTETSTRING& par_sourceLocRef,
    const SCCP__param__ProtocolClass& par_protClass,
    const INTEGER& par_pointer1,
    const INTEGER& par_pointer2,
    const SCCP__param__CPartyAddressEnc& par_calledPAddress,
    const OPTIONAL< SCCP__ConnReq__optionalPart >& par_optionalPart,
    const OPTIONAL< SCCP__param__EndOfOptionalParams >& par_eop)
  :   field_messageType(par_messageType),
  field_sourceLocRef(par_sourceLocRef),
  field_protClass(par_protClass),
  field_pointer1(par_pointer1),
  field_pointer2(par_pointer2),
  field_calledPAddress(par_calledPAddress),
  field_optionalPart(par_optionalPart),
  field_eop(par_eop)
{
}

PDU__SCCP__ConnectionRequest::PDU__SCCP__ConnectionRequest(const PDU__SCCP__ConnectionRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
else field_sourceLocRef.clean_up();
if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
else field_protClass.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
else field_pointer2.clean_up();
if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
else field_calledPAddress.clean_up();
if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
else field_optionalPart.clean_up();
if (other_value.eop().is_bound()) field_eop = other_value.eop();
else field_eop.clean_up();
}

void PDU__SCCP__ConnectionRequest::clean_up()
{
field_messageType.clean_up();
field_sourceLocRef.clean_up();
field_protClass.clean_up();
field_pointer1.clean_up();
field_pointer2.clean_up();
field_calledPAddress.clean_up();
field_optionalPart.clean_up();
field_eop.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ConnectionRequest::get_descriptor() const { return &PDU__SCCP__ConnectionRequest_descr_; }
PDU__SCCP__ConnectionRequest& PDU__SCCP__ConnectionRequest::operator=(const PDU__SCCP__ConnectionRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
  else field_sourceLocRef.clean_up();
  if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
  else field_protClass.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
  else field_pointer2.clean_up();
  if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
  else field_calledPAddress.clean_up();
  if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
  else field_optionalPart.clean_up();
  if (other_value.eop().is_bound()) field_eop = other_value.eop();
  else field_eop.clean_up();
}
return *this;
}

boolean PDU__SCCP__ConnectionRequest::operator==(const PDU__SCCP__ConnectionRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_sourceLocRef==other_value.field_sourceLocRef
  && field_protClass==other_value.field_protClass
  && field_pointer1==other_value.field_pointer1
  && field_pointer2==other_value.field_pointer2
  && field_calledPAddress==other_value.field_calledPAddress
  && field_optionalPart==other_value.field_optionalPart
  && field_eop==other_value.field_eop;
}

boolean PDU__SCCP__ConnectionRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_sourceLocRef.is_bound())
  || (field_protClass.is_bound())
  || (field_pointer1.is_bound())
  || (field_pointer2.is_bound())
  || (field_calledPAddress.is_bound())
  || (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_bound())
  || (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_bound());
}
boolean PDU__SCCP__ConnectionRequest::is_value() const
{
return field_messageType.is_value()
  && field_sourceLocRef.is_value()
  && field_protClass.is_value()
  && field_pointer1.is_value()
  && field_pointer2.is_value()
  && field_calledPAddress.is_value()
  && (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_value())
  && (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_value());
}
int PDU__SCCP__ConnectionRequest::size_of() const
{
  int ret_val = 6;
  if (field_optionalPart.ispresent()) ret_val++;
  if (field_eop.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SCCP__ConnectionRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
field_sourceLocRef.log();
TTCN_Logger::log_event_str(", protClass := ");
field_protClass.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
field_pointer2.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
field_calledPAddress.log();
TTCN_Logger::log_event_str(", optionalPart := ");
field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
field_eop.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ConnectionRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__ConnectionRequest::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @SCCP_Types.PDU_SCCP_ConnectionRequest has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) eop().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ConnectionRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_ConnectionRequest");
  }
}

void PDU__SCCP__ConnectionRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_sourceLocRef.encode_text(text_buf);
field_protClass.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_pointer2.encode_text(text_buf);
field_calledPAddress.encode_text(text_buf);
field_optionalPart.encode_text(text_buf);
field_eop.encode_text(text_buf);
}

void PDU__SCCP__ConnectionRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_sourceLocRef.decode_text(text_buf);
field_protClass.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_pointer2.decode_text(text_buf);
field_calledPAddress.decode_text(text_buf);
field_optionalPart.decode_text(text_buf);
field_eop.decode_text(text_buf);
}

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

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

int PDU__SCCP__ConnectionRequest::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field3=-1;
  int start_pos_of_field4=-1;
  int start_of_field5=-1;
  int start_of_field6=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__SourceLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_sourceLocRef.RAW_decode(SCCP__param__SourceLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__ProtocolClass_descr_.raw->forceomit);
  decoded_field_length = field_protClass.RAW_decode(SCCP__param__ProtocolClass_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());
  start_pos_of_field3=p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__SCCP__ConnectionRequest_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__ConnectionRequest_pointer1_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());
  start_of_field5=(int)field_pointer1+0?1:-1;
  start_pos_of_field4=p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDU__SCCP__ConnectionRequest_pointer2_descr_.raw->forceomit);
  decoded_field_length = field_pointer2.RAW_decode(PDU__SCCP__ConnectionRequest_pointer2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field6=(int)field_pointer2+0?1:-1;
  start_of_field5=start_pos_of_field3+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field5);
  limit=end_of_available_data-start_of_field5;
  RAW_Force_Omit field_5_force_omit(5, force_omit, SCCP__param__CPartyAddressEnc_descr_.raw->forceomit);
  decoded_field_length = field_calledPAddress.RAW_decode(SCCP__param__CPartyAddressEnc_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && start_of_field6!=-1 && start_pos_of_field4!=-1){
  start_of_field6=start_pos_of_field4+(int)field_pointer2*8+0;
  p_buf.set_pos_bit(start_of_field6);
  limit=end_of_available_data-start_of_field6;
  if (force_omit != NULL && (*force_omit)(6)) {
    field_optionalPart = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, SCCP__ConnReq__optionalPart_descr_.raw->forceomit);
  decoded_field_length = field_optionalPart().RAW_decode(SCCP__ConnReq__optionalPart_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_optionalPart = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_optionalPart=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_eop = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, SCCP__param__EndOfOptionalParams_descr_.raw->forceomit);
  decoded_field_length = field_eop().RAW_decode(SCCP__param__EndOfOptionalParams_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_eop = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_eop.ispresent() || field_eop().paramName() != 0){
  field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ConnectionRequest::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__SourceLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__ProtocolClass_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__SCCP__ConnectionRequest_pointer1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDU__SCCP__ConnectionRequest_pointer2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SCCP__param__CPartyAddressEnc_descr_.raw);
  if (field_optionalPart.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, SCCP__ConnReq__optionalPart_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_eop.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, SCCP__param__EndOfOptionalParams_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_sourceLocRef.RAW_encode(SCCP__param__SourceLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_protClass.RAW_encode(SCCP__param__ProtocolClass_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_POINTER;
  myleaf.body.node.nodes[3]->coding_descr = &PDU__SCCP__ConnectionRequest_pointer1_descr_;
  myleaf.body.node.nodes[3]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_base = 3;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[3]->length = 8;
  if (field_optionalPart.ispresent()) {
  encoded_length += 8;
  myleaf.body.node.nodes[4]->calc = CALC_POINTER;
  myleaf.body.node.nodes[4]->coding_descr = &PDU__SCCP__ConnectionRequest_pointer2_descr_;
  myleaf.body.node.nodes[4]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_base = 4;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[4]->length = 8;
  } else {
    INTEGER atm;
    atm = 0;
    encoded_length += atm.RAW_encode(PDU__SCCP__ConnectionRequest_pointer2_descr_, *myleaf.body.node.nodes[4]);
  }
  encoded_length += field_calledPAddress.RAW_encode(SCCP__param__CPartyAddressEnc_descr_, *myleaf.body.node.nodes[5]);
  if (field_optionalPart.ispresent()) {
  encoded_length += field_optionalPart().RAW_encode(SCCP__ConnReq__optionalPart_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_eop.ispresent()) {
  encoded_length += field_eop().RAW_encode(SCCP__param__EndOfOptionalParams_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_eop.ispresent() && (!field_eop.ispresent() || field_eop().paramName() != 0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,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){
  INTEGER new_val = 0;
  new_val.RAW_encode(SCCP__field__ParameterName_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ConnectionRequest_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_sourceLocRef;
SCCP__param__ProtocolClass_template field_protClass;
INTEGER_template field_pointer1;
INTEGER_template field_pointer2;
SCCP__param__CPartyAddressEnc_template field_calledPAddress;
SCCP__ConnReq__optionalPart_template field_optionalPart;
SCCP__param__EndOfOptionalParams_template field_eop;
};

void PDU__SCCP__ConnectionRequest_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_sourceLocRef = ANY_VALUE;
single_value->field_protClass = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_pointer2 = ANY_VALUE;
single_value->field_calledPAddress = ANY_VALUE;
single_value->field_optionalPart = ANY_OR_OMIT;
single_value->field_eop = ANY_OR_OMIT;
}
}
}

void PDU__SCCP__ConnectionRequest_template::copy_value(const PDU__SCCP__ConnectionRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.sourceLocRef().is_bound()) {
  single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
  single_value->field_sourceLocRef.clean_up();
}
if (other_value.protClass().is_bound()) {
  single_value->field_protClass = other_value.protClass();
} else {
  single_value->field_protClass.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.pointer2().is_bound()) {
  single_value->field_pointer2 = other_value.pointer2();
} else {
  single_value->field_pointer2.clean_up();
}
if (other_value.calledPAddress().is_bound()) {
  single_value->field_calledPAddress = other_value.calledPAddress();
} else {
  single_value->field_calledPAddress.clean_up();
}
if (other_value.optionalPart().is_bound()) {
  if (other_value.optionalPart().ispresent()) single_value->field_optionalPart = other_value.optionalPart()();
  else single_value->field_optionalPart = OMIT_VALUE;
} else {
  single_value->field_optionalPart.clean_up();
}
if (other_value.eop().is_bound()) {
  if (other_value.eop().ispresent()) single_value->field_eop = other_value.eop()();
  else single_value->field_eop = OMIT_VALUE;
} else {
  single_value->field_eop.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ConnectionRequest_template::copy_template(const PDU__SCCP__ConnectionRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceLocRef().get_selection()) {
single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
single_value->field_sourceLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protClass().get_selection()) {
single_value->field_protClass = other_value.protClass();
} else {
single_value->field_protClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer2().get_selection()) {
single_value->field_pointer2 = other_value.pointer2();
} else {
single_value->field_pointer2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPAddress().get_selection()) {
single_value->field_calledPAddress = other_value.calledPAddress();
} else {
single_value->field_calledPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.optionalPart().get_selection()) {
single_value->field_optionalPart = other_value.optionalPart();
} else {
single_value->field_optionalPart.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eop().get_selection()) {
single_value->field_eop = other_value.eop();
} else {
single_value->field_eop.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ConnectionRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ConnectionRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ConnectionRequest_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 @SCCP_Types.PDU_SCCP_ConnectionRequest.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ConnectionRequest_template::PDU__SCCP__ConnectionRequest_template()
{
}

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

PDU__SCCP__ConnectionRequest_template::PDU__SCCP__ConnectionRequest_template(const PDU__SCCP__ConnectionRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__ConnectionRequest_template::match(const PDU__SCCP__ConnectionRequest& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.sourceLocRef().is_bound()) return FALSE;
if(!single_value->field_sourceLocRef.match(other_value.sourceLocRef(), legacy))return FALSE;
if(!other_value.protClass().is_bound()) return FALSE;
if(!single_value->field_protClass.match(other_value.protClass(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.pointer2().is_bound()) return FALSE;
if(!single_value->field_pointer2.match(other_value.pointer2(), legacy))return FALSE;
if(!other_value.calledPAddress().is_bound()) return FALSE;
if(!single_value->field_calledPAddress.match(other_value.calledPAddress(), legacy))return FALSE;
if(!other_value.optionalPart().is_bound()) return FALSE;
if((other_value.optionalPart().ispresent() ? !single_value->field_optionalPart.match((const SCCP__ConnReq__optionalPart&)other_value.optionalPart(), legacy) : !single_value->field_optionalPart.match_omit(legacy)))return FALSE;
if(!other_value.eop().is_bound()) return FALSE;
if((other_value.eop().ispresent() ? !single_value->field_eop.match((const SCCP__param__EndOfOptionalParams&)other_value.eop(), legacy) : !single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ConnectionRequest.");
}
return FALSE;
}

boolean PDU__SCCP__ConnectionRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_sourceLocRef.is_bound()
 || single_value->field_protClass.is_bound()
 || single_value->field_pointer1.is_bound()
 || single_value->field_pointer2.is_bound()
 || single_value->field_calledPAddress.is_bound()
 || (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_bound())
 || (single_value->field_eop.is_omit() || single_value->field_eop.is_bound());
}

boolean PDU__SCCP__ConnectionRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_sourceLocRef.is_value()
 && single_value->field_protClass.is_value()
 && single_value->field_pointer1.is_value()
 && single_value->field_pointer2.is_value()
 && single_value->field_calledPAddress.is_value()
 && (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_value())
 && (single_value->field_eop.is_omit() || single_value->field_eop.is_value());
}

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

PDU__SCCP__ConnectionRequest PDU__SCCP__ConnectionRequest_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 @SCCP_Types.PDU_SCCP_ConnectionRequest.");
PDU__SCCP__ConnectionRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_sourceLocRef.is_bound()) {
ret_val.sourceLocRef() = single_value->field_sourceLocRef.valueof();
}
if (single_value->field_protClass.is_bound()) {
ret_val.protClass() = single_value->field_protClass.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_pointer2.is_bound()) {
ret_val.pointer2() = single_value->field_pointer2.valueof();
}
if (single_value->field_calledPAddress.is_bound()) {
ret_val.calledPAddress() = single_value->field_calledPAddress.valueof();
}
if (single_value->field_optionalPart.is_omit()) ret_val.optionalPart() = OMIT_VALUE;
else if (single_value->field_optionalPart.is_bound()) {
ret_val.optionalPart() = single_value->field_optionalPart.valueof();
}
if (single_value->field_eop.is_omit()) ret_val.eop() = OMIT_VALUE;
else if (single_value->field_eop.is_bound()) {
ret_val.eop() = single_value->field_eop.valueof();
}
return ret_val;
}

void PDU__SCCP__ConnectionRequest_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 @SCCP_Types.PDU_SCCP_ConnectionRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ConnectionRequest_template[list_length];
}

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

INTEGER_template& PDU__SCCP__ConnectionRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ConnectionRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ConnectionRequest_template::sourceLocRef()
{
set_specific();
return single_value->field_sourceLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ConnectionRequest_template::sourceLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_sourceLocRef;
}

SCCP__param__ProtocolClass_template& PDU__SCCP__ConnectionRequest_template::protClass()
{
set_specific();
return single_value->field_protClass;
}

const SCCP__param__ProtocolClass_template& PDU__SCCP__ConnectionRequest_template::protClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protClass of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_protClass;
}

INTEGER_template& PDU__SCCP__ConnectionRequest_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__ConnectionRequest_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_pointer1;
}

INTEGER_template& PDU__SCCP__ConnectionRequest_template::pointer2()
{
set_specific();
return single_value->field_pointer2;
}

const INTEGER_template& PDU__SCCP__ConnectionRequest_template::pointer2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer2 of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_pointer2;
}

SCCP__param__CPartyAddressEnc_template& PDU__SCCP__ConnectionRequest_template::calledPAddress()
{
set_specific();
return single_value->field_calledPAddress;
}

const SCCP__param__CPartyAddressEnc_template& PDU__SCCP__ConnectionRequest_template::calledPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPAddress of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_calledPAddress;
}

SCCP__ConnReq__optionalPart_template& PDU__SCCP__ConnectionRequest_template::optionalPart()
{
set_specific();
return single_value->field_optionalPart;
}

const SCCP__ConnReq__optionalPart_template& PDU__SCCP__ConnectionRequest_template::optionalPart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field optionalPart of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_optionalPart;
}

SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ConnectionRequest_template::eop()
{
set_specific();
return single_value->field_eop;
}

const SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ConnectionRequest_template::eop() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eop of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRequest.");
return single_value->field_eop;
}

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

void PDU__SCCP__ConnectionRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log();
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(", optionalPart := ");
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
single_value->field_eop.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__ConnectionRequest_template::log_match(const PDU__SCCP__ConnectionRequest& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sourceLocRef.match(match_value.sourceLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceLocRef");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_protClass.match(match_value.protClass(), legacy)){
TTCN_Logger::log_logmatch_info(".protClass");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer2.match(match_value.pointer2(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer2");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_calledPAddress.match(match_value.calledPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPAddress");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.optionalPart().ispresent()){
if(!single_value->field_optionalPart.match(match_value.optionalPart(), legacy)){
TTCN_Logger::log_logmatch_info(".optionalPart");
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_optionalPart.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".optionalPart := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eop().ispresent()){
if(!single_value->field_eop.match(match_value.eop(), legacy)){
TTCN_Logger::log_logmatch_info(".eop");
single_value->field_eop.log_match(match_value.eop(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eop.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eop := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eop.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::log_event_str(", optionalPart := ");
if (match_value.optionalPart().ispresent()) {
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_optionalPart.log();
if (single_value->field_optionalPart.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eop := ");
if (match_value.eop().ispresent()) {
single_value->field_eop.log_match(match_value.eop(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eop.log();
if (single_value->field_eop.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ConnectionRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__ConnectionRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_sourceLocRef.encode_text(text_buf);
single_value->field_protClass.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_pointer2.encode_text(text_buf);
single_value->field_calledPAddress.encode_text(text_buf);
single_value->field_optionalPart.encode_text(text_buf);
single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ConnectionRequest.");
}
}

void PDU__SCCP__ConnectionRequest_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_sourceLocRef.decode_text(text_buf);
single_value->field_protClass.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_pointer2.decode_text(text_buf);
single_value->field_calledPAddress.decode_text(text_buf);
single_value->field_optionalPart.decode_text(text_buf);
single_value->field_eop.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ConnectionRequest_template[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 @SCCP_Types.PDU_SCCP_ConnectionRequest.");
}
}

void PDU__SCCP__ConnectionRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ConnectionRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_ConnectionRequest has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) eop().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ConnectionRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ConnectionRequest_template* precondition = new PDU__SCCP__ConnectionRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ConnectionRequest_template* implied_template = new PDU__SCCP__ConnectionRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ConnectionRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ConnectionRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ConnectionRequest_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
single_value->field_sourceLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
single_value->field_protClass.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
single_value->field_pointer2.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
single_value->field_calledPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
single_value->field_optionalPart.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
single_value->field_eop.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
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 : "@SCCP_Types.PDU_SCCP_ConnectionRequest");
}

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

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

SCCP__ConnConfirm__optionalPart::SCCP__ConnConfirm__optionalPart()
{
}

SCCP__ConnConfirm__optionalPart::SCCP__ConnConfirm__optionalPart(const OPTIONAL< SCCP__param__Credit__opt >& par_credit,
    const OPTIONAL< SCCP__param__CPartyAddressEnc__opt >& par_calledPAddress,
    const OPTIONAL< SCCP__param__Data__opt >& par_data,
    const OPTIONAL< SCCP__param__Importance__opt >& par_importance)
  :   field_credit(par_credit),
  field_calledPAddress(par_calledPAddress),
  field_data(par_data),
  field_importance(par_importance)
{
}

SCCP__ConnConfirm__optionalPart::SCCP__ConnConfirm__optionalPart(const SCCP__ConnConfirm__optionalPart& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
if (other_value.credit().is_bound()) field_credit = other_value.credit();
else field_credit.clean_up();
if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
else field_calledPAddress.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
if (other_value.importance().is_bound()) field_importance = other_value.importance();
else field_importance.clean_up();
}

void SCCP__ConnConfirm__optionalPart::clean_up()
{
field_credit.clean_up();
field_calledPAddress.clean_up();
field_data.clean_up();
field_importance.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__ConnConfirm__optionalPart::get_descriptor() const { return &SCCP__ConnConfirm__optionalPart_descr_; }
SCCP__ConnConfirm__optionalPart& SCCP__ConnConfirm__optionalPart::operator=(const SCCP__ConnConfirm__optionalPart& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
  if (other_value.credit().is_bound()) field_credit = other_value.credit();
  else field_credit.clean_up();
  if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
  else field_calledPAddress.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
  if (other_value.importance().is_bound()) field_importance = other_value.importance();
  else field_importance.clean_up();
}
return *this;
}

boolean SCCP__ConnConfirm__optionalPart::operator==(const SCCP__ConnConfirm__optionalPart& other_value) const
{
return field_credit==other_value.field_credit
  && field_calledPAddress==other_value.field_calledPAddress
  && field_data==other_value.field_data
  && field_importance==other_value.field_importance;
}

boolean SCCP__ConnConfirm__optionalPart::is_bound() const
{
return (OPTIONAL_OMIT == field_credit.get_selection() || field_credit.is_bound())
  || (OPTIONAL_OMIT == field_calledPAddress.get_selection() || field_calledPAddress.is_bound())
  || (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_bound())
  || (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_bound());
}
boolean SCCP__ConnConfirm__optionalPart::is_value() const
{
return (OPTIONAL_OMIT == field_credit.get_selection() || field_credit.is_value())
  && (OPTIONAL_OMIT == field_calledPAddress.get_selection() || field_calledPAddress.is_value())
  && (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_value())
  && (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_value());
}
int SCCP__ConnConfirm__optionalPart::size_of() const
{
  int ret_val = 0;
  if (field_credit.ispresent()) ret_val++;
  if (field_calledPAddress.ispresent()) ret_val++;
  if (field_data.ispresent()) ret_val++;
  if (field_importance.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__ConnConfirm__optionalPart::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ credit := ");
field_credit.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
field_calledPAddress.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(", importance := ");
field_importance.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__ConnConfirm__optionalPart::set_implicit_omit()
{
if (!credit().is_bound()) credit() = OMIT_VALUE;
else credit().set_implicit_omit();
if (!calledPAddress().is_bound()) calledPAddress() = OMIT_VALUE;
else calledPAddress().set_implicit_omit();
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__ConnConfirm__optionalPart::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 @SCCP_Types.SCCP_ConnConfirm_optionalPart 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) credit().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) importance().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(), "credit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          credit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "importance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          importance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_ConnConfirm_optionalPart: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@SCCP_Types.SCCP_ConnConfirm_optionalPart");
  }
}

void SCCP__ConnConfirm__optionalPart::encode_text(Text_Buf& text_buf) const
{
field_credit.encode_text(text_buf);
field_calledPAddress.encode_text(text_buf);
field_data.encode_text(text_buf);
field_importance.encode_text(text_buf);
}

void SCCP__ConnConfirm__optionalPart::decode_text(Text_Buf& text_buf)
{
field_credit.decode_text(text_buf);
field_calledPAddress.decode_text(text_buf);
field_data.decode_text(text_buf);
field_importance.decode_text(text_buf);
}

void SCCP__ConnConfirm__optionalPart::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 SCCP__ConnConfirm__optionalPart::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 SCCP__ConnConfirm__optionalPart::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));
field_credit = OMIT_VALUE;
field_calledPAddress = OMIT_VALUE;
field_data = OMIT_VALUE;
field_importance = 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 (SCCP__param__Credit__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Credit__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 9) {
RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__Credit__opt_descr_.raw->forceomit);
int decoded_field_length = field_credit().RAW_decode(SCCP__param__Credit__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_credit.ispresent() && field_credit().paramName() == 9)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_credit = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__CPartyAddressEnc__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__CPartyAddressEnc__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 3) {
RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__CPartyAddressEnc__opt_descr_.raw->forceomit);
int decoded_field_length = field_calledPAddress().RAW_decode(SCCP__param__CPartyAddressEnc__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_calledPAddress.ispresent() && field_calledPAddress().paramName() == 3)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_calledPAddress = OMIT_VALUE;
}
}
}
if (field_map[2] == 0 && (force_omit == NULL || !(*force_omit)(2))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 15) {
RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__Data__opt_descr_.raw->forceomit);
int decoded_field_length = field_data().RAW_decode(SCCP__param__Data__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length > 0 && (field_data.ispresent() && field_data().paramName() == 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_data = OMIT_VALUE;
}
}
}
if (field_map[3] == 0 && (force_omit == NULL || !(*force_omit)(3))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 18) {
RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__Importance__opt_descr_.raw->forceomit);
int decoded_field_length = field_importance().RAW_decode(SCCP__param__Importance__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
if (decoded_field_length > 0 && (field_importance.ispresent() && field_importance().paramName() == 18)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[3] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_importance = OMIT_VALUE;
}
}
}
break;
}
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__ConnConfirm__optionalPart::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_credit.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__Credit__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_calledPAddress.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__CPartyAddressEnc__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_data.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__Data__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_importance.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__Importance__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_credit.ispresent()) {
  encoded_length += field_credit().RAW_encode(SCCP__param__Credit__opt_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_calledPAddress.ispresent()) {
  encoded_length += field_calledPAddress().RAW_encode(SCCP__param__CPartyAddressEnc__opt_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_data.ispresent()) {
  encoded_length += field_data().RAW_encode(SCCP__param__Data__opt_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_importance.ispresent()) {
  encoded_length += field_importance().RAW_encode(SCCP__param__Importance__opt_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_credit.ispresent() && (!field_credit.ispresent() || field_credit().paramName() != 9)) {
  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){
  INTEGER new_val = 9;
  new_val.RAW_encode(SCCP__field__ParameterName_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_calledPAddress.ispresent() && (!field_calledPAddress.ispresent() || field_calledPAddress().paramName() != 3)) {
  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){
  INTEGER new_val = 3;
  new_val.RAW_encode(SCCP__field__ParameterName_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_data.ispresent() && (!field_data.ispresent() || field_data().paramName() != 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){
  INTEGER new_val = 15;
  new_val.RAW_encode(SCCP__field__ParameterName_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_importance.ispresent() && (!field_importance.ispresent() || field_importance().paramName() != 18)) {
  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){
  INTEGER new_val = 18;
  new_val.RAW_encode(SCCP__field__ParameterName_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 SCCP__ConnConfirm__optionalPart_template::single_value_struct {
SCCP__param__Credit__opt_template field_credit;
SCCP__param__CPartyAddressEnc__opt_template field_calledPAddress;
SCCP__param__Data__opt_template field_data;
SCCP__param__Importance__opt_template field_importance;
};

void SCCP__ConnConfirm__optionalPart_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_credit = ANY_OR_OMIT;
single_value->field_calledPAddress = ANY_OR_OMIT;
single_value->field_data = ANY_OR_OMIT;
single_value->field_importance = ANY_OR_OMIT;
}
}
}

void SCCP__ConnConfirm__optionalPart_template::copy_value(const SCCP__ConnConfirm__optionalPart& other_value)
{
single_value = new single_value_struct;
if (other_value.credit().is_bound()) {
  if (other_value.credit().ispresent()) single_value->field_credit = other_value.credit()();
  else single_value->field_credit = OMIT_VALUE;
} else {
  single_value->field_credit.clean_up();
}
if (other_value.calledPAddress().is_bound()) {
  if (other_value.calledPAddress().ispresent()) single_value->field_calledPAddress = other_value.calledPAddress()();
  else single_value->field_calledPAddress = OMIT_VALUE;
} else {
  single_value->field_calledPAddress.clean_up();
}
if (other_value.data().is_bound()) {
  if (other_value.data().ispresent()) single_value->field_data = other_value.data()();
  else single_value->field_data = OMIT_VALUE;
} else {
  single_value->field_data.clean_up();
}
if (other_value.importance().is_bound()) {
  if (other_value.importance().ispresent()) single_value->field_importance = other_value.importance()();
  else single_value->field_importance = OMIT_VALUE;
} else {
  single_value->field_importance.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__ConnConfirm__optionalPart_template::copy_template(const SCCP__ConnConfirm__optionalPart_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.credit().get_selection()) {
single_value->field_credit = other_value.credit();
} else {
single_value->field_credit.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPAddress().get_selection()) {
single_value->field_calledPAddress = other_value.calledPAddress();
} else {
single_value->field_calledPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.importance().get_selection()) {
single_value->field_importance = other_value.importance();
} else {
single_value->field_importance.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 SCCP__ConnConfirm__optionalPart_template[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 SCCP__ConnConfirm__optionalPart_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__ConnConfirm__optionalPart_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 @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
break;
}
set_selection(other_value);
}

SCCP__ConnConfirm__optionalPart_template::SCCP__ConnConfirm__optionalPart_template()
{
}

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

SCCP__ConnConfirm__optionalPart_template::SCCP__ConnConfirm__optionalPart_template(const SCCP__ConnConfirm__optionalPart& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__ConnConfirm__optionalPart_template::match(const SCCP__ConnConfirm__optionalPart& 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.credit().is_bound()) return FALSE;
if((other_value.credit().ispresent() ? !single_value->field_credit.match((const SCCP__param__Credit__opt&)other_value.credit(), legacy) : !single_value->field_credit.match_omit(legacy)))return FALSE;
if(!other_value.calledPAddress().is_bound()) return FALSE;
if((other_value.calledPAddress().ispresent() ? !single_value->field_calledPAddress.match((const SCCP__param__CPartyAddressEnc__opt&)other_value.calledPAddress(), legacy) : !single_value->field_calledPAddress.match_omit(legacy)))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if((other_value.data().ispresent() ? !single_value->field_data.match((const SCCP__param__Data__opt&)other_value.data(), legacy) : !single_value->field_data.match_omit(legacy)))return FALSE;
if(!other_value.importance().is_bound()) return FALSE;
if((other_value.importance().ispresent() ? !single_value->field_importance.match((const SCCP__param__Importance__opt&)other_value.importance(), legacy) : !single_value->field_importance.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 @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
}
return FALSE;
}

boolean SCCP__ConnConfirm__optionalPart_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_credit.is_omit() || single_value->field_credit.is_bound())
 || (single_value->field_calledPAddress.is_omit() || single_value->field_calledPAddress.is_bound())
 || (single_value->field_data.is_omit() || single_value->field_data.is_bound())
 || (single_value->field_importance.is_omit() || single_value->field_importance.is_bound());
}

boolean SCCP__ConnConfirm__optionalPart_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_credit.is_omit() || single_value->field_credit.is_value())
 && (single_value->field_calledPAddress.is_omit() || single_value->field_calledPAddress.is_value())
 && (single_value->field_data.is_omit() || single_value->field_data.is_value())
 && (single_value->field_importance.is_omit() || single_value->field_importance.is_value());
}

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

SCCP__ConnConfirm__optionalPart SCCP__ConnConfirm__optionalPart_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 @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
SCCP__ConnConfirm__optionalPart ret_val;
if (single_value->field_credit.is_omit()) ret_val.credit() = OMIT_VALUE;
else if (single_value->field_credit.is_bound()) {
ret_val.credit() = single_value->field_credit.valueof();
}
if (single_value->field_calledPAddress.is_omit()) ret_val.calledPAddress() = OMIT_VALUE;
else if (single_value->field_calledPAddress.is_bound()) {
ret_val.calledPAddress() = single_value->field_calledPAddress.valueof();
}
if (single_value->field_data.is_omit()) ret_val.data() = OMIT_VALUE;
else if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
if (single_value->field_importance.is_omit()) ret_val.importance() = OMIT_VALUE;
else if (single_value->field_importance.is_bound()) {
ret_val.importance() = single_value->field_importance.valueof();
}
return ret_val;
}

void SCCP__ConnConfirm__optionalPart_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 @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__ConnConfirm__optionalPart_template[list_length];
}

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

SCCP__param__Credit__opt_template& SCCP__ConnConfirm__optionalPart_template::credit()
{
set_specific();
return single_value->field_credit;
}

const SCCP__param__Credit__opt_template& SCCP__ConnConfirm__optionalPart_template::credit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field credit of a non-specific template of type @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
return single_value->field_credit;
}

SCCP__param__CPartyAddressEnc__opt_template& SCCP__ConnConfirm__optionalPart_template::calledPAddress()
{
set_specific();
return single_value->field_calledPAddress;
}

const SCCP__param__CPartyAddressEnc__opt_template& SCCP__ConnConfirm__optionalPart_template::calledPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPAddress of a non-specific template of type @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
return single_value->field_calledPAddress;
}

SCCP__param__Data__opt_template& SCCP__ConnConfirm__optionalPart_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data__opt_template& SCCP__ConnConfirm__optionalPart_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
return single_value->field_data;
}

SCCP__param__Importance__opt_template& SCCP__ConnConfirm__optionalPart_template::importance()
{
set_specific();
return single_value->field_importance;
}

const SCCP__param__Importance__opt_template& SCCP__ConnConfirm__optionalPart_template::importance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field importance of a non-specific template of type @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
return single_value->field_importance;
}

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

void SCCP__ConnConfirm__optionalPart_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ credit := ");
single_value->field_credit.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log();
TTCN_Logger::log_event_str(", importance := ");
single_value->field_importance.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 SCCP__ConnConfirm__optionalPart_template::log_match(const SCCP__ConnConfirm__optionalPart& 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.credit().ispresent()){
if(!single_value->field_credit.match(match_value.credit(), legacy)){
TTCN_Logger::log_logmatch_info(".credit");
single_value->field_credit.log_match(match_value.credit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_credit.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".credit := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_credit.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.calledPAddress().ispresent()){
if(!single_value->field_calledPAddress.match(match_value.calledPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPAddress");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_calledPAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".calledPAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.data().ispresent()){
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.importance().ispresent()){
if(!single_value->field_importance.match(match_value.importance(), legacy)){
TTCN_Logger::log_logmatch_info(".importance");
single_value->field_importance.log_match(match_value.importance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_importance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".importance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_importance.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("{ credit := ");
if (match_value.credit().ispresent()) {
single_value->field_credit.log_match(match_value.credit(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_credit.log();
if (single_value->field_credit.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", calledPAddress := ");
if (match_value.calledPAddress().ispresent()) {
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_calledPAddress.log();
if (single_value->field_calledPAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", data := ");
if (match_value.data().ispresent()) {
single_value->field_data.log_match(match_value.data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_data.log();
if (single_value->field_data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", importance := ");
if (match_value.importance().ispresent()) {
single_value->field_importance.log_match(match_value.importance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_importance.log();
if (single_value->field_importance.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 SCCP__ConnConfirm__optionalPart_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!credit().is_bound()) credit() = OMIT_VALUE;
else credit().set_implicit_omit();
if (!calledPAddress().is_bound()) calledPAddress() = OMIT_VALUE;
else calledPAddress().set_implicit_omit();
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__ConnConfirm__optionalPart_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_credit.encode_text(text_buf);
single_value->field_calledPAddress.encode_text(text_buf);
single_value->field_data.encode_text(text_buf);
single_value->field_importance.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 @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
}
}

void SCCP__ConnConfirm__optionalPart_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_credit.decode_text(text_buf);
single_value->field_calledPAddress.decode_text(text_buf);
single_value->field_data.decode_text(text_buf);
single_value->field_importance.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 SCCP__ConnConfirm__optionalPart_template[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 @SCCP_Types.SCCP_ConnConfirm_optionalPart.");
}
}

void SCCP__ConnConfirm__optionalPart_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: {
    SCCP__ConnConfirm__optionalPart_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 @SCCP_Types.SCCP_ConnConfirm_optionalPart 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) credit().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) importance().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(), "credit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          credit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "importance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          importance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_ConnConfirm_optionalPart: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__ConnConfirm__optionalPart_template* precondition = new SCCP__ConnConfirm__optionalPart_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__ConnConfirm__optionalPart_template* implied_template = new SCCP__ConnConfirm__optionalPart_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__ConnConfirm__optionalPart_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@SCCP_Types.SCCP_ConnConfirm_optionalPart");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__ConnConfirm__optionalPart_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_credit.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnConfirm_optionalPart");
single_value->field_calledPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnConfirm_optionalPart");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnConfirm_optionalPart");
single_value->field_importance.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnConfirm_optionalPart");
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 : "@SCCP_Types.SCCP_ConnConfirm_optionalPart");
}

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

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

PDU__SCCP__ConnectionConfirm::PDU__SCCP__ConnectionConfirm()
{
}

PDU__SCCP__ConnectionConfirm::PDU__SCCP__ConnectionConfirm(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const OCTETSTRING& par_sourceLocRef,
    const SCCP__param__ProtocolClass& par_protClass,
    const INTEGER& par_pointer1,
    const OPTIONAL< SCCP__ConnConfirm__optionalPart >& par_optionalPart,
    const OPTIONAL< SCCP__param__EndOfOptionalParams >& par_eop)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_sourceLocRef(par_sourceLocRef),
  field_protClass(par_protClass),
  field_pointer1(par_pointer1),
  field_optionalPart(par_optionalPart),
  field_eop(par_eop)
{
}

PDU__SCCP__ConnectionConfirm::PDU__SCCP__ConnectionConfirm(const PDU__SCCP__ConnectionConfirm& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
else field_sourceLocRef.clean_up();
if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
else field_protClass.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
else field_optionalPart.clean_up();
if (other_value.eop().is_bound()) field_eop = other_value.eop();
else field_eop.clean_up();
}

void PDU__SCCP__ConnectionConfirm::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_sourceLocRef.clean_up();
field_protClass.clean_up();
field_pointer1.clean_up();
field_optionalPart.clean_up();
field_eop.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ConnectionConfirm::get_descriptor() const { return &PDU__SCCP__ConnectionConfirm_descr_; }
PDU__SCCP__ConnectionConfirm& PDU__SCCP__ConnectionConfirm::operator=(const PDU__SCCP__ConnectionConfirm& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
  else field_sourceLocRef.clean_up();
  if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
  else field_protClass.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
  else field_optionalPart.clean_up();
  if (other_value.eop().is_bound()) field_eop = other_value.eop();
  else field_eop.clean_up();
}
return *this;
}

boolean PDU__SCCP__ConnectionConfirm::operator==(const PDU__SCCP__ConnectionConfirm& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_sourceLocRef==other_value.field_sourceLocRef
  && field_protClass==other_value.field_protClass
  && field_pointer1==other_value.field_pointer1
  && field_optionalPart==other_value.field_optionalPart
  && field_eop==other_value.field_eop;
}

boolean PDU__SCCP__ConnectionConfirm::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_sourceLocRef.is_bound())
  || (field_protClass.is_bound())
  || (field_pointer1.is_bound())
  || (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_bound())
  || (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_bound());
}
boolean PDU__SCCP__ConnectionConfirm::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_sourceLocRef.is_value()
  && field_protClass.is_value()
  && field_pointer1.is_value()
  && (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_value())
  && (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_value());
}
int PDU__SCCP__ConnectionConfirm::size_of() const
{
  int ret_val = 5;
  if (field_optionalPart.ispresent()) ret_val++;
  if (field_eop.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SCCP__ConnectionConfirm::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
field_sourceLocRef.log();
TTCN_Logger::log_event_str(", protClass := ");
field_protClass.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", optionalPart := ");
field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
field_eop.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ConnectionConfirm::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__ConnectionConfirm::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @SCCP_Types.PDU_SCCP_ConnectionConfirm 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) eop().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ConnectionConfirm: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
  }
}

void PDU__SCCP__ConnectionConfirm::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_sourceLocRef.encode_text(text_buf);
field_protClass.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_optionalPart.encode_text(text_buf);
field_eop.encode_text(text_buf);
}

void PDU__SCCP__ConnectionConfirm::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_sourceLocRef.decode_text(text_buf);
field_protClass.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_optionalPart.decode_text(text_buf);
field_eop.decode_text(text_buf);
}

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

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

int PDU__SCCP__ConnectionConfirm::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field4=-1;
  int start_of_field5=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SourceLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_sourceLocRef.RAW_decode(SCCP__param__SourceLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__ProtocolClass_descr_.raw->forceomit);
  decoded_field_length = field_protClass.RAW_decode(SCCP__param__ProtocolClass_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());
  start_pos_of_field4=p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDU__SCCP__ConnectionConfirm_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__ConnectionConfirm_pointer1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field5=(int)field_pointer1+0?1:-1;
  if (limit > 0 && start_of_field5!=-1 && start_pos_of_field4!=-1){
  start_of_field5=start_pos_of_field4+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field5);
  limit=end_of_available_data-start_of_field5;
  if (force_omit != NULL && (*force_omit)(5)) {
    field_optionalPart = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, SCCP__ConnConfirm__optionalPart_descr_.raw->forceomit);
  decoded_field_length = field_optionalPart().RAW_decode(SCCP__ConnConfirm__optionalPart_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_optionalPart = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_optionalPart=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_eop = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, SCCP__param__EndOfOptionalParams_descr_.raw->forceomit);
  decoded_field_length = field_eop().RAW_decode(SCCP__param__EndOfOptionalParams_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_eop = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_eop.ispresent() || field_eop().paramName() != 0){
  field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ConnectionConfirm::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SourceLocalReference_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__ProtocolClass_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDU__SCCP__ConnectionConfirm_pointer1_descr_.raw);
  if (field_optionalPart.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SCCP__ConnConfirm__optionalPart_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_eop.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, SCCP__param__EndOfOptionalParams_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_sourceLocRef.RAW_encode(SCCP__param__SourceLocalReference_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_protClass.RAW_encode(SCCP__param__ProtocolClass_descr_, *myleaf.body.node.nodes[3]);
  if (field_optionalPart.ispresent()) {
  encoded_length += 8;
  myleaf.body.node.nodes[4]->calc = CALC_POINTER;
  myleaf.body.node.nodes[4]->coding_descr = &PDU__SCCP__ConnectionConfirm_pointer1_descr_;
  myleaf.body.node.nodes[4]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_base = 4;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[4]->length = 8;
  } else {
    INTEGER atm;
    atm = 0;
    encoded_length += atm.RAW_encode(PDU__SCCP__ConnectionConfirm_pointer1_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_optionalPart.ispresent()) {
  encoded_length += field_optionalPart().RAW_encode(SCCP__ConnConfirm__optionalPart_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_eop.ispresent()) {
  encoded_length += field_eop().RAW_encode(SCCP__param__EndOfOptionalParams_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_eop.ispresent() && (!field_eop.ispresent() || field_eop().paramName() != 0)) {
  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){
  INTEGER new_val = 0;
  new_val.RAW_encode(SCCP__field__ParameterName_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ConnectionConfirm_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
OCTETSTRING_template field_sourceLocRef;
SCCP__param__ProtocolClass_template field_protClass;
INTEGER_template field_pointer1;
SCCP__ConnConfirm__optionalPart_template field_optionalPart;
SCCP__param__EndOfOptionalParams_template field_eop;
};

void PDU__SCCP__ConnectionConfirm_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_sourceLocRef = ANY_VALUE;
single_value->field_protClass = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_optionalPart = ANY_OR_OMIT;
single_value->field_eop = ANY_OR_OMIT;
}
}
}

void PDU__SCCP__ConnectionConfirm_template::copy_value(const PDU__SCCP__ConnectionConfirm& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.sourceLocRef().is_bound()) {
  single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
  single_value->field_sourceLocRef.clean_up();
}
if (other_value.protClass().is_bound()) {
  single_value->field_protClass = other_value.protClass();
} else {
  single_value->field_protClass.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.optionalPart().is_bound()) {
  if (other_value.optionalPart().ispresent()) single_value->field_optionalPart = other_value.optionalPart()();
  else single_value->field_optionalPart = OMIT_VALUE;
} else {
  single_value->field_optionalPart.clean_up();
}
if (other_value.eop().is_bound()) {
  if (other_value.eop().ispresent()) single_value->field_eop = other_value.eop()();
  else single_value->field_eop = OMIT_VALUE;
} else {
  single_value->field_eop.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ConnectionConfirm_template::copy_template(const PDU__SCCP__ConnectionConfirm_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceLocRef().get_selection()) {
single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
single_value->field_sourceLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protClass().get_selection()) {
single_value->field_protClass = other_value.protClass();
} else {
single_value->field_protClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.optionalPart().get_selection()) {
single_value->field_optionalPart = other_value.optionalPart();
} else {
single_value->field_optionalPart.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eop().get_selection()) {
single_value->field_eop = other_value.eop();
} else {
single_value->field_eop.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ConnectionConfirm_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ConnectionConfirm_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ConnectionConfirm_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 @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ConnectionConfirm_template::PDU__SCCP__ConnectionConfirm_template()
{
}

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

PDU__SCCP__ConnectionConfirm_template::PDU__SCCP__ConnectionConfirm_template(const PDU__SCCP__ConnectionConfirm& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__ConnectionConfirm_template::match(const PDU__SCCP__ConnectionConfirm& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.sourceLocRef().is_bound()) return FALSE;
if(!single_value->field_sourceLocRef.match(other_value.sourceLocRef(), legacy))return FALSE;
if(!other_value.protClass().is_bound()) return FALSE;
if(!single_value->field_protClass.match(other_value.protClass(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.optionalPart().is_bound()) return FALSE;
if((other_value.optionalPart().ispresent() ? !single_value->field_optionalPart.match((const SCCP__ConnConfirm__optionalPart&)other_value.optionalPart(), legacy) : !single_value->field_optionalPart.match_omit(legacy)))return FALSE;
if(!other_value.eop().is_bound()) return FALSE;
if((other_value.eop().ispresent() ? !single_value->field_eop.match((const SCCP__param__EndOfOptionalParams&)other_value.eop(), legacy) : !single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
}
return FALSE;
}

boolean PDU__SCCP__ConnectionConfirm_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_sourceLocRef.is_bound()
 || single_value->field_protClass.is_bound()
 || single_value->field_pointer1.is_bound()
 || (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_bound())
 || (single_value->field_eop.is_omit() || single_value->field_eop.is_bound());
}

boolean PDU__SCCP__ConnectionConfirm_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_sourceLocRef.is_value()
 && single_value->field_protClass.is_value()
 && single_value->field_pointer1.is_value()
 && (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_value())
 && (single_value->field_eop.is_omit() || single_value->field_eop.is_value());
}

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

PDU__SCCP__ConnectionConfirm PDU__SCCP__ConnectionConfirm_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 @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
PDU__SCCP__ConnectionConfirm ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_sourceLocRef.is_bound()) {
ret_val.sourceLocRef() = single_value->field_sourceLocRef.valueof();
}
if (single_value->field_protClass.is_bound()) {
ret_val.protClass() = single_value->field_protClass.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_optionalPart.is_omit()) ret_val.optionalPart() = OMIT_VALUE;
else if (single_value->field_optionalPart.is_bound()) {
ret_val.optionalPart() = single_value->field_optionalPart.valueof();
}
if (single_value->field_eop.is_omit()) ret_val.eop() = OMIT_VALUE;
else if (single_value->field_eop.is_bound()) {
ret_val.eop() = single_value->field_eop.valueof();
}
return ret_val;
}

void PDU__SCCP__ConnectionConfirm_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 @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ConnectionConfirm_template[list_length];
}

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

INTEGER_template& PDU__SCCP__ConnectionConfirm_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ConnectionConfirm_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ConnectionConfirm_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ConnectionConfirm_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
return single_value->field_destLocRef;
}

OCTETSTRING_template& PDU__SCCP__ConnectionConfirm_template::sourceLocRef()
{
set_specific();
return single_value->field_sourceLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ConnectionConfirm_template::sourceLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
return single_value->field_sourceLocRef;
}

SCCP__param__ProtocolClass_template& PDU__SCCP__ConnectionConfirm_template::protClass()
{
set_specific();
return single_value->field_protClass;
}

const SCCP__param__ProtocolClass_template& PDU__SCCP__ConnectionConfirm_template::protClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protClass of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
return single_value->field_protClass;
}

INTEGER_template& PDU__SCCP__ConnectionConfirm_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__ConnectionConfirm_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
return single_value->field_pointer1;
}

SCCP__ConnConfirm__optionalPart_template& PDU__SCCP__ConnectionConfirm_template::optionalPart()
{
set_specific();
return single_value->field_optionalPart;
}

const SCCP__ConnConfirm__optionalPart_template& PDU__SCCP__ConnectionConfirm_template::optionalPart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field optionalPart of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
return single_value->field_optionalPart;
}

SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ConnectionConfirm_template::eop()
{
set_specific();
return single_value->field_eop;
}

const SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ConnectionConfirm_template::eop() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eop of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
return single_value->field_eop;
}

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

void PDU__SCCP__ConnectionConfirm_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log();
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", optionalPart := ");
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
single_value->field_eop.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__ConnectionConfirm_template::log_match(const PDU__SCCP__ConnectionConfirm& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sourceLocRef.match(match_value.sourceLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceLocRef");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_protClass.match(match_value.protClass(), legacy)){
TTCN_Logger::log_logmatch_info(".protClass");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.optionalPart().ispresent()){
if(!single_value->field_optionalPart.match(match_value.optionalPart(), legacy)){
TTCN_Logger::log_logmatch_info(".optionalPart");
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_optionalPart.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".optionalPart := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eop().ispresent()){
if(!single_value->field_eop.match(match_value.eop(), legacy)){
TTCN_Logger::log_logmatch_info(".eop");
single_value->field_eop.log_match(match_value.eop(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eop.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eop := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eop.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", optionalPart := ");
if (match_value.optionalPart().ispresent()) {
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_optionalPart.log();
if (single_value->field_optionalPart.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eop := ");
if (match_value.eop().ispresent()) {
single_value->field_eop.log_match(match_value.eop(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eop.log();
if (single_value->field_eop.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ConnectionConfirm_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__ConnectionConfirm_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_sourceLocRef.encode_text(text_buf);
single_value->field_protClass.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_optionalPart.encode_text(text_buf);
single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
}
}

void PDU__SCCP__ConnectionConfirm_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_sourceLocRef.decode_text(text_buf);
single_value->field_protClass.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_optionalPart.decode_text(text_buf);
single_value->field_eop.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ConnectionConfirm_template[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 @SCCP_Types.PDU_SCCP_ConnectionConfirm.");
}
}

void PDU__SCCP__ConnectionConfirm_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ConnectionConfirm_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_ConnectionConfirm 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) eop().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ConnectionConfirm: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ConnectionConfirm_template* precondition = new PDU__SCCP__ConnectionConfirm_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ConnectionConfirm_template* implied_template = new PDU__SCCP__ConnectionConfirm_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ConnectionConfirm_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ConnectionConfirm_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
single_value->field_sourceLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
single_value->field_protClass.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
single_value->field_optionalPart.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
single_value->field_eop.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
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 : "@SCCP_Types.PDU_SCCP_ConnectionConfirm");
}

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

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

SCCP__ConnRefused__optionalPart::SCCP__ConnRefused__optionalPart()
{
}

SCCP__ConnRefused__optionalPart::SCCP__ConnRefused__optionalPart(const OPTIONAL< SCCP__param__CPartyAddressEnc__opt >& par_calledPAddress,
    const OPTIONAL< SCCP__param__Data__opt >& par_data,
    const OPTIONAL< SCCP__param__Importance__opt >& par_importance)
  :   field_calledPAddress(par_calledPAddress),
  field_data(par_data),
  field_importance(par_importance)
{
}

SCCP__ConnRefused__optionalPart::SCCP__ConnRefused__optionalPart(const SCCP__ConnRefused__optionalPart& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_ConnRefused_optionalPart.");
if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
else field_calledPAddress.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
if (other_value.importance().is_bound()) field_importance = other_value.importance();
else field_importance.clean_up();
}

void SCCP__ConnRefused__optionalPart::clean_up()
{
field_calledPAddress.clean_up();
field_data.clean_up();
field_importance.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__ConnRefused__optionalPart::get_descriptor() const { return &SCCP__ConnRefused__optionalPart_descr_; }
SCCP__ConnRefused__optionalPart& SCCP__ConnRefused__optionalPart::operator=(const SCCP__ConnRefused__optionalPart& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_ConnRefused_optionalPart.");
  if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
  else field_calledPAddress.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
  if (other_value.importance().is_bound()) field_importance = other_value.importance();
  else field_importance.clean_up();
}
return *this;
}

boolean SCCP__ConnRefused__optionalPart::operator==(const SCCP__ConnRefused__optionalPart& other_value) const
{
return field_calledPAddress==other_value.field_calledPAddress
  && field_data==other_value.field_data
  && field_importance==other_value.field_importance;
}

boolean SCCP__ConnRefused__optionalPart::is_bound() const
{
return (OPTIONAL_OMIT == field_calledPAddress.get_selection() || field_calledPAddress.is_bound())
  || (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_bound())
  || (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_bound());
}
boolean SCCP__ConnRefused__optionalPart::is_value() const
{
return (OPTIONAL_OMIT == field_calledPAddress.get_selection() || field_calledPAddress.is_value())
  && (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_value())
  && (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_value());
}
int SCCP__ConnRefused__optionalPart::size_of() const
{
  int ret_val = 0;
  if (field_calledPAddress.ispresent()) ret_val++;
  if (field_data.ispresent()) ret_val++;
  if (field_importance.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__ConnRefused__optionalPart::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ calledPAddress := ");
field_calledPAddress.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(", importance := ");
field_importance.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__ConnRefused__optionalPart::set_implicit_omit()
{
if (!calledPAddress().is_bound()) calledPAddress() = OMIT_VALUE;
else calledPAddress().set_implicit_omit();
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

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

void SCCP__ConnRefused__optionalPart::encode_text(Text_Buf& text_buf) const
{
field_calledPAddress.encode_text(text_buf);
field_data.encode_text(text_buf);
field_importance.encode_text(text_buf);
}

void SCCP__ConnRefused__optionalPart::decode_text(Text_Buf& text_buf)
{
field_calledPAddress.decode_text(text_buf);
field_data.decode_text(text_buf);
field_importance.decode_text(text_buf);
}

void SCCP__ConnRefused__optionalPart::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 SCCP__ConnRefused__optionalPart::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 SCCP__ConnRefused__optionalPart::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));
field_calledPAddress = OMIT_VALUE;
field_data = OMIT_VALUE;
field_importance = 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 (SCCP__param__CPartyAddressEnc__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__CPartyAddressEnc__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 3) {
RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__CPartyAddressEnc__opt_descr_.raw->forceomit);
int decoded_field_length = field_calledPAddress().RAW_decode(SCCP__param__CPartyAddressEnc__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_calledPAddress.ispresent() && field_calledPAddress().paramName() == 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_calledPAddress = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 15) {
RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__Data__opt_descr_.raw->forceomit);
int decoded_field_length = field_data().RAW_decode(SCCP__param__Data__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_data.ispresent() && field_data().paramName() == 15)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_data = OMIT_VALUE;
}
}
}
if (field_map[2] == 0 && (force_omit == NULL || !(*force_omit)(2))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 18) {
RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__Importance__opt_descr_.raw->forceomit);
int decoded_field_length = field_importance().RAW_decode(SCCP__param__Importance__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
if (decoded_field_length > 0 && (field_importance.ispresent() && field_importance().paramName() == 18)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[2] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_importance = OMIT_VALUE;
}
}
}
break;
}
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__ConnRefused__optionalPart::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);
  if (field_calledPAddress.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__CPartyAddressEnc__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_data.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__Data__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_importance.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__Importance__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_calledPAddress.ispresent()) {
  encoded_length += field_calledPAddress().RAW_encode(SCCP__param__CPartyAddressEnc__opt_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_data.ispresent()) {
  encoded_length += field_data().RAW_encode(SCCP__param__Data__opt_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_importance.ispresent()) {
  encoded_length += field_importance().RAW_encode(SCCP__param__Importance__opt_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_calledPAddress.ispresent() && (!field_calledPAddress.ispresent() || field_calledPAddress().paramName() != 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){
  INTEGER new_val = 3;
  new_val.RAW_encode(SCCP__field__ParameterName_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_data.ispresent() && (!field_data.ispresent() || field_data().paramName() != 15)) {
  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){
  INTEGER new_val = 15;
  new_val.RAW_encode(SCCP__field__ParameterName_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_importance.ispresent() && (!field_importance.ispresent() || field_importance().paramName() != 18)) {
  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){
  INTEGER new_val = 18;
  new_val.RAW_encode(SCCP__field__ParameterName_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 SCCP__ConnRefused__optionalPart_template::single_value_struct {
SCCP__param__CPartyAddressEnc__opt_template field_calledPAddress;
SCCP__param__Data__opt_template field_data;
SCCP__param__Importance__opt_template field_importance;
};

void SCCP__ConnRefused__optionalPart_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_calledPAddress = ANY_OR_OMIT;
single_value->field_data = ANY_OR_OMIT;
single_value->field_importance = ANY_OR_OMIT;
}
}
}

void SCCP__ConnRefused__optionalPart_template::copy_value(const SCCP__ConnRefused__optionalPart& other_value)
{
single_value = new single_value_struct;
if (other_value.calledPAddress().is_bound()) {
  if (other_value.calledPAddress().ispresent()) single_value->field_calledPAddress = other_value.calledPAddress()();
  else single_value->field_calledPAddress = OMIT_VALUE;
} else {
  single_value->field_calledPAddress.clean_up();
}
if (other_value.data().is_bound()) {
  if (other_value.data().ispresent()) single_value->field_data = other_value.data()();
  else single_value->field_data = OMIT_VALUE;
} else {
  single_value->field_data.clean_up();
}
if (other_value.importance().is_bound()) {
  if (other_value.importance().ispresent()) single_value->field_importance = other_value.importance()();
  else single_value->field_importance = OMIT_VALUE;
} else {
  single_value->field_importance.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__ConnRefused__optionalPart_template::copy_template(const SCCP__ConnRefused__optionalPart_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.calledPAddress().get_selection()) {
single_value->field_calledPAddress = other_value.calledPAddress();
} else {
single_value->field_calledPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.importance().get_selection()) {
single_value->field_importance = other_value.importance();
} else {
single_value->field_importance.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 SCCP__ConnRefused__optionalPart_template[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 SCCP__ConnRefused__optionalPart_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__ConnRefused__optionalPart_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 @SCCP_Types.SCCP_ConnRefused_optionalPart.");
break;
}
set_selection(other_value);
}

SCCP__ConnRefused__optionalPart_template::SCCP__ConnRefused__optionalPart_template()
{
}

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

SCCP__ConnRefused__optionalPart_template::SCCP__ConnRefused__optionalPart_template(const SCCP__ConnRefused__optionalPart& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__ConnRefused__optionalPart_template::match(const SCCP__ConnRefused__optionalPart& 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.calledPAddress().is_bound()) return FALSE;
if((other_value.calledPAddress().ispresent() ? !single_value->field_calledPAddress.match((const SCCP__param__CPartyAddressEnc__opt&)other_value.calledPAddress(), legacy) : !single_value->field_calledPAddress.match_omit(legacy)))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if((other_value.data().ispresent() ? !single_value->field_data.match((const SCCP__param__Data__opt&)other_value.data(), legacy) : !single_value->field_data.match_omit(legacy)))return FALSE;
if(!other_value.importance().is_bound()) return FALSE;
if((other_value.importance().ispresent() ? !single_value->field_importance.match((const SCCP__param__Importance__opt&)other_value.importance(), legacy) : !single_value->field_importance.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 @SCCP_Types.SCCP_ConnRefused_optionalPart.");
}
return FALSE;
}

boolean SCCP__ConnRefused__optionalPart_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_calledPAddress.is_omit() || single_value->field_calledPAddress.is_bound())
 || (single_value->field_data.is_omit() || single_value->field_data.is_bound())
 || (single_value->field_importance.is_omit() || single_value->field_importance.is_bound());
}

boolean SCCP__ConnRefused__optionalPart_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_calledPAddress.is_omit() || single_value->field_calledPAddress.is_value())
 && (single_value->field_data.is_omit() || single_value->field_data.is_value())
 && (single_value->field_importance.is_omit() || single_value->field_importance.is_value());
}

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

SCCP__ConnRefused__optionalPart SCCP__ConnRefused__optionalPart_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 @SCCP_Types.SCCP_ConnRefused_optionalPart.");
SCCP__ConnRefused__optionalPart ret_val;
if (single_value->field_calledPAddress.is_omit()) ret_val.calledPAddress() = OMIT_VALUE;
else if (single_value->field_calledPAddress.is_bound()) {
ret_val.calledPAddress() = single_value->field_calledPAddress.valueof();
}
if (single_value->field_data.is_omit()) ret_val.data() = OMIT_VALUE;
else if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
if (single_value->field_importance.is_omit()) ret_val.importance() = OMIT_VALUE;
else if (single_value->field_importance.is_bound()) {
ret_val.importance() = single_value->field_importance.valueof();
}
return ret_val;
}

void SCCP__ConnRefused__optionalPart_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 @SCCP_Types.SCCP_ConnRefused_optionalPart.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__ConnRefused__optionalPart_template[list_length];
}

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

SCCP__param__CPartyAddressEnc__opt_template& SCCP__ConnRefused__optionalPart_template::calledPAddress()
{
set_specific();
return single_value->field_calledPAddress;
}

const SCCP__param__CPartyAddressEnc__opt_template& SCCP__ConnRefused__optionalPart_template::calledPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPAddress of a non-specific template of type @SCCP_Types.SCCP_ConnRefused_optionalPart.");
return single_value->field_calledPAddress;
}

SCCP__param__Data__opt_template& SCCP__ConnRefused__optionalPart_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data__opt_template& SCCP__ConnRefused__optionalPart_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.SCCP_ConnRefused_optionalPart.");
return single_value->field_data;
}

SCCP__param__Importance__opt_template& SCCP__ConnRefused__optionalPart_template::importance()
{
set_specific();
return single_value->field_importance;
}

const SCCP__param__Importance__opt_template& SCCP__ConnRefused__optionalPart_template::importance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field importance of a non-specific template of type @SCCP_Types.SCCP_ConnRefused_optionalPart.");
return single_value->field_importance;
}

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

void SCCP__ConnRefused__optionalPart_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ calledPAddress := ");
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log();
TTCN_Logger::log_event_str(", importance := ");
single_value->field_importance.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 SCCP__ConnRefused__optionalPart_template::log_match(const SCCP__ConnRefused__optionalPart& 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.calledPAddress().ispresent()){
if(!single_value->field_calledPAddress.match(match_value.calledPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPAddress");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_calledPAddress.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".calledPAddress := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.data().ispresent()){
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.importance().ispresent()){
if(!single_value->field_importance.match(match_value.importance(), legacy)){
TTCN_Logger::log_logmatch_info(".importance");
single_value->field_importance.log_match(match_value.importance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_importance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".importance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_importance.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("{ calledPAddress := ");
if (match_value.calledPAddress().ispresent()) {
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_calledPAddress.log();
if (single_value->field_calledPAddress.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", data := ");
if (match_value.data().ispresent()) {
single_value->field_data.log_match(match_value.data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_data.log();
if (single_value->field_data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", importance := ");
if (match_value.importance().ispresent()) {
single_value->field_importance.log_match(match_value.importance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_importance.log();
if (single_value->field_importance.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 SCCP__ConnRefused__optionalPart_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!calledPAddress().is_bound()) calledPAddress() = OMIT_VALUE;
else calledPAddress().set_implicit_omit();
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__ConnRefused__optionalPart_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_calledPAddress.encode_text(text_buf);
single_value->field_data.encode_text(text_buf);
single_value->field_importance.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 @SCCP_Types.SCCP_ConnRefused_optionalPart.");
}
}

void SCCP__ConnRefused__optionalPart_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_calledPAddress.decode_text(text_buf);
single_value->field_data.decode_text(text_buf);
single_value->field_importance.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 SCCP__ConnRefused__optionalPart_template[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 @SCCP_Types.SCCP_ConnRefused_optionalPart.");
}
}

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

void SCCP__ConnRefused__optionalPart_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_calledPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnRefused_optionalPart");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnRefused_optionalPart");
single_value->field_importance.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ConnRefused_optionalPart");
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 : "@SCCP_Types.SCCP_ConnRefused_optionalPart");
}

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

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

PDU__SCCP__ConnectionRefused::PDU__SCCP__ConnectionRefused()
{
}

PDU__SCCP__ConnectionRefused::PDU__SCCP__ConnectionRefused(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const INTEGER& par_refusalCause,
    const INTEGER& par_pointer1,
    const OPTIONAL< SCCP__ConnRefused__optionalPart >& par_optionalPart,
    const OPTIONAL< SCCP__param__EndOfOptionalParams >& par_eop)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_refusalCause(par_refusalCause),
  field_pointer1(par_pointer1),
  field_optionalPart(par_optionalPart),
  field_eop(par_eop)
{
}

PDU__SCCP__ConnectionRefused::PDU__SCCP__ConnectionRefused(const PDU__SCCP__ConnectionRefused& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.refusalCause().is_bound()) field_refusalCause = other_value.refusalCause();
else field_refusalCause.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
else field_optionalPart.clean_up();
if (other_value.eop().is_bound()) field_eop = other_value.eop();
else field_eop.clean_up();
}

void PDU__SCCP__ConnectionRefused::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_refusalCause.clean_up();
field_pointer1.clean_up();
field_optionalPart.clean_up();
field_eop.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ConnectionRefused::get_descriptor() const { return &PDU__SCCP__ConnectionRefused_descr_; }
PDU__SCCP__ConnectionRefused& PDU__SCCP__ConnectionRefused::operator=(const PDU__SCCP__ConnectionRefused& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.refusalCause().is_bound()) field_refusalCause = other_value.refusalCause();
  else field_refusalCause.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
  else field_optionalPart.clean_up();
  if (other_value.eop().is_bound()) field_eop = other_value.eop();
  else field_eop.clean_up();
}
return *this;
}

boolean PDU__SCCP__ConnectionRefused::operator==(const PDU__SCCP__ConnectionRefused& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_refusalCause==other_value.field_refusalCause
  && field_pointer1==other_value.field_pointer1
  && field_optionalPart==other_value.field_optionalPart
  && field_eop==other_value.field_eop;
}

boolean PDU__SCCP__ConnectionRefused::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_refusalCause.is_bound())
  || (field_pointer1.is_bound())
  || (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_bound())
  || (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_bound());
}
boolean PDU__SCCP__ConnectionRefused::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_refusalCause.is_value()
  && field_pointer1.is_value()
  && (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_value())
  && (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_value());
}
int PDU__SCCP__ConnectionRefused::size_of() const
{
  int ret_val = 4;
  if (field_optionalPart.ispresent()) ret_val++;
  if (field_eop.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SCCP__ConnectionRefused::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", refusalCause := ");
field_refusalCause.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", optionalPart := ");
field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
field_eop.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ConnectionRefused::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (refusalCause().is_bound()) refusalCause().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

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

void PDU__SCCP__ConnectionRefused::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_refusalCause.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_optionalPart.encode_text(text_buf);
field_eop.encode_text(text_buf);
}

void PDU__SCCP__ConnectionRefused::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_refusalCause.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_optionalPart.decode_text(text_buf);
field_eop.decode_text(text_buf);
}

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

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

int PDU__SCCP__ConnectionRefused::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field3=-1;
  int start_of_field4=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__RefusalCause_descr_.raw->forceomit);
  decoded_field_length = field_refusalCause.RAW_decode(SCCP__param__RefusalCause_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());
  start_pos_of_field3=p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__SCCP__ConnectionRefused_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__ConnectionRefused_pointer1_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());
  start_of_field4=(int)field_pointer1+0?1:-1;
  if (limit > 0 && start_of_field4!=-1 && start_pos_of_field3!=-1){
  start_of_field4=start_pos_of_field3+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field4);
  limit=end_of_available_data-start_of_field4;
  if (force_omit != NULL && (*force_omit)(4)) {
    field_optionalPart = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, SCCP__ConnRefused__optionalPart_descr_.raw->forceomit);
  decoded_field_length = field_optionalPart().RAW_decode(SCCP__ConnRefused__optionalPart_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_optionalPart = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_optionalPart=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_eop = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, SCCP__param__EndOfOptionalParams_descr_.raw->forceomit);
  decoded_field_length = field_eop().RAW_decode(SCCP__param__EndOfOptionalParams_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_eop = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_eop.ispresent() || field_eop().paramName() != 0){
  field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ConnectionRefused::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__RefusalCause_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__SCCP__ConnectionRefused_pointer1_descr_.raw);
  if (field_optionalPart.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SCCP__ConnRefused__optionalPart_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_eop.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SCCP__param__EndOfOptionalParams_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_refusalCause.RAW_encode(SCCP__param__RefusalCause_descr_, *myleaf.body.node.nodes[2]);
  if (field_optionalPart.ispresent()) {
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_POINTER;
  myleaf.body.node.nodes[3]->coding_descr = &PDU__SCCP__ConnectionRefused_pointer1_descr_;
  myleaf.body.node.nodes[3]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_base = 3;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[3]->length = 8;
  } else {
    INTEGER atm;
    atm = 0;
    encoded_length += atm.RAW_encode(PDU__SCCP__ConnectionRefused_pointer1_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_optionalPart.ispresent()) {
  encoded_length += field_optionalPart().RAW_encode(SCCP__ConnRefused__optionalPart_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_eop.ispresent()) {
  encoded_length += field_eop().RAW_encode(SCCP__param__EndOfOptionalParams_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_eop.ispresent() && (!field_eop.ispresent() || field_eop().paramName() != 0)) {
  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){
  INTEGER new_val = 0;
  new_val.RAW_encode(SCCP__field__ParameterName_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ConnectionRefused_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
INTEGER_template field_refusalCause;
INTEGER_template field_pointer1;
SCCP__ConnRefused__optionalPart_template field_optionalPart;
SCCP__param__EndOfOptionalParams_template field_eop;
};

void PDU__SCCP__ConnectionRefused_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_refusalCause = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_optionalPart = ANY_OR_OMIT;
single_value->field_eop = ANY_OR_OMIT;
}
}
}

void PDU__SCCP__ConnectionRefused_template::copy_value(const PDU__SCCP__ConnectionRefused& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.refusalCause().is_bound()) {
  single_value->field_refusalCause = other_value.refusalCause();
} else {
  single_value->field_refusalCause.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.optionalPart().is_bound()) {
  if (other_value.optionalPart().ispresent()) single_value->field_optionalPart = other_value.optionalPart()();
  else single_value->field_optionalPart = OMIT_VALUE;
} else {
  single_value->field_optionalPart.clean_up();
}
if (other_value.eop().is_bound()) {
  if (other_value.eop().ispresent()) single_value->field_eop = other_value.eop()();
  else single_value->field_eop = OMIT_VALUE;
} else {
  single_value->field_eop.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ConnectionRefused_template::copy_template(const PDU__SCCP__ConnectionRefused_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.refusalCause().get_selection()) {
single_value->field_refusalCause = other_value.refusalCause();
} else {
single_value->field_refusalCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.optionalPart().get_selection()) {
single_value->field_optionalPart = other_value.optionalPart();
} else {
single_value->field_optionalPart.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eop().get_selection()) {
single_value->field_eop = other_value.eop();
} else {
single_value->field_eop.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ConnectionRefused_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ConnectionRefused_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ConnectionRefused_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 @SCCP_Types.PDU_SCCP_ConnectionRefused.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ConnectionRefused_template::PDU__SCCP__ConnectionRefused_template()
{
}

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

PDU__SCCP__ConnectionRefused_template::PDU__SCCP__ConnectionRefused_template(const PDU__SCCP__ConnectionRefused& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__ConnectionRefused_template::match(const PDU__SCCP__ConnectionRefused& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.refusalCause().is_bound()) return FALSE;
if(!single_value->field_refusalCause.match(other_value.refusalCause(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.optionalPart().is_bound()) return FALSE;
if((other_value.optionalPart().ispresent() ? !single_value->field_optionalPart.match((const SCCP__ConnRefused__optionalPart&)other_value.optionalPart(), legacy) : !single_value->field_optionalPart.match_omit(legacy)))return FALSE;
if(!other_value.eop().is_bound()) return FALSE;
if((other_value.eop().ispresent() ? !single_value->field_eop.match((const SCCP__param__EndOfOptionalParams&)other_value.eop(), legacy) : !single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ConnectionRefused.");
}
return FALSE;
}

boolean PDU__SCCP__ConnectionRefused_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_refusalCause.is_bound()
 || single_value->field_pointer1.is_bound()
 || (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_bound())
 || (single_value->field_eop.is_omit() || single_value->field_eop.is_bound());
}

boolean PDU__SCCP__ConnectionRefused_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_refusalCause.is_value()
 && single_value->field_pointer1.is_value()
 && (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_value())
 && (single_value->field_eop.is_omit() || single_value->field_eop.is_value());
}

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

PDU__SCCP__ConnectionRefused PDU__SCCP__ConnectionRefused_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 @SCCP_Types.PDU_SCCP_ConnectionRefused.");
PDU__SCCP__ConnectionRefused ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_refusalCause.is_bound()) {
ret_val.refusalCause() = single_value->field_refusalCause.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_optionalPart.is_omit()) ret_val.optionalPart() = OMIT_VALUE;
else if (single_value->field_optionalPart.is_bound()) {
ret_val.optionalPart() = single_value->field_optionalPart.valueof();
}
if (single_value->field_eop.is_omit()) ret_val.eop() = OMIT_VALUE;
else if (single_value->field_eop.is_bound()) {
ret_val.eop() = single_value->field_eop.valueof();
}
return ret_val;
}

void PDU__SCCP__ConnectionRefused_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 @SCCP_Types.PDU_SCCP_ConnectionRefused.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ConnectionRefused_template[list_length];
}

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

INTEGER_template& PDU__SCCP__ConnectionRefused_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ConnectionRefused_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ConnectionRefused_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ConnectionRefused_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
return single_value->field_destLocRef;
}

INTEGER_template& PDU__SCCP__ConnectionRefused_template::refusalCause()
{
set_specific();
return single_value->field_refusalCause;
}

const INTEGER_template& PDU__SCCP__ConnectionRefused_template::refusalCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field refusalCause of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
return single_value->field_refusalCause;
}

INTEGER_template& PDU__SCCP__ConnectionRefused_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__ConnectionRefused_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
return single_value->field_pointer1;
}

SCCP__ConnRefused__optionalPart_template& PDU__SCCP__ConnectionRefused_template::optionalPart()
{
set_specific();
return single_value->field_optionalPart;
}

const SCCP__ConnRefused__optionalPart_template& PDU__SCCP__ConnectionRefused_template::optionalPart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field optionalPart of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
return single_value->field_optionalPart;
}

SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ConnectionRefused_template::eop()
{
set_specific();
return single_value->field_eop;
}

const SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ConnectionRefused_template::eop() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eop of a non-specific template of type @SCCP_Types.PDU_SCCP_ConnectionRefused.");
return single_value->field_eop;
}

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

void PDU__SCCP__ConnectionRefused_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", refusalCause := ");
single_value->field_refusalCause.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", optionalPart := ");
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
single_value->field_eop.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__ConnectionRefused_template::log_match(const PDU__SCCP__ConnectionRefused& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_refusalCause.match(match_value.refusalCause(), legacy)){
TTCN_Logger::log_logmatch_info(".refusalCause");
single_value->field_refusalCause.log_match(match_value.refusalCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.optionalPart().ispresent()){
if(!single_value->field_optionalPart.match(match_value.optionalPart(), legacy)){
TTCN_Logger::log_logmatch_info(".optionalPart");
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_optionalPart.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".optionalPart := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eop().ispresent()){
if(!single_value->field_eop.match(match_value.eop(), legacy)){
TTCN_Logger::log_logmatch_info(".eop");
single_value->field_eop.log_match(match_value.eop(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eop.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eop := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eop.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", refusalCause := ");
single_value->field_refusalCause.log_match(match_value.refusalCause(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", optionalPart := ");
if (match_value.optionalPart().ispresent()) {
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_optionalPart.log();
if (single_value->field_optionalPart.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eop := ");
if (match_value.eop().ispresent()) {
single_value->field_eop.log_match(match_value.eop(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eop.log();
if (single_value->field_eop.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ConnectionRefused_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (refusalCause().is_bound()) refusalCause().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__ConnectionRefused_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_refusalCause.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_optionalPart.encode_text(text_buf);
single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ConnectionRefused.");
}
}

void PDU__SCCP__ConnectionRefused_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_refusalCause.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_optionalPart.decode_text(text_buf);
single_value->field_eop.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ConnectionRefused_template[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 @SCCP_Types.PDU_SCCP_ConnectionRefused.");
}
}

void PDU__SCCP__ConnectionRefused_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ConnectionRefused_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_ConnectionRefused has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) refusalCause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eop().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "refusalCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          refusalCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ConnectionRefused: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ConnectionRefused_template* precondition = new PDU__SCCP__ConnectionRefused_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ConnectionRefused_template* implied_template = new PDU__SCCP__ConnectionRefused_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ConnectionRefused_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ConnectionRefused");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ConnectionRefused_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRefused");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRefused");
single_value->field_refusalCause.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRefused");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRefused");
single_value->field_optionalPart.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRefused");
single_value->field_eop.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ConnectionRefused");
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 : "@SCCP_Types.PDU_SCCP_ConnectionRefused");
}

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

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

SCCP__Released__optionalPart::SCCP__Released__optionalPart()
{
}

SCCP__Released__optionalPart::SCCP__Released__optionalPart(const OPTIONAL< SCCP__param__Data__opt >& par_data,
    const OPTIONAL< SCCP__param__Importance__opt >& par_importance)
  :   field_data(par_data),
  field_importance(par_importance)
{
}

SCCP__Released__optionalPart::SCCP__Released__optionalPart(const SCCP__Released__optionalPart& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_Released_optionalPart.");
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
if (other_value.importance().is_bound()) field_importance = other_value.importance();
else field_importance.clean_up();
}

void SCCP__Released__optionalPart::clean_up()
{
field_data.clean_up();
field_importance.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__Released__optionalPart::get_descriptor() const { return &SCCP__Released__optionalPart_descr_; }
SCCP__Released__optionalPart& SCCP__Released__optionalPart::operator=(const SCCP__Released__optionalPart& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_Released_optionalPart.");
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
  if (other_value.importance().is_bound()) field_importance = other_value.importance();
  else field_importance.clean_up();
}
return *this;
}

boolean SCCP__Released__optionalPart::operator==(const SCCP__Released__optionalPart& other_value) const
{
return field_data==other_value.field_data
  && field_importance==other_value.field_importance;
}

boolean SCCP__Released__optionalPart::is_bound() const
{
return (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_bound())
  || (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_bound());
}
boolean SCCP__Released__optionalPart::is_value() const
{
return (OPTIONAL_OMIT == field_data.get_selection() || field_data.is_value())
  && (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_value());
}
int SCCP__Released__optionalPart::size_of() const
{
  int ret_val = 0;
  if (field_data.ispresent()) ret_val++;
  if (field_importance.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__Released__optionalPart::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ data := ");
field_data.log();
TTCN_Logger::log_event_str(", importance := ");
field_importance.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__Released__optionalPart::set_implicit_omit()
{
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

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

void SCCP__Released__optionalPart::encode_text(Text_Buf& text_buf) const
{
field_data.encode_text(text_buf);
field_importance.encode_text(text_buf);
}

void SCCP__Released__optionalPart::decode_text(Text_Buf& text_buf)
{
field_data.decode_text(text_buf);
field_importance.decode_text(text_buf);
}

void SCCP__Released__optionalPart::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 SCCP__Released__optionalPart::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 SCCP__Released__optionalPart::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_data = OMIT_VALUE;
field_importance = 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 (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Data__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 15) {
RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__Data__opt_descr_.raw->forceomit);
int decoded_field_length = field_data().RAW_decode(SCCP__param__Data__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
if (decoded_field_length > 0 && (field_data.ispresent() && field_data().paramName() == 15)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[0] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_data = OMIT_VALUE;
}
}
}
if (field_map[1] == 0 && (force_omit == NULL || !(*force_omit)(1))) {
raw_order_t temporal_top_order;
int temporal_decoded_length;
if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_RIGHT) temporal_top_order = ORDER_MSB;
else if (SCCP__param__Importance__opt_descr_.raw->top_bit_order == TOP_BIT_LEFT) temporal_top_order = ORDER_LSB;
else temporal_top_order = top_bit_ord;
INTEGER temporal_0;
p_buf.set_pos_bit(fl_start_pos + 0);
temporal_decoded_length = temporal_0.RAW_decode(SCCP__field__ParameterName_descr_, p_buf, limit, temporal_top_order, TRUE);
p_buf.set_pos_bit(fl_start_pos);
if (temporal_decoded_length > 0 && temporal_0 == 18) {
RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__Importance__opt_descr_.raw->forceomit);
int decoded_field_length = field_importance().RAW_decode(SCCP__param__Importance__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
if (decoded_field_length > 0 && (field_importance.ispresent() && field_importance().paramName() == 18)) {
decoded_length += decoded_field_length;
limit -= decoded_field_length;
field_map[1] = 1;
continue;
} else {
p_buf.set_pos_bit(fl_start_pos);
field_importance = OMIT_VALUE;
}
}
}
break;
}
return decoded_length + prepaddlength + p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__Released__optionalPart::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_data.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__Data__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_importance.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__Importance__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_data.ispresent()) {
  encoded_length += field_data().RAW_encode(SCCP__param__Data__opt_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_importance.ispresent()) {
  encoded_length += field_importance().RAW_encode(SCCP__param__Importance__opt_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_data.ispresent() && (!field_data.ispresent() || field_data().paramName() != 15)) {
  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){
  INTEGER new_val = 15;
  new_val.RAW_encode(SCCP__field__ParameterName_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_importance.ispresent() && (!field_importance.ispresent() || field_importance().paramName() != 18)) {
  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){
  INTEGER new_val = 18;
  new_val.RAW_encode(SCCP__field__ParameterName_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 SCCP__Released__optionalPart_template::single_value_struct {
SCCP__param__Data__opt_template field_data;
SCCP__param__Importance__opt_template field_importance;
};

void SCCP__Released__optionalPart_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_data = ANY_OR_OMIT;
single_value->field_importance = ANY_OR_OMIT;
}
}
}

void SCCP__Released__optionalPart_template::copy_value(const SCCP__Released__optionalPart& other_value)
{
single_value = new single_value_struct;
if (other_value.data().is_bound()) {
  if (other_value.data().ispresent()) single_value->field_data = other_value.data()();
  else single_value->field_data = OMIT_VALUE;
} else {
  single_value->field_data.clean_up();
}
if (other_value.importance().is_bound()) {
  if (other_value.importance().ispresent()) single_value->field_importance = other_value.importance()();
  else single_value->field_importance = OMIT_VALUE;
} else {
  single_value->field_importance.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__Released__optionalPart_template::copy_template(const SCCP__Released__optionalPart_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.importance().get_selection()) {
single_value->field_importance = other_value.importance();
} else {
single_value->field_importance.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 SCCP__Released__optionalPart_template[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 SCCP__Released__optionalPart_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__Released__optionalPart_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 @SCCP_Types.SCCP_Released_optionalPart.");
break;
}
set_selection(other_value);
}

SCCP__Released__optionalPart_template::SCCP__Released__optionalPart_template()
{
}

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

SCCP__Released__optionalPart_template::SCCP__Released__optionalPart_template(const SCCP__Released__optionalPart& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SCCP__Released__optionalPart_template::match(const SCCP__Released__optionalPart& 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.data().is_bound()) return FALSE;
if((other_value.data().ispresent() ? !single_value->field_data.match((const SCCP__param__Data__opt&)other_value.data(), legacy) : !single_value->field_data.match_omit(legacy)))return FALSE;
if(!other_value.importance().is_bound()) return FALSE;
if((other_value.importance().ispresent() ? !single_value->field_importance.match((const SCCP__param__Importance__opt&)other_value.importance(), legacy) : !single_value->field_importance.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 @SCCP_Types.SCCP_Released_optionalPart.");
}
return FALSE;
}

boolean SCCP__Released__optionalPart_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_data.is_omit() || single_value->field_data.is_bound())
 || (single_value->field_importance.is_omit() || single_value->field_importance.is_bound());
}

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

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

SCCP__Released__optionalPart SCCP__Released__optionalPart_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 @SCCP_Types.SCCP_Released_optionalPart.");
SCCP__Released__optionalPart ret_val;
if (single_value->field_data.is_omit()) ret_val.data() = OMIT_VALUE;
else if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
if (single_value->field_importance.is_omit()) ret_val.importance() = OMIT_VALUE;
else if (single_value->field_importance.is_bound()) {
ret_val.importance() = single_value->field_importance.valueof();
}
return ret_val;
}

void SCCP__Released__optionalPart_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 @SCCP_Types.SCCP_Released_optionalPart.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__Released__optionalPart_template[list_length];
}

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

SCCP__param__Data__opt_template& SCCP__Released__optionalPart_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data__opt_template& SCCP__Released__optionalPart_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.SCCP_Released_optionalPart.");
return single_value->field_data;
}

SCCP__param__Importance__opt_template& SCCP__Released__optionalPart_template::importance()
{
set_specific();
return single_value->field_importance;
}

const SCCP__param__Importance__opt_template& SCCP__Released__optionalPart_template::importance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field importance of a non-specific template of type @SCCP_Types.SCCP_Released_optionalPart.");
return single_value->field_importance;
}

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

void SCCP__Released__optionalPart_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ data := ");
single_value->field_data.log();
TTCN_Logger::log_event_str(", importance := ");
single_value->field_importance.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 SCCP__Released__optionalPart_template::log_match(const SCCP__Released__optionalPart& 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.data().ispresent()){
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_data.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".data := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_data.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.importance().ispresent()){
if(!single_value->field_importance.match(match_value.importance(), legacy)){
TTCN_Logger::log_logmatch_info(".importance");
single_value->field_importance.log_match(match_value.importance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_importance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".importance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_importance.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("{ data := ");
if (match_value.data().ispresent()) {
single_value->field_data.log_match(match_value.data(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_data.log();
if (single_value->field_data.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", importance := ");
if (match_value.importance().ispresent()) {
single_value->field_importance.log_match(match_value.importance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_importance.log();
if (single_value->field_importance.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 SCCP__Released__optionalPart_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!data().is_bound()) data() = OMIT_VALUE;
else data().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__Released__optionalPart_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_data.encode_text(text_buf);
single_value->field_importance.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 @SCCP_Types.SCCP_Released_optionalPart.");
}
}

void SCCP__Released__optionalPart_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_data.decode_text(text_buf);
single_value->field_importance.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 SCCP__Released__optionalPart_template[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 @SCCP_Types.SCCP_Released_optionalPart.");
}
}

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

void SCCP__Released__optionalPart_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_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_Released_optionalPart");
single_value->field_importance.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_Released_optionalPart");
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 : "@SCCP_Types.SCCP_Released_optionalPart");
}

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

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

PDU__SCCP__Released::PDU__SCCP__Released()
{
}

PDU__SCCP__Released::PDU__SCCP__Released(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const OCTETSTRING& par_sourceLocRef,
    const INTEGER& par_releaseCause,
    const INTEGER& par_pointer1,
    const OPTIONAL< SCCP__Released__optionalPart >& par_optionalPart,
    const OPTIONAL< SCCP__param__EndOfOptionalParams >& par_eop)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_sourceLocRef(par_sourceLocRef),
  field_releaseCause(par_releaseCause),
  field_pointer1(par_pointer1),
  field_optionalPart(par_optionalPart),
  field_eop(par_eop)
{
}

PDU__SCCP__Released::PDU__SCCP__Released(const PDU__SCCP__Released& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_Released.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
else field_sourceLocRef.clean_up();
if (other_value.releaseCause().is_bound()) field_releaseCause = other_value.releaseCause();
else field_releaseCause.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
else field_optionalPart.clean_up();
if (other_value.eop().is_bound()) field_eop = other_value.eop();
else field_eop.clean_up();
}

void PDU__SCCP__Released::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_sourceLocRef.clean_up();
field_releaseCause.clean_up();
field_pointer1.clean_up();
field_optionalPart.clean_up();
field_eop.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__Released::get_descriptor() const { return &PDU__SCCP__Released_descr_; }
PDU__SCCP__Released& PDU__SCCP__Released::operator=(const PDU__SCCP__Released& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_Released.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
  else field_sourceLocRef.clean_up();
  if (other_value.releaseCause().is_bound()) field_releaseCause = other_value.releaseCause();
  else field_releaseCause.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
  else field_optionalPart.clean_up();
  if (other_value.eop().is_bound()) field_eop = other_value.eop();
  else field_eop.clean_up();
}
return *this;
}

boolean PDU__SCCP__Released::operator==(const PDU__SCCP__Released& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_sourceLocRef==other_value.field_sourceLocRef
  && field_releaseCause==other_value.field_releaseCause
  && field_pointer1==other_value.field_pointer1
  && field_optionalPart==other_value.field_optionalPart
  && field_eop==other_value.field_eop;
}

boolean PDU__SCCP__Released::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_sourceLocRef.is_bound())
  || (field_releaseCause.is_bound())
  || (field_pointer1.is_bound())
  || (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_bound())
  || (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_bound());
}
boolean PDU__SCCP__Released::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_sourceLocRef.is_value()
  && field_releaseCause.is_value()
  && field_pointer1.is_value()
  && (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_value())
  && (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_value());
}
int PDU__SCCP__Released::size_of() const
{
  int ret_val = 5;
  if (field_optionalPart.ispresent()) ret_val++;
  if (field_eop.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SCCP__Released::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
field_sourceLocRef.log();
TTCN_Logger::log_event_str(", releaseCause := ");
field_releaseCause.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", optionalPart := ");
field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
field_eop.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__Released::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (releaseCause().is_bound()) releaseCause().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__Released::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @SCCP_Types.PDU_SCCP_Released 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) releaseCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) eop().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "releaseCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          releaseCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_Released: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_Released");
  }
}

void PDU__SCCP__Released::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_sourceLocRef.encode_text(text_buf);
field_releaseCause.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_optionalPart.encode_text(text_buf);
field_eop.encode_text(text_buf);
}

void PDU__SCCP__Released::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_sourceLocRef.decode_text(text_buf);
field_releaseCause.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_optionalPart.decode_text(text_buf);
field_eop.decode_text(text_buf);
}

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

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

int PDU__SCCP__Released::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field4=-1;
  int start_of_field5=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SourceLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_sourceLocRef.RAW_decode(SCCP__param__SourceLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__ReleaseCause_descr_.raw->forceomit);
  decoded_field_length = field_releaseCause.RAW_decode(SCCP__param__ReleaseCause_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());
  start_pos_of_field4=p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDU__SCCP__Released_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__Released_pointer1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field5=(int)field_pointer1+0?1:-1;
  if (limit > 0 && start_of_field5!=-1 && start_pos_of_field4!=-1){
  start_of_field5=start_pos_of_field4+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field5);
  limit=end_of_available_data-start_of_field5;
  if (force_omit != NULL && (*force_omit)(5)) {
    field_optionalPart = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, SCCP__Released__optionalPart_descr_.raw->forceomit);
  decoded_field_length = field_optionalPart().RAW_decode(SCCP__Released__optionalPart_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_optionalPart = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_optionalPart=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_eop = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, SCCP__param__EndOfOptionalParams_descr_.raw->forceomit);
  decoded_field_length = field_eop().RAW_decode(SCCP__param__EndOfOptionalParams_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_eop = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_eop.ispresent() || field_eop().paramName() != 0){
  field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__Released::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SourceLocalReference_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__ReleaseCause_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDU__SCCP__Released_pointer1_descr_.raw);
  if (field_optionalPart.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SCCP__Released__optionalPart_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_eop.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, SCCP__param__EndOfOptionalParams_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_sourceLocRef.RAW_encode(SCCP__param__SourceLocalReference_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_releaseCause.RAW_encode(SCCP__param__ReleaseCause_descr_, *myleaf.body.node.nodes[3]);
  if (field_optionalPart.ispresent()) {
  encoded_length += 8;
  myleaf.body.node.nodes[4]->calc = CALC_POINTER;
  myleaf.body.node.nodes[4]->coding_descr = &PDU__SCCP__Released_pointer1_descr_;
  myleaf.body.node.nodes[4]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_base = 4;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[4]->length = 8;
  } else {
    INTEGER atm;
    atm = 0;
    encoded_length += atm.RAW_encode(PDU__SCCP__Released_pointer1_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_optionalPart.ispresent()) {
  encoded_length += field_optionalPart().RAW_encode(SCCP__Released__optionalPart_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_eop.ispresent()) {
  encoded_length += field_eop().RAW_encode(SCCP__param__EndOfOptionalParams_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_eop.ispresent() && (!field_eop.ispresent() || field_eop().paramName() != 0)) {
  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){
  INTEGER new_val = 0;
  new_val.RAW_encode(SCCP__field__ParameterName_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__Released_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
OCTETSTRING_template field_sourceLocRef;
INTEGER_template field_releaseCause;
INTEGER_template field_pointer1;
SCCP__Released__optionalPart_template field_optionalPart;
SCCP__param__EndOfOptionalParams_template field_eop;
};

void PDU__SCCP__Released_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_sourceLocRef = ANY_VALUE;
single_value->field_releaseCause = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_optionalPart = ANY_OR_OMIT;
single_value->field_eop = ANY_OR_OMIT;
}
}
}

void PDU__SCCP__Released_template::copy_value(const PDU__SCCP__Released& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.sourceLocRef().is_bound()) {
  single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
  single_value->field_sourceLocRef.clean_up();
}
if (other_value.releaseCause().is_bound()) {
  single_value->field_releaseCause = other_value.releaseCause();
} else {
  single_value->field_releaseCause.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.optionalPart().is_bound()) {
  if (other_value.optionalPart().ispresent()) single_value->field_optionalPart = other_value.optionalPart()();
  else single_value->field_optionalPart = OMIT_VALUE;
} else {
  single_value->field_optionalPart.clean_up();
}
if (other_value.eop().is_bound()) {
  if (other_value.eop().ispresent()) single_value->field_eop = other_value.eop()();
  else single_value->field_eop = OMIT_VALUE;
} else {
  single_value->field_eop.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__Released_template::copy_template(const PDU__SCCP__Released_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceLocRef().get_selection()) {
single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
single_value->field_sourceLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.releaseCause().get_selection()) {
single_value->field_releaseCause = other_value.releaseCause();
} else {
single_value->field_releaseCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.optionalPart().get_selection()) {
single_value->field_optionalPart = other_value.optionalPart();
} else {
single_value->field_optionalPart.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eop().get_selection()) {
single_value->field_eop = other_value.eop();
} else {
single_value->field_eop.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__Released_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__Released_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__Released_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 @SCCP_Types.PDU_SCCP_Released.");
break;
}
set_selection(other_value);
}

PDU__SCCP__Released_template::PDU__SCCP__Released_template()
{
}

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

PDU__SCCP__Released_template::PDU__SCCP__Released_template(const PDU__SCCP__Released& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__Released_template::match(const PDU__SCCP__Released& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.sourceLocRef().is_bound()) return FALSE;
if(!single_value->field_sourceLocRef.match(other_value.sourceLocRef(), legacy))return FALSE;
if(!other_value.releaseCause().is_bound()) return FALSE;
if(!single_value->field_releaseCause.match(other_value.releaseCause(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.optionalPart().is_bound()) return FALSE;
if((other_value.optionalPart().ispresent() ? !single_value->field_optionalPart.match((const SCCP__Released__optionalPart&)other_value.optionalPart(), legacy) : !single_value->field_optionalPart.match_omit(legacy)))return FALSE;
if(!other_value.eop().is_bound()) return FALSE;
if((other_value.eop().ispresent() ? !single_value->field_eop.match((const SCCP__param__EndOfOptionalParams&)other_value.eop(), legacy) : !single_value->field_eop.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 @SCCP_Types.PDU_SCCP_Released.");
}
return FALSE;
}

boolean PDU__SCCP__Released_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_sourceLocRef.is_bound()
 || single_value->field_releaseCause.is_bound()
 || single_value->field_pointer1.is_bound()
 || (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_bound())
 || (single_value->field_eop.is_omit() || single_value->field_eop.is_bound());
}

boolean PDU__SCCP__Released_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_sourceLocRef.is_value()
 && single_value->field_releaseCause.is_value()
 && single_value->field_pointer1.is_value()
 && (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_value())
 && (single_value->field_eop.is_omit() || single_value->field_eop.is_value());
}

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

PDU__SCCP__Released PDU__SCCP__Released_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 @SCCP_Types.PDU_SCCP_Released.");
PDU__SCCP__Released ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_sourceLocRef.is_bound()) {
ret_val.sourceLocRef() = single_value->field_sourceLocRef.valueof();
}
if (single_value->field_releaseCause.is_bound()) {
ret_val.releaseCause() = single_value->field_releaseCause.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_optionalPart.is_omit()) ret_val.optionalPart() = OMIT_VALUE;
else if (single_value->field_optionalPart.is_bound()) {
ret_val.optionalPart() = single_value->field_optionalPart.valueof();
}
if (single_value->field_eop.is_omit()) ret_val.eop() = OMIT_VALUE;
else if (single_value->field_eop.is_bound()) {
ret_val.eop() = single_value->field_eop.valueof();
}
return ret_val;
}

void PDU__SCCP__Released_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 @SCCP_Types.PDU_SCCP_Released.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__Released_template[list_length];
}

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

INTEGER_template& PDU__SCCP__Released_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__Released_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_Released.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__Released_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__Released_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_Released.");
return single_value->field_destLocRef;
}

OCTETSTRING_template& PDU__SCCP__Released_template::sourceLocRef()
{
set_specific();
return single_value->field_sourceLocRef;
}

const OCTETSTRING_template& PDU__SCCP__Released_template::sourceLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_Released.");
return single_value->field_sourceLocRef;
}

INTEGER_template& PDU__SCCP__Released_template::releaseCause()
{
set_specific();
return single_value->field_releaseCause;
}

const INTEGER_template& PDU__SCCP__Released_template::releaseCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field releaseCause of a non-specific template of type @SCCP_Types.PDU_SCCP_Released.");
return single_value->field_releaseCause;
}

INTEGER_template& PDU__SCCP__Released_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__Released_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_Released.");
return single_value->field_pointer1;
}

SCCP__Released__optionalPart_template& PDU__SCCP__Released_template::optionalPart()
{
set_specific();
return single_value->field_optionalPart;
}

const SCCP__Released__optionalPart_template& PDU__SCCP__Released_template::optionalPart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field optionalPart of a non-specific template of type @SCCP_Types.PDU_SCCP_Released.");
return single_value->field_optionalPart;
}

SCCP__param__EndOfOptionalParams_template& PDU__SCCP__Released_template::eop()
{
set_specific();
return single_value->field_eop;
}

const SCCP__param__EndOfOptionalParams_template& PDU__SCCP__Released_template::eop() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eop of a non-specific template of type @SCCP_Types.PDU_SCCP_Released.");
return single_value->field_eop;
}

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

void PDU__SCCP__Released_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log();
TTCN_Logger::log_event_str(", releaseCause := ");
single_value->field_releaseCause.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", optionalPart := ");
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
single_value->field_eop.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__Released_template::log_match(const PDU__SCCP__Released& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sourceLocRef.match(match_value.sourceLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceLocRef");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_releaseCause.match(match_value.releaseCause(), legacy)){
TTCN_Logger::log_logmatch_info(".releaseCause");
single_value->field_releaseCause.log_match(match_value.releaseCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.optionalPart().ispresent()){
if(!single_value->field_optionalPart.match(match_value.optionalPart(), legacy)){
TTCN_Logger::log_logmatch_info(".optionalPart");
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_optionalPart.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".optionalPart := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eop().ispresent()){
if(!single_value->field_eop.match(match_value.eop(), legacy)){
TTCN_Logger::log_logmatch_info(".eop");
single_value->field_eop.log_match(match_value.eop(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eop.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eop := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eop.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::log_event_str(", releaseCause := ");
single_value->field_releaseCause.log_match(match_value.releaseCause(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", optionalPart := ");
if (match_value.optionalPart().ispresent()) {
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_optionalPart.log();
if (single_value->field_optionalPart.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eop := ");
if (match_value.eop().ispresent()) {
single_value->field_eop.log_match(match_value.eop(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eop.log();
if (single_value->field_eop.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__Released_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (releaseCause().is_bound()) releaseCause().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__Released_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_sourceLocRef.encode_text(text_buf);
single_value->field_releaseCause.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_optionalPart.encode_text(text_buf);
single_value->field_eop.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 @SCCP_Types.PDU_SCCP_Released.");
}
}

void PDU__SCCP__Released_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_sourceLocRef.decode_text(text_buf);
single_value->field_releaseCause.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_optionalPart.decode_text(text_buf);
single_value->field_eop.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__Released_template[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 @SCCP_Types.PDU_SCCP_Released.");
}
}

void PDU__SCCP__Released_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__Released_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_Released 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) releaseCause().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) eop().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(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "releaseCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          releaseCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_Released: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__Released_template* precondition = new PDU__SCCP__Released_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__Released_template* implied_template = new PDU__SCCP__Released_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__Released_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_Released");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__Released_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Released");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Released");
single_value->field_sourceLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Released");
single_value->field_releaseCause.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Released");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Released");
single_value->field_optionalPart.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Released");
single_value->field_eop.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Released");
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 : "@SCCP_Types.PDU_SCCP_Released");
}

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

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

PDU__SCCP__ReleaseComplete::PDU__SCCP__ReleaseComplete()
{
}

PDU__SCCP__ReleaseComplete::PDU__SCCP__ReleaseComplete(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const OCTETSTRING& par_sourceLocRef)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_sourceLocRef(par_sourceLocRef)
{
}

PDU__SCCP__ReleaseComplete::PDU__SCCP__ReleaseComplete(const PDU__SCCP__ReleaseComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ReleaseComplete.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
else field_sourceLocRef.clean_up();
}

void PDU__SCCP__ReleaseComplete::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_sourceLocRef.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ReleaseComplete::get_descriptor() const { return &PDU__SCCP__ReleaseComplete_descr_; }
PDU__SCCP__ReleaseComplete& PDU__SCCP__ReleaseComplete::operator=(const PDU__SCCP__ReleaseComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ReleaseComplete.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
  else field_sourceLocRef.clean_up();
}
return *this;
}

boolean PDU__SCCP__ReleaseComplete::operator==(const PDU__SCCP__ReleaseComplete& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_sourceLocRef==other_value.field_sourceLocRef;
}

boolean PDU__SCCP__ReleaseComplete::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_sourceLocRef.is_bound());
}
boolean PDU__SCCP__ReleaseComplete::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_sourceLocRef.is_value();
}
void PDU__SCCP__ReleaseComplete::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
field_sourceLocRef.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ReleaseComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
}

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

void PDU__SCCP__ReleaseComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_sourceLocRef.encode_text(text_buf);
}

void PDU__SCCP__ReleaseComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_sourceLocRef.decode_text(text_buf);
}

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

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

int PDU__SCCP__ReleaseComplete::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, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SourceLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_sourceLocRef.RAW_decode(SCCP__param__SourceLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ReleaseComplete::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SourceLocalReference_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_sourceLocRef.RAW_encode(SCCP__param__SourceLocalReference_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ReleaseComplete_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
OCTETSTRING_template field_sourceLocRef;
};

void PDU__SCCP__ReleaseComplete_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_sourceLocRef = ANY_VALUE;
}
}
}

void PDU__SCCP__ReleaseComplete_template::copy_value(const PDU__SCCP__ReleaseComplete& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.sourceLocRef().is_bound()) {
  single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
  single_value->field_sourceLocRef.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ReleaseComplete_template::copy_template(const PDU__SCCP__ReleaseComplete_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceLocRef().get_selection()) {
single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
single_value->field_sourceLocRef.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ReleaseComplete_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ReleaseComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ReleaseComplete_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 @SCCP_Types.PDU_SCCP_ReleaseComplete.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ReleaseComplete_template::PDU__SCCP__ReleaseComplete_template()
{
}

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

PDU__SCCP__ReleaseComplete_template::PDU__SCCP__ReleaseComplete_template(const PDU__SCCP__ReleaseComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__ReleaseComplete_template::match(const PDU__SCCP__ReleaseComplete& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.sourceLocRef().is_bound()) return FALSE;
if(!single_value->field_sourceLocRef.match(other_value.sourceLocRef(), 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 @SCCP_Types.PDU_SCCP_ReleaseComplete.");
}
return FALSE;
}

boolean PDU__SCCP__ReleaseComplete_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_sourceLocRef.is_bound();
}

boolean PDU__SCCP__ReleaseComplete_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_sourceLocRef.is_value();
}

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

PDU__SCCP__ReleaseComplete PDU__SCCP__ReleaseComplete_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 @SCCP_Types.PDU_SCCP_ReleaseComplete.");
PDU__SCCP__ReleaseComplete ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_sourceLocRef.is_bound()) {
ret_val.sourceLocRef() = single_value->field_sourceLocRef.valueof();
}
return ret_val;
}

void PDU__SCCP__ReleaseComplete_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 @SCCP_Types.PDU_SCCP_ReleaseComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ReleaseComplete_template[list_length];
}

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

INTEGER_template& PDU__SCCP__ReleaseComplete_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ReleaseComplete_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ReleaseComplete.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ReleaseComplete_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ReleaseComplete_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ReleaseComplete.");
return single_value->field_destLocRef;
}

OCTETSTRING_template& PDU__SCCP__ReleaseComplete_template::sourceLocRef()
{
set_specific();
return single_value->field_sourceLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ReleaseComplete_template::sourceLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ReleaseComplete.");
return single_value->field_sourceLocRef;
}

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

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

void PDU__SCCP__ReleaseComplete_template::log_match(const PDU__SCCP__ReleaseComplete& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sourceLocRef.match(match_value.sourceLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceLocRef");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ReleaseComplete_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
}

void PDU__SCCP__ReleaseComplete_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_sourceLocRef.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 @SCCP_Types.PDU_SCCP_ReleaseComplete.");
}
}

void PDU__SCCP__ReleaseComplete_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_sourceLocRef.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ReleaseComplete_template[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 @SCCP_Types.PDU_SCCP_ReleaseComplete.");
}
}

void PDU__SCCP__ReleaseComplete_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ReleaseComplete_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 @SCCP_Types.PDU_SCCP_ReleaseComplete has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ReleaseComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ReleaseComplete_template* precondition = new PDU__SCCP__ReleaseComplete_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ReleaseComplete_template* implied_template = new PDU__SCCP__ReleaseComplete_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ReleaseComplete_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ReleaseComplete");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ReleaseComplete_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ReleaseComplete");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ReleaseComplete");
single_value->field_sourceLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ReleaseComplete");
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 : "@SCCP_Types.PDU_SCCP_ReleaseComplete");
}

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

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

PDU__SCCP__DataForm1::PDU__SCCP__DataForm1()
{
}

PDU__SCCP__DataForm1::PDU__SCCP__DataForm1(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const SCCP__param__SegmentingReassembl& par_segmentingReassembl,
    const INTEGER& par_pointer1,
    const SCCP__param__Data& par_data)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_segmentingReassembl(par_segmentingReassembl),
  field_pointer1(par_pointer1),
  field_data(par_data)
{
}

PDU__SCCP__DataForm1::PDU__SCCP__DataForm1(const PDU__SCCP__DataForm1& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_DataForm1.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.segmentingReassembl().is_bound()) field_segmentingReassembl = other_value.segmentingReassembl();
else field_segmentingReassembl.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void PDU__SCCP__DataForm1::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_segmentingReassembl.clean_up();
field_pointer1.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__DataForm1::get_descriptor() const { return &PDU__SCCP__DataForm1_descr_; }
PDU__SCCP__DataForm1& PDU__SCCP__DataForm1::operator=(const PDU__SCCP__DataForm1& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_DataForm1.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.segmentingReassembl().is_bound()) field_segmentingReassembl = other_value.segmentingReassembl();
  else field_segmentingReassembl.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean PDU__SCCP__DataForm1::operator==(const PDU__SCCP__DataForm1& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_segmentingReassembl==other_value.field_segmentingReassembl
  && field_pointer1==other_value.field_pointer1
  && field_data==other_value.field_data;
}

boolean PDU__SCCP__DataForm1::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_segmentingReassembl.is_bound())
  || (field_pointer1.is_bound())
  || (field_data.is_bound());
}
boolean PDU__SCCP__DataForm1::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_segmentingReassembl.is_value()
  && field_pointer1.is_value()
  && field_data.is_value();
}
void PDU__SCCP__DataForm1::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", segmentingReassembl := ");
field_segmentingReassembl.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__DataForm1::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (segmentingReassembl().is_bound()) segmentingReassembl().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__DataForm1::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 @SCCP_Types.PDU_SCCP_DataForm1 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) segmentingReassembl().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "segmentingReassembl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          segmentingReassembl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_DataForm1: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_DataForm1");
  }
}

void PDU__SCCP__DataForm1::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_segmentingReassembl.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void PDU__SCCP__DataForm1::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_segmentingReassembl.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_data.decode_text(text_buf);
}

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

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

int PDU__SCCP__DataForm1::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field3=-1;
  int start_of_field4=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SegmentingReassembl_descr_.raw->forceomit);
  decoded_field_length = field_segmentingReassembl.RAW_decode(SCCP__param__SegmentingReassembl_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());
  start_pos_of_field3=p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__SCCP__DataForm1_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__DataForm1_pointer1_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());
  start_of_field4=(int)field_pointer1+0?1:-1;
  start_of_field4=start_pos_of_field3+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field4);
  limit=end_of_available_data-start_of_field4;
  RAW_Force_Omit field_4_force_omit(4, force_omit, SCCP__param__Data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(SCCP__param__Data_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__DataForm1::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SegmentingReassembl_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__SCCP__DataForm1_pointer1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SCCP__param__Data_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_segmentingReassembl.RAW_encode(SCCP__param__SegmentingReassembl_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_POINTER;
  myleaf.body.node.nodes[3]->coding_descr = &PDU__SCCP__DataForm1_pointer1_descr_;
  myleaf.body.node.nodes[3]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_base = 3;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[3]->length = 8;
  encoded_length += field_data.RAW_encode(SCCP__param__Data_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__DataForm1_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
SCCP__param__SegmentingReassembl_template field_segmentingReassembl;
INTEGER_template field_pointer1;
SCCP__param__Data_template field_data;
};

void PDU__SCCP__DataForm1_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_segmentingReassembl = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void PDU__SCCP__DataForm1_template::copy_value(const PDU__SCCP__DataForm1& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.segmentingReassembl().is_bound()) {
  single_value->field_segmentingReassembl = other_value.segmentingReassembl();
} else {
  single_value->field_segmentingReassembl.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__DataForm1_template::copy_template(const PDU__SCCP__DataForm1_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.segmentingReassembl().get_selection()) {
single_value->field_segmentingReassembl = other_value.segmentingReassembl();
} else {
single_value->field_segmentingReassembl.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 PDU__SCCP__DataForm1_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__DataForm1_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__DataForm1_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 @SCCP_Types.PDU_SCCP_DataForm1.");
break;
}
set_selection(other_value);
}

PDU__SCCP__DataForm1_template::PDU__SCCP__DataForm1_template()
{
}

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

PDU__SCCP__DataForm1_template::PDU__SCCP__DataForm1_template(const PDU__SCCP__DataForm1& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__DataForm1_template::match(const PDU__SCCP__DataForm1& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.segmentingReassembl().is_bound()) return FALSE;
if(!single_value->field_segmentingReassembl.match(other_value.segmentingReassembl(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.PDU_SCCP_DataForm1.");
}
return FALSE;
}

boolean PDU__SCCP__DataForm1_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_segmentingReassembl.is_bound()
 || single_value->field_pointer1.is_bound()
 || single_value->field_data.is_bound();
}

boolean PDU__SCCP__DataForm1_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_segmentingReassembl.is_value()
 && single_value->field_pointer1.is_value()
 && single_value->field_data.is_value();
}

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

PDU__SCCP__DataForm1 PDU__SCCP__DataForm1_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 @SCCP_Types.PDU_SCCP_DataForm1.");
PDU__SCCP__DataForm1 ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_segmentingReassembl.is_bound()) {
ret_val.segmentingReassembl() = single_value->field_segmentingReassembl.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void PDU__SCCP__DataForm1_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 @SCCP_Types.PDU_SCCP_DataForm1.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__DataForm1_template[list_length];
}

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

INTEGER_template& PDU__SCCP__DataForm1_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__DataForm1_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm1.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__DataForm1_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__DataForm1_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm1.");
return single_value->field_destLocRef;
}

SCCP__param__SegmentingReassembl_template& PDU__SCCP__DataForm1_template::segmentingReassembl()
{
set_specific();
return single_value->field_segmentingReassembl;
}

const SCCP__param__SegmentingReassembl_template& PDU__SCCP__DataForm1_template::segmentingReassembl() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field segmentingReassembl of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm1.");
return single_value->field_segmentingReassembl;
}

INTEGER_template& PDU__SCCP__DataForm1_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__DataForm1_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm1.");
return single_value->field_pointer1;
}

SCCP__param__Data_template& PDU__SCCP__DataForm1_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data_template& PDU__SCCP__DataForm1_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm1.");
return single_value->field_data;
}

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

void PDU__SCCP__DataForm1_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", segmentingReassembl := ");
single_value->field_segmentingReassembl.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 PDU__SCCP__DataForm1_template::log_match(const PDU__SCCP__DataForm1& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_segmentingReassembl.match(match_value.segmentingReassembl(), legacy)){
TTCN_Logger::log_logmatch_info(".segmentingReassembl");
single_value->field_segmentingReassembl.log_match(match_value.segmentingReassembl(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", segmentingReassembl := ");
single_value->field_segmentingReassembl.log_match(match_value.segmentingReassembl(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 PDU__SCCP__DataForm1_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (segmentingReassembl().is_bound()) segmentingReassembl().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__DataForm1_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_segmentingReassembl.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_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 @SCCP_Types.PDU_SCCP_DataForm1.");
}
}

void PDU__SCCP__DataForm1_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_segmentingReassembl.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_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 PDU__SCCP__DataForm1_template[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 @SCCP_Types.PDU_SCCP_DataForm1.");
}
}

void PDU__SCCP__DataForm1_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__DataForm1_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 @SCCP_Types.PDU_SCCP_DataForm1 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) segmentingReassembl().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "segmentingReassembl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          segmentingReassembl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_DataForm1: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__DataForm1_template* precondition = new PDU__SCCP__DataForm1_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__DataForm1_template* implied_template = new PDU__SCCP__DataForm1_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__DataForm1_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_DataForm1");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__DataForm1_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm1");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm1");
single_value->field_segmentingReassembl.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm1");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm1");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm1");
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 : "@SCCP_Types.PDU_SCCP_DataForm1");
}

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

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

PDU__SCCP__DataForm2::PDU__SCCP__DataForm2()
{
}

PDU__SCCP__DataForm2::PDU__SCCP__DataForm2(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const SCCP__param__SequencingSegmenting& par_sequencingSegmenting,
    const INTEGER& par_pointer1,
    const SCCP__param__Data& par_data)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_sequencingSegmenting(par_sequencingSegmenting),
  field_pointer1(par_pointer1),
  field_data(par_data)
{
}

PDU__SCCP__DataForm2::PDU__SCCP__DataForm2(const PDU__SCCP__DataForm2& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_DataForm2.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.sequencingSegmenting().is_bound()) field_sequencingSegmenting = other_value.sequencingSegmenting();
else field_sequencingSegmenting.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void PDU__SCCP__DataForm2::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_sequencingSegmenting.clean_up();
field_pointer1.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__DataForm2::get_descriptor() const { return &PDU__SCCP__DataForm2_descr_; }
PDU__SCCP__DataForm2& PDU__SCCP__DataForm2::operator=(const PDU__SCCP__DataForm2& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_DataForm2.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.sequencingSegmenting().is_bound()) field_sequencingSegmenting = other_value.sequencingSegmenting();
  else field_sequencingSegmenting.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean PDU__SCCP__DataForm2::operator==(const PDU__SCCP__DataForm2& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_sequencingSegmenting==other_value.field_sequencingSegmenting
  && field_pointer1==other_value.field_pointer1
  && field_data==other_value.field_data;
}

boolean PDU__SCCP__DataForm2::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_sequencingSegmenting.is_bound())
  || (field_pointer1.is_bound())
  || (field_data.is_bound());
}
boolean PDU__SCCP__DataForm2::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_sequencingSegmenting.is_value()
  && field_pointer1.is_value()
  && field_data.is_value();
}
void PDU__SCCP__DataForm2::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", sequencingSegmenting := ");
field_sequencingSegmenting.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__DataForm2::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sequencingSegmenting().is_bound()) sequencingSegmenting().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__DataForm2::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 @SCCP_Types.PDU_SCCP_DataForm2 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sequencingSegmenting().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sequencingSegmenting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequencingSegmenting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_DataForm2: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_DataForm2");
  }
}

void PDU__SCCP__DataForm2::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_sequencingSegmenting.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void PDU__SCCP__DataForm2::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_sequencingSegmenting.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_data.decode_text(text_buf);
}

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

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

int PDU__SCCP__DataForm2::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field3=-1;
  int start_of_field4=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SequencingSegmenting_descr_.raw->forceomit);
  decoded_field_length = field_sequencingSegmenting.RAW_decode(SCCP__param__SequencingSegmenting_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());
  start_pos_of_field3=p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__SCCP__DataForm2_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__DataForm2_pointer1_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());
  start_of_field4=(int)field_pointer1+0?1:-1;
  start_of_field4=start_pos_of_field3+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field4);
  limit=end_of_available_data-start_of_field4;
  RAW_Force_Omit field_4_force_omit(4, force_omit, SCCP__param__Data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(SCCP__param__Data_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__DataForm2::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SequencingSegmenting_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__SCCP__DataForm2_pointer1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SCCP__param__Data_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_sequencingSegmenting.RAW_encode(SCCP__param__SequencingSegmenting_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_POINTER;
  myleaf.body.node.nodes[3]->coding_descr = &PDU__SCCP__DataForm2_pointer1_descr_;
  myleaf.body.node.nodes[3]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_base = 3;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[3]->length = 8;
  encoded_length += field_data.RAW_encode(SCCP__param__Data_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__DataForm2_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
SCCP__param__SequencingSegmenting_template field_sequencingSegmenting;
INTEGER_template field_pointer1;
SCCP__param__Data_template field_data;
};

void PDU__SCCP__DataForm2_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_sequencingSegmenting = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void PDU__SCCP__DataForm2_template::copy_value(const PDU__SCCP__DataForm2& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.sequencingSegmenting().is_bound()) {
  single_value->field_sequencingSegmenting = other_value.sequencingSegmenting();
} else {
  single_value->field_sequencingSegmenting.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__DataForm2_template::copy_template(const PDU__SCCP__DataForm2_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sequencingSegmenting().get_selection()) {
single_value->field_sequencingSegmenting = other_value.sequencingSegmenting();
} else {
single_value->field_sequencingSegmenting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 PDU__SCCP__DataForm2_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__DataForm2_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__DataForm2_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 @SCCP_Types.PDU_SCCP_DataForm2.");
break;
}
set_selection(other_value);
}

PDU__SCCP__DataForm2_template::PDU__SCCP__DataForm2_template()
{
}

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

PDU__SCCP__DataForm2_template::PDU__SCCP__DataForm2_template(const PDU__SCCP__DataForm2& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__DataForm2_template::match(const PDU__SCCP__DataForm2& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.sequencingSegmenting().is_bound()) return FALSE;
if(!single_value->field_sequencingSegmenting.match(other_value.sequencingSegmenting(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.PDU_SCCP_DataForm2.");
}
return FALSE;
}

boolean PDU__SCCP__DataForm2_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_sequencingSegmenting.is_bound()
 || single_value->field_pointer1.is_bound()
 || single_value->field_data.is_bound();
}

boolean PDU__SCCP__DataForm2_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_sequencingSegmenting.is_value()
 && single_value->field_pointer1.is_value()
 && single_value->field_data.is_value();
}

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

PDU__SCCP__DataForm2 PDU__SCCP__DataForm2_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 @SCCP_Types.PDU_SCCP_DataForm2.");
PDU__SCCP__DataForm2 ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_sequencingSegmenting.is_bound()) {
ret_val.sequencingSegmenting() = single_value->field_sequencingSegmenting.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void PDU__SCCP__DataForm2_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 @SCCP_Types.PDU_SCCP_DataForm2.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__DataForm2_template[list_length];
}

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

INTEGER_template& PDU__SCCP__DataForm2_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__DataForm2_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm2.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__DataForm2_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__DataForm2_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm2.");
return single_value->field_destLocRef;
}

SCCP__param__SequencingSegmenting_template& PDU__SCCP__DataForm2_template::sequencingSegmenting()
{
set_specific();
return single_value->field_sequencingSegmenting;
}

const SCCP__param__SequencingSegmenting_template& PDU__SCCP__DataForm2_template::sequencingSegmenting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sequencingSegmenting of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm2.");
return single_value->field_sequencingSegmenting;
}

INTEGER_template& PDU__SCCP__DataForm2_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__DataForm2_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm2.");
return single_value->field_pointer1;
}

SCCP__param__Data_template& PDU__SCCP__DataForm2_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data_template& PDU__SCCP__DataForm2_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.PDU_SCCP_DataForm2.");
return single_value->field_data;
}

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

void PDU__SCCP__DataForm2_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", sequencingSegmenting := ");
single_value->field_sequencingSegmenting.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 PDU__SCCP__DataForm2_template::log_match(const PDU__SCCP__DataForm2& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sequencingSegmenting.match(match_value.sequencingSegmenting(), legacy)){
TTCN_Logger::log_logmatch_info(".sequencingSegmenting");
single_value->field_sequencingSegmenting.log_match(match_value.sequencingSegmenting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", sequencingSegmenting := ");
single_value->field_sequencingSegmenting.log_match(match_value.sequencingSegmenting(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 PDU__SCCP__DataForm2_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sequencingSegmenting().is_bound()) sequencingSegmenting().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__DataForm2_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_sequencingSegmenting.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_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 @SCCP_Types.PDU_SCCP_DataForm2.");
}
}

void PDU__SCCP__DataForm2_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_sequencingSegmenting.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_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 PDU__SCCP__DataForm2_template[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 @SCCP_Types.PDU_SCCP_DataForm2.");
}
}

void PDU__SCCP__DataForm2_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__DataForm2_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 @SCCP_Types.PDU_SCCP_DataForm2 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) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sequencingSegmenting().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sequencingSegmenting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequencingSegmenting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_DataForm2: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__DataForm2_template* precondition = new PDU__SCCP__DataForm2_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__DataForm2_template* implied_template = new PDU__SCCP__DataForm2_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__DataForm2_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_DataForm2");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__DataForm2_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm2");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm2");
single_value->field_sequencingSegmenting.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm2");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm2");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataForm2");
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 : "@SCCP_Types.PDU_SCCP_DataForm2");
}

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

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

PDU__SCCP__DataAcknowledgement::PDU__SCCP__DataAcknowledgement()
{
}

PDU__SCCP__DataAcknowledgement::PDU__SCCP__DataAcknowledgement(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const SCCP__param__RecSeqNumber& par_recSeqNumber,
    const OCTETSTRING& par_credit)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_recSeqNumber(par_recSeqNumber),
  field_credit(par_credit)
{
}

PDU__SCCP__DataAcknowledgement::PDU__SCCP__DataAcknowledgement(const PDU__SCCP__DataAcknowledgement& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.recSeqNumber().is_bound()) field_recSeqNumber = other_value.recSeqNumber();
else field_recSeqNumber.clean_up();
if (other_value.credit().is_bound()) field_credit = other_value.credit();
else field_credit.clean_up();
}

void PDU__SCCP__DataAcknowledgement::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_recSeqNumber.clean_up();
field_credit.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__DataAcknowledgement::get_descriptor() const { return &PDU__SCCP__DataAcknowledgement_descr_; }
PDU__SCCP__DataAcknowledgement& PDU__SCCP__DataAcknowledgement::operator=(const PDU__SCCP__DataAcknowledgement& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.recSeqNumber().is_bound()) field_recSeqNumber = other_value.recSeqNumber();
  else field_recSeqNumber.clean_up();
  if (other_value.credit().is_bound()) field_credit = other_value.credit();
  else field_credit.clean_up();
}
return *this;
}

boolean PDU__SCCP__DataAcknowledgement::operator==(const PDU__SCCP__DataAcknowledgement& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_recSeqNumber==other_value.field_recSeqNumber
  && field_credit==other_value.field_credit;
}

boolean PDU__SCCP__DataAcknowledgement::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_recSeqNumber.is_bound())
  || (field_credit.is_bound());
}
boolean PDU__SCCP__DataAcknowledgement::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_recSeqNumber.is_value()
  && field_credit.is_value();
}
void PDU__SCCP__DataAcknowledgement::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", recSeqNumber := ");
field_recSeqNumber.log();
TTCN_Logger::log_event_str(", credit := ");
field_credit.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__DataAcknowledgement::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (recSeqNumber().is_bound()) recSeqNumber().set_implicit_omit();
if (credit().is_bound()) credit().set_implicit_omit();
}

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

void PDU__SCCP__DataAcknowledgement::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_recSeqNumber.encode_text(text_buf);
field_credit.encode_text(text_buf);
}

void PDU__SCCP__DataAcknowledgement::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_recSeqNumber.decode_text(text_buf);
field_credit.decode_text(text_buf);
}

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

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

int PDU__SCCP__DataAcknowledgement::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, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__RecSeqNumber_descr_.raw->forceomit);
  decoded_field_length = field_recSeqNumber.RAW_decode(SCCP__param__RecSeqNumber_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__Credit_descr_.raw->forceomit);
  decoded_field_length = field_credit.RAW_decode(SCCP__param__Credit_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__DataAcknowledgement::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__RecSeqNumber_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__Credit_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_recSeqNumber.RAW_encode(SCCP__param__RecSeqNumber_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_credit.RAW_encode(SCCP__param__Credit_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__DataAcknowledgement_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
SCCP__param__RecSeqNumber_template field_recSeqNumber;
OCTETSTRING_template field_credit;
};

void PDU__SCCP__DataAcknowledgement_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_recSeqNumber = ANY_VALUE;
single_value->field_credit = ANY_VALUE;
}
}
}

void PDU__SCCP__DataAcknowledgement_template::copy_value(const PDU__SCCP__DataAcknowledgement& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.recSeqNumber().is_bound()) {
  single_value->field_recSeqNumber = other_value.recSeqNumber();
} else {
  single_value->field_recSeqNumber.clean_up();
}
if (other_value.credit().is_bound()) {
  single_value->field_credit = other_value.credit();
} else {
  single_value->field_credit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__DataAcknowledgement_template::copy_template(const PDU__SCCP__DataAcknowledgement_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.recSeqNumber().get_selection()) {
single_value->field_recSeqNumber = other_value.recSeqNumber();
} else {
single_value->field_recSeqNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.credit().get_selection()) {
single_value->field_credit = other_value.credit();
} else {
single_value->field_credit.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__DataAcknowledgement_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__DataAcknowledgement_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__DataAcknowledgement_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 @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
break;
}
set_selection(other_value);
}

PDU__SCCP__DataAcknowledgement_template::PDU__SCCP__DataAcknowledgement_template()
{
}

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

PDU__SCCP__DataAcknowledgement_template::PDU__SCCP__DataAcknowledgement_template(const PDU__SCCP__DataAcknowledgement& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__DataAcknowledgement_template::match(const PDU__SCCP__DataAcknowledgement& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.recSeqNumber().is_bound()) return FALSE;
if(!single_value->field_recSeqNumber.match(other_value.recSeqNumber(), legacy))return FALSE;
if(!other_value.credit().is_bound()) return FALSE;
if(!single_value->field_credit.match(other_value.credit(), 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 @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
}
return FALSE;
}

boolean PDU__SCCP__DataAcknowledgement_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_recSeqNumber.is_bound()
 || single_value->field_credit.is_bound();
}

boolean PDU__SCCP__DataAcknowledgement_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_recSeqNumber.is_value()
 && single_value->field_credit.is_value();
}

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

PDU__SCCP__DataAcknowledgement PDU__SCCP__DataAcknowledgement_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 @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
PDU__SCCP__DataAcknowledgement ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_recSeqNumber.is_bound()) {
ret_val.recSeqNumber() = single_value->field_recSeqNumber.valueof();
}
if (single_value->field_credit.is_bound()) {
ret_val.credit() = single_value->field_credit.valueof();
}
return ret_val;
}

void PDU__SCCP__DataAcknowledgement_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 @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__DataAcknowledgement_template[list_length];
}

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

INTEGER_template& PDU__SCCP__DataAcknowledgement_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__DataAcknowledgement_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__DataAcknowledgement_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__DataAcknowledgement_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
return single_value->field_destLocRef;
}

SCCP__param__RecSeqNumber_template& PDU__SCCP__DataAcknowledgement_template::recSeqNumber()
{
set_specific();
return single_value->field_recSeqNumber;
}

const SCCP__param__RecSeqNumber_template& PDU__SCCP__DataAcknowledgement_template::recSeqNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field recSeqNumber of a non-specific template of type @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
return single_value->field_recSeqNumber;
}

OCTETSTRING_template& PDU__SCCP__DataAcknowledgement_template::credit()
{
set_specific();
return single_value->field_credit;
}

const OCTETSTRING_template& PDU__SCCP__DataAcknowledgement_template::credit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field credit of a non-specific template of type @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
return single_value->field_credit;
}

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

void PDU__SCCP__DataAcknowledgement_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", recSeqNumber := ");
single_value->field_recSeqNumber.log();
TTCN_Logger::log_event_str(", credit := ");
single_value->field_credit.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__DataAcknowledgement_template::log_match(const PDU__SCCP__DataAcknowledgement& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_recSeqNumber.match(match_value.recSeqNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".recSeqNumber");
single_value->field_recSeqNumber.log_match(match_value.recSeqNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_credit.match(match_value.credit(), legacy)){
TTCN_Logger::log_logmatch_info(".credit");
single_value->field_credit.log_match(match_value.credit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", recSeqNumber := ");
single_value->field_recSeqNumber.log_match(match_value.recSeqNumber(), legacy);
TTCN_Logger::log_event_str(", credit := ");
single_value->field_credit.log_match(match_value.credit(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__DataAcknowledgement_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (recSeqNumber().is_bound()) recSeqNumber().set_implicit_omit();
if (credit().is_bound()) credit().set_implicit_omit();
}

void PDU__SCCP__DataAcknowledgement_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_recSeqNumber.encode_text(text_buf);
single_value->field_credit.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 @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
}
}

void PDU__SCCP__DataAcknowledgement_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_recSeqNumber.decode_text(text_buf);
single_value->field_credit.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__DataAcknowledgement_template[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 @SCCP_Types.PDU_SCCP_DataAcknowledgement.");
}
}

void PDU__SCCP__DataAcknowledgement_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__DataAcknowledgement_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 @SCCP_Types.PDU_SCCP_DataAcknowledgement has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) recSeqNumber().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) credit().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "recSeqNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          recSeqNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "credit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          credit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_DataAcknowledgement: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__DataAcknowledgement_template* precondition = new PDU__SCCP__DataAcknowledgement_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__DataAcknowledgement_template* implied_template = new PDU__SCCP__DataAcknowledgement_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__DataAcknowledgement_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_DataAcknowledgement");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__DataAcknowledgement_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataAcknowledgement");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataAcknowledgement");
single_value->field_recSeqNumber.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataAcknowledgement");
single_value->field_credit.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_DataAcknowledgement");
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 : "@SCCP_Types.PDU_SCCP_DataAcknowledgement");
}

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

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

PDU__SCCP__Unitdata::PDU__SCCP__Unitdata()
{
}

PDU__SCCP__Unitdata::PDU__SCCP__Unitdata(const INTEGER& par_messageType,
    const SCCP__param__ProtocolClass& par_protClass,
    const INTEGER& par_pointer1,
    const INTEGER& par_pointer2,
    const INTEGER& par_pointer3,
    const SCCP__param__CPartyAddressEnc& par_calledPAddress,
    const SCCP__param__CPartyAddressEnc& par_callingPAddress,
    const SCCP__param__Data& par_data)
  :   field_messageType(par_messageType),
  field_protClass(par_protClass),
  field_pointer1(par_pointer1),
  field_pointer2(par_pointer2),
  field_pointer3(par_pointer3),
  field_calledPAddress(par_calledPAddress),
  field_callingPAddress(par_callingPAddress),
  field_data(par_data)
{
}

PDU__SCCP__Unitdata::PDU__SCCP__Unitdata(const PDU__SCCP__Unitdata& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_Unitdata.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
else field_protClass.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
else field_pointer2.clean_up();
if (other_value.pointer3().is_bound()) field_pointer3 = other_value.pointer3();
else field_pointer3.clean_up();
if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
else field_calledPAddress.clean_up();
if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
else field_callingPAddress.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void PDU__SCCP__Unitdata::clean_up()
{
field_messageType.clean_up();
field_protClass.clean_up();
field_pointer1.clean_up();
field_pointer2.clean_up();
field_pointer3.clean_up();
field_calledPAddress.clean_up();
field_callingPAddress.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__Unitdata::get_descriptor() const { return &PDU__SCCP__Unitdata_descr_; }
PDU__SCCP__Unitdata& PDU__SCCP__Unitdata::operator=(const PDU__SCCP__Unitdata& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_Unitdata.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
  else field_protClass.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
  else field_pointer2.clean_up();
  if (other_value.pointer3().is_bound()) field_pointer3 = other_value.pointer3();
  else field_pointer3.clean_up();
  if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
  else field_calledPAddress.clean_up();
  if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
  else field_callingPAddress.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean PDU__SCCP__Unitdata::operator==(const PDU__SCCP__Unitdata& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_protClass==other_value.field_protClass
  && field_pointer1==other_value.field_pointer1
  && field_pointer2==other_value.field_pointer2
  && field_pointer3==other_value.field_pointer3
  && field_calledPAddress==other_value.field_calledPAddress
  && field_callingPAddress==other_value.field_callingPAddress
  && field_data==other_value.field_data;
}

boolean PDU__SCCP__Unitdata::is_bound() const
{
return (field_messageType.is_bound())
  || (field_protClass.is_bound())
  || (field_pointer1.is_bound())
  || (field_pointer2.is_bound())
  || (field_pointer3.is_bound())
  || (field_calledPAddress.is_bound())
  || (field_callingPAddress.is_bound())
  || (field_data.is_bound());
}
boolean PDU__SCCP__Unitdata::is_value() const
{
return field_messageType.is_value()
  && field_protClass.is_value()
  && field_pointer1.is_value()
  && field_pointer2.is_value()
  && field_pointer3.is_value()
  && field_calledPAddress.is_value()
  && field_callingPAddress.is_value()
  && field_data.is_value();
}
void PDU__SCCP__Unitdata::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", protClass := ");
field_protClass.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
field_pointer2.log();
TTCN_Logger::log_event_str(", pointer3 := ");
field_pointer3.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
field_calledPAddress.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__Unitdata::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (pointer3().is_bound()) pointer3().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (callingPAddress().is_bound()) callingPAddress().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__Unitdata::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @SCCP_Types.PDU_SCCP_Unitdata has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_Unitdata: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_Unitdata");
  }
}

void PDU__SCCP__Unitdata::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_protClass.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_pointer2.encode_text(text_buf);
field_pointer3.encode_text(text_buf);
field_calledPAddress.encode_text(text_buf);
field_callingPAddress.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void PDU__SCCP__Unitdata::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_protClass.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_pointer2.decode_text(text_buf);
field_pointer3.decode_text(text_buf);
field_calledPAddress.decode_text(text_buf);
field_callingPAddress.decode_text(text_buf);
field_data.decode_text(text_buf);
}

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

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

int PDU__SCCP__Unitdata::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field2=-1;
  int start_pos_of_field3=-1;
  int start_pos_of_field4=-1;
  int start_of_field5=-1;
  int start_of_field6=-1;
  int start_of_field7=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__ProtocolClass_descr_.raw->forceomit);
  decoded_field_length = field_protClass.RAW_decode(SCCP__param__ProtocolClass_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());
  start_pos_of_field2=p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__SCCP__Unitdata_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__Unitdata_pointer1_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());
  start_of_field5=(int)field_pointer1+0?1:-1;
  start_pos_of_field3=p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__SCCP__Unitdata_pointer2_descr_.raw->forceomit);
  decoded_field_length = field_pointer2.RAW_decode(PDU__SCCP__Unitdata_pointer2_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());
  start_of_field6=(int)field_pointer2+0?1:-1;
  start_pos_of_field4=p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDU__SCCP__Unitdata_pointer3_descr_.raw->forceomit);
  decoded_field_length = field_pointer3.RAW_decode(PDU__SCCP__Unitdata_pointer3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field7=(int)field_pointer3+0?1:-1;
  start_of_field5=start_pos_of_field2+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field5);
  limit=end_of_available_data-start_of_field5;
  RAW_Force_Omit field_5_force_omit(5, force_omit, SCCP__param__CPartyAddressEnc_descr_.raw->forceomit);
  decoded_field_length = field_calledPAddress.RAW_decode(SCCP__param__CPartyAddressEnc_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field6=start_pos_of_field3+(int)field_pointer2*8+0;
  p_buf.set_pos_bit(start_of_field6);
  limit=end_of_available_data-start_of_field6;
  RAW_Force_Omit field_6_force_omit(6, force_omit, SCCP__param__CPartyAddressEnc_descr_.raw->forceomit);
  decoded_field_length = field_callingPAddress.RAW_decode(SCCP__param__CPartyAddressEnc_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field7=start_pos_of_field4+(int)field_pointer3*8+0;
  p_buf.set_pos_bit(start_of_field7);
  limit=end_of_available_data-start_of_field7;
  RAW_Force_Omit field_7_force_omit(7, force_omit, SCCP__param__Data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(SCCP__param__Data_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__Unitdata::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__ProtocolClass_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__SCCP__Unitdata_pointer1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__SCCP__Unitdata_pointer2_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDU__SCCP__Unitdata_pointer3_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SCCP__param__CPartyAddressEnc_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, SCCP__param__CPartyAddressEnc_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, SCCP__param__Data_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_protClass.RAW_encode(SCCP__param__ProtocolClass_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_POINTER;
  myleaf.body.node.nodes[2]->coding_descr = &PDU__SCCP__Unitdata_pointer1_descr_;
  myleaf.body.node.nodes[2]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[2]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[2]->calcof.pointerto.ptr_base = 2;
  myleaf.body.node.nodes[2]->calcof.pointerto.target.level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->calcof.pointerto.target.pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->length = 8;
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_POINTER;
  myleaf.body.node.nodes[3]->coding_descr = &PDU__SCCP__Unitdata_pointer2_descr_;
  myleaf.body.node.nodes[3]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_base = 3;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[3]->length = 8;
  encoded_length += 8;
  myleaf.body.node.nodes[4]->calc = CALC_POINTER;
  myleaf.body.node.nodes[4]->coding_descr = &PDU__SCCP__Unitdata_pointer3_descr_;
  myleaf.body.node.nodes[4]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_base = 4;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[4]->length = 8;
  encoded_length += field_calledPAddress.RAW_encode(SCCP__param__CPartyAddressEnc_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_callingPAddress.RAW_encode(SCCP__param__CPartyAddressEnc_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_data.RAW_encode(SCCP__param__Data_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__Unitdata_template::single_value_struct {
INTEGER_template field_messageType;
SCCP__param__ProtocolClass_template field_protClass;
INTEGER_template field_pointer1;
INTEGER_template field_pointer2;
INTEGER_template field_pointer3;
SCCP__param__CPartyAddressEnc_template field_calledPAddress;
SCCP__param__CPartyAddressEnc_template field_callingPAddress;
SCCP__param__Data_template field_data;
};

void PDU__SCCP__Unitdata_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_protClass = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_pointer2 = ANY_VALUE;
single_value->field_pointer3 = ANY_VALUE;
single_value->field_calledPAddress = ANY_VALUE;
single_value->field_callingPAddress = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void PDU__SCCP__Unitdata_template::copy_value(const PDU__SCCP__Unitdata& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.protClass().is_bound()) {
  single_value->field_protClass = other_value.protClass();
} else {
  single_value->field_protClass.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.pointer2().is_bound()) {
  single_value->field_pointer2 = other_value.pointer2();
} else {
  single_value->field_pointer2.clean_up();
}
if (other_value.pointer3().is_bound()) {
  single_value->field_pointer3 = other_value.pointer3();
} else {
  single_value->field_pointer3.clean_up();
}
if (other_value.calledPAddress().is_bound()) {
  single_value->field_calledPAddress = other_value.calledPAddress();
} else {
  single_value->field_calledPAddress.clean_up();
}
if (other_value.callingPAddress().is_bound()) {
  single_value->field_callingPAddress = other_value.callingPAddress();
} else {
  single_value->field_callingPAddress.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__Unitdata_template::copy_template(const PDU__SCCP__Unitdata_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protClass().get_selection()) {
single_value->field_protClass = other_value.protClass();
} else {
single_value->field_protClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer2().get_selection()) {
single_value->field_pointer2 = other_value.pointer2();
} else {
single_value->field_pointer2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer3().get_selection()) {
single_value->field_pointer3 = other_value.pointer3();
} else {
single_value->field_pointer3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPAddress().get_selection()) {
single_value->field_calledPAddress = other_value.calledPAddress();
} else {
single_value->field_calledPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.callingPAddress().get_selection()) {
single_value->field_callingPAddress = other_value.callingPAddress();
} else {
single_value->field_callingPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 PDU__SCCP__Unitdata_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__Unitdata_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__Unitdata_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 @SCCP_Types.PDU_SCCP_Unitdata.");
break;
}
set_selection(other_value);
}

PDU__SCCP__Unitdata_template::PDU__SCCP__Unitdata_template()
{
}

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

PDU__SCCP__Unitdata_template::PDU__SCCP__Unitdata_template(const PDU__SCCP__Unitdata& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__Unitdata_template::match(const PDU__SCCP__Unitdata& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.protClass().is_bound()) return FALSE;
if(!single_value->field_protClass.match(other_value.protClass(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.pointer2().is_bound()) return FALSE;
if(!single_value->field_pointer2.match(other_value.pointer2(), legacy))return FALSE;
if(!other_value.pointer3().is_bound()) return FALSE;
if(!single_value->field_pointer3.match(other_value.pointer3(), legacy))return FALSE;
if(!other_value.calledPAddress().is_bound()) return FALSE;
if(!single_value->field_calledPAddress.match(other_value.calledPAddress(), legacy))return FALSE;
if(!other_value.callingPAddress().is_bound()) return FALSE;
if(!single_value->field_callingPAddress.match(other_value.callingPAddress(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.PDU_SCCP_Unitdata.");
}
return FALSE;
}

boolean PDU__SCCP__Unitdata_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_protClass.is_bound()
 || single_value->field_pointer1.is_bound()
 || single_value->field_pointer2.is_bound()
 || single_value->field_pointer3.is_bound()
 || single_value->field_calledPAddress.is_bound()
 || single_value->field_callingPAddress.is_bound()
 || single_value->field_data.is_bound();
}

boolean PDU__SCCP__Unitdata_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_protClass.is_value()
 && single_value->field_pointer1.is_value()
 && single_value->field_pointer2.is_value()
 && single_value->field_pointer3.is_value()
 && single_value->field_calledPAddress.is_value()
 && single_value->field_callingPAddress.is_value()
 && single_value->field_data.is_value();
}

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

PDU__SCCP__Unitdata PDU__SCCP__Unitdata_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 @SCCP_Types.PDU_SCCP_Unitdata.");
PDU__SCCP__Unitdata ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_protClass.is_bound()) {
ret_val.protClass() = single_value->field_protClass.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_pointer2.is_bound()) {
ret_val.pointer2() = single_value->field_pointer2.valueof();
}
if (single_value->field_pointer3.is_bound()) {
ret_val.pointer3() = single_value->field_pointer3.valueof();
}
if (single_value->field_calledPAddress.is_bound()) {
ret_val.calledPAddress() = single_value->field_calledPAddress.valueof();
}
if (single_value->field_callingPAddress.is_bound()) {
ret_val.callingPAddress() = single_value->field_callingPAddress.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void PDU__SCCP__Unitdata_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 @SCCP_Types.PDU_SCCP_Unitdata.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__Unitdata_template[list_length];
}

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

INTEGER_template& PDU__SCCP__Unitdata_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__Unitdata_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_messageType;
}

SCCP__param__ProtocolClass_template& PDU__SCCP__Unitdata_template::protClass()
{
set_specific();
return single_value->field_protClass;
}

const SCCP__param__ProtocolClass_template& PDU__SCCP__Unitdata_template::protClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protClass of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_protClass;
}

INTEGER_template& PDU__SCCP__Unitdata_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__Unitdata_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_pointer1;
}

INTEGER_template& PDU__SCCP__Unitdata_template::pointer2()
{
set_specific();
return single_value->field_pointer2;
}

const INTEGER_template& PDU__SCCP__Unitdata_template::pointer2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer2 of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_pointer2;
}

INTEGER_template& PDU__SCCP__Unitdata_template::pointer3()
{
set_specific();
return single_value->field_pointer3;
}

const INTEGER_template& PDU__SCCP__Unitdata_template::pointer3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer3 of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_pointer3;
}

SCCP__param__CPartyAddressEnc_template& PDU__SCCP__Unitdata_template::calledPAddress()
{
set_specific();
return single_value->field_calledPAddress;
}

const SCCP__param__CPartyAddressEnc_template& PDU__SCCP__Unitdata_template::calledPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPAddress of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_calledPAddress;
}

SCCP__param__CPartyAddressEnc_template& PDU__SCCP__Unitdata_template::callingPAddress()
{
set_specific();
return single_value->field_callingPAddress;
}

const SCCP__param__CPartyAddressEnc_template& PDU__SCCP__Unitdata_template::callingPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field callingPAddress of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_callingPAddress;
}

SCCP__param__Data_template& PDU__SCCP__Unitdata_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data_template& PDU__SCCP__Unitdata_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.PDU_SCCP_Unitdata.");
return single_value->field_data;
}

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

void PDU__SCCP__Unitdata_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log();
TTCN_Logger::log_event_str(", pointer3 := ");
single_value->field_pointer3.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
single_value->field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 PDU__SCCP__Unitdata_template::log_match(const PDU__SCCP__Unitdata& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_protClass.match(match_value.protClass(), legacy)){
TTCN_Logger::log_logmatch_info(".protClass");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer2.match(match_value.pointer2(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer2");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer3.match(match_value.pointer3(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer3");
single_value->field_pointer3.log_match(match_value.pointer3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_calledPAddress.match(match_value.calledPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPAddress");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_callingPAddress.match(match_value.callingPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".callingPAddress");
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::log_event_str(", pointer3 := ");
single_value->field_pointer3.log_match(match_value.pointer3(), legacy);
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::log_event_str(", callingPAddress := ");
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 PDU__SCCP__Unitdata_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (pointer3().is_bound()) pointer3().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (callingPAddress().is_bound()) callingPAddress().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__Unitdata_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_protClass.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_pointer2.encode_text(text_buf);
single_value->field_pointer3.encode_text(text_buf);
single_value->field_calledPAddress.encode_text(text_buf);
single_value->field_callingPAddress.encode_text(text_buf);
single_value->field_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 @SCCP_Types.PDU_SCCP_Unitdata.");
}
}

void PDU__SCCP__Unitdata_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_protClass.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_pointer2.decode_text(text_buf);
single_value->field_pointer3.decode_text(text_buf);
single_value->field_calledPAddress.decode_text(text_buf);
single_value->field_callingPAddress.decode_text(text_buf);
single_value->field_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 PDU__SCCP__Unitdata_template[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 @SCCP_Types.PDU_SCCP_Unitdata.");
}
}

void PDU__SCCP__Unitdata_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__Unitdata_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_Unitdata has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_Unitdata: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__Unitdata_template* precondition = new PDU__SCCP__Unitdata_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__Unitdata_template* implied_template = new PDU__SCCP__Unitdata_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__Unitdata_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_Unitdata");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__Unitdata_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
single_value->field_protClass.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
single_value->field_pointer2.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
single_value->field_pointer3.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
single_value->field_calledPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
single_value->field_callingPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_Unitdata");
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 : "@SCCP_Types.PDU_SCCP_Unitdata");
}

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

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

PDU__SCCP__UnitdataService::PDU__SCCP__UnitdataService()
{
}

PDU__SCCP__UnitdataService::PDU__SCCP__UnitdataService(const INTEGER& par_messageType,
    const INTEGER& par_returnCause,
    const INTEGER& par_pointer1,
    const INTEGER& par_pointer2,
    const INTEGER& par_pointer3,
    const SCCP__param__CPartyAddressEnc& par_calledPAddress,
    const SCCP__param__CPartyAddressEnc& par_callingPAddress,
    const SCCP__param__Data& par_data)
  :   field_messageType(par_messageType),
  field_returnCause(par_returnCause),
  field_pointer1(par_pointer1),
  field_pointer2(par_pointer2),
  field_pointer3(par_pointer3),
  field_calledPAddress(par_calledPAddress),
  field_callingPAddress(par_callingPAddress),
  field_data(par_data)
{
}

PDU__SCCP__UnitdataService::PDU__SCCP__UnitdataService(const PDU__SCCP__UnitdataService& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_UnitdataService.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.returnCause().is_bound()) field_returnCause = other_value.returnCause();
else field_returnCause.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
else field_pointer2.clean_up();
if (other_value.pointer3().is_bound()) field_pointer3 = other_value.pointer3();
else field_pointer3.clean_up();
if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
else field_calledPAddress.clean_up();
if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
else field_callingPAddress.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void PDU__SCCP__UnitdataService::clean_up()
{
field_messageType.clean_up();
field_returnCause.clean_up();
field_pointer1.clean_up();
field_pointer2.clean_up();
field_pointer3.clean_up();
field_calledPAddress.clean_up();
field_callingPAddress.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__UnitdataService::get_descriptor() const { return &PDU__SCCP__UnitdataService_descr_; }
PDU__SCCP__UnitdataService& PDU__SCCP__UnitdataService::operator=(const PDU__SCCP__UnitdataService& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_UnitdataService.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.returnCause().is_bound()) field_returnCause = other_value.returnCause();
  else field_returnCause.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
  else field_pointer2.clean_up();
  if (other_value.pointer3().is_bound()) field_pointer3 = other_value.pointer3();
  else field_pointer3.clean_up();
  if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
  else field_calledPAddress.clean_up();
  if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
  else field_callingPAddress.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean PDU__SCCP__UnitdataService::operator==(const PDU__SCCP__UnitdataService& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_returnCause==other_value.field_returnCause
  && field_pointer1==other_value.field_pointer1
  && field_pointer2==other_value.field_pointer2
  && field_pointer3==other_value.field_pointer3
  && field_calledPAddress==other_value.field_calledPAddress
  && field_callingPAddress==other_value.field_callingPAddress
  && field_data==other_value.field_data;
}

boolean PDU__SCCP__UnitdataService::is_bound() const
{
return (field_messageType.is_bound())
  || (field_returnCause.is_bound())
  || (field_pointer1.is_bound())
  || (field_pointer2.is_bound())
  || (field_pointer3.is_bound())
  || (field_calledPAddress.is_bound())
  || (field_callingPAddress.is_bound())
  || (field_data.is_bound());
}
boolean PDU__SCCP__UnitdataService::is_value() const
{
return field_messageType.is_value()
  && field_returnCause.is_value()
  && field_pointer1.is_value()
  && field_pointer2.is_value()
  && field_pointer3.is_value()
  && field_calledPAddress.is_value()
  && field_callingPAddress.is_value()
  && field_data.is_value();
}
void PDU__SCCP__UnitdataService::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", returnCause := ");
field_returnCause.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
field_pointer2.log();
TTCN_Logger::log_event_str(", pointer3 := ");
field_pointer3.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
field_calledPAddress.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__UnitdataService::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (returnCause().is_bound()) returnCause().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (pointer3().is_bound()) pointer3().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (callingPAddress().is_bound()) callingPAddress().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__UnitdataService::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record value of type @SCCP_Types.PDU_SCCP_UnitdataService has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) returnCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "returnCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          returnCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_UnitdataService: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_UnitdataService");
  }
}

void PDU__SCCP__UnitdataService::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_returnCause.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_pointer2.encode_text(text_buf);
field_pointer3.encode_text(text_buf);
field_calledPAddress.encode_text(text_buf);
field_callingPAddress.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void PDU__SCCP__UnitdataService::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_returnCause.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_pointer2.decode_text(text_buf);
field_pointer3.decode_text(text_buf);
field_calledPAddress.decode_text(text_buf);
field_callingPAddress.decode_text(text_buf);
field_data.decode_text(text_buf);
}

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

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

int PDU__SCCP__UnitdataService::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field2=-1;
  int start_pos_of_field3=-1;
  int start_pos_of_field4=-1;
  int start_of_field5=-1;
  int start_of_field6=-1;
  int start_of_field7=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__ReturnCause_descr_.raw->forceomit);
  decoded_field_length = field_returnCause.RAW_decode(SCCP__param__ReturnCause_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());
  start_pos_of_field2=p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__SCCP__UnitdataService_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__UnitdataService_pointer1_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());
  start_of_field5=(int)field_pointer1+0?1:-1;
  start_pos_of_field3=p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__SCCP__UnitdataService_pointer2_descr_.raw->forceomit);
  decoded_field_length = field_pointer2.RAW_decode(PDU__SCCP__UnitdataService_pointer2_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());
  start_of_field6=(int)field_pointer2+0?1:-1;
  start_pos_of_field4=p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDU__SCCP__UnitdataService_pointer3_descr_.raw->forceomit);
  decoded_field_length = field_pointer3.RAW_decode(PDU__SCCP__UnitdataService_pointer3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field7=(int)field_pointer3+0?1:-1;
  start_of_field5=start_pos_of_field2+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field5);
  limit=end_of_available_data-start_of_field5;
  RAW_Force_Omit field_5_force_omit(5, force_omit, SCCP__param__CPartyAddressEnc_descr_.raw->forceomit);
  decoded_field_length = field_calledPAddress.RAW_decode(SCCP__param__CPartyAddressEnc_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field6=start_pos_of_field3+(int)field_pointer2*8+0;
  p_buf.set_pos_bit(start_of_field6);
  limit=end_of_available_data-start_of_field6;
  RAW_Force_Omit field_6_force_omit(6, force_omit, SCCP__param__CPartyAddressEnc_descr_.raw->forceomit);
  decoded_field_length = field_callingPAddress.RAW_decode(SCCP__param__CPartyAddressEnc_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field7=start_pos_of_field4+(int)field_pointer3*8+0;
  p_buf.set_pos_bit(start_of_field7);
  limit=end_of_available_data-start_of_field7;
  RAW_Force_Omit field_7_force_omit(7, force_omit, SCCP__param__Data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(SCCP__param__Data_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__UnitdataService::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 8;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(8);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__ReturnCause_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__SCCP__UnitdataService_pointer1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__SCCP__UnitdataService_pointer2_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDU__SCCP__UnitdataService_pointer3_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SCCP__param__CPartyAddressEnc_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, SCCP__param__CPartyAddressEnc_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, SCCP__param__Data_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_returnCause.RAW_encode(SCCP__param__ReturnCause_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_POINTER;
  myleaf.body.node.nodes[2]->coding_descr = &PDU__SCCP__UnitdataService_pointer1_descr_;
  myleaf.body.node.nodes[2]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[2]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[2]->calcof.pointerto.ptr_base = 2;
  myleaf.body.node.nodes[2]->calcof.pointerto.target.level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[2]->calcof.pointerto.target.pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[2]->length = 8;
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_POINTER;
  myleaf.body.node.nodes[3]->coding_descr = &PDU__SCCP__UnitdataService_pointer2_descr_;
  myleaf.body.node.nodes[3]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_base = 3;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[3]->length = 8;
  encoded_length += 8;
  myleaf.body.node.nodes[4]->calc = CALC_POINTER;
  myleaf.body.node.nodes[4]->coding_descr = &PDU__SCCP__UnitdataService_pointer3_descr_;
  myleaf.body.node.nodes[4]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_base = 4;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[4]->length = 8;
  encoded_length += field_calledPAddress.RAW_encode(SCCP__param__CPartyAddressEnc_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_callingPAddress.RAW_encode(SCCP__param__CPartyAddressEnc_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_data.RAW_encode(SCCP__param__Data_descr_, *myleaf.body.node.nodes[7]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__UnitdataService_template::single_value_struct {
INTEGER_template field_messageType;
INTEGER_template field_returnCause;
INTEGER_template field_pointer1;
INTEGER_template field_pointer2;
INTEGER_template field_pointer3;
SCCP__param__CPartyAddressEnc_template field_calledPAddress;
SCCP__param__CPartyAddressEnc_template field_callingPAddress;
SCCP__param__Data_template field_data;
};

void PDU__SCCP__UnitdataService_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_returnCause = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_pointer2 = ANY_VALUE;
single_value->field_pointer3 = ANY_VALUE;
single_value->field_calledPAddress = ANY_VALUE;
single_value->field_callingPAddress = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void PDU__SCCP__UnitdataService_template::copy_value(const PDU__SCCP__UnitdataService& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.returnCause().is_bound()) {
  single_value->field_returnCause = other_value.returnCause();
} else {
  single_value->field_returnCause.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.pointer2().is_bound()) {
  single_value->field_pointer2 = other_value.pointer2();
} else {
  single_value->field_pointer2.clean_up();
}
if (other_value.pointer3().is_bound()) {
  single_value->field_pointer3 = other_value.pointer3();
} else {
  single_value->field_pointer3.clean_up();
}
if (other_value.calledPAddress().is_bound()) {
  single_value->field_calledPAddress = other_value.calledPAddress();
} else {
  single_value->field_calledPAddress.clean_up();
}
if (other_value.callingPAddress().is_bound()) {
  single_value->field_callingPAddress = other_value.callingPAddress();
} else {
  single_value->field_callingPAddress.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__UnitdataService_template::copy_template(const PDU__SCCP__UnitdataService_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.returnCause().get_selection()) {
single_value->field_returnCause = other_value.returnCause();
} else {
single_value->field_returnCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer2().get_selection()) {
single_value->field_pointer2 = other_value.pointer2();
} else {
single_value->field_pointer2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer3().get_selection()) {
single_value->field_pointer3 = other_value.pointer3();
} else {
single_value->field_pointer3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPAddress().get_selection()) {
single_value->field_calledPAddress = other_value.calledPAddress();
} else {
single_value->field_calledPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.callingPAddress().get_selection()) {
single_value->field_callingPAddress = other_value.callingPAddress();
} else {
single_value->field_callingPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 PDU__SCCP__UnitdataService_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__UnitdataService_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__UnitdataService_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 @SCCP_Types.PDU_SCCP_UnitdataService.");
break;
}
set_selection(other_value);
}

PDU__SCCP__UnitdataService_template::PDU__SCCP__UnitdataService_template()
{
}

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

PDU__SCCP__UnitdataService_template::PDU__SCCP__UnitdataService_template(const PDU__SCCP__UnitdataService& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__UnitdataService_template::match(const PDU__SCCP__UnitdataService& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.returnCause().is_bound()) return FALSE;
if(!single_value->field_returnCause.match(other_value.returnCause(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.pointer2().is_bound()) return FALSE;
if(!single_value->field_pointer2.match(other_value.pointer2(), legacy))return FALSE;
if(!other_value.pointer3().is_bound()) return FALSE;
if(!single_value->field_pointer3.match(other_value.pointer3(), legacy))return FALSE;
if(!other_value.calledPAddress().is_bound()) return FALSE;
if(!single_value->field_calledPAddress.match(other_value.calledPAddress(), legacy))return FALSE;
if(!other_value.callingPAddress().is_bound()) return FALSE;
if(!single_value->field_callingPAddress.match(other_value.callingPAddress(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.PDU_SCCP_UnitdataService.");
}
return FALSE;
}

boolean PDU__SCCP__UnitdataService_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_returnCause.is_bound()
 || single_value->field_pointer1.is_bound()
 || single_value->field_pointer2.is_bound()
 || single_value->field_pointer3.is_bound()
 || single_value->field_calledPAddress.is_bound()
 || single_value->field_callingPAddress.is_bound()
 || single_value->field_data.is_bound();
}

boolean PDU__SCCP__UnitdataService_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_returnCause.is_value()
 && single_value->field_pointer1.is_value()
 && single_value->field_pointer2.is_value()
 && single_value->field_pointer3.is_value()
 && single_value->field_calledPAddress.is_value()
 && single_value->field_callingPAddress.is_value()
 && single_value->field_data.is_value();
}

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

PDU__SCCP__UnitdataService PDU__SCCP__UnitdataService_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 @SCCP_Types.PDU_SCCP_UnitdataService.");
PDU__SCCP__UnitdataService ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_returnCause.is_bound()) {
ret_val.returnCause() = single_value->field_returnCause.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_pointer2.is_bound()) {
ret_val.pointer2() = single_value->field_pointer2.valueof();
}
if (single_value->field_pointer3.is_bound()) {
ret_val.pointer3() = single_value->field_pointer3.valueof();
}
if (single_value->field_calledPAddress.is_bound()) {
ret_val.calledPAddress() = single_value->field_calledPAddress.valueof();
}
if (single_value->field_callingPAddress.is_bound()) {
ret_val.callingPAddress() = single_value->field_callingPAddress.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void PDU__SCCP__UnitdataService_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 @SCCP_Types.PDU_SCCP_UnitdataService.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__UnitdataService_template[list_length];
}

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

INTEGER_template& PDU__SCCP__UnitdataService_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__UnitdataService_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_messageType;
}

INTEGER_template& PDU__SCCP__UnitdataService_template::returnCause()
{
set_specific();
return single_value->field_returnCause;
}

const INTEGER_template& PDU__SCCP__UnitdataService_template::returnCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field returnCause of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_returnCause;
}

INTEGER_template& PDU__SCCP__UnitdataService_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__UnitdataService_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_pointer1;
}

INTEGER_template& PDU__SCCP__UnitdataService_template::pointer2()
{
set_specific();
return single_value->field_pointer2;
}

const INTEGER_template& PDU__SCCP__UnitdataService_template::pointer2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer2 of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_pointer2;
}

INTEGER_template& PDU__SCCP__UnitdataService_template::pointer3()
{
set_specific();
return single_value->field_pointer3;
}

const INTEGER_template& PDU__SCCP__UnitdataService_template::pointer3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer3 of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_pointer3;
}

SCCP__param__CPartyAddressEnc_template& PDU__SCCP__UnitdataService_template::calledPAddress()
{
set_specific();
return single_value->field_calledPAddress;
}

const SCCP__param__CPartyAddressEnc_template& PDU__SCCP__UnitdataService_template::calledPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPAddress of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_calledPAddress;
}

SCCP__param__CPartyAddressEnc_template& PDU__SCCP__UnitdataService_template::callingPAddress()
{
set_specific();
return single_value->field_callingPAddress;
}

const SCCP__param__CPartyAddressEnc_template& PDU__SCCP__UnitdataService_template::callingPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field callingPAddress of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_callingPAddress;
}

SCCP__param__Data_template& PDU__SCCP__UnitdataService_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data_template& PDU__SCCP__UnitdataService_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.PDU_SCCP_UnitdataService.");
return single_value->field_data;
}

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

void PDU__SCCP__UnitdataService_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", returnCause := ");
single_value->field_returnCause.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log();
TTCN_Logger::log_event_str(", pointer3 := ");
single_value->field_pointer3.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
single_value->field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 PDU__SCCP__UnitdataService_template::log_match(const PDU__SCCP__UnitdataService& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_returnCause.match(match_value.returnCause(), legacy)){
TTCN_Logger::log_logmatch_info(".returnCause");
single_value->field_returnCause.log_match(match_value.returnCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer2.match(match_value.pointer2(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer2");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer3.match(match_value.pointer3(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer3");
single_value->field_pointer3.log_match(match_value.pointer3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_calledPAddress.match(match_value.calledPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPAddress");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_callingPAddress.match(match_value.callingPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".callingPAddress");
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", returnCause := ");
single_value->field_returnCause.log_match(match_value.returnCause(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::log_event_str(", pointer3 := ");
single_value->field_pointer3.log_match(match_value.pointer3(), legacy);
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::log_event_str(", callingPAddress := ");
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 PDU__SCCP__UnitdataService_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (returnCause().is_bound()) returnCause().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (pointer3().is_bound()) pointer3().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (callingPAddress().is_bound()) callingPAddress().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__UnitdataService_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_returnCause.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_pointer2.encode_text(text_buf);
single_value->field_pointer3.encode_text(text_buf);
single_value->field_calledPAddress.encode_text(text_buf);
single_value->field_callingPAddress.encode_text(text_buf);
single_value->field_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 @SCCP_Types.PDU_SCCP_UnitdataService.");
}
}

void PDU__SCCP__UnitdataService_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_returnCause.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_pointer2.decode_text(text_buf);
single_value->field_pointer3.decode_text(text_buf);
single_value->field_calledPAddress.decode_text(text_buf);
single_value->field_callingPAddress.decode_text(text_buf);
single_value->field_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 PDU__SCCP__UnitdataService_template[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 @SCCP_Types.PDU_SCCP_UnitdataService.");
}
}

void PDU__SCCP__UnitdataService_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__UnitdataService_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_UnitdataService has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) returnCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer3().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "returnCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          returnCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_UnitdataService: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__UnitdataService_template* precondition = new PDU__SCCP__UnitdataService_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__UnitdataService_template* implied_template = new PDU__SCCP__UnitdataService_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__UnitdataService_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_UnitdataService");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__UnitdataService_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
single_value->field_returnCause.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
single_value->field_pointer2.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
single_value->field_pointer3.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
single_value->field_calledPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
single_value->field_callingPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_UnitdataService");
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 : "@SCCP_Types.PDU_SCCP_UnitdataService");
}

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

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

PDU__SCCP__ExpeditedData::PDU__SCCP__ExpeditedData()
{
}

PDU__SCCP__ExpeditedData::PDU__SCCP__ExpeditedData(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const INTEGER& par_pointer1,
    const SCCP__param__Data& par_data)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_pointer1(par_pointer1),
  field_data(par_data)
{
}

PDU__SCCP__ExpeditedData::PDU__SCCP__ExpeditedData(const PDU__SCCP__ExpeditedData& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ExpeditedData.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void PDU__SCCP__ExpeditedData::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_pointer1.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ExpeditedData::get_descriptor() const { return &PDU__SCCP__ExpeditedData_descr_; }
PDU__SCCP__ExpeditedData& PDU__SCCP__ExpeditedData::operator=(const PDU__SCCP__ExpeditedData& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ExpeditedData.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean PDU__SCCP__ExpeditedData::operator==(const PDU__SCCP__ExpeditedData& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_pointer1==other_value.field_pointer1
  && field_data==other_value.field_data;
}

boolean PDU__SCCP__ExpeditedData::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_pointer1.is_bound())
  || (field_data.is_bound());
}
boolean PDU__SCCP__ExpeditedData::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_pointer1.is_value()
  && field_data.is_value();
}
void PDU__SCCP__ExpeditedData::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ExpeditedData::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

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

void PDU__SCCP__ExpeditedData::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void PDU__SCCP__ExpeditedData::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_data.decode_text(text_buf);
}

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

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

int PDU__SCCP__ExpeditedData::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field2=-1;
  int start_of_field3=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_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());
  start_pos_of_field2=p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__SCCP__ExpeditedData_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__ExpeditedData_pointer1_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());
  start_of_field3=(int)field_pointer1+0?1:-1;
  start_of_field3=start_pos_of_field2+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field3);
  limit=end_of_available_data-start_of_field3;
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__Data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(SCCP__param__Data_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ExpeditedData::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__SCCP__ExpeditedData_pointer1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__Data_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += 8;
  myleaf.body.node.nodes[2]->calc = CALC_POINTER;
  myleaf.body.node.nodes[2]->coding_descr = &PDU__SCCP__ExpeditedData_pointer1_descr_;
  myleaf.body.node.nodes[2]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[2]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[2]->calcof.pointerto.ptr_base = 2;
  myleaf.body.node.nodes[2]->calcof.pointerto.target.level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[2]->calcof.pointerto.target.pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[2]->length = 8;
  encoded_length += field_data.RAW_encode(SCCP__param__Data_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ExpeditedData_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
INTEGER_template field_pointer1;
SCCP__param__Data_template field_data;
};

void PDU__SCCP__ExpeditedData_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void PDU__SCCP__ExpeditedData_template::copy_value(const PDU__SCCP__ExpeditedData& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ExpeditedData_template::copy_template(const PDU__SCCP__ExpeditedData_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_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 PDU__SCCP__ExpeditedData_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ExpeditedData_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ExpeditedData_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 @SCCP_Types.PDU_SCCP_ExpeditedData.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ExpeditedData_template::PDU__SCCP__ExpeditedData_template()
{
}

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

PDU__SCCP__ExpeditedData_template::PDU__SCCP__ExpeditedData_template(const PDU__SCCP__ExpeditedData& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__ExpeditedData_template::match(const PDU__SCCP__ExpeditedData& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.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 @SCCP_Types.PDU_SCCP_ExpeditedData.");
}
return FALSE;
}

boolean PDU__SCCP__ExpeditedData_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_pointer1.is_bound()
 || single_value->field_data.is_bound();
}

boolean PDU__SCCP__ExpeditedData_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_pointer1.is_value()
 && single_value->field_data.is_value();
}

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

PDU__SCCP__ExpeditedData PDU__SCCP__ExpeditedData_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 @SCCP_Types.PDU_SCCP_ExpeditedData.");
PDU__SCCP__ExpeditedData ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void PDU__SCCP__ExpeditedData_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 @SCCP_Types.PDU_SCCP_ExpeditedData.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ExpeditedData_template[list_length];
}

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

INTEGER_template& PDU__SCCP__ExpeditedData_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ExpeditedData_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ExpeditedData.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ExpeditedData_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ExpeditedData_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ExpeditedData.");
return single_value->field_destLocRef;
}

INTEGER_template& PDU__SCCP__ExpeditedData_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__ExpeditedData_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_ExpeditedData.");
return single_value->field_pointer1;
}

SCCP__param__Data_template& PDU__SCCP__ExpeditedData_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data_template& PDU__SCCP__ExpeditedData_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.PDU_SCCP_ExpeditedData.");
return single_value->field_data;
}

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

void PDU__SCCP__ExpeditedData_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_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 PDU__SCCP__ExpeditedData_template::log_match(const PDU__SCCP__ExpeditedData& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.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 PDU__SCCP__ExpeditedData_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

void PDU__SCCP__ExpeditedData_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_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 @SCCP_Types.PDU_SCCP_ExpeditedData.");
}
}

void PDU__SCCP__ExpeditedData_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_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 PDU__SCCP__ExpeditedData_template[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 @SCCP_Types.PDU_SCCP_ExpeditedData.");
}
}

void PDU__SCCP__ExpeditedData_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ExpeditedData_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 @SCCP_Types.PDU_SCCP_ExpeditedData has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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 @SCCP_Types.PDU_SCCP_ExpeditedData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ExpeditedData_template* precondition = new PDU__SCCP__ExpeditedData_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ExpeditedData_template* implied_template = new PDU__SCCP__ExpeditedData_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ExpeditedData_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ExpeditedData");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ExpeditedData_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExpeditedData");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExpeditedData");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExpeditedData");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExpeditedData");
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 : "@SCCP_Types.PDU_SCCP_ExpeditedData");
}

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

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

PDU__SCCP__ExpeditedDataAck::PDU__SCCP__ExpeditedDataAck()
{
}

PDU__SCCP__ExpeditedDataAck::PDU__SCCP__ExpeditedDataAck(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef)
{
}

PDU__SCCP__ExpeditedDataAck::PDU__SCCP__ExpeditedDataAck(const PDU__SCCP__ExpeditedDataAck& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
}

void PDU__SCCP__ExpeditedDataAck::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ExpeditedDataAck::get_descriptor() const { return &PDU__SCCP__ExpeditedDataAck_descr_; }
PDU__SCCP__ExpeditedDataAck& PDU__SCCP__ExpeditedDataAck::operator=(const PDU__SCCP__ExpeditedDataAck& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
}
return *this;
}

boolean PDU__SCCP__ExpeditedDataAck::operator==(const PDU__SCCP__ExpeditedDataAck& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef;
}

boolean PDU__SCCP__ExpeditedDataAck::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound());
}
boolean PDU__SCCP__ExpeditedDataAck::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value();
}
void PDU__SCCP__ExpeditedDataAck::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ExpeditedDataAck::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
}

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

void PDU__SCCP__ExpeditedDataAck::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
}

void PDU__SCCP__ExpeditedDataAck::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
}

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

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

int PDU__SCCP__ExpeditedDataAck::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, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ExpeditedDataAck::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ExpeditedDataAck_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
};

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

void PDU__SCCP__ExpeditedDataAck_template::copy_value(const PDU__SCCP__ExpeditedDataAck& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ExpeditedDataAck_template::copy_template(const PDU__SCCP__ExpeditedDataAck_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ExpeditedDataAck_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ExpeditedDataAck_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ExpeditedDataAck_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 @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ExpeditedDataAck_template::PDU__SCCP__ExpeditedDataAck_template()
{
}

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

PDU__SCCP__ExpeditedDataAck_template::PDU__SCCP__ExpeditedDataAck_template(const PDU__SCCP__ExpeditedDataAck& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean PDU__SCCP__ExpeditedDataAck_template::match(const PDU__SCCP__ExpeditedDataAck& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), 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 @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
}
return FALSE;
}

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

boolean PDU__SCCP__ExpeditedDataAck_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value();
}

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

PDU__SCCP__ExpeditedDataAck PDU__SCCP__ExpeditedDataAck_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 @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
PDU__SCCP__ExpeditedDataAck ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
return ret_val;
}

void PDU__SCCP__ExpeditedDataAck_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 @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ExpeditedDataAck_template[list_length];
}

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

INTEGER_template& PDU__SCCP__ExpeditedDataAck_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ExpeditedDataAck_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ExpeditedDataAck_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ExpeditedDataAck_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
return single_value->field_destLocRef;
}

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

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

void PDU__SCCP__ExpeditedDataAck_template::log_match(const PDU__SCCP__ExpeditedDataAck& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ExpeditedDataAck_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
}

void PDU__SCCP__ExpeditedDataAck_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.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 @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
}
}

void PDU__SCCP__ExpeditedDataAck_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ExpeditedDataAck_template[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 @SCCP_Types.PDU_SCCP_ExpeditedDataAck.");
}
}

void PDU__SCCP__ExpeditedDataAck_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ExpeditedDataAck_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 @SCCP_Types.PDU_SCCP_ExpeditedDataAck has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ExpeditedDataAck: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ExpeditedDataAck_template* precondition = new PDU__SCCP__ExpeditedDataAck_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ExpeditedDataAck_template* implied_template = new PDU__SCCP__ExpeditedDataAck_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ExpeditedDataAck_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ExpeditedDataAck");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

PDU__SCCP__ResetRequest::PDU__SCCP__ResetRequest()
{
}

PDU__SCCP__ResetRequest::PDU__SCCP__ResetRequest(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const OCTETSTRING& par_sourceLocRef,
    const INTEGER& par_resetCause)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_sourceLocRef(par_sourceLocRef),
  field_resetCause(par_resetCause)
{
}

PDU__SCCP__ResetRequest::PDU__SCCP__ResetRequest(const PDU__SCCP__ResetRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ResetRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
else field_sourceLocRef.clean_up();
if (other_value.resetCause().is_bound()) field_resetCause = other_value.resetCause();
else field_resetCause.clean_up();
}

void PDU__SCCP__ResetRequest::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_sourceLocRef.clean_up();
field_resetCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ResetRequest::get_descriptor() const { return &PDU__SCCP__ResetRequest_descr_; }
PDU__SCCP__ResetRequest& PDU__SCCP__ResetRequest::operator=(const PDU__SCCP__ResetRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ResetRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
  else field_sourceLocRef.clean_up();
  if (other_value.resetCause().is_bound()) field_resetCause = other_value.resetCause();
  else field_resetCause.clean_up();
}
return *this;
}

boolean PDU__SCCP__ResetRequest::operator==(const PDU__SCCP__ResetRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_sourceLocRef==other_value.field_sourceLocRef
  && field_resetCause==other_value.field_resetCause;
}

boolean PDU__SCCP__ResetRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_sourceLocRef.is_bound())
  || (field_resetCause.is_bound());
}
boolean PDU__SCCP__ResetRequest::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_sourceLocRef.is_value()
  && field_resetCause.is_value();
}
void PDU__SCCP__ResetRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
field_sourceLocRef.log();
TTCN_Logger::log_event_str(", resetCause := ");
field_resetCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ResetRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (resetCause().is_bound()) resetCause().set_implicit_omit();
}

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

void PDU__SCCP__ResetRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_sourceLocRef.encode_text(text_buf);
field_resetCause.encode_text(text_buf);
}

void PDU__SCCP__ResetRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_sourceLocRef.decode_text(text_buf);
field_resetCause.decode_text(text_buf);
}

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

void PDU__SCCP__ResetRequest::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__SCCP__ResetRequest::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, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SourceLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_sourceLocRef.RAW_decode(SCCP__param__SourceLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__ResetCause_descr_.raw->forceomit);
  decoded_field_length = field_resetCause.RAW_decode(SCCP__param__ResetCause_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ResetRequest::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SourceLocalReference_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__ResetCause_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_sourceLocRef.RAW_encode(SCCP__param__SourceLocalReference_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_resetCause.RAW_encode(SCCP__param__ResetCause_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ResetRequest_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
OCTETSTRING_template field_sourceLocRef;
INTEGER_template field_resetCause;
};

void PDU__SCCP__ResetRequest_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_sourceLocRef = ANY_VALUE;
single_value->field_resetCause = ANY_VALUE;
}
}
}

void PDU__SCCP__ResetRequest_template::copy_value(const PDU__SCCP__ResetRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.sourceLocRef().is_bound()) {
  single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
  single_value->field_sourceLocRef.clean_up();
}
if (other_value.resetCause().is_bound()) {
  single_value->field_resetCause = other_value.resetCause();
} else {
  single_value->field_resetCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ResetRequest_template::copy_template(const PDU__SCCP__ResetRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceLocRef().get_selection()) {
single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
single_value->field_sourceLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.resetCause().get_selection()) {
single_value->field_resetCause = other_value.resetCause();
} else {
single_value->field_resetCause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ResetRequest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ResetRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ResetRequest_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 @SCCP_Types.PDU_SCCP_ResetRequest.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ResetRequest_template::PDU__SCCP__ResetRequest_template()
{
}

PDU__SCCP__ResetRequest_template::PDU__SCCP__ResetRequest_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__SCCP__ResetRequest_template::PDU__SCCP__ResetRequest_template(const PDU__SCCP__ResetRequest& other_value)
{
copy_value(other_value);
}

PDU__SCCP__ResetRequest_template::PDU__SCCP__ResetRequest_template(const OPTIONAL<PDU__SCCP__ResetRequest>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ResetRequest&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SCCP_Types.PDU_SCCP_ResetRequest from an unbound optional field.");
}
}

PDU__SCCP__ResetRequest_template::PDU__SCCP__ResetRequest_template(PDU__SCCP__ResetRequest_template* p_precondition, PDU__SCCP__ResetRequest_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__SCCP__ResetRequest_template::PDU__SCCP__ResetRequest_template(Dynamic_Match_Interface<PDU__SCCP__ResetRequest>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__SCCP__ResetRequest>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__SCCP__ResetRequest_template::PDU__SCCP__ResetRequest_template(const PDU__SCCP__ResetRequest_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__SCCP__ResetRequest_template::~PDU__SCCP__ResetRequest_template()
{
clean_up();
}

PDU__SCCP__ResetRequest_template& PDU__SCCP__ResetRequest_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__SCCP__ResetRequest_template& PDU__SCCP__ResetRequest_template::operator=(const PDU__SCCP__ResetRequest& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__SCCP__ResetRequest_template& PDU__SCCP__ResetRequest_template::operator=(const OPTIONAL<PDU__SCCP__ResetRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ResetRequest&)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 @SCCP_Types.PDU_SCCP_ResetRequest.");
}
return *this;
}

PDU__SCCP__ResetRequest_template& PDU__SCCP__ResetRequest_template::operator=(const PDU__SCCP__ResetRequest_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__SCCP__ResetRequest_template::match(const PDU__SCCP__ResetRequest& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.sourceLocRef().is_bound()) return FALSE;
if(!single_value->field_sourceLocRef.match(other_value.sourceLocRef(), legacy))return FALSE;
if(!other_value.resetCause().is_bound()) return FALSE;
if(!single_value->field_resetCause.match(other_value.resetCause(), 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 @SCCP_Types.PDU_SCCP_ResetRequest.");
}
return FALSE;
}

boolean PDU__SCCP__ResetRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_sourceLocRef.is_bound()
 || single_value->field_resetCause.is_bound();
}

boolean PDU__SCCP__ResetRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_sourceLocRef.is_value()
 && single_value->field_resetCause.is_value();
}

void PDU__SCCP__ResetRequest_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__SCCP__ResetRequest PDU__SCCP__ResetRequest_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 @SCCP_Types.PDU_SCCP_ResetRequest.");
PDU__SCCP__ResetRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_sourceLocRef.is_bound()) {
ret_val.sourceLocRef() = single_value->field_sourceLocRef.valueof();
}
if (single_value->field_resetCause.is_bound()) {
ret_val.resetCause() = single_value->field_resetCause.valueof();
}
return ret_val;
}

void PDU__SCCP__ResetRequest_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 @SCCP_Types.PDU_SCCP_ResetRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ResetRequest_template[list_length];
}

PDU__SCCP__ResetRequest_template& PDU__SCCP__ResetRequest_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 @SCCP_Types.PDU_SCCP_ResetRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SCCP_Types.PDU_SCCP_ResetRequest.");
return value_list.list_value[list_index];
}

INTEGER_template& PDU__SCCP__ResetRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ResetRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ResetRequest.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ResetRequest_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ResetRequest_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ResetRequest.");
return single_value->field_destLocRef;
}

OCTETSTRING_template& PDU__SCCP__ResetRequest_template::sourceLocRef()
{
set_specific();
return single_value->field_sourceLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ResetRequest_template::sourceLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ResetRequest.");
return single_value->field_sourceLocRef;
}

INTEGER_template& PDU__SCCP__ResetRequest_template::resetCause()
{
set_specific();
return single_value->field_resetCause;
}

const INTEGER_template& PDU__SCCP__ResetRequest_template::resetCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field resetCause of a non-specific template of type @SCCP_Types.PDU_SCCP_ResetRequest.");
return single_value->field_resetCause;
}

int PDU__SCCP__ResetRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetRequest 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 @SCCP_Types.PDU_SCCP_ResetRequest 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 @SCCP_Types.PDU_SCCP_ResetRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SCCP_Types.PDU_SCCP_ResetRequest.");
  }
  return 0;
}

void PDU__SCCP__ResetRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log();
TTCN_Logger::log_event_str(", resetCause := ");
single_value->field_resetCause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__ResetRequest_template::log_match(const PDU__SCCP__ResetRequest& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sourceLocRef.match(match_value.sourceLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceLocRef");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_resetCause.match(match_value.resetCause(), legacy)){
TTCN_Logger::log_logmatch_info(".resetCause");
single_value->field_resetCause.log_match(match_value.resetCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::log_event_str(", resetCause := ");
single_value->field_resetCause.log_match(match_value.resetCause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ResetRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (resetCause().is_bound()) resetCause().set_implicit_omit();
}

void PDU__SCCP__ResetRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_sourceLocRef.encode_text(text_buf);
single_value->field_resetCause.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 @SCCP_Types.PDU_SCCP_ResetRequest.");
}
}

void PDU__SCCP__ResetRequest_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_sourceLocRef.decode_text(text_buf);
single_value->field_resetCause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ResetRequest_template[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 @SCCP_Types.PDU_SCCP_ResetRequest.");
}
}

void PDU__SCCP__ResetRequest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ResetRequest_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 @SCCP_Types.PDU_SCCP_ResetRequest has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) resetCause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "resetCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          resetCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ResetRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ResetRequest_template* precondition = new PDU__SCCP__ResetRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ResetRequest_template* implied_template = new PDU__SCCP__ResetRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ResetRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ResetRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ResetRequest_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ResetRequest");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ResetRequest");
single_value->field_sourceLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ResetRequest");
single_value->field_resetCause.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ResetRequest");
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 : "@SCCP_Types.PDU_SCCP_ResetRequest");
}

boolean PDU__SCCP__ResetRequest_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__SCCP__ResetRequest_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__SCCP__ResetConfirm::PDU__SCCP__ResetConfirm()
{
}

PDU__SCCP__ResetConfirm::PDU__SCCP__ResetConfirm(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const OCTETSTRING& par_sourceLocRef)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_sourceLocRef(par_sourceLocRef)
{
}

PDU__SCCP__ResetConfirm::PDU__SCCP__ResetConfirm(const PDU__SCCP__ResetConfirm& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ResetConfirm.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
else field_sourceLocRef.clean_up();
}

void PDU__SCCP__ResetConfirm::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_sourceLocRef.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ResetConfirm::get_descriptor() const { return &PDU__SCCP__ResetConfirm_descr_; }
PDU__SCCP__ResetConfirm& PDU__SCCP__ResetConfirm::operator=(const PDU__SCCP__ResetConfirm& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ResetConfirm.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
  else field_sourceLocRef.clean_up();
}
return *this;
}

boolean PDU__SCCP__ResetConfirm::operator==(const PDU__SCCP__ResetConfirm& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_sourceLocRef==other_value.field_sourceLocRef;
}

boolean PDU__SCCP__ResetConfirm::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_sourceLocRef.is_bound());
}
boolean PDU__SCCP__ResetConfirm::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_sourceLocRef.is_value();
}
void PDU__SCCP__ResetConfirm::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
field_sourceLocRef.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ResetConfirm::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
}

void PDU__SCCP__ResetConfirm::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 @SCCP_Types.PDU_SCCP_ResetConfirm has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ResetConfirm: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_ResetConfirm");
  }
}

void PDU__SCCP__ResetConfirm::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_sourceLocRef.encode_text(text_buf);
}

void PDU__SCCP__ResetConfirm::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_sourceLocRef.decode_text(text_buf);
}

void PDU__SCCP__ResetConfirm::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__SCCP__ResetConfirm::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__SCCP__ResetConfirm::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, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SourceLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_sourceLocRef.RAW_decode(SCCP__param__SourceLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ResetConfirm::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SourceLocalReference_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_sourceLocRef.RAW_encode(SCCP__param__SourceLocalReference_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ResetConfirm_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
OCTETSTRING_template field_sourceLocRef;
};

void PDU__SCCP__ResetConfirm_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_sourceLocRef = ANY_VALUE;
}
}
}

void PDU__SCCP__ResetConfirm_template::copy_value(const PDU__SCCP__ResetConfirm& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.sourceLocRef().is_bound()) {
  single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
  single_value->field_sourceLocRef.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ResetConfirm_template::copy_template(const PDU__SCCP__ResetConfirm_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceLocRef().get_selection()) {
single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
single_value->field_sourceLocRef.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ResetConfirm_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ResetConfirm_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ResetConfirm_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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ResetConfirm_template::PDU__SCCP__ResetConfirm_template()
{
}

PDU__SCCP__ResetConfirm_template::PDU__SCCP__ResetConfirm_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__SCCP__ResetConfirm_template::PDU__SCCP__ResetConfirm_template(const PDU__SCCP__ResetConfirm& other_value)
{
copy_value(other_value);
}

PDU__SCCP__ResetConfirm_template::PDU__SCCP__ResetConfirm_template(const OPTIONAL<PDU__SCCP__ResetConfirm>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ResetConfirm&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SCCP_Types.PDU_SCCP_ResetConfirm from an unbound optional field.");
}
}

PDU__SCCP__ResetConfirm_template::PDU__SCCP__ResetConfirm_template(PDU__SCCP__ResetConfirm_template* p_precondition, PDU__SCCP__ResetConfirm_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__SCCP__ResetConfirm_template::PDU__SCCP__ResetConfirm_template(Dynamic_Match_Interface<PDU__SCCP__ResetConfirm>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__SCCP__ResetConfirm>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__SCCP__ResetConfirm_template::PDU__SCCP__ResetConfirm_template(const PDU__SCCP__ResetConfirm_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__SCCP__ResetConfirm_template::~PDU__SCCP__ResetConfirm_template()
{
clean_up();
}

PDU__SCCP__ResetConfirm_template& PDU__SCCP__ResetConfirm_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__SCCP__ResetConfirm_template& PDU__SCCP__ResetConfirm_template::operator=(const PDU__SCCP__ResetConfirm& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__SCCP__ResetConfirm_template& PDU__SCCP__ResetConfirm_template::operator=(const OPTIONAL<PDU__SCCP__ResetConfirm>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ResetConfirm&)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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
}
return *this;
}

PDU__SCCP__ResetConfirm_template& PDU__SCCP__ResetConfirm_template::operator=(const PDU__SCCP__ResetConfirm_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__SCCP__ResetConfirm_template::match(const PDU__SCCP__ResetConfirm& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.sourceLocRef().is_bound()) return FALSE;
if(!single_value->field_sourceLocRef.match(other_value.sourceLocRef(), 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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
}
return FALSE;
}

boolean PDU__SCCP__ResetConfirm_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_sourceLocRef.is_bound();
}

boolean PDU__SCCP__ResetConfirm_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_sourceLocRef.is_value();
}

void PDU__SCCP__ResetConfirm_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__SCCP__ResetConfirm PDU__SCCP__ResetConfirm_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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
PDU__SCCP__ResetConfirm ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_sourceLocRef.is_bound()) {
ret_val.sourceLocRef() = single_value->field_sourceLocRef.valueof();
}
return ret_val;
}

void PDU__SCCP__ResetConfirm_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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ResetConfirm_template[list_length];
}

PDU__SCCP__ResetConfirm_template& PDU__SCCP__ResetConfirm_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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SCCP_Types.PDU_SCCP_ResetConfirm.");
return value_list.list_value[list_index];
}

INTEGER_template& PDU__SCCP__ResetConfirm_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ResetConfirm_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ResetConfirm.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ResetConfirm_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ResetConfirm_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ResetConfirm.");
return single_value->field_destLocRef;
}

OCTETSTRING_template& PDU__SCCP__ResetConfirm_template::sourceLocRef()
{
set_specific();
return single_value->field_sourceLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ResetConfirm_template::sourceLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ResetConfirm.");
return single_value->field_sourceLocRef;
}

int PDU__SCCP__ResetConfirm_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetConfirm 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 @SCCP_Types.PDU_SCCP_ResetConfirm 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 @SCCP_Types.PDU_SCCP_ResetConfirm containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetConfirm containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetConfirm containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetConfirm containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetConfirm containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetConfirm containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ResetConfirm containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SCCP_Types.PDU_SCCP_ResetConfirm.");
  }
  return 0;
}

void PDU__SCCP__ResetConfirm_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__ResetConfirm_template::log_match(const PDU__SCCP__ResetConfirm& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sourceLocRef.match(match_value.sourceLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceLocRef");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ResetConfirm_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
}

void PDU__SCCP__ResetConfirm_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_sourceLocRef.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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
}
}

void PDU__SCCP__ResetConfirm_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_sourceLocRef.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ResetConfirm_template[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 @SCCP_Types.PDU_SCCP_ResetConfirm.");
}
}

void PDU__SCCP__ResetConfirm_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ResetConfirm_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 @SCCP_Types.PDU_SCCP_ResetConfirm has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ResetConfirm: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ResetConfirm_template* precondition = new PDU__SCCP__ResetConfirm_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ResetConfirm_template* implied_template = new PDU__SCCP__ResetConfirm_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ResetConfirm_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ResetConfirm");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ResetConfirm_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ResetConfirm");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ResetConfirm");
single_value->field_sourceLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ResetConfirm");
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 : "@SCCP_Types.PDU_SCCP_ResetConfirm");
}

boolean PDU__SCCP__ResetConfirm_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__SCCP__ResetConfirm_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__SCCP__ProtDataUnitError::PDU__SCCP__ProtDataUnitError()
{
}

PDU__SCCP__ProtDataUnitError::PDU__SCCP__ProtDataUnitError(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const INTEGER& par_errorCause)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_errorCause(par_errorCause)
{
}

PDU__SCCP__ProtDataUnitError::PDU__SCCP__ProtDataUnitError(const PDU__SCCP__ProtDataUnitError& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.errorCause().is_bound()) field_errorCause = other_value.errorCause();
else field_errorCause.clean_up();
}

void PDU__SCCP__ProtDataUnitError::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_errorCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ProtDataUnitError::get_descriptor() const { return &PDU__SCCP__ProtDataUnitError_descr_; }
PDU__SCCP__ProtDataUnitError& PDU__SCCP__ProtDataUnitError::operator=(const PDU__SCCP__ProtDataUnitError& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.errorCause().is_bound()) field_errorCause = other_value.errorCause();
  else field_errorCause.clean_up();
}
return *this;
}

boolean PDU__SCCP__ProtDataUnitError::operator==(const PDU__SCCP__ProtDataUnitError& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_errorCause==other_value.field_errorCause;
}

boolean PDU__SCCP__ProtDataUnitError::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_errorCause.is_bound());
}
boolean PDU__SCCP__ProtDataUnitError::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_errorCause.is_value();
}
void PDU__SCCP__ProtDataUnitError::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", errorCause := ");
field_errorCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ProtDataUnitError::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (errorCause().is_bound()) errorCause().set_implicit_omit();
}

void PDU__SCCP__ProtDataUnitError::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 @SCCP_Types.PDU_SCCP_ProtDataUnitError has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) errorCause().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "errorCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          errorCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ProtDataUnitError: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_ProtDataUnitError");
  }
}

void PDU__SCCP__ProtDataUnitError::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_errorCause.encode_text(text_buf);
}

void PDU__SCCP__ProtDataUnitError::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_errorCause.decode_text(text_buf);
}

void PDU__SCCP__ProtDataUnitError::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__SCCP__ProtDataUnitError::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__SCCP__ProtDataUnitError::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, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__ErrorCause_descr_.raw->forceomit);
  decoded_field_length = field_errorCause.RAW_decode(SCCP__param__ErrorCause_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ProtDataUnitError::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, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__ErrorCause_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_errorCause.RAW_encode(SCCP__param__ErrorCause_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ProtDataUnitError_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
INTEGER_template field_errorCause;
};

void PDU__SCCP__ProtDataUnitError_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_errorCause = ANY_VALUE;
}
}
}

void PDU__SCCP__ProtDataUnitError_template::copy_value(const PDU__SCCP__ProtDataUnitError& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.errorCause().is_bound()) {
  single_value->field_errorCause = other_value.errorCause();
} else {
  single_value->field_errorCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ProtDataUnitError_template::copy_template(const PDU__SCCP__ProtDataUnitError_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.errorCause().get_selection()) {
single_value->field_errorCause = other_value.errorCause();
} else {
single_value->field_errorCause.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ProtDataUnitError_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ProtDataUnitError_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ProtDataUnitError_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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ProtDataUnitError_template::PDU__SCCP__ProtDataUnitError_template()
{
}

PDU__SCCP__ProtDataUnitError_template::PDU__SCCP__ProtDataUnitError_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__SCCP__ProtDataUnitError_template::PDU__SCCP__ProtDataUnitError_template(const PDU__SCCP__ProtDataUnitError& other_value)
{
copy_value(other_value);
}

PDU__SCCP__ProtDataUnitError_template::PDU__SCCP__ProtDataUnitError_template(const OPTIONAL<PDU__SCCP__ProtDataUnitError>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ProtDataUnitError&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError from an unbound optional field.");
}
}

PDU__SCCP__ProtDataUnitError_template::PDU__SCCP__ProtDataUnitError_template(PDU__SCCP__ProtDataUnitError_template* p_precondition, PDU__SCCP__ProtDataUnitError_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__SCCP__ProtDataUnitError_template::PDU__SCCP__ProtDataUnitError_template(Dynamic_Match_Interface<PDU__SCCP__ProtDataUnitError>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__SCCP__ProtDataUnitError>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__SCCP__ProtDataUnitError_template::PDU__SCCP__ProtDataUnitError_template(const PDU__SCCP__ProtDataUnitError_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__SCCP__ProtDataUnitError_template::~PDU__SCCP__ProtDataUnitError_template()
{
clean_up();
}

PDU__SCCP__ProtDataUnitError_template& PDU__SCCP__ProtDataUnitError_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__SCCP__ProtDataUnitError_template& PDU__SCCP__ProtDataUnitError_template::operator=(const PDU__SCCP__ProtDataUnitError& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__SCCP__ProtDataUnitError_template& PDU__SCCP__ProtDataUnitError_template::operator=(const OPTIONAL<PDU__SCCP__ProtDataUnitError>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ProtDataUnitError&)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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
}
return *this;
}

PDU__SCCP__ProtDataUnitError_template& PDU__SCCP__ProtDataUnitError_template::operator=(const PDU__SCCP__ProtDataUnitError_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__SCCP__ProtDataUnitError_template::match(const PDU__SCCP__ProtDataUnitError& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.errorCause().is_bound()) return FALSE;
if(!single_value->field_errorCause.match(other_value.errorCause(), 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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
}
return FALSE;
}

boolean PDU__SCCP__ProtDataUnitError_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_errorCause.is_bound();
}

boolean PDU__SCCP__ProtDataUnitError_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_errorCause.is_value();
}

void PDU__SCCP__ProtDataUnitError_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__SCCP__ProtDataUnitError PDU__SCCP__ProtDataUnitError_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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
PDU__SCCP__ProtDataUnitError ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_errorCause.is_bound()) {
ret_val.errorCause() = single_value->field_errorCause.valueof();
}
return ret_val;
}

void PDU__SCCP__ProtDataUnitError_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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ProtDataUnitError_template[list_length];
}

PDU__SCCP__ProtDataUnitError_template& PDU__SCCP__ProtDataUnitError_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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
return value_list.list_value[list_index];
}

INTEGER_template& PDU__SCCP__ProtDataUnitError_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ProtDataUnitError_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__ProtDataUnitError_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__ProtDataUnitError_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
return single_value->field_destLocRef;
}

INTEGER_template& PDU__SCCP__ProtDataUnitError_template::errorCause()
{
set_specific();
return single_value->field_errorCause;
}

const INTEGER_template& PDU__SCCP__ProtDataUnitError_template::errorCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field errorCause of a non-specific template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
return single_value->field_errorCause;
}

int PDU__SCCP__ProtDataUnitError_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError 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 @SCCP_Types.PDU_SCCP_ProtDataUnitError 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 @SCCP_Types.PDU_SCCP_ProtDataUnitError containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
  }
  return 0;
}

void PDU__SCCP__ProtDataUnitError_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", errorCause := ");
single_value->field_errorCause.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__ProtDataUnitError_template::log_match(const PDU__SCCP__ProtDataUnitError& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_errorCause.match(match_value.errorCause(), legacy)){
TTCN_Logger::log_logmatch_info(".errorCause");
single_value->field_errorCause.log_match(match_value.errorCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", errorCause := ");
single_value->field_errorCause.log_match(match_value.errorCause(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ProtDataUnitError_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (errorCause().is_bound()) errorCause().set_implicit_omit();
}

void PDU__SCCP__ProtDataUnitError_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_errorCause.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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
}
}

void PDU__SCCP__ProtDataUnitError_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_errorCause.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ProtDataUnitError_template[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 @SCCP_Types.PDU_SCCP_ProtDataUnitError.");
}
}

void PDU__SCCP__ProtDataUnitError_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ProtDataUnitError_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 @SCCP_Types.PDU_SCCP_ProtDataUnitError has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) errorCause().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "errorCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          errorCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ProtDataUnitError: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ProtDataUnitError_template* precondition = new PDU__SCCP__ProtDataUnitError_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ProtDataUnitError_template* implied_template = new PDU__SCCP__ProtDataUnitError_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ProtDataUnitError_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ProtDataUnitError");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ProtDataUnitError_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ProtDataUnitError");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ProtDataUnitError");
single_value->field_errorCause.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ProtDataUnitError");
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 : "@SCCP_Types.PDU_SCCP_ProtDataUnitError");
}

boolean PDU__SCCP__ProtDataUnitError_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__SCCP__ProtDataUnitError_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__SCCP__InactivityTest::PDU__SCCP__InactivityTest()
{
}

PDU__SCCP__InactivityTest::PDU__SCCP__InactivityTest(const INTEGER& par_messageType,
    const OCTETSTRING& par_destLocRef,
    const OCTETSTRING& par_sourceLocRef,
    const SCCP__param__ProtocolClass& par_protClass,
    const SCCP__param__SequencingSegmenting& par_sequencingSegmenting,
    const OCTETSTRING& par_credit)
  :   field_messageType(par_messageType),
  field_destLocRef(par_destLocRef),
  field_sourceLocRef(par_sourceLocRef),
  field_protClass(par_protClass),
  field_sequencingSegmenting(par_sequencingSegmenting),
  field_credit(par_credit)
{
}

PDU__SCCP__InactivityTest::PDU__SCCP__InactivityTest(const PDU__SCCP__InactivityTest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_InactivityTest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
else field_destLocRef.clean_up();
if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
else field_sourceLocRef.clean_up();
if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
else field_protClass.clean_up();
if (other_value.sequencingSegmenting().is_bound()) field_sequencingSegmenting = other_value.sequencingSegmenting();
else field_sequencingSegmenting.clean_up();
if (other_value.credit().is_bound()) field_credit = other_value.credit();
else field_credit.clean_up();
}

void PDU__SCCP__InactivityTest::clean_up()
{
field_messageType.clean_up();
field_destLocRef.clean_up();
field_sourceLocRef.clean_up();
field_protClass.clean_up();
field_sequencingSegmenting.clean_up();
field_credit.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__InactivityTest::get_descriptor() const { return &PDU__SCCP__InactivityTest_descr_; }
PDU__SCCP__InactivityTest& PDU__SCCP__InactivityTest::operator=(const PDU__SCCP__InactivityTest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_InactivityTest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.destLocRef().is_bound()) field_destLocRef = other_value.destLocRef();
  else field_destLocRef.clean_up();
  if (other_value.sourceLocRef().is_bound()) field_sourceLocRef = other_value.sourceLocRef();
  else field_sourceLocRef.clean_up();
  if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
  else field_protClass.clean_up();
  if (other_value.sequencingSegmenting().is_bound()) field_sequencingSegmenting = other_value.sequencingSegmenting();
  else field_sequencingSegmenting.clean_up();
  if (other_value.credit().is_bound()) field_credit = other_value.credit();
  else field_credit.clean_up();
}
return *this;
}

boolean PDU__SCCP__InactivityTest::operator==(const PDU__SCCP__InactivityTest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_destLocRef==other_value.field_destLocRef
  && field_sourceLocRef==other_value.field_sourceLocRef
  && field_protClass==other_value.field_protClass
  && field_sequencingSegmenting==other_value.field_sequencingSegmenting
  && field_credit==other_value.field_credit;
}

boolean PDU__SCCP__InactivityTest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_destLocRef.is_bound())
  || (field_sourceLocRef.is_bound())
  || (field_protClass.is_bound())
  || (field_sequencingSegmenting.is_bound())
  || (field_credit.is_bound());
}
boolean PDU__SCCP__InactivityTest::is_value() const
{
return field_messageType.is_value()
  && field_destLocRef.is_value()
  && field_sourceLocRef.is_value()
  && field_protClass.is_value()
  && field_sequencingSegmenting.is_value()
  && field_credit.is_value();
}
void PDU__SCCP__InactivityTest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
field_sourceLocRef.log();
TTCN_Logger::log_event_str(", protClass := ");
field_protClass.log();
TTCN_Logger::log_event_str(", sequencingSegmenting := ");
field_sequencingSegmenting.log();
TTCN_Logger::log_event_str(", credit := ");
field_credit.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__InactivityTest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (sequencingSegmenting().is_bound()) sequencingSegmenting().set_implicit_omit();
if (credit().is_bound()) credit().set_implicit_omit();
}

void PDU__SCCP__InactivityTest::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @SCCP_Types.PDU_SCCP_InactivityTest has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sequencingSegmenting().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) credit().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sequencingSegmenting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequencingSegmenting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "credit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          credit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_InactivityTest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_InactivityTest");
  }
}

void PDU__SCCP__InactivityTest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_destLocRef.encode_text(text_buf);
field_sourceLocRef.encode_text(text_buf);
field_protClass.encode_text(text_buf);
field_sequencingSegmenting.encode_text(text_buf);
field_credit.encode_text(text_buf);
}

void PDU__SCCP__InactivityTest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_destLocRef.decode_text(text_buf);
field_sourceLocRef.decode_text(text_buf);
field_protClass.decode_text(text_buf);
field_sequencingSegmenting.decode_text(text_buf);
field_credit.decode_text(text_buf);
}

void PDU__SCCP__InactivityTest::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__SCCP__InactivityTest::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__SCCP__InactivityTest::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, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__DestLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_destLocRef.RAW_decode(SCCP__param__DestLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__SourceLocalReference_descr_.raw->forceomit);
  decoded_field_length = field_sourceLocRef.RAW_decode(SCCP__param__SourceLocalReference_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_3_force_omit(3, force_omit, SCCP__param__ProtocolClass_descr_.raw->forceomit);
  decoded_field_length = field_protClass.RAW_decode(SCCP__param__ProtocolClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, SCCP__param__SequencingSegmenting_descr_.raw->forceomit);
  decoded_field_length = field_sequencingSegmenting.RAW_decode(SCCP__param__SequencingSegmenting_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, SCCP__param__Credit_descr_.raw->forceomit);
  decoded_field_length = field_credit.RAW_decode(SCCP__param__Credit_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__InactivityTest::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__DestLocalReference_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__SourceLocalReference_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SCCP__param__ProtocolClass_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SCCP__param__SequencingSegmenting_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SCCP__param__Credit_descr_.raw);
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_destLocRef.RAW_encode(SCCP__param__DestLocalReference_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_sourceLocRef.RAW_encode(SCCP__param__SourceLocalReference_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_protClass.RAW_encode(SCCP__param__ProtocolClass_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_sequencingSegmenting.RAW_encode(SCCP__param__SequencingSegmenting_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_credit.RAW_encode(SCCP__param__Credit_descr_, *myleaf.body.node.nodes[5]);
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__InactivityTest_template::single_value_struct {
INTEGER_template field_messageType;
OCTETSTRING_template field_destLocRef;
OCTETSTRING_template field_sourceLocRef;
SCCP__param__ProtocolClass_template field_protClass;
SCCP__param__SequencingSegmenting_template field_sequencingSegmenting;
OCTETSTRING_template field_credit;
};

void PDU__SCCP__InactivityTest_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_destLocRef = ANY_VALUE;
single_value->field_sourceLocRef = ANY_VALUE;
single_value->field_protClass = ANY_VALUE;
single_value->field_sequencingSegmenting = ANY_VALUE;
single_value->field_credit = ANY_VALUE;
}
}
}

void PDU__SCCP__InactivityTest_template::copy_value(const PDU__SCCP__InactivityTest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.destLocRef().is_bound()) {
  single_value->field_destLocRef = other_value.destLocRef();
} else {
  single_value->field_destLocRef.clean_up();
}
if (other_value.sourceLocRef().is_bound()) {
  single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
  single_value->field_sourceLocRef.clean_up();
}
if (other_value.protClass().is_bound()) {
  single_value->field_protClass = other_value.protClass();
} else {
  single_value->field_protClass.clean_up();
}
if (other_value.sequencingSegmenting().is_bound()) {
  single_value->field_sequencingSegmenting = other_value.sequencingSegmenting();
} else {
  single_value->field_sequencingSegmenting.clean_up();
}
if (other_value.credit().is_bound()) {
  single_value->field_credit = other_value.credit();
} else {
  single_value->field_credit.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__InactivityTest_template::copy_template(const PDU__SCCP__InactivityTest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.destLocRef().get_selection()) {
single_value->field_destLocRef = other_value.destLocRef();
} else {
single_value->field_destLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sourceLocRef().get_selection()) {
single_value->field_sourceLocRef = other_value.sourceLocRef();
} else {
single_value->field_sourceLocRef.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protClass().get_selection()) {
single_value->field_protClass = other_value.protClass();
} else {
single_value->field_protClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sequencingSegmenting().get_selection()) {
single_value->field_sequencingSegmenting = other_value.sequencingSegmenting();
} else {
single_value->field_sequencingSegmenting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.credit().get_selection()) {
single_value->field_credit = other_value.credit();
} else {
single_value->field_credit.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__InactivityTest_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__InactivityTest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__InactivityTest_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 @SCCP_Types.PDU_SCCP_InactivityTest.");
break;
}
set_selection(other_value);
}

PDU__SCCP__InactivityTest_template::PDU__SCCP__InactivityTest_template()
{
}

PDU__SCCP__InactivityTest_template::PDU__SCCP__InactivityTest_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__SCCP__InactivityTest_template::PDU__SCCP__InactivityTest_template(const PDU__SCCP__InactivityTest& other_value)
{
copy_value(other_value);
}

PDU__SCCP__InactivityTest_template::PDU__SCCP__InactivityTest_template(const OPTIONAL<PDU__SCCP__InactivityTest>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__InactivityTest&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SCCP_Types.PDU_SCCP_InactivityTest from an unbound optional field.");
}
}

PDU__SCCP__InactivityTest_template::PDU__SCCP__InactivityTest_template(PDU__SCCP__InactivityTest_template* p_precondition, PDU__SCCP__InactivityTest_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__SCCP__InactivityTest_template::PDU__SCCP__InactivityTest_template(Dynamic_Match_Interface<PDU__SCCP__InactivityTest>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__SCCP__InactivityTest>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__SCCP__InactivityTest_template::PDU__SCCP__InactivityTest_template(const PDU__SCCP__InactivityTest_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__SCCP__InactivityTest_template::~PDU__SCCP__InactivityTest_template()
{
clean_up();
}

PDU__SCCP__InactivityTest_template& PDU__SCCP__InactivityTest_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__SCCP__InactivityTest_template& PDU__SCCP__InactivityTest_template::operator=(const PDU__SCCP__InactivityTest& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__SCCP__InactivityTest_template& PDU__SCCP__InactivityTest_template::operator=(const OPTIONAL<PDU__SCCP__InactivityTest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__InactivityTest&)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 @SCCP_Types.PDU_SCCP_InactivityTest.");
}
return *this;
}

PDU__SCCP__InactivityTest_template& PDU__SCCP__InactivityTest_template::operator=(const PDU__SCCP__InactivityTest_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__SCCP__InactivityTest_template::match(const PDU__SCCP__InactivityTest& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.destLocRef().is_bound()) return FALSE;
if(!single_value->field_destLocRef.match(other_value.destLocRef(), legacy))return FALSE;
if(!other_value.sourceLocRef().is_bound()) return FALSE;
if(!single_value->field_sourceLocRef.match(other_value.sourceLocRef(), legacy))return FALSE;
if(!other_value.protClass().is_bound()) return FALSE;
if(!single_value->field_protClass.match(other_value.protClass(), legacy))return FALSE;
if(!other_value.sequencingSegmenting().is_bound()) return FALSE;
if(!single_value->field_sequencingSegmenting.match(other_value.sequencingSegmenting(), legacy))return FALSE;
if(!other_value.credit().is_bound()) return FALSE;
if(!single_value->field_credit.match(other_value.credit(), 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 @SCCP_Types.PDU_SCCP_InactivityTest.");
}
return FALSE;
}

boolean PDU__SCCP__InactivityTest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_destLocRef.is_bound()
 || single_value->field_sourceLocRef.is_bound()
 || single_value->field_protClass.is_bound()
 || single_value->field_sequencingSegmenting.is_bound()
 || single_value->field_credit.is_bound();
}

boolean PDU__SCCP__InactivityTest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_destLocRef.is_value()
 && single_value->field_sourceLocRef.is_value()
 && single_value->field_protClass.is_value()
 && single_value->field_sequencingSegmenting.is_value()
 && single_value->field_credit.is_value();
}

void PDU__SCCP__InactivityTest_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__SCCP__InactivityTest PDU__SCCP__InactivityTest_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 @SCCP_Types.PDU_SCCP_InactivityTest.");
PDU__SCCP__InactivityTest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_destLocRef.is_bound()) {
ret_val.destLocRef() = single_value->field_destLocRef.valueof();
}
if (single_value->field_sourceLocRef.is_bound()) {
ret_val.sourceLocRef() = single_value->field_sourceLocRef.valueof();
}
if (single_value->field_protClass.is_bound()) {
ret_val.protClass() = single_value->field_protClass.valueof();
}
if (single_value->field_sequencingSegmenting.is_bound()) {
ret_val.sequencingSegmenting() = single_value->field_sequencingSegmenting.valueof();
}
if (single_value->field_credit.is_bound()) {
ret_val.credit() = single_value->field_credit.valueof();
}
return ret_val;
}

void PDU__SCCP__InactivityTest_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 @SCCP_Types.PDU_SCCP_InactivityTest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__InactivityTest_template[list_length];
}

PDU__SCCP__InactivityTest_template& PDU__SCCP__InactivityTest_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 @SCCP_Types.PDU_SCCP_InactivityTest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
return value_list.list_value[list_index];
}

INTEGER_template& PDU__SCCP__InactivityTest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__InactivityTest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
return single_value->field_messageType;
}

OCTETSTRING_template& PDU__SCCP__InactivityTest_template::destLocRef()
{
set_specific();
return single_value->field_destLocRef;
}

const OCTETSTRING_template& PDU__SCCP__InactivityTest_template::destLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field destLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
return single_value->field_destLocRef;
}

OCTETSTRING_template& PDU__SCCP__InactivityTest_template::sourceLocRef()
{
set_specific();
return single_value->field_sourceLocRef;
}

const OCTETSTRING_template& PDU__SCCP__InactivityTest_template::sourceLocRef() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sourceLocRef of a non-specific template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
return single_value->field_sourceLocRef;
}

SCCP__param__ProtocolClass_template& PDU__SCCP__InactivityTest_template::protClass()
{
set_specific();
return single_value->field_protClass;
}

const SCCP__param__ProtocolClass_template& PDU__SCCP__InactivityTest_template::protClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protClass of a non-specific template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
return single_value->field_protClass;
}

SCCP__param__SequencingSegmenting_template& PDU__SCCP__InactivityTest_template::sequencingSegmenting()
{
set_specific();
return single_value->field_sequencingSegmenting;
}

const SCCP__param__SequencingSegmenting_template& PDU__SCCP__InactivityTest_template::sequencingSegmenting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sequencingSegmenting of a non-specific template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
return single_value->field_sequencingSegmenting;
}

OCTETSTRING_template& PDU__SCCP__InactivityTest_template::credit()
{
set_specific();
return single_value->field_credit;
}

const OCTETSTRING_template& PDU__SCCP__InactivityTest_template::credit() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field credit of a non-specific template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
return single_value->field_credit;
}

int PDU__SCCP__InactivityTest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 6;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest 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 @SCCP_Types.PDU_SCCP_InactivityTest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_InactivityTest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SCCP_Types.PDU_SCCP_InactivityTest.");
  }
  return 0;
}

void PDU__SCCP__InactivityTest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log();
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log();
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log();
TTCN_Logger::log_event_str(", sequencingSegmenting := ");
single_value->field_sequencingSegmenting.log();
TTCN_Logger::log_event_str(", credit := ");
single_value->field_credit.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__InactivityTest_template::log_match(const PDU__SCCP__InactivityTest& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_destLocRef.match(match_value.destLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".destLocRef");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sourceLocRef.match(match_value.sourceLocRef(), legacy)){
TTCN_Logger::log_logmatch_info(".sourceLocRef");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_protClass.match(match_value.protClass(), legacy)){
TTCN_Logger::log_logmatch_info(".protClass");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sequencingSegmenting.match(match_value.sequencingSegmenting(), legacy)){
TTCN_Logger::log_logmatch_info(".sequencingSegmenting");
single_value->field_sequencingSegmenting.log_match(match_value.sequencingSegmenting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_credit.match(match_value.credit(), legacy)){
TTCN_Logger::log_logmatch_info(".credit");
single_value->field_credit.log_match(match_value.credit(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", destLocRef := ");
single_value->field_destLocRef.log_match(match_value.destLocRef(), legacy);
TTCN_Logger::log_event_str(", sourceLocRef := ");
single_value->field_sourceLocRef.log_match(match_value.sourceLocRef(), legacy);
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::log_event_str(", sequencingSegmenting := ");
single_value->field_sequencingSegmenting.log_match(match_value.sequencingSegmenting(), legacy);
TTCN_Logger::log_event_str(", credit := ");
single_value->field_credit.log_match(match_value.credit(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__InactivityTest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (destLocRef().is_bound()) destLocRef().set_implicit_omit();
if (sourceLocRef().is_bound()) sourceLocRef().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (sequencingSegmenting().is_bound()) sequencingSegmenting().set_implicit_omit();
if (credit().is_bound()) credit().set_implicit_omit();
}

void PDU__SCCP__InactivityTest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_destLocRef.encode_text(text_buf);
single_value->field_sourceLocRef.encode_text(text_buf);
single_value->field_protClass.encode_text(text_buf);
single_value->field_sequencingSegmenting.encode_text(text_buf);
single_value->field_credit.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 @SCCP_Types.PDU_SCCP_InactivityTest.");
}
}

void PDU__SCCP__InactivityTest_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_destLocRef.decode_text(text_buf);
single_value->field_sourceLocRef.decode_text(text_buf);
single_value->field_protClass.decode_text(text_buf);
single_value->field_sequencingSegmenting.decode_text(text_buf);
single_value->field_credit.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__InactivityTest_template[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 @SCCP_Types.PDU_SCCP_InactivityTest.");
}
}

void PDU__SCCP__InactivityTest_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__InactivityTest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_InactivityTest has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) destLocRef().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) sourceLocRef().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) sequencingSegmenting().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) credit().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "destLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          destLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sourceLocRef")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sourceLocRef().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sequencingSegmenting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sequencingSegmenting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "credit")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          credit().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_InactivityTest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__InactivityTest_template* precondition = new PDU__SCCP__InactivityTest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__InactivityTest_template* implied_template = new PDU__SCCP__InactivityTest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__InactivityTest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_InactivityTest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__InactivityTest_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_InactivityTest");
single_value->field_destLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_InactivityTest");
single_value->field_sourceLocRef.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_InactivityTest");
single_value->field_protClass.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_InactivityTest");
single_value->field_sequencingSegmenting.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_InactivityTest");
single_value->field_credit.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_InactivityTest");
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 : "@SCCP_Types.PDU_SCCP_InactivityTest");
}

boolean PDU__SCCP__InactivityTest_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__SCCP__InactivityTest_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;
}

SCCP__ExtUnitdata__optionalPart::SCCP__ExtUnitdata__optionalPart()
{
}

SCCP__ExtUnitdata__optionalPart::SCCP__ExtUnitdata__optionalPart(const OPTIONAL< SCCP__param__Segmentation__opt >& par_segmentation,
    const OPTIONAL< SCCP__param__Importance__opt >& par_importance)
  :   field_segmentation(par_segmentation),
  field_importance(par_importance)
{
}

SCCP__ExtUnitdata__optionalPart::SCCP__ExtUnitdata__optionalPart(const SCCP__ExtUnitdata__optionalPart& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
if (other_value.segmentation().is_bound()) field_segmentation = other_value.segmentation();
else field_segmentation.clean_up();
if (other_value.importance().is_bound()) field_importance = other_value.importance();
else field_importance.clean_up();
}

void SCCP__ExtUnitdata__optionalPart::clean_up()
{
field_segmentation.clean_up();
field_importance.clean_up();
}

const TTCN_Typedescriptor_t* SCCP__ExtUnitdata__optionalPart::get_descriptor() const { return &SCCP__ExtUnitdata__optionalPart_descr_; }
SCCP__ExtUnitdata__optionalPart& SCCP__ExtUnitdata__optionalPart::operator=(const SCCP__ExtUnitdata__optionalPart& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
  if (other_value.segmentation().is_bound()) field_segmentation = other_value.segmentation();
  else field_segmentation.clean_up();
  if (other_value.importance().is_bound()) field_importance = other_value.importance();
  else field_importance.clean_up();
}
return *this;
}

boolean SCCP__ExtUnitdata__optionalPart::operator==(const SCCP__ExtUnitdata__optionalPart& other_value) const
{
return field_segmentation==other_value.field_segmentation
  && field_importance==other_value.field_importance;
}

boolean SCCP__ExtUnitdata__optionalPart::is_bound() const
{
return (OPTIONAL_OMIT == field_segmentation.get_selection() || field_segmentation.is_bound())
  || (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_bound());
}
boolean SCCP__ExtUnitdata__optionalPart::is_value() const
{
return (OPTIONAL_OMIT == field_segmentation.get_selection() || field_segmentation.is_value())
  && (OPTIONAL_OMIT == field_importance.get_selection() || field_importance.is_value());
}
int SCCP__ExtUnitdata__optionalPart::size_of() const
{
  int ret_val = 0;
  if (field_segmentation.ispresent()) ret_val++;
  if (field_importance.ispresent()) ret_val++;
  return ret_val;
}

void SCCP__ExtUnitdata__optionalPart::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ segmentation := ");
field_segmentation.log();
TTCN_Logger::log_event_str(", importance := ");
field_importance.log();
TTCN_Logger::log_event_str(" }");
}

void SCCP__ExtUnitdata__optionalPart::set_implicit_omit()
{
if (!segmentation().is_bound()) segmentation() = OMIT_VALUE;
else segmentation().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__ExtUnitdata__optionalPart::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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart 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) segmentation().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) importance().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(), "segmentation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          segmentation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "importance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          importance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_ExtUnitdata_optionalPart: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.SCCP_ExtUnitdata_optionalPart");
  }
}

void SCCP__ExtUnitdata__optionalPart::encode_text(Text_Buf& text_buf) const
{
field_segmentation.encode_text(text_buf);
field_importance.encode_text(text_buf);
}

void SCCP__ExtUnitdata__optionalPart::decode_text(Text_Buf& text_buf)
{
field_segmentation.decode_text(text_buf);
field_importance.decode_text(text_buf);
}

void SCCP__ExtUnitdata__optionalPart::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 SCCP__ExtUnitdata__optionalPart::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 SCCP__ExtUnitdata__optionalPart::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;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(0)) {
    field_segmentation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__Segmentation__opt_descr_.raw->forceomit);
  decoded_field_length = field_segmentation().RAW_decode(SCCP__param__Segmentation__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 1) {
  field_segmentation = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_segmentation.ispresent() || field_segmentation().paramName() != 16){
  field_segmentation=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_segmentation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_importance = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, SCCP__param__Importance__opt_descr_.raw->forceomit);
  decoded_field_length = field_importance().RAW_decode(SCCP__param__Importance__opt_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_importance = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_importance.ispresent() || field_importance().paramName() != 18){
  field_importance=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_importance=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SCCP__ExtUnitdata__optionalPart::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_segmentation.ispresent()) {
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__Segmentation__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[0] = NULL;
  if (field_importance.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__Importance__opt_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_segmentation.ispresent()) {
  encoded_length += field_segmentation().RAW_encode(SCCP__param__Segmentation__opt_descr_, *myleaf.body.node.nodes[0]);
  }
  if (field_importance.ispresent()) {
  encoded_length += field_importance().RAW_encode(SCCP__param__Importance__opt_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_segmentation.ispresent() && (!field_segmentation.ispresent() || field_segmentation().paramName() != 16)) {
  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){
  INTEGER new_val = 16;
  new_val.RAW_encode(SCCP__field__ParameterName_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_importance.ispresent() && (!field_importance.ispresent() || field_importance().paramName() != 18)) {
  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){
  INTEGER new_val = 18;
  new_val.RAW_encode(SCCP__field__ParameterName_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 SCCP__ExtUnitdata__optionalPart_template::single_value_struct {
SCCP__param__Segmentation__opt_template field_segmentation;
SCCP__param__Importance__opt_template field_importance;
};

void SCCP__ExtUnitdata__optionalPart_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_segmentation = ANY_OR_OMIT;
single_value->field_importance = ANY_OR_OMIT;
}
}
}

void SCCP__ExtUnitdata__optionalPart_template::copy_value(const SCCP__ExtUnitdata__optionalPart& other_value)
{
single_value = new single_value_struct;
if (other_value.segmentation().is_bound()) {
  if (other_value.segmentation().ispresent()) single_value->field_segmentation = other_value.segmentation()();
  else single_value->field_segmentation = OMIT_VALUE;
} else {
  single_value->field_segmentation.clean_up();
}
if (other_value.importance().is_bound()) {
  if (other_value.importance().ispresent()) single_value->field_importance = other_value.importance()();
  else single_value->field_importance = OMIT_VALUE;
} else {
  single_value->field_importance.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SCCP__ExtUnitdata__optionalPart_template::copy_template(const SCCP__ExtUnitdata__optionalPart_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.segmentation().get_selection()) {
single_value->field_segmentation = other_value.segmentation();
} else {
single_value->field_segmentation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.importance().get_selection()) {
single_value->field_importance = other_value.importance();
} else {
single_value->field_importance.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 SCCP__ExtUnitdata__optionalPart_template[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 SCCP__ExtUnitdata__optionalPart_template(*other_value.implication_.precondition);
implication_.implied_template = new SCCP__ExtUnitdata__optionalPart_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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
break;
}
set_selection(other_value);
}

SCCP__ExtUnitdata__optionalPart_template::SCCP__ExtUnitdata__optionalPart_template()
{
}

SCCP__ExtUnitdata__optionalPart_template::SCCP__ExtUnitdata__optionalPart_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

SCCP__ExtUnitdata__optionalPart_template::SCCP__ExtUnitdata__optionalPart_template(const SCCP__ExtUnitdata__optionalPart& other_value)
{
copy_value(other_value);
}

SCCP__ExtUnitdata__optionalPart_template::SCCP__ExtUnitdata__optionalPart_template(const OPTIONAL<SCCP__ExtUnitdata__optionalPart>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SCCP__ExtUnitdata__optionalPart&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart from an unbound optional field.");
}
}

SCCP__ExtUnitdata__optionalPart_template::SCCP__ExtUnitdata__optionalPart_template(SCCP__ExtUnitdata__optionalPart_template* p_precondition, SCCP__ExtUnitdata__optionalPart_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

SCCP__ExtUnitdata__optionalPart_template::SCCP__ExtUnitdata__optionalPart_template(Dynamic_Match_Interface<SCCP__ExtUnitdata__optionalPart>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<SCCP__ExtUnitdata__optionalPart>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

SCCP__ExtUnitdata__optionalPart_template::SCCP__ExtUnitdata__optionalPart_template(const SCCP__ExtUnitdata__optionalPart_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

SCCP__ExtUnitdata__optionalPart_template::~SCCP__ExtUnitdata__optionalPart_template()
{
clean_up();
}

SCCP__ExtUnitdata__optionalPart_template& SCCP__ExtUnitdata__optionalPart_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

SCCP__ExtUnitdata__optionalPart_template& SCCP__ExtUnitdata__optionalPart_template::operator=(const SCCP__ExtUnitdata__optionalPart& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

SCCP__ExtUnitdata__optionalPart_template& SCCP__ExtUnitdata__optionalPart_template::operator=(const OPTIONAL<SCCP__ExtUnitdata__optionalPart>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SCCP__ExtUnitdata__optionalPart&)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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
}
return *this;
}

SCCP__ExtUnitdata__optionalPart_template& SCCP__ExtUnitdata__optionalPart_template::operator=(const SCCP__ExtUnitdata__optionalPart_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean SCCP__ExtUnitdata__optionalPart_template::match(const SCCP__ExtUnitdata__optionalPart& 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.segmentation().is_bound()) return FALSE;
if((other_value.segmentation().ispresent() ? !single_value->field_segmentation.match((const SCCP__param__Segmentation__opt&)other_value.segmentation(), legacy) : !single_value->field_segmentation.match_omit(legacy)))return FALSE;
if(!other_value.importance().is_bound()) return FALSE;
if((other_value.importance().ispresent() ? !single_value->field_importance.match((const SCCP__param__Importance__opt&)other_value.importance(), legacy) : !single_value->field_importance.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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
}
return FALSE;
}

boolean SCCP__ExtUnitdata__optionalPart_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_segmentation.is_omit() || single_value->field_segmentation.is_bound())
 || (single_value->field_importance.is_omit() || single_value->field_importance.is_bound());
}

boolean SCCP__ExtUnitdata__optionalPart_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_segmentation.is_omit() || single_value->field_segmentation.is_value())
 && (single_value->field_importance.is_omit() || single_value->field_importance.is_value());
}

void SCCP__ExtUnitdata__optionalPart_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;
}

SCCP__ExtUnitdata__optionalPart SCCP__ExtUnitdata__optionalPart_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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
SCCP__ExtUnitdata__optionalPart ret_val;
if (single_value->field_segmentation.is_omit()) ret_val.segmentation() = OMIT_VALUE;
else if (single_value->field_segmentation.is_bound()) {
ret_val.segmentation() = single_value->field_segmentation.valueof();
}
if (single_value->field_importance.is_omit()) ret_val.importance() = OMIT_VALUE;
else if (single_value->field_importance.is_bound()) {
ret_val.importance() = single_value->field_importance.valueof();
}
return ret_val;
}

void SCCP__ExtUnitdata__optionalPart_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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SCCP__ExtUnitdata__optionalPart_template[list_length];
}

SCCP__ExtUnitdata__optionalPart_template& SCCP__ExtUnitdata__optionalPart_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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
return value_list.list_value[list_index];
}

SCCP__param__Segmentation__opt_template& SCCP__ExtUnitdata__optionalPart_template::segmentation()
{
set_specific();
return single_value->field_segmentation;
}

const SCCP__param__Segmentation__opt_template& SCCP__ExtUnitdata__optionalPart_template::segmentation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field segmentation of a non-specific template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
return single_value->field_segmentation;
}

SCCP__param__Importance__opt_template& SCCP__ExtUnitdata__optionalPart_template::importance()
{
set_specific();
return single_value->field_importance;
}

const SCCP__param__Importance__opt_template& SCCP__ExtUnitdata__optionalPart_template::importance() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field importance of a non-specific template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
return single_value->field_importance;
}

int SCCP__ExtUnitdata__optionalPart_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 0;
      if (single_value->field_segmentation.is_present()) ret_val++;
      if (single_value->field_importance.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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart 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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
  }
  return 0;
}

void SCCP__ExtUnitdata__optionalPart_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ segmentation := ");
single_value->field_segmentation.log();
TTCN_Logger::log_event_str(", importance := ");
single_value->field_importance.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 SCCP__ExtUnitdata__optionalPart_template::log_match(const SCCP__ExtUnitdata__optionalPart& 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.segmentation().ispresent()){
if(!single_value->field_segmentation.match(match_value.segmentation(), legacy)){
TTCN_Logger::log_logmatch_info(".segmentation");
single_value->field_segmentation.log_match(match_value.segmentation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_segmentation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".segmentation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_segmentation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.importance().ispresent()){
if(!single_value->field_importance.match(match_value.importance(), legacy)){
TTCN_Logger::log_logmatch_info(".importance");
single_value->field_importance.log_match(match_value.importance(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_importance.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".importance := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_importance.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("{ segmentation := ");
if (match_value.segmentation().ispresent()) {
single_value->field_segmentation.log_match(match_value.segmentation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_segmentation.log();
if (single_value->field_segmentation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", importance := ");
if (match_value.importance().ispresent()) {
single_value->field_importance.log_match(match_value.importance(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_importance.log();
if (single_value->field_importance.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 SCCP__ExtUnitdata__optionalPart_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!segmentation().is_bound()) segmentation() = OMIT_VALUE;
else segmentation().set_implicit_omit();
if (!importance().is_bound()) importance() = OMIT_VALUE;
else importance().set_implicit_omit();
}

void SCCP__ExtUnitdata__optionalPart_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_segmentation.encode_text(text_buf);
single_value->field_importance.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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
}
}

void SCCP__ExtUnitdata__optionalPart_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_segmentation.decode_text(text_buf);
single_value->field_importance.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 SCCP__ExtUnitdata__optionalPart_template[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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart.");
}
}

void SCCP__ExtUnitdata__optionalPart_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: {
    SCCP__ExtUnitdata__optionalPart_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 @SCCP_Types.SCCP_ExtUnitdata_optionalPart 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) segmentation().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) importance().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(), "segmentation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          segmentation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "importance")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          importance().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.SCCP_ExtUnitdata_optionalPart: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SCCP__ExtUnitdata__optionalPart_template* precondition = new SCCP__ExtUnitdata__optionalPart_template;
    precondition->set_param(*param.get_elem(0));
    SCCP__ExtUnitdata__optionalPart_template* implied_template = new SCCP__ExtUnitdata__optionalPart_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SCCP__ExtUnitdata__optionalPart_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.SCCP_ExtUnitdata_optionalPart");
  }
  is_ifpresent = param.get_ifpresent();
}

void SCCP__ExtUnitdata__optionalPart_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_segmentation.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ExtUnitdata_optionalPart");
single_value->field_importance.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.SCCP_ExtUnitdata_optionalPart");
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 : "@SCCP_Types.SCCP_ExtUnitdata_optionalPart");
}

boolean SCCP__ExtUnitdata__optionalPart_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean SCCP__ExtUnitdata__optionalPart_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PDU__SCCP__ExtUnitdata::PDU__SCCP__ExtUnitdata()
{
}

PDU__SCCP__ExtUnitdata::PDU__SCCP__ExtUnitdata(const INTEGER& par_messageType,
    const SCCP__param__ProtocolClass& par_protClass,
    const INTEGER& par_hopCounter,
    const INTEGER& par_pointer1,
    const INTEGER& par_pointer2,
    const INTEGER& par_pointer3,
    const INTEGER& par_pointer4,
    const SCCP__param__CPartyAddressEnc& par_calledPAddress,
    const SCCP__param__CPartyAddressEnc& par_callingPAddress,
    const SCCP__param__Data& par_data,
    const OPTIONAL< SCCP__ExtUnitdata__optionalPart >& par_optionalPart,
    const OPTIONAL< SCCP__param__EndOfOptionalParams >& par_eop)
  :   field_messageType(par_messageType),
  field_protClass(par_protClass),
  field_hopCounter(par_hopCounter),
  field_pointer1(par_pointer1),
  field_pointer2(par_pointer2),
  field_pointer3(par_pointer3),
  field_pointer4(par_pointer4),
  field_calledPAddress(par_calledPAddress),
  field_callingPAddress(par_callingPAddress),
  field_data(par_data),
  field_optionalPart(par_optionalPart),
  field_eop(par_eop)
{
}

PDU__SCCP__ExtUnitdata::PDU__SCCP__ExtUnitdata(const PDU__SCCP__ExtUnitdata& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
else field_protClass.clean_up();
if (other_value.hopCounter().is_bound()) field_hopCounter = other_value.hopCounter();
else field_hopCounter.clean_up();
if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
else field_pointer1.clean_up();
if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
else field_pointer2.clean_up();
if (other_value.pointer3().is_bound()) field_pointer3 = other_value.pointer3();
else field_pointer3.clean_up();
if (other_value.pointer4().is_bound()) field_pointer4 = other_value.pointer4();
else field_pointer4.clean_up();
if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
else field_calledPAddress.clean_up();
if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
else field_callingPAddress.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
else field_optionalPart.clean_up();
if (other_value.eop().is_bound()) field_eop = other_value.eop();
else field_eop.clean_up();
}

void PDU__SCCP__ExtUnitdata::clean_up()
{
field_messageType.clean_up();
field_protClass.clean_up();
field_hopCounter.clean_up();
field_pointer1.clean_up();
field_pointer2.clean_up();
field_pointer3.clean_up();
field_pointer4.clean_up();
field_calledPAddress.clean_up();
field_callingPAddress.clean_up();
field_data.clean_up();
field_optionalPart.clean_up();
field_eop.clean_up();
}

const TTCN_Typedescriptor_t* PDU__SCCP__ExtUnitdata::get_descriptor() const { return &PDU__SCCP__ExtUnitdata_descr_; }
PDU__SCCP__ExtUnitdata& PDU__SCCP__ExtUnitdata::operator=(const PDU__SCCP__ExtUnitdata& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.protClass().is_bound()) field_protClass = other_value.protClass();
  else field_protClass.clean_up();
  if (other_value.hopCounter().is_bound()) field_hopCounter = other_value.hopCounter();
  else field_hopCounter.clean_up();
  if (other_value.pointer1().is_bound()) field_pointer1 = other_value.pointer1();
  else field_pointer1.clean_up();
  if (other_value.pointer2().is_bound()) field_pointer2 = other_value.pointer2();
  else field_pointer2.clean_up();
  if (other_value.pointer3().is_bound()) field_pointer3 = other_value.pointer3();
  else field_pointer3.clean_up();
  if (other_value.pointer4().is_bound()) field_pointer4 = other_value.pointer4();
  else field_pointer4.clean_up();
  if (other_value.calledPAddress().is_bound()) field_calledPAddress = other_value.calledPAddress();
  else field_calledPAddress.clean_up();
  if (other_value.callingPAddress().is_bound()) field_callingPAddress = other_value.callingPAddress();
  else field_callingPAddress.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
  if (other_value.optionalPart().is_bound()) field_optionalPart = other_value.optionalPart();
  else field_optionalPart.clean_up();
  if (other_value.eop().is_bound()) field_eop = other_value.eop();
  else field_eop.clean_up();
}
return *this;
}

boolean PDU__SCCP__ExtUnitdata::operator==(const PDU__SCCP__ExtUnitdata& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_protClass==other_value.field_protClass
  && field_hopCounter==other_value.field_hopCounter
  && field_pointer1==other_value.field_pointer1
  && field_pointer2==other_value.field_pointer2
  && field_pointer3==other_value.field_pointer3
  && field_pointer4==other_value.field_pointer4
  && field_calledPAddress==other_value.field_calledPAddress
  && field_callingPAddress==other_value.field_callingPAddress
  && field_data==other_value.field_data
  && field_optionalPart==other_value.field_optionalPart
  && field_eop==other_value.field_eop;
}

boolean PDU__SCCP__ExtUnitdata::is_bound() const
{
return (field_messageType.is_bound())
  || (field_protClass.is_bound())
  || (field_hopCounter.is_bound())
  || (field_pointer1.is_bound())
  || (field_pointer2.is_bound())
  || (field_pointer3.is_bound())
  || (field_pointer4.is_bound())
  || (field_calledPAddress.is_bound())
  || (field_callingPAddress.is_bound())
  || (field_data.is_bound())
  || (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_bound())
  || (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_bound());
}
boolean PDU__SCCP__ExtUnitdata::is_value() const
{
return field_messageType.is_value()
  && field_protClass.is_value()
  && field_hopCounter.is_value()
  && field_pointer1.is_value()
  && field_pointer2.is_value()
  && field_pointer3.is_value()
  && field_pointer4.is_value()
  && field_calledPAddress.is_value()
  && field_callingPAddress.is_value()
  && field_data.is_value()
  && (OPTIONAL_OMIT == field_optionalPart.get_selection() || field_optionalPart.is_value())
  && (OPTIONAL_OMIT == field_eop.get_selection() || field_eop.is_value());
}
int PDU__SCCP__ExtUnitdata::size_of() const
{
  int ret_val = 10;
  if (field_optionalPart.ispresent()) ret_val++;
  if (field_eop.ispresent()) ret_val++;
  return ret_val;
}

void PDU__SCCP__ExtUnitdata::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", protClass := ");
field_protClass.log();
TTCN_Logger::log_event_str(", hopCounter := ");
field_hopCounter.log();
TTCN_Logger::log_event_str(", pointer1 := ");
field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
field_pointer2.log();
TTCN_Logger::log_event_str(", pointer3 := ");
field_pointer3.log();
TTCN_Logger::log_event_str(", pointer4 := ");
field_pointer4.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
field_calledPAddress.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(", optionalPart := ");
field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
field_eop.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__SCCP__ExtUnitdata::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (hopCounter().is_bound()) hopCounter().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (pointer3().is_bound()) pointer3().set_implicit_omit();
if (pointer4().is_bound()) pointer4().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (callingPAddress().is_bound()) callingPAddress().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__ExtUnitdata::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record value of type @SCCP_Types.PDU_SCCP_ExtUnitdata has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) hopCounter().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pointer3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pointer4().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) eop().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hopCounter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hopCounter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ExtUnitdata: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@SCCP_Types.PDU_SCCP_ExtUnitdata");
  }
}

void PDU__SCCP__ExtUnitdata::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_protClass.encode_text(text_buf);
field_hopCounter.encode_text(text_buf);
field_pointer1.encode_text(text_buf);
field_pointer2.encode_text(text_buf);
field_pointer3.encode_text(text_buf);
field_pointer4.encode_text(text_buf);
field_calledPAddress.encode_text(text_buf);
field_callingPAddress.encode_text(text_buf);
field_data.encode_text(text_buf);
field_optionalPart.encode_text(text_buf);
field_eop.encode_text(text_buf);
}

void PDU__SCCP__ExtUnitdata::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_protClass.decode_text(text_buf);
field_hopCounter.decode_text(text_buf);
field_pointer1.decode_text(text_buf);
field_pointer2.decode_text(text_buf);
field_pointer3.decode_text(text_buf);
field_pointer4.decode_text(text_buf);
field_calledPAddress.decode_text(text_buf);
field_callingPAddress.decode_text(text_buf);
field_data.decode_text(text_buf);
field_optionalPart.decode_text(text_buf);
field_eop.decode_text(text_buf);
}

void PDU__SCCP__ExtUnitdata::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__SCCP__ExtUnitdata::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__SCCP__ExtUnitdata::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 end_of_available_data=last_decoded_pos+limit;
  int start_pos_of_field3=-1;
  int start_pos_of_field4=-1;
  int start_pos_of_field5=-1;
  int start_pos_of_field6=-1;
  int start_of_field7=-1;
  int start_of_field8=-1;
  int start_of_field9=-1;
  int start_of_field10=-1;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SCCP__param__MessageType_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(SCCP__param__MessageType_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, SCCP__param__ProtocolClass_descr_.raw->forceomit);
  decoded_field_length = field_protClass.RAW_decode(SCCP__param__ProtocolClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_2_force_omit(2, force_omit, SCCP__param__HopCounter_descr_.raw->forceomit);
  decoded_field_length = field_hopCounter.RAW_decode(SCCP__param__HopCounter_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());
  start_pos_of_field3=p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, PDU__SCCP__ExtUnitdata_pointer1_descr_.raw->forceomit);
  decoded_field_length = field_pointer1.RAW_decode(PDU__SCCP__ExtUnitdata_pointer1_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());
  start_of_field7=(int)field_pointer1+0?1:-1;
  start_pos_of_field4=p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, PDU__SCCP__ExtUnitdata_pointer2_descr_.raw->forceomit);
  decoded_field_length = field_pointer2.RAW_decode(PDU__SCCP__ExtUnitdata_pointer2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field8=(int)field_pointer2+0?1:-1;
  start_pos_of_field5=p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, PDU__SCCP__ExtUnitdata_pointer3_descr_.raw->forceomit);
  decoded_field_length = field_pointer3.RAW_decode(PDU__SCCP__ExtUnitdata_pointer3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field9=(int)field_pointer3+0?1:-1;
  start_pos_of_field6=p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, PDU__SCCP__ExtUnitdata_pointer4_descr_.raw->forceomit);
  decoded_field_length = field_pointer4.RAW_decode(PDU__SCCP__ExtUnitdata_pointer4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field10=(int)field_pointer4+0?1:-1;
  start_of_field7=start_pos_of_field3+(int)field_pointer1*8+0;
  p_buf.set_pos_bit(start_of_field7);
  limit=end_of_available_data-start_of_field7;
  RAW_Force_Omit field_7_force_omit(7, force_omit, SCCP__param__CPartyAddressEnc_descr_.raw->forceomit);
  decoded_field_length = field_calledPAddress.RAW_decode(SCCP__param__CPartyAddressEnc_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field8=start_pos_of_field4+(int)field_pointer2*8+0;
  p_buf.set_pos_bit(start_of_field8);
  limit=end_of_available_data-start_of_field8;
  RAW_Force_Omit field_8_force_omit(8, force_omit, SCCP__param__CPartyAddressEnc_descr_.raw->forceomit);
  decoded_field_length = field_callingPAddress.RAW_decode(SCCP__param__CPartyAddressEnc_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  start_of_field9=start_pos_of_field5+(int)field_pointer3*8+0;
  p_buf.set_pos_bit(start_of_field9);
  limit=end_of_available_data-start_of_field9;
  RAW_Force_Omit field_9_force_omit(9, force_omit, SCCP__param__Data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(SCCP__param__Data_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0 && start_of_field10!=-1 && start_pos_of_field6!=-1){
  start_of_field10=start_pos_of_field6+(int)field_pointer4*8+0;
  p_buf.set_pos_bit(start_of_field10);
  limit=end_of_available_data-start_of_field10;
  if (force_omit != NULL && (*force_omit)(10)) {
    field_optionalPart = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, SCCP__ExtUnitdata__optionalPart_descr_.raw->forceomit);
  decoded_field_length = field_optionalPart().RAW_decode(SCCP__ExtUnitdata__optionalPart_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_optionalPart = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  else field_optionalPart=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_eop = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, SCCP__param__EndOfOptionalParams_descr_.raw->forceomit);
  decoded_field_length = field_eop().RAW_decode(SCCP__param__EndOfOptionalParams_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_eop = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_eop.ispresent() || field_eop().paramName() != 0){
  field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_eop=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int PDU__SCCP__ExtUnitdata::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 12;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(12);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SCCP__param__MessageType_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SCCP__param__ProtocolClass_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SCCP__param__HopCounter_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, PDU__SCCP__ExtUnitdata_pointer1_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, PDU__SCCP__ExtUnitdata_pointer2_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, PDU__SCCP__ExtUnitdata_pointer3_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, PDU__SCCP__ExtUnitdata_pointer4_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, SCCP__param__CPartyAddressEnc_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, SCCP__param__CPartyAddressEnc_descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, SCCP__param__Data_descr_.raw);
  if (field_optionalPart.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, SCCP__ExtUnitdata__optionalPart_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_eop.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, SCCP__param__EndOfOptionalParams_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  encoded_length += field_messageType.RAW_encode(SCCP__param__MessageType_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_protClass.RAW_encode(SCCP__param__ProtocolClass_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_hopCounter.RAW_encode(SCCP__param__HopCounter_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += 8;
  myleaf.body.node.nodes[3]->calc = CALC_POINTER;
  myleaf.body.node.nodes[3]->coding_descr = &PDU__SCCP__ExtUnitdata_pointer1_descr_;
  myleaf.body.node.nodes[3]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[3]->calcof.pointerto.ptr_base = 3;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[3]->calcof.pointerto.target.pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[3]->length = 8;
  encoded_length += 8;
  myleaf.body.node.nodes[4]->calc = CALC_POINTER;
  myleaf.body.node.nodes[4]->coding_descr = &PDU__SCCP__ExtUnitdata_pointer2_descr_;
  myleaf.body.node.nodes[4]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[4]->calcof.pointerto.ptr_base = 4;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[4]->calcof.pointerto.target.pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  myleaf.body.node.nodes[4]->length = 8;
  encoded_length += 8;
  myleaf.body.node.nodes[5]->calc = CALC_POINTER;
  myleaf.body.node.nodes[5]->coding_descr = &PDU__SCCP__ExtUnitdata_pointer3_descr_;
  myleaf.body.node.nodes[5]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[5]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[5]->calcof.pointerto.ptr_base = 5;
  myleaf.body.node.nodes[5]->calcof.pointerto.target.level = myleaf.body.node.nodes[9]->curr_pos.level;
  myleaf.body.node.nodes[5]->calcof.pointerto.target.pos = myleaf.body.node.nodes[9]->curr_pos.pos;
  myleaf.body.node.nodes[5]->length = 8;
  if (field_optionalPart.ispresent()) {
  encoded_length += 8;
  myleaf.body.node.nodes[6]->calc = CALC_POINTER;
  myleaf.body.node.nodes[6]->coding_descr = &PDU__SCCP__ExtUnitdata_pointer4_descr_;
  myleaf.body.node.nodes[6]->calcof.pointerto.unit = 8;
  myleaf.body.node.nodes[6]->calcof.pointerto.ptr_offset = 0;
  myleaf.body.node.nodes[6]->calcof.pointerto.ptr_base = 6;
  myleaf.body.node.nodes[6]->calcof.pointerto.target.level = myleaf.body.node.nodes[10]->curr_pos.level;
  myleaf.body.node.nodes[6]->calcof.pointerto.target.pos = myleaf.body.node.nodes[10]->curr_pos.pos;
  myleaf.body.node.nodes[6]->length = 8;
  } else {
    INTEGER atm;
    atm = 0;
    encoded_length += atm.RAW_encode(PDU__SCCP__ExtUnitdata_pointer4_descr_, *myleaf.body.node.nodes[6]);
  }
  encoded_length += field_calledPAddress.RAW_encode(SCCP__param__CPartyAddressEnc_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_callingPAddress.RAW_encode(SCCP__param__CPartyAddressEnc_descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_data.RAW_encode(SCCP__param__Data_descr_, *myleaf.body.node.nodes[9]);
  if (field_optionalPart.ispresent()) {
  encoded_length += field_optionalPart().RAW_encode(SCCP__ExtUnitdata__optionalPart_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_eop.ispresent()) {
  encoded_length += field_eop().RAW_encode(SCCP__param__EndOfOptionalParams_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_eop.ispresent() && (!field_eop.ispresent() || field_eop().paramName() != 0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={11,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){
  INTEGER new_val = 0;
  new_val.RAW_encode(SCCP__field__ParameterName_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct PDU__SCCP__ExtUnitdata_template::single_value_struct {
INTEGER_template field_messageType;
SCCP__param__ProtocolClass_template field_protClass;
INTEGER_template field_hopCounter;
INTEGER_template field_pointer1;
INTEGER_template field_pointer2;
INTEGER_template field_pointer3;
INTEGER_template field_pointer4;
SCCP__param__CPartyAddressEnc_template field_calledPAddress;
SCCP__param__CPartyAddressEnc_template field_callingPAddress;
SCCP__param__Data_template field_data;
SCCP__ExtUnitdata__optionalPart_template field_optionalPart;
SCCP__param__EndOfOptionalParams_template field_eop;
};

void PDU__SCCP__ExtUnitdata_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_messageType = ANY_VALUE;
single_value->field_protClass = ANY_VALUE;
single_value->field_hopCounter = ANY_VALUE;
single_value->field_pointer1 = ANY_VALUE;
single_value->field_pointer2 = ANY_VALUE;
single_value->field_pointer3 = ANY_VALUE;
single_value->field_pointer4 = ANY_VALUE;
single_value->field_calledPAddress = ANY_VALUE;
single_value->field_callingPAddress = ANY_VALUE;
single_value->field_data = ANY_VALUE;
single_value->field_optionalPart = ANY_OR_OMIT;
single_value->field_eop = ANY_OR_OMIT;
}
}
}

void PDU__SCCP__ExtUnitdata_template::copy_value(const PDU__SCCP__ExtUnitdata& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.protClass().is_bound()) {
  single_value->field_protClass = other_value.protClass();
} else {
  single_value->field_protClass.clean_up();
}
if (other_value.hopCounter().is_bound()) {
  single_value->field_hopCounter = other_value.hopCounter();
} else {
  single_value->field_hopCounter.clean_up();
}
if (other_value.pointer1().is_bound()) {
  single_value->field_pointer1 = other_value.pointer1();
} else {
  single_value->field_pointer1.clean_up();
}
if (other_value.pointer2().is_bound()) {
  single_value->field_pointer2 = other_value.pointer2();
} else {
  single_value->field_pointer2.clean_up();
}
if (other_value.pointer3().is_bound()) {
  single_value->field_pointer3 = other_value.pointer3();
} else {
  single_value->field_pointer3.clean_up();
}
if (other_value.pointer4().is_bound()) {
  single_value->field_pointer4 = other_value.pointer4();
} else {
  single_value->field_pointer4.clean_up();
}
if (other_value.calledPAddress().is_bound()) {
  single_value->field_calledPAddress = other_value.calledPAddress();
} else {
  single_value->field_calledPAddress.clean_up();
}
if (other_value.callingPAddress().is_bound()) {
  single_value->field_callingPAddress = other_value.callingPAddress();
} else {
  single_value->field_callingPAddress.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
if (other_value.optionalPart().is_bound()) {
  if (other_value.optionalPart().ispresent()) single_value->field_optionalPart = other_value.optionalPart()();
  else single_value->field_optionalPart = OMIT_VALUE;
} else {
  single_value->field_optionalPart.clean_up();
}
if (other_value.eop().is_bound()) {
  if (other_value.eop().ispresent()) single_value->field_eop = other_value.eop()();
  else single_value->field_eop = OMIT_VALUE;
} else {
  single_value->field_eop.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__SCCP__ExtUnitdata_template::copy_template(const PDU__SCCP__ExtUnitdata_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.protClass().get_selection()) {
single_value->field_protClass = other_value.protClass();
} else {
single_value->field_protClass.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.hopCounter().get_selection()) {
single_value->field_hopCounter = other_value.hopCounter();
} else {
single_value->field_hopCounter.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer1().get_selection()) {
single_value->field_pointer1 = other_value.pointer1();
} else {
single_value->field_pointer1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer2().get_selection()) {
single_value->field_pointer2 = other_value.pointer2();
} else {
single_value->field_pointer2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer3().get_selection()) {
single_value->field_pointer3 = other_value.pointer3();
} else {
single_value->field_pointer3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pointer4().get_selection()) {
single_value->field_pointer4 = other_value.pointer4();
} else {
single_value->field_pointer4.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.calledPAddress().get_selection()) {
single_value->field_calledPAddress = other_value.calledPAddress();
} else {
single_value->field_calledPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.callingPAddress().get_selection()) {
single_value->field_callingPAddress = other_value.callingPAddress();
} else {
single_value->field_callingPAddress.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.optionalPart().get_selection()) {
single_value->field_optionalPart = other_value.optionalPart();
} else {
single_value->field_optionalPart.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eop().get_selection()) {
single_value->field_eop = other_value.eop();
} else {
single_value->field_eop.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PDU__SCCP__ExtUnitdata_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PDU__SCCP__ExtUnitdata_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__SCCP__ExtUnitdata_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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
break;
}
set_selection(other_value);
}

PDU__SCCP__ExtUnitdata_template::PDU__SCCP__ExtUnitdata_template()
{
}

PDU__SCCP__ExtUnitdata_template::PDU__SCCP__ExtUnitdata_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PDU__SCCP__ExtUnitdata_template::PDU__SCCP__ExtUnitdata_template(const PDU__SCCP__ExtUnitdata& other_value)
{
copy_value(other_value);
}

PDU__SCCP__ExtUnitdata_template::PDU__SCCP__ExtUnitdata_template(const OPTIONAL<PDU__SCCP__ExtUnitdata>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ExtUnitdata&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata from an unbound optional field.");
}
}

PDU__SCCP__ExtUnitdata_template::PDU__SCCP__ExtUnitdata_template(PDU__SCCP__ExtUnitdata_template* p_precondition, PDU__SCCP__ExtUnitdata_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PDU__SCCP__ExtUnitdata_template::PDU__SCCP__ExtUnitdata_template(Dynamic_Match_Interface<PDU__SCCP__ExtUnitdata>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PDU__SCCP__ExtUnitdata>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PDU__SCCP__ExtUnitdata_template::PDU__SCCP__ExtUnitdata_template(const PDU__SCCP__ExtUnitdata_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PDU__SCCP__ExtUnitdata_template::~PDU__SCCP__ExtUnitdata_template()
{
clean_up();
}

PDU__SCCP__ExtUnitdata_template& PDU__SCCP__ExtUnitdata_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PDU__SCCP__ExtUnitdata_template& PDU__SCCP__ExtUnitdata_template::operator=(const PDU__SCCP__ExtUnitdata& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PDU__SCCP__ExtUnitdata_template& PDU__SCCP__ExtUnitdata_template::operator=(const OPTIONAL<PDU__SCCP__ExtUnitdata>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__SCCP__ExtUnitdata&)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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
}
return *this;
}

PDU__SCCP__ExtUnitdata_template& PDU__SCCP__ExtUnitdata_template::operator=(const PDU__SCCP__ExtUnitdata_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PDU__SCCP__ExtUnitdata_template::match(const PDU__SCCP__ExtUnitdata& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.protClass().is_bound()) return FALSE;
if(!single_value->field_protClass.match(other_value.protClass(), legacy))return FALSE;
if(!other_value.hopCounter().is_bound()) return FALSE;
if(!single_value->field_hopCounter.match(other_value.hopCounter(), legacy))return FALSE;
if(!other_value.pointer1().is_bound()) return FALSE;
if(!single_value->field_pointer1.match(other_value.pointer1(), legacy))return FALSE;
if(!other_value.pointer2().is_bound()) return FALSE;
if(!single_value->field_pointer2.match(other_value.pointer2(), legacy))return FALSE;
if(!other_value.pointer3().is_bound()) return FALSE;
if(!single_value->field_pointer3.match(other_value.pointer3(), legacy))return FALSE;
if(!other_value.pointer4().is_bound()) return FALSE;
if(!single_value->field_pointer4.match(other_value.pointer4(), legacy))return FALSE;
if(!other_value.calledPAddress().is_bound()) return FALSE;
if(!single_value->field_calledPAddress.match(other_value.calledPAddress(), legacy))return FALSE;
if(!other_value.callingPAddress().is_bound()) return FALSE;
if(!single_value->field_callingPAddress.match(other_value.callingPAddress(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.data(), legacy))return FALSE;
if(!other_value.optionalPart().is_bound()) return FALSE;
if((other_value.optionalPart().ispresent() ? !single_value->field_optionalPart.match((const SCCP__ExtUnitdata__optionalPart&)other_value.optionalPart(), legacy) : !single_value->field_optionalPart.match_omit(legacy)))return FALSE;
if(!other_value.eop().is_bound()) return FALSE;
if((other_value.eop().ispresent() ? !single_value->field_eop.match((const SCCP__param__EndOfOptionalParams&)other_value.eop(), legacy) : !single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
}
return FALSE;
}

boolean PDU__SCCP__ExtUnitdata_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_protClass.is_bound()
 || single_value->field_hopCounter.is_bound()
 || single_value->field_pointer1.is_bound()
 || single_value->field_pointer2.is_bound()
 || single_value->field_pointer3.is_bound()
 || single_value->field_pointer4.is_bound()
 || single_value->field_calledPAddress.is_bound()
 || single_value->field_callingPAddress.is_bound()
 || single_value->field_data.is_bound()
 || (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_bound())
 || (single_value->field_eop.is_omit() || single_value->field_eop.is_bound());
}

boolean PDU__SCCP__ExtUnitdata_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_protClass.is_value()
 && single_value->field_hopCounter.is_value()
 && single_value->field_pointer1.is_value()
 && single_value->field_pointer2.is_value()
 && single_value->field_pointer3.is_value()
 && single_value->field_pointer4.is_value()
 && single_value->field_calledPAddress.is_value()
 && single_value->field_callingPAddress.is_value()
 && single_value->field_data.is_value()
 && (single_value->field_optionalPart.is_omit() || single_value->field_optionalPart.is_value())
 && (single_value->field_eop.is_omit() || single_value->field_eop.is_value());
}

void PDU__SCCP__ExtUnitdata_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PDU__SCCP__ExtUnitdata PDU__SCCP__ExtUnitdata_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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
PDU__SCCP__ExtUnitdata ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_protClass.is_bound()) {
ret_val.protClass() = single_value->field_protClass.valueof();
}
if (single_value->field_hopCounter.is_bound()) {
ret_val.hopCounter() = single_value->field_hopCounter.valueof();
}
if (single_value->field_pointer1.is_bound()) {
ret_val.pointer1() = single_value->field_pointer1.valueof();
}
if (single_value->field_pointer2.is_bound()) {
ret_val.pointer2() = single_value->field_pointer2.valueof();
}
if (single_value->field_pointer3.is_bound()) {
ret_val.pointer3() = single_value->field_pointer3.valueof();
}
if (single_value->field_pointer4.is_bound()) {
ret_val.pointer4() = single_value->field_pointer4.valueof();
}
if (single_value->field_calledPAddress.is_bound()) {
ret_val.calledPAddress() = single_value->field_calledPAddress.valueof();
}
if (single_value->field_callingPAddress.is_bound()) {
ret_val.callingPAddress() = single_value->field_callingPAddress.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
if (single_value->field_optionalPart.is_omit()) ret_val.optionalPart() = OMIT_VALUE;
else if (single_value->field_optionalPart.is_bound()) {
ret_val.optionalPart() = single_value->field_optionalPart.valueof();
}
if (single_value->field_eop.is_omit()) ret_val.eop() = OMIT_VALUE;
else if (single_value->field_eop.is_bound()) {
ret_val.eop() = single_value->field_eop.valueof();
}
return ret_val;
}

void PDU__SCCP__ExtUnitdata_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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__SCCP__ExtUnitdata_template[list_length];
}

PDU__SCCP__ExtUnitdata_template& PDU__SCCP__ExtUnitdata_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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return value_list.list_value[list_index];
}

INTEGER_template& PDU__SCCP__ExtUnitdata_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const INTEGER_template& PDU__SCCP__ExtUnitdata_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_messageType;
}

SCCP__param__ProtocolClass_template& PDU__SCCP__ExtUnitdata_template::protClass()
{
set_specific();
return single_value->field_protClass;
}

const SCCP__param__ProtocolClass_template& PDU__SCCP__ExtUnitdata_template::protClass() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field protClass of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_protClass;
}

INTEGER_template& PDU__SCCP__ExtUnitdata_template::hopCounter()
{
set_specific();
return single_value->field_hopCounter;
}

const INTEGER_template& PDU__SCCP__ExtUnitdata_template::hopCounter() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hopCounter of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_hopCounter;
}

INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer1()
{
set_specific();
return single_value->field_pointer1;
}

const INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer1 of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_pointer1;
}

INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer2()
{
set_specific();
return single_value->field_pointer2;
}

const INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer2 of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_pointer2;
}

INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer3()
{
set_specific();
return single_value->field_pointer3;
}

const INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer3 of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_pointer3;
}

INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer4()
{
set_specific();
return single_value->field_pointer4;
}

const INTEGER_template& PDU__SCCP__ExtUnitdata_template::pointer4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pointer4 of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_pointer4;
}

SCCP__param__CPartyAddressEnc_template& PDU__SCCP__ExtUnitdata_template::calledPAddress()
{
set_specific();
return single_value->field_calledPAddress;
}

const SCCP__param__CPartyAddressEnc_template& PDU__SCCP__ExtUnitdata_template::calledPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field calledPAddress of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_calledPAddress;
}

SCCP__param__CPartyAddressEnc_template& PDU__SCCP__ExtUnitdata_template::callingPAddress()
{
set_specific();
return single_value->field_callingPAddress;
}

const SCCP__param__CPartyAddressEnc_template& PDU__SCCP__ExtUnitdata_template::callingPAddress() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field callingPAddress of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_callingPAddress;
}

SCCP__param__Data_template& PDU__SCCP__ExtUnitdata_template::data()
{
set_specific();
return single_value->field_data;
}

const SCCP__param__Data_template& PDU__SCCP__ExtUnitdata_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_data;
}

SCCP__ExtUnitdata__optionalPart_template& PDU__SCCP__ExtUnitdata_template::optionalPart()
{
set_specific();
return single_value->field_optionalPart;
}

const SCCP__ExtUnitdata__optionalPart_template& PDU__SCCP__ExtUnitdata_template::optionalPart() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field optionalPart of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_optionalPart;
}

SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ExtUnitdata_template::eop()
{
set_specific();
return single_value->field_eop;
}

const SCCP__param__EndOfOptionalParams_template& PDU__SCCP__ExtUnitdata_template::eop() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eop of a non-specific template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
return single_value->field_eop;
}

int PDU__SCCP__ExtUnitdata_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 10;
      if (single_value->field_optionalPart.is_present()) ret_val++;
      if (single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ExtUnitdata 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 @SCCP_Types.PDU_SCCP_ExtUnitdata containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @SCCP_Types.PDU_SCCP_ExtUnitdata containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SCCP_Types.PDU_SCCP_ExtUnitdata.");
  }
  return 0;
}

void PDU__SCCP__ExtUnitdata_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log();
TTCN_Logger::log_event_str(", hopCounter := ");
single_value->field_hopCounter.log();
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log();
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log();
TTCN_Logger::log_event_str(", pointer3 := ");
single_value->field_pointer3.log();
TTCN_Logger::log_event_str(", pointer4 := ");
single_value->field_pointer4.log();
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log();
TTCN_Logger::log_event_str(", callingPAddress := ");
single_value->field_callingPAddress.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log();
TTCN_Logger::log_event_str(", optionalPart := ");
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(", eop := ");
single_value->field_eop.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PDU__SCCP__ExtUnitdata_template::log_match(const PDU__SCCP__ExtUnitdata& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_protClass.match(match_value.protClass(), legacy)){
TTCN_Logger::log_logmatch_info(".protClass");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_hopCounter.match(match_value.hopCounter(), legacy)){
TTCN_Logger::log_logmatch_info(".hopCounter");
single_value->field_hopCounter.log_match(match_value.hopCounter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer1.match(match_value.pointer1(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer1");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer2.match(match_value.pointer2(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer2");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer3.match(match_value.pointer3(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer3");
single_value->field_pointer3.log_match(match_value.pointer3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pointer4.match(match_value.pointer4(), legacy)){
TTCN_Logger::log_logmatch_info(".pointer4");
single_value->field_pointer4.log_match(match_value.pointer4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_calledPAddress.match(match_value.calledPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".calledPAddress");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_callingPAddress.match(match_value.callingPAddress(), legacy)){
TTCN_Logger::log_logmatch_info(".callingPAddress");
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.optionalPart().ispresent()){
if(!single_value->field_optionalPart.match(match_value.optionalPart(), legacy)){
TTCN_Logger::log_logmatch_info(".optionalPart");
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_optionalPart.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".optionalPart := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_optionalPart.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eop().ispresent()){
if(!single_value->field_eop.match(match_value.eop(), legacy)){
TTCN_Logger::log_logmatch_info(".eop");
single_value->field_eop.log_match(match_value.eop(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eop.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eop := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eop.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", protClass := ");
single_value->field_protClass.log_match(match_value.protClass(), legacy);
TTCN_Logger::log_event_str(", hopCounter := ");
single_value->field_hopCounter.log_match(match_value.hopCounter(), legacy);
TTCN_Logger::log_event_str(", pointer1 := ");
single_value->field_pointer1.log_match(match_value.pointer1(), legacy);
TTCN_Logger::log_event_str(", pointer2 := ");
single_value->field_pointer2.log_match(match_value.pointer2(), legacy);
TTCN_Logger::log_event_str(", pointer3 := ");
single_value->field_pointer3.log_match(match_value.pointer3(), legacy);
TTCN_Logger::log_event_str(", pointer4 := ");
single_value->field_pointer4.log_match(match_value.pointer4(), legacy);
TTCN_Logger::log_event_str(", calledPAddress := ");
single_value->field_calledPAddress.log_match(match_value.calledPAddress(), legacy);
TTCN_Logger::log_event_str(", callingPAddress := ");
single_value->field_callingPAddress.log_match(match_value.callingPAddress(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::log_event_str(", optionalPart := ");
if (match_value.optionalPart().ispresent()) {
single_value->field_optionalPart.log_match(match_value.optionalPart(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_optionalPart.log();
if (single_value->field_optionalPart.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eop := ");
if (match_value.eop().ispresent()) {
single_value->field_eop.log_match(match_value.eop(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eop.log();
if (single_value->field_eop.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PDU__SCCP__ExtUnitdata_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (protClass().is_bound()) protClass().set_implicit_omit();
if (hopCounter().is_bound()) hopCounter().set_implicit_omit();
if (pointer1().is_bound()) pointer1().set_implicit_omit();
if (pointer2().is_bound()) pointer2().set_implicit_omit();
if (pointer3().is_bound()) pointer3().set_implicit_omit();
if (pointer4().is_bound()) pointer4().set_implicit_omit();
if (calledPAddress().is_bound()) calledPAddress().set_implicit_omit();
if (callingPAddress().is_bound()) callingPAddress().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
if (!optionalPart().is_bound()) optionalPart() = OMIT_VALUE;
else optionalPart().set_implicit_omit();
if (!eop().is_bound()) eop() = OMIT_VALUE;
else eop().set_implicit_omit();
}

void PDU__SCCP__ExtUnitdata_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_protClass.encode_text(text_buf);
single_value->field_hopCounter.encode_text(text_buf);
single_value->field_pointer1.encode_text(text_buf);
single_value->field_pointer2.encode_text(text_buf);
single_value->field_pointer3.encode_text(text_buf);
single_value->field_pointer4.encode_text(text_buf);
single_value->field_calledPAddress.encode_text(text_buf);
single_value->field_callingPAddress.encode_text(text_buf);
single_value->field_data.encode_text(text_buf);
single_value->field_optionalPart.encode_text(text_buf);
single_value->field_eop.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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
}
}

void PDU__SCCP__ExtUnitdata_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_messageType.decode_text(text_buf);
single_value->field_protClass.decode_text(text_buf);
single_value->field_hopCounter.decode_text(text_buf);
single_value->field_pointer1.decode_text(text_buf);
single_value->field_pointer2.decode_text(text_buf);
single_value->field_pointer3.decode_text(text_buf);
single_value->field_pointer4.decode_text(text_buf);
single_value->field_calledPAddress.decode_text(text_buf);
single_value->field_callingPAddress.decode_text(text_buf);
single_value->field_data.decode_text(text_buf);
single_value->field_optionalPart.decode_text(text_buf);
single_value->field_eop.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PDU__SCCP__ExtUnitdata_template[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 @SCCP_Types.PDU_SCCP_ExtUnitdata.");
}
}

void PDU__SCCP__ExtUnitdata_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PDU__SCCP__ExtUnitdata_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (12<param.get_size()) {
      param.error("record template of type @SCCP_Types.PDU_SCCP_ExtUnitdata has 12 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) protClass().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) hopCounter().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pointer1().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) pointer2().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) pointer3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pointer4().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) calledPAddress().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) callingPAddress().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) optionalPart().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) eop().set_param(*param.get_elem(11));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "protClass")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          protClass().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hopCounter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hopCounter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pointer4")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pointer4().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "calledPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          calledPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "callingPAddress")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          callingPAddress().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "data")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "optionalPart")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          optionalPart().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eop")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eop().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @SCCP_Types.PDU_SCCP_ExtUnitdata: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__SCCP__ExtUnitdata_template* precondition = new PDU__SCCP__ExtUnitdata_template;
    precondition->set_param(*param.get_elem(0));
    PDU__SCCP__ExtUnitdata_template* implied_template = new PDU__SCCP__ExtUnitdata_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__SCCP__ExtUnitdata_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@SCCP_Types.PDU_SCCP_ExtUnitdata");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__SCCP__ExtUnitdata_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_messageType.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_protClass.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_hopCounter.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_pointer1.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_pointer2.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_pointer3.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_pointer4.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_calledPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_callingPAddress.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_optionalPart.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
single_value->field_eop.check_restriction(t_res, t_name ? t_name : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
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 : "@SCCP_Types.PDU_SCCP_ExtUnitdata");
}

boolean PDU__SCCP__ExtUnitdata_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PDU__SCCP__ExtUnitdata_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 */
