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

namespace Q933__Types {

/* Literal string constants */

const unsigned char bs_3_bits[] = { 0 },
bs_0_bits[] = { 0 },
bs_2_bits[] = { 0 },
bs_1_bits[] = { 1 };
extern const BITSTRING bs_3(1, bs_3_bits),
bs_0(2, bs_0_bits),
bs_2(3, bs_2_bits),
bs_1(1, bs_1_bits);
const unsigned char os_1_octets[] = { 0 },
os_0_octets[] = { 8 };
extern const OCTETSTRING os_1(1, os_1_octets),
os_0(1, os_0_octets);
const unsigned char module_checksum[] = { 0x73, 0x86, 0x70, 0x74, 0xfb, 0x48, 0x81, 0x3d, 0x38, 0x15, 0x77, 0x65, 0x4f, 0xae, 0xe5, 0x5a };

/* Global variable definitions */

const TTCN_RAWdescriptor_t Q933__IEI_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__IEI
const TTCN_Typedescriptor_t Q933__IEI_descr_ = { "@Q933_Types.Q933_IEI", NULL, &Q933__IEI_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__IEI_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__ReportTypeIE_iei_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__ReportTypeIE_iei
const TTCN_Typedescriptor_t Q933__ReportTypeIE_iei_descr_ = { "@Q933_Types.Q933_ReportTypeIE.iei", NULL, &Q933__ReportTypeIE_iei_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__ReportTypeIE_iei_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__ReportTypeIE_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__ReportTypeIE_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__ReportTypeIE_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__ReportTypeIE_len_descr_ = { "@Q933_Types.Q933_ReportTypeIE.len", &INTEGER_ber_, &Q933__ReportTypeIE_len_raw_, &INTEGER_text_, &Q933__ReportTypeIE_len_xer_, &INTEGER_json_, &Q933__ReportTypeIE_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__ReportTypeIE_len_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__TypeOfReport_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__TypeOfReport
const TTCN_Typedescriptor_t Q933__TypeOfReport_descr_ = { "@Q933_Types.Q933_TypeOfReport", NULL, &Q933__TypeOfReport_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__TypeOfReport_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__ReportTypeIE_type__of__rep_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__ReportTypeIE_type__of__rep
const TTCN_Typedescriptor_t Q933__ReportTypeIE_type__of__rep_descr_ = { "@Q933_Types.Q933_ReportTypeIE.type_of_rep", NULL, &Q933__ReportTypeIE_type__of__rep_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__ReportTypeIE_type__of__rep_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__ReportTypeIE_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__ReportTypeIE
const TTCN_Typedescriptor_t Q933__ReportTypeIE_descr_ = { "@Q933_Types.Q933_ReportTypeIE", NULL, &Q933__ReportTypeIE_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__ReportTypeIE_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__STATUS__Msg_rep__type_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__STATUS__Msg_rep__type
const TTCN_Typedescriptor_t Q933__STATUS__Msg_rep__type_descr_ = { "@Q933_Types.Q933_STATUS_Msg.rep_type", NULL, &Q933__STATUS__Msg_rep__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__STATUS__Msg_rep__type_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__STATUS__Msg_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__STATUS__Msg
const TTCN_Typedescriptor_t Q933__STATUS__Msg_descr_ = { "@Q933_Types.Q933_STATUS_Msg", NULL, &Q933__STATUS__Msg_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t Q933__LinkIntegrityIE_iei_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__LinkIntegrityIE_iei
const TTCN_Typedescriptor_t Q933__LinkIntegrityIE_iei_descr_ = { "@Q933_Types.Q933_LinkIntegrityIE.iei", NULL, &Q933__LinkIntegrityIE_iei_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__LinkIntegrityIE_iei_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__LinkIntegrityIE_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__LinkIntegrityIE_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__LinkIntegrityIE_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__LinkIntegrityIE_len_descr_ = { "@Q933_Types.Q933_LinkIntegrityIE.len", &INTEGER_ber_, &Q933__LinkIntegrityIE_len_raw_, &INTEGER_text_, &Q933__LinkIntegrityIE_len_xer_, &INTEGER_json_, &Q933__LinkIntegrityIE_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__LinkIntegrityIE_len_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__LinkIntegrityIE_send__seq__nr_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__LinkIntegrityIE_send__seq__nr_xer_ = { {"send_seq_nr>\n", "send_seq_nr>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__LinkIntegrityIE_send__seq__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__LinkIntegrityIE_send__seq__nr_descr_ = { "@Q933_Types.Q933_LinkIntegrityIE.send_seq_nr", &INTEGER_ber_, &Q933__LinkIntegrityIE_send__seq__nr_raw_, &INTEGER_text_, &Q933__LinkIntegrityIE_send__seq__nr_xer_, &INTEGER_json_, &Q933__LinkIntegrityIE_send__seq__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__LinkIntegrityIE_send__seq__nr_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__LinkIntegrityIE_recv__seq__nr_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__LinkIntegrityIE_recv__seq__nr_xer_ = { {"recv_seq_nr>\n", "recv_seq_nr>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__LinkIntegrityIE_recv__seq__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__LinkIntegrityIE_recv__seq__nr_descr_ = { "@Q933_Types.Q933_LinkIntegrityIE.recv_seq_nr", &INTEGER_ber_, &Q933__LinkIntegrityIE_recv__seq__nr_raw_, &INTEGER_text_, &Q933__LinkIntegrityIE_recv__seq__nr_xer_, &INTEGER_json_, &Q933__LinkIntegrityIE_recv__seq__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__LinkIntegrityIE_recv__seq__nr_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__LinkIntegrityIE_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__LinkIntegrityIE
const TTCN_Typedescriptor_t Q933__LinkIntegrityIE_descr_ = { "@Q933_Types.Q933_LinkIntegrityIE", NULL, &Q933__LinkIntegrityIE_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__LinkIntegrityIE_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__STATUS__Msg_link__int_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__STATUS__Msg_link__int
const TTCN_Typedescriptor_t Q933__STATUS__Msg_link__int_descr_ = { "@Q933_Types.Q933_STATUS_Msg.link_int", NULL, &Q933__STATUS__Msg_link__int_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__STATUS__Msg_link__int_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatusIE_iei_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PvcStatusIE_iei
const TTCN_Typedescriptor_t Q933__PvcStatusIE_iei_descr_ = { "@Q933_Types.Q933_PvcStatusIE.iei", NULL, &Q933__PvcStatusIE_iei_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatusIE_iei_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatusIE_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatusIE_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatusIE_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatusIE_len_descr_ = { "@Q933_Types.Q933_PvcStatusIE.len", &INTEGER_ber_, &Q933__PvcStatusIE_len_raw_, &INTEGER_text_, &Q933__PvcStatusIE_len_xer_, &INTEGER_json_, &Q933__PvcStatusIE_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatusIE_len_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatusRec_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PvcStatusRec
const TTCN_Typedescriptor_t Q933__PvcStatusRec_descr_ = { "@Q933_Types.Q933_PvcStatusRec", NULL, &Q933__PvcStatusRec_raw_, NULL, NULL, NULL, NULL, NULL, &Q933__PvcStatusRec_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t Q933__PvcStatus_spare_raw_ = {2,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,2,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_spare_descr_ = { "@Q933_Types.Q933_PvcStatus.spare", &BITSTRING_ber_, &Q933__PvcStatus_spare_raw_, NULL, &Q933__PvcStatus_spare_xer_, &BITSTRING_json_, &Q933__PvcStatus_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_dlci__high_raw_ = {6,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,6,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_dlci__high_xer_ = { {"dlci_high>\n", "dlci_high>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_dlci__high_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_dlci__high_descr_ = { "@Q933_Types.Q933_PvcStatus.dlci_high", &BITSTRING_ber_, &Q933__PvcStatus_dlci__high_raw_, NULL, &Q933__PvcStatus_dlci__high_xer_, &BITSTRING_json_, &Q933__PvcStatus_dlci__high_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_dlci__high_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_ext1_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_ext1_xer_ = { {"ext1>\n", "ext1>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_ext1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_ext1_descr_ = { "@Q933_Types.Q933_PvcStatus.ext1", &BITSTRING_ber_, &Q933__PvcStatus_ext1_raw_, NULL, &Q933__PvcStatus_ext1_xer_, &BITSTRING_json_, &Q933__PvcStatus_ext1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_ext1_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_dlci__low_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_dlci__low_xer_ = { {"dlci_low>\n", "dlci_low>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_dlci__low_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_dlci__low_descr_ = { "@Q933_Types.Q933_PvcStatus.dlci_low", &BITSTRING_ber_, &Q933__PvcStatus_dlci__low_raw_, NULL, &Q933__PvcStatus_dlci__low_xer_, &BITSTRING_json_, &Q933__PvcStatus_dlci__low_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_dlci__low_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_spare0_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,3,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_spare0_xer_ = { {"spare0>\n", "spare0>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_spare0_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_spare0_descr_ = { "@Q933_Types.Q933_PvcStatus.spare0", &BITSTRING_ber_, &Q933__PvcStatus_spare0_raw_, NULL, &Q933__PvcStatus_spare0_xer_, &BITSTRING_json_, &Q933__PvcStatus_spare0_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_spare0_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_ext1___raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_ext1___xer_ = { {"ext1_>\n", "ext1_>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_ext1___oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_ext1___descr_ = { "@Q933_Types.Q933_PvcStatus.ext1_", &BITSTRING_ber_, &Q933__PvcStatus_ext1___raw_, NULL, &Q933__PvcStatus_ext1___xer_, &BITSTRING_json_, &Q933__PvcStatus_ext1___oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_ext1___default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_spare0___raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,3,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_spare0___xer_ = { {"spare0_>\n", "spare0_>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_spare0___oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_spare0___descr_ = { "@Q933_Types.Q933_PvcStatus.spare0_", &BITSTRING_ber_, &Q933__PvcStatus_spare0___raw_, NULL, &Q933__PvcStatus_spare0___xer_, &BITSTRING_json_, &Q933__PvcStatus_spare0___oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_spare0___default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_new__raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_new__xer_ = { {"new>\n", "new>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933__PvcStatus_new__oer_ext_arr_[0] = {};
const int Q933__PvcStatus_new__oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933__PvcStatus_new__oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933__PvcStatus_new__oer_ext_arr_, 0, Q933__PvcStatus_new__oer_p_};
const TTCN_Typedescriptor_t Q933__PvcStatus_new__descr_ = { "@Q933_Types.Q933_PvcStatus.new", &BOOLEAN_ber_, &Q933__PvcStatus_new__raw_, &BOOLEAN_text_, &Q933__PvcStatus_new__xer_, &BOOLEAN_json_, &Q933__PvcStatus_new__oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_new__default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_delete__raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_delete__xer_ = { {"delete>\n", "delete>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933__PvcStatus_delete__oer_ext_arr_[0] = {};
const int Q933__PvcStatus_delete__oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933__PvcStatus_delete__oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933__PvcStatus_delete__oer_ext_arr_, 0, Q933__PvcStatus_delete__oer_p_};
const TTCN_Typedescriptor_t Q933__PvcStatus_delete__descr_ = { "@Q933_Types.Q933_PvcStatus.delete", &BOOLEAN_ber_, &Q933__PvcStatus_delete__raw_, &BOOLEAN_text_, &Q933__PvcStatus_delete__xer_, &BOOLEAN_json_, &Q933__PvcStatus_delete__oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_delete__default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_active_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_active_xer_ = { {"active>\n", "active>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933__PvcStatus_active_oer_ext_arr_[0] = {};
const int Q933__PvcStatus_active_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933__PvcStatus_active_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933__PvcStatus_active_oer_ext_arr_, 0, Q933__PvcStatus_active_oer_p_};
const TTCN_Typedescriptor_t Q933__PvcStatus_active_descr_ = { "@Q933_Types.Q933_PvcStatus.active", &BOOLEAN_ber_, &Q933__PvcStatus_active_raw_, &BOOLEAN_text_, &Q933__PvcStatus_active_xer_, &BOOLEAN_json_, &Q933__PvcStatus_active_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_active_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_reserved0_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PvcStatus_reserved0_xer_ = { {"reserved0>\n", "reserved0>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933__PvcStatus_reserved0_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933__PvcStatus_reserved0_descr_ = { "@Q933_Types.Q933_PvcStatus.reserved0", &BITSTRING_ber_, &Q933__PvcStatus_reserved0_raw_, NULL, &Q933__PvcStatus_reserved0_xer_, &BITSTRING_json_, &Q933__PvcStatus_reserved0_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_reserved0_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatus_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PvcStatus
const TTCN_Typedescriptor_t Q933__PvcStatus_descr_ = { "@Q933_Types.Q933_PvcStatus", NULL, &Q933__PvcStatus_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatus_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatusRec_0_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PvcStatusRec_0
const TTCN_Typedescriptor_t Q933__PvcStatusRec_0_descr_ = { "@Q933_Types.Q933_PvcStatusRec.<oftype>", NULL, &Q933__PvcStatusRec_0_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatusRec_0_default_coding("RAW");
UNIVERSAL_CHARSTRING Q933__PvcStatusRec_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatusIE_pvc__status_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PvcStatusIE_pvc__status
const TTCN_Typedescriptor_t Q933__PvcStatusIE_pvc__status_descr_ = { "@Q933_Types.Q933_PvcStatusIE.pvc_status", NULL, &Q933__PvcStatusIE_pvc__status_raw_, NULL, NULL, NULL, NULL, NULL, &Q933__PvcStatusRec_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatusIE_pvc__status_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PvcStatusIE_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PvcStatusIE
const TTCN_Typedescriptor_t Q933__PvcStatusIE_descr_ = { "@Q933_Types.Q933_PvcStatusIE", NULL, &Q933__PvcStatusIE_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PvcStatusIE_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__STATUS__Msg_pvc__status_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__STATUS__Msg_pvc__status
const TTCN_Typedescriptor_t Q933__STATUS__Msg_pvc__status_descr_ = { "@Q933_Types.Q933_STATUS_Msg.pvc_status", NULL, &Q933__STATUS__Msg_pvc__status_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__STATUS__Msg_pvc__status_default_coding("RAW");
UNIVERSAL_CHARSTRING Q933__STATUS__Msg_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__STATEUS__ENQ__Msg_rep__type_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__STATEUS__ENQ__Msg_rep__type
const TTCN_Typedescriptor_t Q933__STATEUS__ENQ__Msg_rep__type_descr_ = { "@Q933_Types.Q933_STATEUS_ENQ_Msg.rep_type", NULL, &Q933__STATEUS__ENQ__Msg_rep__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__STATEUS__ENQ__Msg_rep__type_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__STATEUS__ENQ__Msg_link__int_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__STATEUS__ENQ__Msg_link__int
const TTCN_Typedescriptor_t Q933__STATEUS__ENQ__Msg_link__int_descr_ = { "@Q933_Types.Q933_STATEUS_ENQ_Msg.link_int", NULL, &Q933__STATEUS__ENQ__Msg_link__int_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__STATEUS__ENQ__Msg_link__int_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__STATEUS__ENQ__Msg_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__STATEUS__ENQ__Msg
const TTCN_Typedescriptor_t Q933__STATEUS__ENQ__Msg_descr_ = { "@Q933_Types.Q933_STATEUS_ENQ_Msg", NULL, &Q933__STATEUS__ENQ__Msg_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__STATEUS__ENQ__Msg_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__Payload_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__Payload
const TTCN_Typedescriptor_t Q933__Payload_descr_ = { "@Q933_Types.Q933_Payload", NULL, &Q933__Payload_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t Q933__Payload_status_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__Payload_status
const TTCN_Typedescriptor_t Q933__Payload_status_descr_ = { "@Q933_Types.Q933_Payload.status", NULL, &Q933__Payload_status_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__Payload_status_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__Payload_status__enq_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__Payload_status__enq
const TTCN_Typedescriptor_t Q933__Payload_status__enq_descr_ = { "@Q933_Types.Q933_Payload.status_enq", NULL, &Q933__Payload_status__enq_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__Payload_status__enq_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__Payload_other_raw_ = {0,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__Payload_other_xer_ = { {"other>\n", "other>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933__Payload_other_oer_ext_arr_[0] = {};
const int Q933__Payload_other_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933__Payload_other_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933__Payload_other_oer_ext_arr_, 0, Q933__Payload_other_oer_p_};
const TTCN_Typedescriptor_t Q933__Payload_other_descr_ = { "@Q933_Types.Q933_Payload.other", &OCTETSTRING_ber_, &Q933__Payload_other_raw_, &OCTETSTRING_text_, &Q933__Payload_other_xer_, &OCTETSTRING_json_, &Q933__Payload_other_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__Payload_other_default_coding("RAW");
UNIVERSAL_CHARSTRING Q933__Payload_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PDU_prot__disc_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PDU_prot__disc_xer_ = { {"prot_disc>\n", "prot_disc>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933__PDU_prot__disc_oer_ext_arr_[0] = {};
const int Q933__PDU_prot__disc_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933__PDU_prot__disc_oer_ = { -1, TRUE, 1, FALSE, 0, 0, Q933__PDU_prot__disc_oer_ext_arr_, 0, Q933__PDU_prot__disc_oer_p_};
const TTCN_Typedescriptor_t Q933__PDU_prot__disc_descr_ = { "@Q933_Types.Q933_PDU.prot_disc", &OCTETSTRING_ber_, &Q933__PDU_prot__disc_raw_, &OCTETSTRING_text_, &Q933__PDU_prot__disc_xer_, &OCTETSTRING_json_, &Q933__PDU_prot__disc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PDU_prot__disc_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PDU_call__ref_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       Q933__PDU_call__ref_xer_ = { {"call_ref>\n", "call_ref>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933__PDU_call__ref_oer_ext_arr_[0] = {};
const int Q933__PDU_call__ref_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933__PDU_call__ref_oer_ = { -1, TRUE, 1, FALSE, 0, 0, Q933__PDU_call__ref_oer_ext_arr_, 0, Q933__PDU_call__ref_oer_p_};
const TTCN_Typedescriptor_t Q933__PDU_call__ref_descr_ = { "@Q933_Types.Q933_PDU.call_ref", &OCTETSTRING_ber_, &Q933__PDU_call__ref_raw_, &OCTETSTRING_text_, &Q933__PDU_call__ref_xer_, &OCTETSTRING_json_, &Q933__PDU_call__ref_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PDU_call__ref_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PDU_msg__type_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PDU_msg__type
const TTCN_Typedescriptor_t Q933__PDU_msg__type_descr_ = { "@Q933_Types.Q933_PDU.msg_type", NULL, &Q933__PDU_msg__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PDU_msg__type_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PDU_body_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PDU_body
const TTCN_Typedescriptor_t Q933__PDU_body_descr_ = { "@Q933_Types.Q933_PDU.body", NULL, &Q933__PDU_body_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PDU_body_default_coding("RAW");
const TTCN_RAWdescriptor_t Q933__PDU_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for Q933__PDU
const TTCN_Typedescriptor_t Q933__PDU_descr_ = { "@Q933_Types.Q933_PDU", NULL, &Q933__PDU_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933__PDU_default_coding("RAW");
Q933__PDU_template template_tr__Q933__LMI__PDU;
const Q933__PDU_template& tr__Q933__LMI__PDU = template_tr__Q933__LMI__PDU;
Q933__PDU_template template_ts__Q933__LMI__PDU;
const Q933__PDU_template& ts__Q933__LMI__PDU = template_ts__Q933__LMI__PDU;
Q933__TypeOfReport_template template_tr__Q933__STATUS__ENQ_rep__type_defval;
const Q933__TypeOfReport_template& tr__Q933__STATUS__ENQ_rep__type_defval = template_tr__Q933__STATUS__ENQ_rep__type_defval;
Q933__TypeOfReport_template template_tr__Q933__STATUS_rep__type_defval;
const Q933__TypeOfReport_template& tr__Q933__STATUS_rep__type_defval = template_tr__Q933__STATUS_rep__type_defval;
Q933__LinkIntegrityIE_template template_tr__Q933__STATUS_link__int_defval;
const Q933__LinkIntegrityIE_template& tr__Q933__STATUS_link__int_defval = template_tr__Q933__STATUS_link__int_defval;
Q933__PvcStatusIE_template template_tr__Q933__STATUS_pvc__sts_defval;
const Q933__PvcStatusIE_template& tr__Q933__STATUS_pvc__sts_defval = template_tr__Q933__STATUS_pvc__sts_defval;
Q933__PvcStatusIE_template template_ts__Q933__STATUS_pvc__sts_defval;
const Q933__PvcStatusIE_template& ts__Q933__STATUS_pvc__sts_defval = template_ts__Q933__STATUS_pvc__sts_defval;
Q933__TypeOfReport_template template_tr__Q933__RepTypeIE_rept_defval;
const Q933__TypeOfReport_template& tr__Q933__RepTypeIE_rept_defval = template_tr__Q933__RepTypeIE_rept_defval;
TTCN_Module module_object("Q933_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

/* Member functions of C++ classes */

Q933__IEI::Q933__IEI()
{
enum_value = UNBOUND_VALUE;
}

Q933__IEI::Q933__IEI(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Q933_Types.Q933_IEI with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

Q933__IEI::Q933__IEI(enum_type other_value)
{
enum_value = other_value;
}

Q933__IEI::Q933__IEI(const Q933__IEI& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Q933_Types.Q933_IEI.");
enum_value = other_value.enum_value;
}

Q933__IEI& Q933__IEI::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Q933_Types.Q933_IEI.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

Q933__IEI& Q933__IEI::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

Q933__IEI& Q933__IEI::operator=(const Q933__IEI& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Q933_Types.Q933_IEI.");
enum_value = other_value.enum_value;
return *this;
}

boolean Q933__IEI::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Q933_Types.Q933_IEI comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean Q933__IEI::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 @Q933_Types.Q933_IEI.");
return enum_value == other_value;
}

boolean Q933__IEI::operator==(const Q933__IEI& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
return enum_value == other_value.enum_value;
}

boolean Q933__IEI::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Q933_Types.Q933_IEI comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean Q933__IEI::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 @Q933_Types.Q933_IEI.");
return enum_value < other_value;
}

boolean Q933__IEI::operator<(const Q933__IEI& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
return enum_value < other_value.enum_value;
}

boolean Q933__IEI::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Q933_Types.Q933_IEI comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean Q933__IEI::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 @Q933_Types.Q933_IEI.");
return enum_value > other_value;
}

boolean Q933__IEI::operator>(const Q933__IEI& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_IEI.");
return enum_value > other_value.enum_value;
}

const char *Q933__IEI::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case Q933__IEI__REPORT__TYPE: return "Q933_IEI_REPORT_TYPE";
case Q933__IEI__LINK__INTEGRITY: return "Q933_IEI_LINK_INTEGRITY";
case Q933__IEI__PVC__STATUS: return "Q933_IEI_PVC_STATUS";
default:
return "<unknown>";
}
}

Q933__IEI::enum_type Q933__IEI::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, "Q933_IEI_REPORT_TYPE")) return Q933__IEI__REPORT__TYPE;
if (!strcmp(str_par, "Q933_IEI_LINK_INTEGRITY")) return Q933__IEI__LINK__INTEGRITY;
if (!strcmp(str_par, "Q933_IEI_PVC_STATUS")) return Q933__IEI__PVC__STATUS;
}
return UNKNOWN_VALUE;
}

boolean Q933__IEI::is_valid_enum(int int_par)
{
switch (int_par) {
case 81:
case 83:
case 87:
return TRUE;
default:
return FALSE;
}
}

int Q933__IEI::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 @Q933_Types.Q933_IEI.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int Q933__IEI::enum2int(const Q933__IEI& 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 @Q933_Types.Q933_IEI.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void Q933__IEI::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Q933_Types.Q933_IEI.", int_val);
enum_value = (enum_type)int_val;
}

Q933__IEI::operator Q933__IEI::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Q933_Types.Q933_IEI.");
return enum_value;
}

void Q933__IEI::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 Q933__IEI::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", "@Q933_Types.Q933_IEI");
  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 @Q933_Types.Q933_IEI.");
  }
}

void Q933__IEI::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Q933_Types.Q933_IEI.");
text_buf.push_int(enum_value);
}

void Q933__IEI::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 @Q933_Types.Q933_IEI.", enum_value);
}

void Q933__IEI::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 Q933__IEI::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 Q933__IEI::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, 7, 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 Q933__IEI::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 7);
}

void Q933__IEI_template::copy_template(const Q933__IEI_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 Q933__IEI_template[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 Q933__IEI_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__IEI_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 @Q933_Types.Q933_IEI.");
}
}

Q933__IEI_template::Q933__IEI_template()
{
}

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

Q933__IEI_template::Q933__IEI_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!Q933__IEI::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Q933_Types.Q933_IEI with unknown numeric value %d.", other_value);
single_value = (Q933__IEI::enum_type)other_value;
}

Q933__IEI_template::Q933__IEI_template(Q933__IEI::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

Q933__IEI_template::Q933__IEI_template(const Q933__IEI& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == Q933__IEI::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Q933_Types.Q933_IEI.");
single_value = other_value.enum_value;
}

Q933__IEI_template::Q933__IEI_template(const OPTIONAL<Q933__IEI>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (Q933__IEI::enum_type)(const Q933__IEI&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Q933_Types.Q933_IEI from an unbound optional field.");
}
}

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

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

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

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

boolean Q933__IEI_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean Q933__IEI_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != Q933__IEI::UNBOUND_VALUE;
}

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

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

Q933__IEI_template& Q933__IEI_template::operator=(int other_value)
{
if (!Q933__IEI::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Q933_Types.Q933_IEI.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (Q933__IEI::enum_type)other_value;
return *this;
}

Q933__IEI_template& Q933__IEI_template::operator=(Q933__IEI::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

Q933__IEI_template& Q933__IEI_template::operator=(const Q933__IEI& other_value)
{
if (other_value.enum_value == Q933__IEI::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Q933_Types.Q933_IEI to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

Q933__IEI_template& Q933__IEI_template::operator=(const OPTIONAL<Q933__IEI>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (Q933__IEI::enum_type)(const Q933__IEI&)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 @Q933_Types.Q933_IEI.");
}
return *this;
}

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

boolean Q933__IEI_template::match(Q933__IEI::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 @Q933_Types.Q933_IEI.");
}
return FALSE;
}

boolean Q933__IEI_template::match(const Q933__IEI& other_value, boolean) const
{
if (other_value.enum_value == Q933__IEI::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Q933_Types.Q933_IEI with an unbound value.");
return match(other_value.enum_value);
}

Q933__IEI::enum_type Q933__IEI_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 @Q933_Types.Q933_IEI.");
return single_value;
}

void Q933__IEI_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 Q933__IEI_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Q933_Types.Q933_IEI.");
}
}

Q933__IEI_template& Q933__IEI_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 @Q933_Types.Q933_IEI.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @Q933_Types.Q933_IEI.");
return value_list.list_value[list_index];
}

void Q933__IEI_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(Q933__IEI::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 Q933__IEI_template::log_match(const Q933__IEI& 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 Q933__IEI_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 @Q933_Types.Q933_IEI.");
}
}

void Q933__IEI_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (Q933__IEI::enum_type)text_buf.pull_int().get_val();
if (!Q933__IEI::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Q933_Types.Q933_IEI.", 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 Q933__IEI_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 @Q933_Types.Q933_IEI.");
}
}

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

boolean Q933__IEI_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 Q933__IEI_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: {
    Q933__IEI_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: {
    Q933__IEI::enum_type enum_val = Q933__IEI::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!Q933__IEI::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Q933_Types.Q933_IEI.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933__IEI_template* precondition = new Q933__IEI_template;
    precondition->set_param(*m_p->get_elem(0));
    Q933__IEI_template* implied_template = new Q933__IEI_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Q933__IEI_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Q933_Types.Q933_IEI");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933__IEI_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 : "@Q933_Types.Q933_IEI");
}

Q933__TypeOfReport::Q933__TypeOfReport()
{
enum_value = UNBOUND_VALUE;
}

Q933__TypeOfReport::Q933__TypeOfReport(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Q933_Types.Q933_TypeOfReport with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

Q933__TypeOfReport::Q933__TypeOfReport(enum_type other_value)
{
enum_value = other_value;
}

Q933__TypeOfReport::Q933__TypeOfReport(const Q933__TypeOfReport& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
enum_value = other_value.enum_value;
}

Q933__TypeOfReport& Q933__TypeOfReport::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Q933_Types.Q933_TypeOfReport.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

Q933__TypeOfReport& Q933__TypeOfReport::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

Q933__TypeOfReport& Q933__TypeOfReport::operator=(const Q933__TypeOfReport& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
enum_value = other_value.enum_value;
return *this;
}

boolean Q933__TypeOfReport::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Q933_Types.Q933_TypeOfReport comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean Q933__TypeOfReport::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 @Q933_Types.Q933_TypeOfReport.");
return enum_value == other_value;
}

boolean Q933__TypeOfReport::operator==(const Q933__TypeOfReport& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
return enum_value == other_value.enum_value;
}

boolean Q933__TypeOfReport::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Q933_Types.Q933_TypeOfReport comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean Q933__TypeOfReport::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 @Q933_Types.Q933_TypeOfReport.");
return enum_value < other_value;
}

boolean Q933__TypeOfReport::operator<(const Q933__TypeOfReport& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
return enum_value < other_value.enum_value;
}

boolean Q933__TypeOfReport::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Q933_Types.Q933_TypeOfReport comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean Q933__TypeOfReport::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 @Q933_Types.Q933_TypeOfReport.");
return enum_value > other_value;
}

boolean Q933__TypeOfReport::operator>(const Q933__TypeOfReport& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
return enum_value > other_value.enum_value;
}

const char *Q933__TypeOfReport::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case Q993__REP__T__FULL__STATUS: return "Q993_REP_T_FULL_STATUS";
case Q933__REP__T__LINK__INTEG__VF__ONLY: return "Q933_REP_T_LINK_INTEG_VF_ONLY";
case Q933__REP__T__SINGLE__PVC__ASYNC__STS: return "Q933_REP_T_SINGLE_PVC_ASYNC_STS";
default:
return "<unknown>";
}
}

Q933__TypeOfReport::enum_type Q933__TypeOfReport::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, "Q993_REP_T_FULL_STATUS")) return Q993__REP__T__FULL__STATUS;
if (!strcmp(str_par, "Q933_REP_T_LINK_INTEG_VF_ONLY")) return Q933__REP__T__LINK__INTEG__VF__ONLY;
if (!strcmp(str_par, "Q933_REP_T_SINGLE_PVC_ASYNC_STS")) return Q933__REP__T__SINGLE__PVC__ASYNC__STS;
}
return UNKNOWN_VALUE;
}

boolean Q933__TypeOfReport::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
return TRUE;
default:
return FALSE;
}
}

int Q933__TypeOfReport::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 @Q933_Types.Q933_TypeOfReport.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int Q933__TypeOfReport::enum2int(const Q933__TypeOfReport& 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 @Q933_Types.Q933_TypeOfReport.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void Q933__TypeOfReport::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Q933_Types.Q933_TypeOfReport.", int_val);
enum_value = (enum_type)int_val;
}

Q933__TypeOfReport::operator Q933__TypeOfReport::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Q933_Types.Q933_TypeOfReport.");
return enum_value;
}

void Q933__TypeOfReport::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 Q933__TypeOfReport::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", "@Q933_Types.Q933_TypeOfReport");
  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 @Q933_Types.Q933_TypeOfReport.");
  }
}

void Q933__TypeOfReport::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
text_buf.push_int(enum_value);
}

void Q933__TypeOfReport::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 @Q933_Types.Q933_TypeOfReport.", enum_value);
}

void Q933__TypeOfReport::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 Q933__TypeOfReport::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 Q933__TypeOfReport::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, 2, 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 Q933__TypeOfReport::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void Q933__TypeOfReport_template::copy_template(const Q933__TypeOfReport_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 Q933__TypeOfReport_template[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 Q933__TypeOfReport_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__TypeOfReport_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 @Q933_Types.Q933_TypeOfReport.");
}
}

Q933__TypeOfReport_template::Q933__TypeOfReport_template()
{
}

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

Q933__TypeOfReport_template::Q933__TypeOfReport_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!Q933__TypeOfReport::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Q933_Types.Q933_TypeOfReport with unknown numeric value %d.", other_value);
single_value = (Q933__TypeOfReport::enum_type)other_value;
}

Q933__TypeOfReport_template::Q933__TypeOfReport_template(Q933__TypeOfReport::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

Q933__TypeOfReport_template::Q933__TypeOfReport_template(const Q933__TypeOfReport& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == Q933__TypeOfReport::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport.");
single_value = other_value.enum_value;
}

Q933__TypeOfReport_template::Q933__TypeOfReport_template(const OPTIONAL<Q933__TypeOfReport>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (Q933__TypeOfReport::enum_type)(const Q933__TypeOfReport&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Q933_Types.Q933_TypeOfReport from an unbound optional field.");
}
}

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

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

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

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

boolean Q933__TypeOfReport_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean Q933__TypeOfReport_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != Q933__TypeOfReport::UNBOUND_VALUE;
}

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

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

Q933__TypeOfReport_template& Q933__TypeOfReport_template::operator=(int other_value)
{
if (!Q933__TypeOfReport::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Q933_Types.Q933_TypeOfReport.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (Q933__TypeOfReport::enum_type)other_value;
return *this;
}

Q933__TypeOfReport_template& Q933__TypeOfReport_template::operator=(Q933__TypeOfReport::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

Q933__TypeOfReport_template& Q933__TypeOfReport_template::operator=(const Q933__TypeOfReport& other_value)
{
if (other_value.enum_value == Q933__TypeOfReport::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Q933_Types.Q933_TypeOfReport to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

Q933__TypeOfReport_template& Q933__TypeOfReport_template::operator=(const OPTIONAL<Q933__TypeOfReport>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (Q933__TypeOfReport::enum_type)(const Q933__TypeOfReport&)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 @Q933_Types.Q933_TypeOfReport.");
}
return *this;
}

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

boolean Q933__TypeOfReport_template::match(Q933__TypeOfReport::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 @Q933_Types.Q933_TypeOfReport.");
}
return FALSE;
}

boolean Q933__TypeOfReport_template::match(const Q933__TypeOfReport& other_value, boolean) const
{
if (other_value.enum_value == Q933__TypeOfReport::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Q933_Types.Q933_TypeOfReport with an unbound value.");
return match(other_value.enum_value);
}

Q933__TypeOfReport::enum_type Q933__TypeOfReport_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 @Q933_Types.Q933_TypeOfReport.");
return single_value;
}

void Q933__TypeOfReport_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 Q933__TypeOfReport_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Q933_Types.Q933_TypeOfReport.");
}
}

Q933__TypeOfReport_template& Q933__TypeOfReport_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 @Q933_Types.Q933_TypeOfReport.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @Q933_Types.Q933_TypeOfReport.");
return value_list.list_value[list_index];
}

void Q933__TypeOfReport_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(Q933__TypeOfReport::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 Q933__TypeOfReport_template::log_match(const Q933__TypeOfReport& 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 Q933__TypeOfReport_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 @Q933_Types.Q933_TypeOfReport.");
}
}

void Q933__TypeOfReport_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (Q933__TypeOfReport::enum_type)text_buf.pull_int().get_val();
if (!Q933__TypeOfReport::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Q933_Types.Q933_TypeOfReport.", 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 Q933__TypeOfReport_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 @Q933_Types.Q933_TypeOfReport.");
}
}

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

boolean Q933__TypeOfReport_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 Q933__TypeOfReport_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: {
    Q933__TypeOfReport_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: {
    Q933__TypeOfReport::enum_type enum_val = Q933__TypeOfReport::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!Q933__TypeOfReport::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Q933_Types.Q933_TypeOfReport.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933__TypeOfReport_template* precondition = new Q933__TypeOfReport_template;
    precondition->set_param(*m_p->get_elem(0));
    Q933__TypeOfReport_template* implied_template = new Q933__TypeOfReport_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Q933__TypeOfReport_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Q933_Types.Q933_TypeOfReport");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933__TypeOfReport_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 : "@Q933_Types.Q933_TypeOfReport");
}

Q933__ReportTypeIE::Q933__ReportTypeIE()
{
}

Q933__ReportTypeIE::Q933__ReportTypeIE(const Q933__IEI& par_iei,
    const INTEGER& par_len,
    const Q933__TypeOfReport& par_type__of__rep)
  :   field_iei(par_iei),
  field_len(par_len),
  field_type__of__rep(par_type__of__rep)
{
}

Q933__ReportTypeIE::Q933__ReportTypeIE(const Q933__ReportTypeIE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Q933_Types.Q933_ReportTypeIE.");
if (other_value.iei().is_bound()) field_iei = other_value.iei();
else field_iei.clean_up();
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.type__of__rep().is_bound()) field_type__of__rep = other_value.type__of__rep();
else field_type__of__rep.clean_up();
}

void Q933__ReportTypeIE::clean_up()
{
field_iei.clean_up();
field_len.clean_up();
field_type__of__rep.clean_up();
}

const TTCN_Typedescriptor_t* Q933__ReportTypeIE::get_descriptor() const { return &Q933__ReportTypeIE_descr_; }
Q933__ReportTypeIE& Q933__ReportTypeIE::operator=(const Q933__ReportTypeIE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Q933_Types.Q933_ReportTypeIE.");
  if (other_value.iei().is_bound()) field_iei = other_value.iei();
  else field_iei.clean_up();
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.type__of__rep().is_bound()) field_type__of__rep = other_value.type__of__rep();
  else field_type__of__rep.clean_up();
}
return *this;
}

boolean Q933__ReportTypeIE::operator==(const Q933__ReportTypeIE& other_value) const
{
return field_iei==other_value.field_iei
  && field_len==other_value.field_len
  && field_type__of__rep==other_value.field_type__of__rep;
}

boolean Q933__ReportTypeIE::is_bound() const
{
return (field_iei.is_bound())
  || (field_len.is_bound())
  || (field_type__of__rep.is_bound());
}
boolean Q933__ReportTypeIE::is_value() const
{
return field_iei.is_value()
  && field_len.is_value()
  && field_type__of__rep.is_value();
}
void Q933__ReportTypeIE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iei := ");
field_iei.log();
TTCN_Logger::log_event_str(", len := ");
field_len.log();
TTCN_Logger::log_event_str(", type_of_rep := ");
field_type__of__rep.log();
TTCN_Logger::log_event_str(" }");
}

void Q933__ReportTypeIE::set_implicit_omit()
{
if (iei().is_bound()) iei().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (type__of__rep().is_bound()) type__of__rep().set_implicit_omit();
}

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

void Q933__ReportTypeIE::encode_text(Text_Buf& text_buf) const
{
field_iei.encode_text(text_buf);
field_len.encode_text(text_buf);
field_type__of__rep.encode_text(text_buf);
}

void Q933__ReportTypeIE::decode_text(Text_Buf& text_buf)
{
field_iei.decode_text(text_buf);
field_len.decode_text(text_buf);
field_type__of__rep.decode_text(text_buf);
}

void Q933__ReportTypeIE::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 Q933__ReportTypeIE::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 Q933__ReportTypeIE::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, Q933__ReportTypeIE_iei_descr_.raw->forceomit);
  decoded_field_length = field_iei.RAW_decode(Q933__ReportTypeIE_iei_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, Q933__ReportTypeIE_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(Q933__ReportTypeIE_len_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_len.convert_to_Integer(Q933__ReportTypeIE_len_descr_);
  field_len = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Q933__ReportTypeIE_type__of__rep_descr_.raw->forceomit);
  decoded_field_length = field_type__of__rep.RAW_decode(Q933__ReportTypeIE_type__of__rep_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  if (field_iei != Q933__IEI::Q933__IEI__REPORT__TYPE) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Q933__ReportTypeIE::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, Q933__ReportTypeIE_iei_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Q933__ReportTypeIE_len_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Q933__ReportTypeIE_type__of__rep_descr_.raw);
  encoded_length += field_iei.RAW_encode(Q933__ReportTypeIE_iei_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &Q933__ReportTypeIE_len_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_type__of__rep.RAW_encode(Q933__ReportTypeIE_type__of__rep_descr_, *myleaf.body.node.nodes[2]);
  if (field_iei != Q933__IEI::Q933__IEI__REPORT__TYPE) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
  Q933__IEI new_val = Q933__IEI::Q933__IEI__REPORT__TYPE;
  new_val.RAW_encode(Q933__ReportTypeIE_iei_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 Q933__ReportTypeIE_template::single_value_struct {
Q933__IEI_template field_iei;
INTEGER_template field_len;
Q933__TypeOfReport_template field_type__of__rep;
};

void Q933__ReportTypeIE_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_iei = ANY_VALUE;
single_value->field_len = ANY_VALUE;
single_value->field_type__of__rep = ANY_VALUE;
}
}
}

void Q933__ReportTypeIE_template::copy_value(const Q933__ReportTypeIE& other_value)
{
single_value = new single_value_struct;
if (other_value.iei().is_bound()) {
  single_value->field_iei = other_value.iei();
} else {
  single_value->field_iei.clean_up();
}
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.type__of__rep().is_bound()) {
  single_value->field_type__of__rep = other_value.type__of__rep();
} else {
  single_value->field_type__of__rep.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933__ReportTypeIE_template::copy_template(const Q933__ReportTypeIE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iei().get_selection()) {
single_value->field_iei = other_value.iei();
} else {
single_value->field_iei.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.type__of__rep().get_selection()) {
single_value->field_type__of__rep = other_value.type__of__rep();
} else {
single_value->field_type__of__rep.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 Q933__ReportTypeIE_template[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 Q933__ReportTypeIE_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__ReportTypeIE_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 @Q933_Types.Q933_ReportTypeIE.");
break;
}
set_selection(other_value);
}

Q933__ReportTypeIE_template::Q933__ReportTypeIE_template()
{
}

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

Q933__ReportTypeIE_template::Q933__ReportTypeIE_template(const Q933__ReportTypeIE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933__ReportTypeIE_template::match(const Q933__ReportTypeIE& 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.iei().is_bound()) return FALSE;
if(!single_value->field_iei.match(other_value.iei(), legacy))return FALSE;
if(!other_value.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.type__of__rep().is_bound()) return FALSE;
if(!single_value->field_type__of__rep.match(other_value.type__of__rep(), 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 @Q933_Types.Q933_ReportTypeIE.");
}
return FALSE;
}

boolean Q933__ReportTypeIE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iei.is_bound()
 || single_value->field_len.is_bound()
 || single_value->field_type__of__rep.is_bound();
}

boolean Q933__ReportTypeIE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iei.is_value()
 && single_value->field_len.is_value()
 && single_value->field_type__of__rep.is_value();
}

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

Q933__ReportTypeIE Q933__ReportTypeIE_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 @Q933_Types.Q933_ReportTypeIE.");
Q933__ReportTypeIE ret_val;
if (single_value->field_iei.is_bound()) {
ret_val.iei() = single_value->field_iei.valueof();
}
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_type__of__rep.is_bound()) {
ret_val.type__of__rep() = single_value->field_type__of__rep.valueof();
}
return ret_val;
}

void Q933__ReportTypeIE_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 @Q933_Types.Q933_ReportTypeIE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933__ReportTypeIE_template[list_length];
}

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

Q933__IEI_template& Q933__ReportTypeIE_template::iei()
{
set_specific();
return single_value->field_iei;
}

const Q933__IEI_template& Q933__ReportTypeIE_template::iei() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iei of a non-specific template of type @Q933_Types.Q933_ReportTypeIE.");
return single_value->field_iei;
}

INTEGER_template& Q933__ReportTypeIE_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& Q933__ReportTypeIE_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @Q933_Types.Q933_ReportTypeIE.");
return single_value->field_len;
}

Q933__TypeOfReport_template& Q933__ReportTypeIE_template::type__of__rep()
{
set_specific();
return single_value->field_type__of__rep;
}

const Q933__TypeOfReport_template& Q933__ReportTypeIE_template::type__of__rep() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field type_of_rep of a non-specific template of type @Q933_Types.Q933_ReportTypeIE.");
return single_value->field_type__of__rep;
}

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

void Q933__ReportTypeIE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iei := ");
single_value->field_iei.log();
TTCN_Logger::log_event_str(", len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", type_of_rep := ");
single_value->field_type__of__rep.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 Q933__ReportTypeIE_template::log_match(const Q933__ReportTypeIE& 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_iei.match(match_value.iei(), legacy)){
TTCN_Logger::log_logmatch_info(".iei");
single_value->field_iei.log_match(match_value.iei(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_type__of__rep.match(match_value.type__of__rep(), legacy)){
TTCN_Logger::log_logmatch_info(".type_of_rep");
single_value->field_type__of__rep.log_match(match_value.type__of__rep(), 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("{ iei := ");
single_value->field_iei.log_match(match_value.iei(), legacy);
TTCN_Logger::log_event_str(", len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", type_of_rep := ");
single_value->field_type__of__rep.log_match(match_value.type__of__rep(), 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 Q933__ReportTypeIE_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (iei().is_bound()) iei().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (type__of__rep().is_bound()) type__of__rep().set_implicit_omit();
}

void Q933__ReportTypeIE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iei.encode_text(text_buf);
single_value->field_len.encode_text(text_buf);
single_value->field_type__of__rep.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 @Q933_Types.Q933_ReportTypeIE.");
}
}

void Q933__ReportTypeIE_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_iei.decode_text(text_buf);
single_value->field_len.decode_text(text_buf);
single_value->field_type__of__rep.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 Q933__ReportTypeIE_template[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 @Q933_Types.Q933_ReportTypeIE.");
}
}

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

void Q933__ReportTypeIE_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_iei.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_ReportTypeIE");
single_value->field_len.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_ReportTypeIE");
single_value->field_type__of__rep.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_ReportTypeIE");
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 : "@Q933_Types.Q933_ReportTypeIE");
}

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

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

Q933__STATUS__Msg::Q933__STATUS__Msg()
{
}

Q933__STATUS__Msg::Q933__STATUS__Msg(const Q933__ReportTypeIE& par_rep__type,
    const OPTIONAL< Q933__LinkIntegrityIE >& par_link__int,
    const OPTIONAL< Q933__PvcStatusIE >& par_pvc__status)
  :   field_rep__type(par_rep__type),
  field_link__int(par_link__int),
  field_pvc__status(par_pvc__status)
{
}

Q933__STATUS__Msg::Q933__STATUS__Msg(const Q933__STATUS__Msg& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Q933_Types.Q933_STATUS_Msg.");
if (other_value.rep__type().is_bound()) field_rep__type = other_value.rep__type();
else field_rep__type.clean_up();
if (other_value.link__int().is_bound()) field_link__int = other_value.link__int();
else field_link__int.clean_up();
if (other_value.pvc__status().is_bound()) field_pvc__status = other_value.pvc__status();
else field_pvc__status.clean_up();
}

void Q933__STATUS__Msg::clean_up()
{
field_rep__type.clean_up();
field_link__int.clean_up();
field_pvc__status.clean_up();
}

const TTCN_Typedescriptor_t* Q933__STATUS__Msg::get_descriptor() const { return &Q933__STATUS__Msg_descr_; }
Q933__STATUS__Msg& Q933__STATUS__Msg::operator=(const Q933__STATUS__Msg& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Q933_Types.Q933_STATUS_Msg.");
  if (other_value.rep__type().is_bound()) field_rep__type = other_value.rep__type();
  else field_rep__type.clean_up();
  if (other_value.link__int().is_bound()) field_link__int = other_value.link__int();
  else field_link__int.clean_up();
  if (other_value.pvc__status().is_bound()) field_pvc__status = other_value.pvc__status();
  else field_pvc__status.clean_up();
}
return *this;
}

boolean Q933__STATUS__Msg::operator==(const Q933__STATUS__Msg& other_value) const
{
return field_rep__type==other_value.field_rep__type
  && field_link__int==other_value.field_link__int
  && field_pvc__status==other_value.field_pvc__status;
}

boolean Q933__STATUS__Msg::is_bound() const
{
return (field_rep__type.is_bound())
  || (OPTIONAL_OMIT == field_link__int.get_selection() || field_link__int.is_bound())
  || (OPTIONAL_OMIT == field_pvc__status.get_selection() || field_pvc__status.is_bound());
}
boolean Q933__STATUS__Msg::is_value() const
{
return field_rep__type.is_value()
  && (OPTIONAL_OMIT == field_link__int.get_selection() || field_link__int.is_value())
  && (OPTIONAL_OMIT == field_pvc__status.get_selection() || field_pvc__status.is_value());
}
int Q933__STATUS__Msg::size_of() const
{
  int ret_val = 1;
  if (field_link__int.ispresent()) ret_val++;
  if (field_pvc__status.ispresent()) ret_val++;
  return ret_val;
}

void Q933__STATUS__Msg::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rep_type := ");
field_rep__type.log();
TTCN_Logger::log_event_str(", link_int := ");
field_link__int.log();
TTCN_Logger::log_event_str(", pvc_status := ");
field_pvc__status.log();
TTCN_Logger::log_event_str(" }");
}

void Q933__STATUS__Msg::set_implicit_omit()
{
if (rep__type().is_bound()) rep__type().set_implicit_omit();
if (!link__int().is_bound()) link__int() = OMIT_VALUE;
else link__int().set_implicit_omit();
if (!pvc__status().is_bound()) pvc__status() = OMIT_VALUE;
else pvc__status().set_implicit_omit();
}

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

void Q933__STATUS__Msg::encode_text(Text_Buf& text_buf) const
{
field_rep__type.encode_text(text_buf);
field_link__int.encode_text(text_buf);
field_pvc__status.encode_text(text_buf);
}

void Q933__STATUS__Msg::decode_text(Text_Buf& text_buf)
{
field_rep__type.decode_text(text_buf);
field_link__int.decode_text(text_buf);
field_pvc__status.decode_text(text_buf);
}

void Q933__STATUS__Msg::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 Q933__STATUS__Msg::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 Q933__STATUS__Msg::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, Q933__STATUS__Msg_rep__type_descr_.raw->forceomit);
  decoded_field_length = field_rep__type.RAW_decode(Q933__STATUS__Msg_rep__type_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){
  if (force_omit != NULL && (*force_omit)(1)) {
    field_link__int = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, Q933__STATUS__Msg_link__int_descr_.raw->forceomit);
  decoded_field_length = field_link__int().RAW_decode(Q933__STATUS__Msg_link__int_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_link__int = 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_link__int=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_pvc__status = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, Q933__STATUS__Msg_pvc__status_descr_.raw->forceomit);
  decoded_field_length = field_pvc__status().RAW_decode(Q933__STATUS__Msg_pvc__status_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_pvc__status = 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_pvc__status=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Q933__STATUS__Msg::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, Q933__STATUS__Msg_rep__type_descr_.raw);
  if (field_link__int.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Q933__STATUS__Msg_link__int_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_pvc__status.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Q933__STATUS__Msg_pvc__status_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_rep__type.RAW_encode(Q933__STATUS__Msg_rep__type_descr_, *myleaf.body.node.nodes[0]);
  if (field_link__int.ispresent()) {
  encoded_length += field_link__int().RAW_encode(Q933__STATUS__Msg_link__int_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_pvc__status.ispresent()) {
  encoded_length += field_pvc__status().RAW_encode(Q933__STATUS__Msg_pvc__status_descr_, *myleaf.body.node.nodes[2]);
  }
  return myleaf.length = encoded_length;
}

struct Q933__STATUS__Msg_template::single_value_struct {
Q933__ReportTypeIE_template field_rep__type;
Q933__LinkIntegrityIE_template field_link__int;
Q933__PvcStatusIE_template field_pvc__status;
};

void Q933__STATUS__Msg_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_rep__type = ANY_VALUE;
single_value->field_link__int = ANY_OR_OMIT;
single_value->field_pvc__status = ANY_OR_OMIT;
}
}
}

void Q933__STATUS__Msg_template::copy_value(const Q933__STATUS__Msg& other_value)
{
single_value = new single_value_struct;
if (other_value.rep__type().is_bound()) {
  single_value->field_rep__type = other_value.rep__type();
} else {
  single_value->field_rep__type.clean_up();
}
if (other_value.link__int().is_bound()) {
  if (other_value.link__int().ispresent()) single_value->field_link__int = other_value.link__int()();
  else single_value->field_link__int = OMIT_VALUE;
} else {
  single_value->field_link__int.clean_up();
}
if (other_value.pvc__status().is_bound()) {
  if (other_value.pvc__status().ispresent()) single_value->field_pvc__status = other_value.pvc__status()();
  else single_value->field_pvc__status = OMIT_VALUE;
} else {
  single_value->field_pvc__status.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933__STATUS__Msg_template::copy_template(const Q933__STATUS__Msg_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rep__type().get_selection()) {
single_value->field_rep__type = other_value.rep__type();
} else {
single_value->field_rep__type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.link__int().get_selection()) {
single_value->field_link__int = other_value.link__int();
} else {
single_value->field_link__int.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pvc__status().get_selection()) {
single_value->field_pvc__status = other_value.pvc__status();
} else {
single_value->field_pvc__status.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Q933__STATUS__Msg_template[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 Q933__STATUS__Msg_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__STATUS__Msg_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 @Q933_Types.Q933_STATUS_Msg.");
break;
}
set_selection(other_value);
}

Q933__STATUS__Msg_template::Q933__STATUS__Msg_template()
{
}

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

Q933__STATUS__Msg_template::Q933__STATUS__Msg_template(const Q933__STATUS__Msg& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933__STATUS__Msg_template::match(const Q933__STATUS__Msg& 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.rep__type().is_bound()) return FALSE;
if(!single_value->field_rep__type.match(other_value.rep__type(), legacy))return FALSE;
if(!other_value.link__int().is_bound()) return FALSE;
if((other_value.link__int().ispresent() ? !single_value->field_link__int.match((const Q933__LinkIntegrityIE&)other_value.link__int(), legacy) : !single_value->field_link__int.match_omit(legacy)))return FALSE;
if(!other_value.pvc__status().is_bound()) return FALSE;
if((other_value.pvc__status().ispresent() ? !single_value->field_pvc__status.match((const Q933__PvcStatusIE&)other_value.pvc__status(), legacy) : !single_value->field_pvc__status.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 @Q933_Types.Q933_STATUS_Msg.");
}
return FALSE;
}

boolean Q933__STATUS__Msg_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rep__type.is_bound()
 || (single_value->field_link__int.is_omit() || single_value->field_link__int.is_bound())
 || (single_value->field_pvc__status.is_omit() || single_value->field_pvc__status.is_bound());
}

boolean Q933__STATUS__Msg_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rep__type.is_value()
 && (single_value->field_link__int.is_omit() || single_value->field_link__int.is_value())
 && (single_value->field_pvc__status.is_omit() || single_value->field_pvc__status.is_value());
}

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

Q933__STATUS__Msg Q933__STATUS__Msg_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 @Q933_Types.Q933_STATUS_Msg.");
Q933__STATUS__Msg ret_val;
if (single_value->field_rep__type.is_bound()) {
ret_val.rep__type() = single_value->field_rep__type.valueof();
}
if (single_value->field_link__int.is_omit()) ret_val.link__int() = OMIT_VALUE;
else if (single_value->field_link__int.is_bound()) {
ret_val.link__int() = single_value->field_link__int.valueof();
}
if (single_value->field_pvc__status.is_omit()) ret_val.pvc__status() = OMIT_VALUE;
else if (single_value->field_pvc__status.is_bound()) {
ret_val.pvc__status() = single_value->field_pvc__status.valueof();
}
return ret_val;
}

void Q933__STATUS__Msg_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 @Q933_Types.Q933_STATUS_Msg.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933__STATUS__Msg_template[list_length];
}

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

Q933__ReportTypeIE_template& Q933__STATUS__Msg_template::rep__type()
{
set_specific();
return single_value->field_rep__type;
}

const Q933__ReportTypeIE_template& Q933__STATUS__Msg_template::rep__type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rep_type of a non-specific template of type @Q933_Types.Q933_STATUS_Msg.");
return single_value->field_rep__type;
}

Q933__LinkIntegrityIE_template& Q933__STATUS__Msg_template::link__int()
{
set_specific();
return single_value->field_link__int;
}

const Q933__LinkIntegrityIE_template& Q933__STATUS__Msg_template::link__int() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field link_int of a non-specific template of type @Q933_Types.Q933_STATUS_Msg.");
return single_value->field_link__int;
}

Q933__PvcStatusIE_template& Q933__STATUS__Msg_template::pvc__status()
{
set_specific();
return single_value->field_pvc__status;
}

const Q933__PvcStatusIE_template& Q933__STATUS__Msg_template::pvc__status() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pvc_status of a non-specific template of type @Q933_Types.Q933_STATUS_Msg.");
return single_value->field_pvc__status;
}

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

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

void Q933__STATUS__Msg_template::log_match(const Q933__STATUS__Msg& 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_rep__type.match(match_value.rep__type(), legacy)){
TTCN_Logger::log_logmatch_info(".rep_type");
single_value->field_rep__type.log_match(match_value.rep__type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.link__int().ispresent()){
if(!single_value->field_link__int.match(match_value.link__int(), legacy)){
TTCN_Logger::log_logmatch_info(".link_int");
single_value->field_link__int.log_match(match_value.link__int(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_link__int.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".link_int := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_link__int.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pvc__status().ispresent()){
if(!single_value->field_pvc__status.match(match_value.pvc__status(), legacy)){
TTCN_Logger::log_logmatch_info(".pvc_status");
single_value->field_pvc__status.log_match(match_value.pvc__status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pvc__status.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pvc_status := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pvc__status.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("{ rep_type := ");
single_value->field_rep__type.log_match(match_value.rep__type(), legacy);
TTCN_Logger::log_event_str(", link_int := ");
if (match_value.link__int().ispresent()) {
single_value->field_link__int.log_match(match_value.link__int(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_link__int.log();
if (single_value->field_link__int.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pvc_status := ");
if (match_value.pvc__status().ispresent()) {
single_value->field_pvc__status.log_match(match_value.pvc__status(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pvc__status.log();
if (single_value->field_pvc__status.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 Q933__STATUS__Msg_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rep__type().is_bound()) rep__type().set_implicit_omit();
if (!link__int().is_bound()) link__int() = OMIT_VALUE;
else link__int().set_implicit_omit();
if (!pvc__status().is_bound()) pvc__status() = OMIT_VALUE;
else pvc__status().set_implicit_omit();
}

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

void Q933__STATUS__Msg_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_rep__type.decode_text(text_buf);
single_value->field_link__int.decode_text(text_buf);
single_value->field_pvc__status.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Q933__STATUS__Msg_template[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 @Q933_Types.Q933_STATUS_Msg.");
}
}

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

void Q933__STATUS__Msg_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_rep__type.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_STATUS_Msg");
single_value->field_link__int.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_STATUS_Msg");
single_value->field_pvc__status.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_STATUS_Msg");
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 : "@Q933_Types.Q933_STATUS_Msg");
}

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

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

Q933__LinkIntegrityIE::Q933__LinkIntegrityIE()
{
}

Q933__LinkIntegrityIE::Q933__LinkIntegrityIE(const Q933__IEI& par_iei,
    const INTEGER& par_len,
    const INTEGER& par_send__seq__nr,
    const INTEGER& par_recv__seq__nr)
  :   field_iei(par_iei),
  field_len(par_len),
  field_send__seq__nr(par_send__seq__nr),
  field_recv__seq__nr(par_recv__seq__nr)
{
}

Q933__LinkIntegrityIE::Q933__LinkIntegrityIE(const Q933__LinkIntegrityIE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Q933_Types.Q933_LinkIntegrityIE.");
if (other_value.iei().is_bound()) field_iei = other_value.iei();
else field_iei.clean_up();
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.send__seq__nr().is_bound()) field_send__seq__nr = other_value.send__seq__nr();
else field_send__seq__nr.clean_up();
if (other_value.recv__seq__nr().is_bound()) field_recv__seq__nr = other_value.recv__seq__nr();
else field_recv__seq__nr.clean_up();
}

void Q933__LinkIntegrityIE::clean_up()
{
field_iei.clean_up();
field_len.clean_up();
field_send__seq__nr.clean_up();
field_recv__seq__nr.clean_up();
}

const TTCN_Typedescriptor_t* Q933__LinkIntegrityIE::get_descriptor() const { return &Q933__LinkIntegrityIE_descr_; }
Q933__LinkIntegrityIE& Q933__LinkIntegrityIE::operator=(const Q933__LinkIntegrityIE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Q933_Types.Q933_LinkIntegrityIE.");
  if (other_value.iei().is_bound()) field_iei = other_value.iei();
  else field_iei.clean_up();
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.send__seq__nr().is_bound()) field_send__seq__nr = other_value.send__seq__nr();
  else field_send__seq__nr.clean_up();
  if (other_value.recv__seq__nr().is_bound()) field_recv__seq__nr = other_value.recv__seq__nr();
  else field_recv__seq__nr.clean_up();
}
return *this;
}

boolean Q933__LinkIntegrityIE::operator==(const Q933__LinkIntegrityIE& other_value) const
{
return field_iei==other_value.field_iei
  && field_len==other_value.field_len
  && field_send__seq__nr==other_value.field_send__seq__nr
  && field_recv__seq__nr==other_value.field_recv__seq__nr;
}

boolean Q933__LinkIntegrityIE::is_bound() const
{
return (field_iei.is_bound())
  || (field_len.is_bound())
  || (field_send__seq__nr.is_bound())
  || (field_recv__seq__nr.is_bound());
}
boolean Q933__LinkIntegrityIE::is_value() const
{
return field_iei.is_value()
  && field_len.is_value()
  && field_send__seq__nr.is_value()
  && field_recv__seq__nr.is_value();
}
void Q933__LinkIntegrityIE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iei := ");
field_iei.log();
TTCN_Logger::log_event_str(", len := ");
field_len.log();
TTCN_Logger::log_event_str(", send_seq_nr := ");
field_send__seq__nr.log();
TTCN_Logger::log_event_str(", recv_seq_nr := ");
field_recv__seq__nr.log();
TTCN_Logger::log_event_str(" }");
}

void Q933__LinkIntegrityIE::set_implicit_omit()
{
if (iei().is_bound()) iei().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (send__seq__nr().is_bound()) send__seq__nr().set_implicit_omit();
if (recv__seq__nr().is_bound()) recv__seq__nr().set_implicit_omit();
}

void Q933__LinkIntegrityIE::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 @Q933_Types.Q933_LinkIntegrityIE 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) iei().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) send__seq__nr().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) recv__seq__nr().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(), "iei")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iei().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "send_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          send__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "recv_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          recv__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @Q933_Types.Q933_LinkIntegrityIE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@Q933_Types.Q933_LinkIntegrityIE");
  }
}

void Q933__LinkIntegrityIE::encode_text(Text_Buf& text_buf) const
{
field_iei.encode_text(text_buf);
field_len.encode_text(text_buf);
field_send__seq__nr.encode_text(text_buf);
field_recv__seq__nr.encode_text(text_buf);
}

void Q933__LinkIntegrityIE::decode_text(Text_Buf& text_buf)
{
field_iei.decode_text(text_buf);
field_len.decode_text(text_buf);
field_send__seq__nr.decode_text(text_buf);
field_recv__seq__nr.decode_text(text_buf);
}

void Q933__LinkIntegrityIE::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 Q933__LinkIntegrityIE::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 Q933__LinkIntegrityIE::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, Q933__LinkIntegrityIE_iei_descr_.raw->forceomit);
  decoded_field_length = field_iei.RAW_decode(Q933__LinkIntegrityIE_iei_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, Q933__LinkIntegrityIE_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(Q933__LinkIntegrityIE_len_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_len.convert_to_Integer(Q933__LinkIntegrityIE_len_descr_);
  field_len = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Q933__LinkIntegrityIE_send__seq__nr_descr_.raw->forceomit);
  decoded_field_length = field_send__seq__nr.RAW_decode(Q933__LinkIntegrityIE_send__seq__nr_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, Q933__LinkIntegrityIE_recv__seq__nr_descr_.raw->forceomit);
  decoded_field_length = field_recv__seq__nr.RAW_decode(Q933__LinkIntegrityIE_recv__seq__nr_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  if (field_iei != Q933__IEI::Q933__IEI__LINK__INTEGRITY) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Q933__LinkIntegrityIE::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, Q933__LinkIntegrityIE_iei_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Q933__LinkIntegrityIE_len_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Q933__LinkIntegrityIE_send__seq__nr_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Q933__LinkIntegrityIE_recv__seq__nr_descr_.raw);
  encoded_length += field_iei.RAW_encode(Q933__LinkIntegrityIE_iei_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &Q933__LinkIntegrityIE_len_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 2;
  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(2);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_send__seq__nr.RAW_encode(Q933__LinkIntegrityIE_send__seq__nr_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_recv__seq__nr.RAW_encode(Q933__LinkIntegrityIE_recv__seq__nr_descr_, *myleaf.body.node.nodes[3]);
  if (field_iei != Q933__IEI::Q933__IEI__LINK__INTEGRITY) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
  Q933__IEI new_val = Q933__IEI::Q933__IEI__LINK__INTEGRITY;
  new_val.RAW_encode(Q933__LinkIntegrityIE_iei_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 Q933__LinkIntegrityIE_template::single_value_struct {
Q933__IEI_template field_iei;
INTEGER_template field_len;
INTEGER_template field_send__seq__nr;
INTEGER_template field_recv__seq__nr;
};

void Q933__LinkIntegrityIE_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_iei = ANY_VALUE;
single_value->field_len = ANY_VALUE;
single_value->field_send__seq__nr = ANY_VALUE;
single_value->field_recv__seq__nr = ANY_VALUE;
}
}
}

void Q933__LinkIntegrityIE_template::copy_value(const Q933__LinkIntegrityIE& other_value)
{
single_value = new single_value_struct;
if (other_value.iei().is_bound()) {
  single_value->field_iei = other_value.iei();
} else {
  single_value->field_iei.clean_up();
}
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.send__seq__nr().is_bound()) {
  single_value->field_send__seq__nr = other_value.send__seq__nr();
} else {
  single_value->field_send__seq__nr.clean_up();
}
if (other_value.recv__seq__nr().is_bound()) {
  single_value->field_recv__seq__nr = other_value.recv__seq__nr();
} else {
  single_value->field_recv__seq__nr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933__LinkIntegrityIE_template::copy_template(const Q933__LinkIntegrityIE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iei().get_selection()) {
single_value->field_iei = other_value.iei();
} else {
single_value->field_iei.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.send__seq__nr().get_selection()) {
single_value->field_send__seq__nr = other_value.send__seq__nr();
} else {
single_value->field_send__seq__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.recv__seq__nr().get_selection()) {
single_value->field_recv__seq__nr = other_value.recv__seq__nr();
} else {
single_value->field_recv__seq__nr.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 Q933__LinkIntegrityIE_template[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 Q933__LinkIntegrityIE_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__LinkIntegrityIE_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 @Q933_Types.Q933_LinkIntegrityIE.");
break;
}
set_selection(other_value);
}

Q933__LinkIntegrityIE_template::Q933__LinkIntegrityIE_template()
{
}

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

Q933__LinkIntegrityIE_template::Q933__LinkIntegrityIE_template(const Q933__LinkIntegrityIE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933__LinkIntegrityIE_template::match(const Q933__LinkIntegrityIE& 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.iei().is_bound()) return FALSE;
if(!single_value->field_iei.match(other_value.iei(), legacy))return FALSE;
if(!other_value.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.send__seq__nr().is_bound()) return FALSE;
if(!single_value->field_send__seq__nr.match(other_value.send__seq__nr(), legacy))return FALSE;
if(!other_value.recv__seq__nr().is_bound()) return FALSE;
if(!single_value->field_recv__seq__nr.match(other_value.recv__seq__nr(), 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 @Q933_Types.Q933_LinkIntegrityIE.");
}
return FALSE;
}

boolean Q933__LinkIntegrityIE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iei.is_bound()
 || single_value->field_len.is_bound()
 || single_value->field_send__seq__nr.is_bound()
 || single_value->field_recv__seq__nr.is_bound();
}

boolean Q933__LinkIntegrityIE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iei.is_value()
 && single_value->field_len.is_value()
 && single_value->field_send__seq__nr.is_value()
 && single_value->field_recv__seq__nr.is_value();
}

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

Q933__LinkIntegrityIE Q933__LinkIntegrityIE_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 @Q933_Types.Q933_LinkIntegrityIE.");
Q933__LinkIntegrityIE ret_val;
if (single_value->field_iei.is_bound()) {
ret_val.iei() = single_value->field_iei.valueof();
}
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_send__seq__nr.is_bound()) {
ret_val.send__seq__nr() = single_value->field_send__seq__nr.valueof();
}
if (single_value->field_recv__seq__nr.is_bound()) {
ret_val.recv__seq__nr() = single_value->field_recv__seq__nr.valueof();
}
return ret_val;
}

void Q933__LinkIntegrityIE_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 @Q933_Types.Q933_LinkIntegrityIE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933__LinkIntegrityIE_template[list_length];
}

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

Q933__IEI_template& Q933__LinkIntegrityIE_template::iei()
{
set_specific();
return single_value->field_iei;
}

const Q933__IEI_template& Q933__LinkIntegrityIE_template::iei() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iei of a non-specific template of type @Q933_Types.Q933_LinkIntegrityIE.");
return single_value->field_iei;
}

INTEGER_template& Q933__LinkIntegrityIE_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& Q933__LinkIntegrityIE_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @Q933_Types.Q933_LinkIntegrityIE.");
return single_value->field_len;
}

INTEGER_template& Q933__LinkIntegrityIE_template::send__seq__nr()
{
set_specific();
return single_value->field_send__seq__nr;
}

const INTEGER_template& Q933__LinkIntegrityIE_template::send__seq__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field send_seq_nr of a non-specific template of type @Q933_Types.Q933_LinkIntegrityIE.");
return single_value->field_send__seq__nr;
}

INTEGER_template& Q933__LinkIntegrityIE_template::recv__seq__nr()
{
set_specific();
return single_value->field_recv__seq__nr;
}

const INTEGER_template& Q933__LinkIntegrityIE_template::recv__seq__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field recv_seq_nr of a non-specific template of type @Q933_Types.Q933_LinkIntegrityIE.");
return single_value->field_recv__seq__nr;
}

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

void Q933__LinkIntegrityIE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ iei := ");
single_value->field_iei.log();
TTCN_Logger::log_event_str(", len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", send_seq_nr := ");
single_value->field_send__seq__nr.log();
TTCN_Logger::log_event_str(", recv_seq_nr := ");
single_value->field_recv__seq__nr.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 Q933__LinkIntegrityIE_template::log_match(const Q933__LinkIntegrityIE& 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_iei.match(match_value.iei(), legacy)){
TTCN_Logger::log_logmatch_info(".iei");
single_value->field_iei.log_match(match_value.iei(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_send__seq__nr.match(match_value.send__seq__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".send_seq_nr");
single_value->field_send__seq__nr.log_match(match_value.send__seq__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_recv__seq__nr.match(match_value.recv__seq__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".recv_seq_nr");
single_value->field_recv__seq__nr.log_match(match_value.recv__seq__nr(), 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("{ iei := ");
single_value->field_iei.log_match(match_value.iei(), legacy);
TTCN_Logger::log_event_str(", len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", send_seq_nr := ");
single_value->field_send__seq__nr.log_match(match_value.send__seq__nr(), legacy);
TTCN_Logger::log_event_str(", recv_seq_nr := ");
single_value->field_recv__seq__nr.log_match(match_value.recv__seq__nr(), 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 Q933__LinkIntegrityIE_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (iei().is_bound()) iei().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (send__seq__nr().is_bound()) send__seq__nr().set_implicit_omit();
if (recv__seq__nr().is_bound()) recv__seq__nr().set_implicit_omit();
}

void Q933__LinkIntegrityIE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_iei.encode_text(text_buf);
single_value->field_len.encode_text(text_buf);
single_value->field_send__seq__nr.encode_text(text_buf);
single_value->field_recv__seq__nr.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 @Q933_Types.Q933_LinkIntegrityIE.");
}
}

void Q933__LinkIntegrityIE_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_iei.decode_text(text_buf);
single_value->field_len.decode_text(text_buf);
single_value->field_send__seq__nr.decode_text(text_buf);
single_value->field_recv__seq__nr.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 Q933__LinkIntegrityIE_template[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 @Q933_Types.Q933_LinkIntegrityIE.");
}
}

void Q933__LinkIntegrityIE_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: {
    Q933__LinkIntegrityIE_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 @Q933_Types.Q933_LinkIntegrityIE 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) iei().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) send__seq__nr().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) recv__seq__nr().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(), "iei")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          iei().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "send_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          send__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "recv_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          recv__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @Q933_Types.Q933_LinkIntegrityIE: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933__LinkIntegrityIE_template* precondition = new Q933__LinkIntegrityIE_template;
    precondition->set_param(*param.get_elem(0));
    Q933__LinkIntegrityIE_template* implied_template = new Q933__LinkIntegrityIE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Q933__LinkIntegrityIE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@Q933_Types.Q933_LinkIntegrityIE");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933__LinkIntegrityIE_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_iei.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_LinkIntegrityIE");
single_value->field_len.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_LinkIntegrityIE");
single_value->field_send__seq__nr.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_LinkIntegrityIE");
single_value->field_recv__seq__nr.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_LinkIntegrityIE");
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 : "@Q933_Types.Q933_LinkIntegrityIE");
}

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

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


const Q933__PvcStatus Q933__PvcStatusRec::UNBOUND_ELEM;
boolean Q933__PvcStatusRec::compare_function(const Base_Type *left_ptr, int left_index, const Base_Type *right_ptr, int right_index)
{
if (((const Q933__PvcStatusRec*)left_ptr)->val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @Q933_Types.Q933_PvcStatusRec.");
if (((const Q933__PvcStatusRec*)right_ptr)->val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @Q933_Types.Q933_PvcStatusRec.");
if (((const Q933__PvcStatusRec*)left_ptr)->val_ptr->value_elements[left_index] != NULL){
if (((const Q933__PvcStatusRec*)right_ptr)->val_ptr->value_elements[right_index] != NULL){
return *((const Q933__PvcStatusRec*)left_ptr)->val_ptr->value_elements[left_index] == *((const Q933__PvcStatusRec*)right_ptr)->val_ptr->value_elements[right_index];
} else return FALSE;
} else {
return ((const Q933__PvcStatusRec*)right_ptr)->val_ptr->value_elements[right_index] == NULL;
}
}

Q933__PvcStatusRec::Q933__PvcStatusRec()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

boolean Q933__PvcStatusRec::operator==(const Q933__PvcStatusRec& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @Q933_Types.Q933_PvcStatusRec.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @Q933_Types.Q933_PvcStatusRec.");
if (val_ptr == other_value.val_ptr) return TRUE;
return compare_set_of(this, val_ptr->n_elements, &other_value, (other_value.val_ptr)->n_elements, compare_function);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void Q933__PvcStatusRec_template::copy_template(const Q933__PvcStatusRec_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (Q933__PvcStatus_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new Q933__PvcStatus_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new Q933__PvcStatus_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Q933__PvcStatusRec_template[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 SUPERSET_MATCH:
case SUBSET_MATCH:
value_set.n_items = other_value.value_set.n_items;
value_set.set_items = new Q933__PvcStatus_template[value_set.n_items];
for (unsigned int set_count = 0; set_count < value_set.n_items; set_count++)
value_set.set_items[set_count] = other_value.value_set.set_items[set_count];
break;
case IMPLICATION_MATCH:
implication_.precondition = new Q933__PvcStatusRec_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__PvcStatusRec_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 @Q933_Types.Q933_PvcStatusRec.");
break;
}
set_selection(other_value);
}

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

boolean Q933__PvcStatusRec_template::match_function_set(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const Q933__PvcStatusRec_template*)template_ptr)->value_set.set_items[template_index].match((*(const Q933__PvcStatusRec*)value_ptr)[value_index], legacy);
else return ((const Q933__PvcStatusRec_template*)template_ptr)->value_set.set_items[template_index].is_any_or_omit();
}

void Q933__PvcStatusRec_template::log_function(const Base_Type *value_ptr, const Restricted_Length_Template *template_ptr, int index_value, int index_template, boolean legacy)
{
if (value_ptr == NULL) {
if (template_ptr != NULL) {
((const Q933__PvcStatusRec_template*)template_ptr)->single_value.value_elements[index_template]->log();
}
} else if (template_ptr == NULL) {
(*(const Q933__PvcStatusRec*)value_ptr)[index_value].log();
} else {
((const Q933__PvcStatusRec_template*)template_ptr)->single_value.value_elements[index_template]->log_match((*(const Q933__PvcStatusRec*)value_ptr)[index_value], legacy);
}
}

Q933__PvcStatusRec_template::Q933__PvcStatusRec_template()
{
}

Q933__PvcStatusRec_template::Q933__PvcStatusRec_template(template_sel other_value)
 : Restricted_Length_Template(other_value)
{
check_single_selection(other_value);
}

Q933__PvcStatusRec_template::Q933__PvcStatusRec_template(null_type)
 : Restricted_Length_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

Q933__PvcStatusRec_template::Q933__PvcStatusRec_template(const Q933__PvcStatusRec& other_value)
{
copy_value(other_value);
}

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

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

Q933__PvcStatusRec_template::Q933__PvcStatusRec_template(Dynamic_Match_Interface<Q933__PvcStatusRec>* p_dyn_match)
 : Restricted_Length_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<Q933__PvcStatusRec>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

Q933__PvcStatusRec_template::Q933__PvcStatusRec_template(const Q933__PvcStatusRec_template& other_value)
 : Restricted_Length_Template()
{
copy_template(other_value);
}

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

void Q933__PvcStatusRec_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
break;
case SUPERSET_MATCH:
case SUBSET_MATCH:
delete [] value_set.set_items;
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;
}

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

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

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

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

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

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

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

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

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

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

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

int Q933__PvcStatusRec_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case SUPERSET_MATCH:
case SUBSET_MATCH: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = value_set.n_items;
  if (!is_size) { while (elem_count>0 && !value_set.set_items[elem_count-1].is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (value_set.set_items[i].get_selection())
    {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
  if (template_selection==SUPERSET_MATCH) {
    has_any_or_none = TRUE;
   } else {
    int max_size = min_size;
    min_size = 0;
    if (!has_any_or_none) { // [0,max_size]
      switch (length_restriction_type) {
      case NO_LENGTH_RESTRICTION:
        if (max_size==0) return 0;
        TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec with no exact size.", op_name);
      case SINGLE_LENGTH_RESTRICTION:
        if (length_restriction.single_length<=max_size)
          return length_restriction.single_length;
        TTCN_error("Performing %sof() operation on an invalid template of type @Q933_Types.Q933_PvcStatusRec. The maximum size (%d) contradicts the length restriction (%d).", op_name, max_size, length_restriction.single_length);
      case RANGE_LENGTH_RESTRICTION:
        if (max_size==length_restriction.range_length.min_length) {
          return max_size;
        } else if (max_size>length_restriction.range_length.min_length){
          TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec with no exact size.", op_name);
        } else
          TTCN_error("Performing %sof() operation on an invalid template of type @Q933_Types.Q933_PvcStatusRec. Maximum size (%d) contradicts the length restriction (%d..%d).", op_name, max_size, length_restriction.range_length.min_length, length_restriction.range_length.max_length);
      default:
        TTCN_error("Internal error: Template has invalid length restriction type.");
      }
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @Q933_Types.Q933_PvcStatusRec containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @Q933_Types.Q933_PvcStatusRec.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @Q933_Types.Q933_PvcStatusRec");
}

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

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

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

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

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

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

void Q933__PvcStatusRec_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new Q933__PvcStatusRec_template[list_length];
break;
case SUPERSET_MATCH:
case SUBSET_MATCH:
value_set.n_items = list_length;
value_set.set_items = new Q933__PvcStatus_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @Q933_Types.Q933_PvcStatusRec.");
}
set_selection(template_type);
}

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

Q933__PvcStatus_template& Q933__PvcStatusRec_template::set_item(unsigned int set_index)
{
if (template_selection != SUPERSET_MATCH && template_selection != SUBSET_MATCH) TTCN_error("Internal error: Accessing a set element of a non-set template of type @Q933_Types.Q933_PvcStatusRec.");
if (set_index >= value_set.n_items) TTCN_error("Internal error: Index overflow in a set template of type @Q933_Types.Q933_PvcStatusRec.");
return value_set.set_items[set_index];
}

void Q933__PvcStatusRec_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log();
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case SUPERSET_MATCH:
case SUBSET_MATCH:
TTCN_Logger::log_event("%s(", template_selection == SUPERSET_MATCH ? "superset" : "subset");
for (unsigned int set_count = 0; set_count < value_set.n_items; set_count++) {
if (set_count > 0) TTCN_Logger::log_event_str(", ");
value_set.set_items[set_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void Q933__PvcStatusRec_template::log_match(const Q933__PvcStatusRec& 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{
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (template_selection == SPECIFIC_VALUE)
  log_match_heuristics(&match_value, match_value.size_of(), this, single_value.n_elements, match_function_specific, log_function, legacy);
else{
if(previous_size != 0){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::set_logmatch_buffer_len(previous_size);
TTCN_Logger::log_event_str(":=");
}
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
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");
if (template_selection == SPECIFIC_VALUE) log_match_heuristics(&match_value, match_value.size_of(), this, single_value.n_elements, match_function_specific, log_function, legacy);
}
}

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

void Q933__PvcStatusRec_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_restricted(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @Q933_Types.Q933_PvcStatusRec.");
single_value.value_elements = (Q933__PvcStatus_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new Q933__PvcStatus_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Q933__PvcStatusRec_template[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;
case SUPERSET_MATCH:
case SUBSET_MATCH:
value_set.n_items = text_buf.pull_int().get_val();
value_set.set_items = new Q933__PvcStatus_template[value_set.n_items];
for (unsigned int set_count = 0; set_count < value_set.n_items; set_count++)
value_set.set_items[set_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @Q933_Types.Q933_PvcStatusRec.");
}
}

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

boolean Q933__PvcStatusRec_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 Q933__PvcStatusRec_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void Q933__PvcStatusRec_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "set of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    Q933__PvcStatusRec_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List:
    set_size(param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      if (param.get_elem(p_i)->get_type()!=Module_Param::MP_NotUsed) {
        (*this)[p_i].set_param(*param.get_elem(p_i));
      }
    }
    break;
  case Module_Param::MP_Superset_Template:
  case Module_Param::MP_Subset_Template:
    set_type(param.get_type()==Module_Param::MP_Superset_Template ? SUPERSET_MATCH : SUBSET_MATCH, param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      set_item(p_i).set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Implication_Template: {
    Q933__PvcStatusRec_template* precondition = new Q933__PvcStatusRec_template;
    precondition->set_param(*param.get_elem(0));
    Q933__PvcStatusRec_template* implied_template = new Q933__PvcStatusRec_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Q933__PvcStatusRec_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set of template", "@Q933_Types.Q933_PvcStatusRec");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

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

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

Q933__PvcStatus::Q933__PvcStatus(const BITSTRING& par_spare,
    const BITSTRING& par_dlci__high,
    const BITSTRING& par_ext1,
    const BITSTRING& par_dlci__low,
    const BITSTRING& par_spare0,
    const BITSTRING& par_ext1__,
    const BITSTRING& par_spare0__,
    const BOOLEAN& par_new_,
    const BOOLEAN& par_delete_,
    const BOOLEAN& par_active,
    const BITSTRING& par_reserved0)
  :   field_spare(par_spare),
  field_dlci__high(par_dlci__high),
  field_ext1(par_ext1),
  field_dlci__low(par_dlci__low),
  field_spare0(par_spare0),
  field_ext1__(par_ext1__),
  field_spare0__(par_spare0__),
  field_new_(par_new_),
  field_delete_(par_delete_),
  field_active(par_active),
  field_reserved0(par_reserved0)
{
}

Q933__PvcStatus::Q933__PvcStatus(const Q933__PvcStatus& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Q933_Types.Q933_PvcStatus.");
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.dlci__high().is_bound()) field_dlci__high = other_value.dlci__high();
else field_dlci__high.clean_up();
if (other_value.ext1().is_bound()) field_ext1 = other_value.ext1();
else field_ext1.clean_up();
if (other_value.dlci__low().is_bound()) field_dlci__low = other_value.dlci__low();
else field_dlci__low.clean_up();
if (other_value.spare0().is_bound()) field_spare0 = other_value.spare0();
else field_spare0.clean_up();
if (other_value.ext1__().is_bound()) field_ext1__ = other_value.ext1__();
else field_ext1__.clean_up();
if (other_value.spare0__().is_bound()) field_spare0__ = other_value.spare0__();
else field_spare0__.clean_up();
if (other_value.new_().is_bound()) field_new_ = other_value.new_();
else field_new_.clean_up();
if (other_value.delete_().is_bound()) field_delete_ = other_value.delete_();
else field_delete_.clean_up();
if (other_value.active().is_bound()) field_active = other_value.active();
else field_active.clean_up();
if (other_value.reserved0().is_bound()) field_reserved0 = other_value.reserved0();
else field_reserved0.clean_up();
}

void Q933__PvcStatus::clean_up()
{
field_spare.clean_up();
field_dlci__high.clean_up();
field_ext1.clean_up();
field_dlci__low.clean_up();
field_spare0.clean_up();
field_ext1__.clean_up();
field_spare0__.clean_up();
field_new_.clean_up();
field_delete_.clean_up();
field_active.clean_up();
field_reserved0.clean_up();
}

const TTCN_Typedescriptor_t* Q933__PvcStatus::get_descriptor() const { return &Q933__PvcStatus_descr_; }
Q933__PvcStatus& Q933__PvcStatus::operator=(const Q933__PvcStatus& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Q933_Types.Q933_PvcStatus.");
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.dlci__high().is_bound()) field_dlci__high = other_value.dlci__high();
  else field_dlci__high.clean_up();
  if (other_value.ext1().is_bound()) field_ext1 = other_value.ext1();
  else field_ext1.clean_up();
  if (other_value.dlci__low().is_bound()) field_dlci__low = other_value.dlci__low();
  else field_dlci__low.clean_up();
  if (other_value.spare0().is_bound()) field_spare0 = other_value.spare0();
  else field_spare0.clean_up();
  if (other_value.ext1__().is_bound()) field_ext1__ = other_value.ext1__();
  else field_ext1__.clean_up();
  if (other_value.spare0__().is_bound()) field_spare0__ = other_value.spare0__();
  else field_spare0__.clean_up();
  if (other_value.new_().is_bound()) field_new_ = other_value.new_();
  else field_new_.clean_up();
  if (other_value.delete_().is_bound()) field_delete_ = other_value.delete_();
  else field_delete_.clean_up();
  if (other_value.active().is_bound()) field_active = other_value.active();
  else field_active.clean_up();
  if (other_value.reserved0().is_bound()) field_reserved0 = other_value.reserved0();
  else field_reserved0.clean_up();
}
return *this;
}

boolean Q933__PvcStatus::operator==(const Q933__PvcStatus& other_value) const
{
return field_spare==other_value.field_spare
  && field_dlci__high==other_value.field_dlci__high
  && field_ext1==other_value.field_ext1
  && field_dlci__low==other_value.field_dlci__low
  && field_spare0==other_value.field_spare0
  && field_ext1__==other_value.field_ext1__
  && field_spare0__==other_value.field_spare0__
  && field_new_==other_value.field_new_
  && field_delete_==other_value.field_delete_
  && field_active==other_value.field_active
  && field_reserved0==other_value.field_reserved0;
}

boolean Q933__PvcStatus::is_bound() const
{
return (field_spare.is_bound())
  || (field_dlci__high.is_bound())
  || (field_ext1.is_bound())
  || (field_dlci__low.is_bound())
  || (field_spare0.is_bound())
  || (field_ext1__.is_bound())
  || (field_spare0__.is_bound())
  || (field_new_.is_bound())
  || (field_delete_.is_bound())
  || (field_active.is_bound())
  || (field_reserved0.is_bound());
}
boolean Q933__PvcStatus::is_value() const
{
return field_spare.is_value()
  && field_dlci__high.is_value()
  && field_ext1.is_value()
  && field_dlci__low.is_value()
  && field_spare0.is_value()
  && field_ext1__.is_value()
  && field_spare0__.is_value()
  && field_new_.is_value()
  && field_delete_.is_value()
  && field_active.is_value()
  && field_reserved0.is_value();
}
void Q933__PvcStatus::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", dlci_high := ");
field_dlci__high.log();
TTCN_Logger::log_event_str(", ext1 := ");
field_ext1.log();
TTCN_Logger::log_event_str(", dlci_low := ");
field_dlci__low.log();
TTCN_Logger::log_event_str(", spare0 := ");
field_spare0.log();
TTCN_Logger::log_event_str(", ext1_ := ");
field_ext1__.log();
TTCN_Logger::log_event_str(", spare0_ := ");
field_spare0__.log();
TTCN_Logger::log_event_str(", new := ");
field_new_.log();
TTCN_Logger::log_event_str(", delete := ");
field_delete_.log();
TTCN_Logger::log_event_str(", active := ");
field_active.log();
TTCN_Logger::log_event_str(", reserved0 := ");
field_reserved0.log();
TTCN_Logger::log_event_str(" }");
}

void Q933__PvcStatus::set_implicit_omit()
{
if (spare().is_bound()) spare().set_implicit_omit();
if (dlci__high().is_bound()) dlci__high().set_implicit_omit();
if (ext1().is_bound()) ext1().set_implicit_omit();
if (dlci__low().is_bound()) dlci__low().set_implicit_omit();
if (spare0().is_bound()) spare0().set_implicit_omit();
if (ext1__().is_bound()) ext1__().set_implicit_omit();
if (spare0__().is_bound()) spare0__().set_implicit_omit();
if (new_().is_bound()) new_().set_implicit_omit();
if (delete_().is_bound()) delete_().set_implicit_omit();
if (active().is_bound()) active().set_implicit_omit();
if (reserved0().is_bound()) reserved0().set_implicit_omit();
}

void Q933__PvcStatus::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record value of type @Q933_Types.Q933_PvcStatus has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dlci__high().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ext1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dlci__low().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare0().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ext1__().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare0__().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) new_().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) delete_().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) active().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) reserved0().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dlci_high")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dlci__high().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dlci_low")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dlci__low().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare0")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare0().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext1_")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext1__().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare0_")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare0__().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "new")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          new_().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "delete")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          delete_().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "active")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          active().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved0")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved0().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @Q933_Types.Q933_PvcStatus: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@Q933_Types.Q933_PvcStatus");
  }
}

void Q933__PvcStatus::encode_text(Text_Buf& text_buf) const
{
field_spare.encode_text(text_buf);
field_dlci__high.encode_text(text_buf);
field_ext1.encode_text(text_buf);
field_dlci__low.encode_text(text_buf);
field_spare0.encode_text(text_buf);
field_ext1__.encode_text(text_buf);
field_spare0__.encode_text(text_buf);
field_new_.encode_text(text_buf);
field_delete_.encode_text(text_buf);
field_active.encode_text(text_buf);
field_reserved0.encode_text(text_buf);
}

void Q933__PvcStatus::decode_text(Text_Buf& text_buf)
{
field_spare.decode_text(text_buf);
field_dlci__high.decode_text(text_buf);
field_ext1.decode_text(text_buf);
field_dlci__low.decode_text(text_buf);
field_spare0.decode_text(text_buf);
field_ext1__.decode_text(text_buf);
field_spare0__.decode_text(text_buf);
field_new_.decode_text(text_buf);
field_delete_.decode_text(text_buf);
field_active.decode_text(text_buf);
field_reserved0.decode_text(text_buf);
}

void Q933__PvcStatus::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 Q933__PvcStatus::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 Q933__PvcStatus::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, Q933__PvcStatus_spare_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(Q933__PvcStatus_spare_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, Q933__PvcStatus_dlci__high_descr_.raw->forceomit);
  decoded_field_length = field_dlci__high.RAW_decode(Q933__PvcStatus_dlci__high_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, Q933__PvcStatus_ext1_descr_.raw->forceomit);
  decoded_field_length = field_ext1.RAW_decode(Q933__PvcStatus_ext1_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, Q933__PvcStatus_dlci__low_descr_.raw->forceomit);
  decoded_field_length = field_dlci__low.RAW_decode(Q933__PvcStatus_dlci__low_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, Q933__PvcStatus_spare0_descr_.raw->forceomit);
  decoded_field_length = field_spare0.RAW_decode(Q933__PvcStatus_spare0_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, Q933__PvcStatus_ext1___descr_.raw->forceomit);
  decoded_field_length = field_ext1__.RAW_decode(Q933__PvcStatus_ext1___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, Q933__PvcStatus_spare0___descr_.raw->forceomit);
  decoded_field_length = field_spare0__.RAW_decode(Q933__PvcStatus_spare0___descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, Q933__PvcStatus_new__descr_.raw->forceomit);
  decoded_field_length = field_new_.RAW_decode(Q933__PvcStatus_new__descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, Q933__PvcStatus_delete__descr_.raw->forceomit);
  decoded_field_length = field_delete_.RAW_decode(Q933__PvcStatus_delete__descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_9_force_omit(9, force_omit, Q933__PvcStatus_active_descr_.raw->forceomit);
  decoded_field_length = field_active.RAW_decode(Q933__PvcStatus_active_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_10_force_omit(10, force_omit, Q933__PvcStatus_reserved0_descr_.raw->forceomit);
  decoded_field_length = field_reserved0.RAW_decode(Q933__PvcStatus_reserved0_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Q933__PvcStatus::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 11;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(11);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, Q933__PvcStatus_spare_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Q933__PvcStatus_dlci__high_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Q933__PvcStatus_ext1_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Q933__PvcStatus_dlci__low_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, Q933__PvcStatus_spare0_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, Q933__PvcStatus_ext1___descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, Q933__PvcStatus_spare0___descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, Q933__PvcStatus_new__descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, Q933__PvcStatus_delete__descr_.raw);
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, Q933__PvcStatus_active_descr_.raw);
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, Q933__PvcStatus_reserved0_descr_.raw);
  encoded_length += field_spare.RAW_encode(Q933__PvcStatus_spare_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_dlci__high.RAW_encode(Q933__PvcStatus_dlci__high_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_ext1.RAW_encode(Q933__PvcStatus_ext1_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_dlci__low.RAW_encode(Q933__PvcStatus_dlci__low_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare0.RAW_encode(Q933__PvcStatus_spare0_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_ext1__.RAW_encode(Q933__PvcStatus_ext1___descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare0__.RAW_encode(Q933__PvcStatus_spare0___descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_new_.RAW_encode(Q933__PvcStatus_new__descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_delete_.RAW_encode(Q933__PvcStatus_delete__descr_, *myleaf.body.node.nodes[8]);
  encoded_length += field_active.RAW_encode(Q933__PvcStatus_active_descr_, *myleaf.body.node.nodes[9]);
  encoded_length += field_reserved0.RAW_encode(Q933__PvcStatus_reserved0_descr_, *myleaf.body.node.nodes[10]);
  return myleaf.length = encoded_length;
}

struct Q933__PvcStatus_template::single_value_struct {
BITSTRING_template field_spare;
BITSTRING_template field_dlci__high;
BITSTRING_template field_ext1;
BITSTRING_template field_dlci__low;
BITSTRING_template field_spare0;
BITSTRING_template field_ext1__;
BITSTRING_template field_spare0__;
BOOLEAN_template field_new_;
BOOLEAN_template field_delete_;
BOOLEAN_template field_active;
BITSTRING_template field_reserved0;
};

void Q933__PvcStatus_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_spare = ANY_VALUE;
single_value->field_dlci__high = ANY_VALUE;
single_value->field_ext1 = ANY_VALUE;
single_value->field_dlci__low = ANY_VALUE;
single_value->field_spare0 = ANY_VALUE;
single_value->field_ext1__ = ANY_VALUE;
single_value->field_spare0__ = ANY_VALUE;
single_value->field_new_ = ANY_VALUE;
single_value->field_delete_ = ANY_VALUE;
single_value->field_active = ANY_VALUE;
single_value->field_reserved0 = ANY_VALUE;
}
}
}

void Q933__PvcStatus_template::copy_value(const Q933__PvcStatus& other_value)
{
single_value = new single_value_struct;
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.dlci__high().is_bound()) {
  single_value->field_dlci__high = other_value.dlci__high();
} else {
  single_value->field_dlci__high.clean_up();
}
if (other_value.ext1().is_bound()) {
  single_value->field_ext1 = other_value.ext1();
} else {
  single_value->field_ext1.clean_up();
}
if (other_value.dlci__low().is_bound()) {
  single_value->field_dlci__low = other_value.dlci__low();
} else {
  single_value->field_dlci__low.clean_up();
}
if (other_value.spare0().is_bound()) {
  single_value->field_spare0 = other_value.spare0();
} else {
  single_value->field_spare0.clean_up();
}
if (other_value.ext1__().is_bound()) {
  single_value->field_ext1__ = other_value.ext1__();
} else {
  single_value->field_ext1__.clean_up();
}
if (other_value.spare0__().is_bound()) {
  single_value->field_spare0__ = other_value.spare0__();
} else {
  single_value->field_spare0__.clean_up();
}
if (other_value.new_().is_bound()) {
  single_value->field_new_ = other_value.new_();
} else {
  single_value->field_new_.clean_up();
}
if (other_value.delete_().is_bound()) {
  single_value->field_delete_ = other_value.delete_();
} else {
  single_value->field_delete_.clean_up();
}
if (other_value.active().is_bound()) {
  single_value->field_active = other_value.active();
} else {
  single_value->field_active.clean_up();
}
if (other_value.reserved0().is_bound()) {
  single_value->field_reserved0 = other_value.reserved0();
} else {
  single_value->field_reserved0.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933__PvcStatus_template::copy_template(const Q933__PvcStatus_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dlci__high().get_selection()) {
single_value->field_dlci__high = other_value.dlci__high();
} else {
single_value->field_dlci__high.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext1().get_selection()) {
single_value->field_ext1 = other_value.ext1();
} else {
single_value->field_ext1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dlci__low().get_selection()) {
single_value->field_dlci__low = other_value.dlci__low();
} else {
single_value->field_dlci__low.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare0().get_selection()) {
single_value->field_spare0 = other_value.spare0();
} else {
single_value->field_spare0.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ext1__().get_selection()) {
single_value->field_ext1__ = other_value.ext1__();
} else {
single_value->field_ext1__.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare0__().get_selection()) {
single_value->field_spare0__ = other_value.spare0__();
} else {
single_value->field_spare0__.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.new_().get_selection()) {
single_value->field_new_ = other_value.new_();
} else {
single_value->field_new_.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.delete_().get_selection()) {
single_value->field_delete_ = other_value.delete_();
} else {
single_value->field_delete_.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.active().get_selection()) {
single_value->field_active = other_value.active();
} else {
single_value->field_active.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved0().get_selection()) {
single_value->field_reserved0 = other_value.reserved0();
} else {
single_value->field_reserved0.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 Q933__PvcStatus_template[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 Q933__PvcStatus_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__PvcStatus_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 @Q933_Types.Q933_PvcStatus.");
break;
}
set_selection(other_value);
}

Q933__PvcStatus_template::Q933__PvcStatus_template()
{
}

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

Q933__PvcStatus_template::Q933__PvcStatus_template(const Q933__PvcStatus& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933__PvcStatus_template::match(const Q933__PvcStatus& 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.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.dlci__high().is_bound()) return FALSE;
if(!single_value->field_dlci__high.match(other_value.dlci__high(), legacy))return FALSE;
if(!other_value.ext1().is_bound()) return FALSE;
if(!single_value->field_ext1.match(other_value.ext1(), legacy))return FALSE;
if(!other_value.dlci__low().is_bound()) return FALSE;
if(!single_value->field_dlci__low.match(other_value.dlci__low(), legacy))return FALSE;
if(!other_value.spare0().is_bound()) return FALSE;
if(!single_value->field_spare0.match(other_value.spare0(), legacy))return FALSE;
if(!other_value.ext1__().is_bound()) return FALSE;
if(!single_value->field_ext1__.match(other_value.ext1__(), legacy))return FALSE;
if(!other_value.spare0__().is_bound()) return FALSE;
if(!single_value->field_spare0__.match(other_value.spare0__(), legacy))return FALSE;
if(!other_value.new_().is_bound()) return FALSE;
if(!single_value->field_new_.match(other_value.new_(), legacy))return FALSE;
if(!other_value.delete_().is_bound()) return FALSE;
if(!single_value->field_delete_.match(other_value.delete_(), legacy))return FALSE;
if(!other_value.active().is_bound()) return FALSE;
if(!single_value->field_active.match(other_value.active(), legacy))return FALSE;
if(!other_value.reserved0().is_bound()) return FALSE;
if(!single_value->field_reserved0.match(other_value.reserved0(), 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 @Q933_Types.Q933_PvcStatus.");
}
return FALSE;
}

boolean Q933__PvcStatus_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_spare.is_bound()
 || single_value->field_dlci__high.is_bound()
 || single_value->field_ext1.is_bound()
 || single_value->field_dlci__low.is_bound()
 || single_value->field_spare0.is_bound()
 || single_value->field_ext1__.is_bound()
 || single_value->field_spare0__.is_bound()
 || single_value->field_new_.is_bound()
 || single_value->field_delete_.is_bound()
 || single_value->field_active.is_bound()
 || single_value->field_reserved0.is_bound();
}

boolean Q933__PvcStatus_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_spare.is_value()
 && single_value->field_dlci__high.is_value()
 && single_value->field_ext1.is_value()
 && single_value->field_dlci__low.is_value()
 && single_value->field_spare0.is_value()
 && single_value->field_ext1__.is_value()
 && single_value->field_spare0__.is_value()
 && single_value->field_new_.is_value()
 && single_value->field_delete_.is_value()
 && single_value->field_active.is_value()
 && single_value->field_reserved0.is_value();
}

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

Q933__PvcStatus Q933__PvcStatus_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 @Q933_Types.Q933_PvcStatus.");
Q933__PvcStatus ret_val;
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_dlci__high.is_bound()) {
ret_val.dlci__high() = single_value->field_dlci__high.valueof();
}
if (single_value->field_ext1.is_bound()) {
ret_val.ext1() = single_value->field_ext1.valueof();
}
if (single_value->field_dlci__low.is_bound()) {
ret_val.dlci__low() = single_value->field_dlci__low.valueof();
}
if (single_value->field_spare0.is_bound()) {
ret_val.spare0() = single_value->field_spare0.valueof();
}
if (single_value->field_ext1__.is_bound()) {
ret_val.ext1__() = single_value->field_ext1__.valueof();
}
if (single_value->field_spare0__.is_bound()) {
ret_val.spare0__() = single_value->field_spare0__.valueof();
}
if (single_value->field_new_.is_bound()) {
ret_val.new_() = single_value->field_new_.valueof();
}
if (single_value->field_delete_.is_bound()) {
ret_val.delete_() = single_value->field_delete_.valueof();
}
if (single_value->field_active.is_bound()) {
ret_val.active() = single_value->field_active.valueof();
}
if (single_value->field_reserved0.is_bound()) {
ret_val.reserved0() = single_value->field_reserved0.valueof();
}
return ret_val;
}

void Q933__PvcStatus_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 @Q933_Types.Q933_PvcStatus.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933__PvcStatus_template[list_length];
}

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

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

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

BITSTRING_template& Q933__PvcStatus_template::dlci__high()
{
set_specific();
return single_value->field_dlci__high;
}

const BITSTRING_template& Q933__PvcStatus_template::dlci__high() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dlci_high of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_dlci__high;
}

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

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

BITSTRING_template& Q933__PvcStatus_template::dlci__low()
{
set_specific();
return single_value->field_dlci__low;
}

const BITSTRING_template& Q933__PvcStatus_template::dlci__low() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dlci_low of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_dlci__low;
}

BITSTRING_template& Q933__PvcStatus_template::spare0()
{
set_specific();
return single_value->field_spare0;
}

const BITSTRING_template& Q933__PvcStatus_template::spare0() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare0 of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_spare0;
}

BITSTRING_template& Q933__PvcStatus_template::ext1__()
{
set_specific();
return single_value->field_ext1__;
}

const BITSTRING_template& Q933__PvcStatus_template::ext1__() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ext1_ of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_ext1__;
}

BITSTRING_template& Q933__PvcStatus_template::spare0__()
{
set_specific();
return single_value->field_spare0__;
}

const BITSTRING_template& Q933__PvcStatus_template::spare0__() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare0_ of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_spare0__;
}

BOOLEAN_template& Q933__PvcStatus_template::new_()
{
set_specific();
return single_value->field_new_;
}

const BOOLEAN_template& Q933__PvcStatus_template::new_() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field new of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_new_;
}

BOOLEAN_template& Q933__PvcStatus_template::delete_()
{
set_specific();
return single_value->field_delete_;
}

const BOOLEAN_template& Q933__PvcStatus_template::delete_() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field delete of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_delete_;
}

BOOLEAN_template& Q933__PvcStatus_template::active()
{
set_specific();
return single_value->field_active;
}

const BOOLEAN_template& Q933__PvcStatus_template::active() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field active of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_active;
}

BITSTRING_template& Q933__PvcStatus_template::reserved0()
{
set_specific();
return single_value->field_reserved0;
}

const BITSTRING_template& Q933__PvcStatus_template::reserved0() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved0 of a non-specific template of type @Q933_Types.Q933_PvcStatus.");
return single_value->field_reserved0;
}

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

void Q933__PvcStatus_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", dlci_high := ");
single_value->field_dlci__high.log();
TTCN_Logger::log_event_str(", ext1 := ");
single_value->field_ext1.log();
TTCN_Logger::log_event_str(", dlci_low := ");
single_value->field_dlci__low.log();
TTCN_Logger::log_event_str(", spare0 := ");
single_value->field_spare0.log();
TTCN_Logger::log_event_str(", ext1_ := ");
single_value->field_ext1__.log();
TTCN_Logger::log_event_str(", spare0_ := ");
single_value->field_spare0__.log();
TTCN_Logger::log_event_str(", new := ");
single_value->field_new_.log();
TTCN_Logger::log_event_str(", delete := ");
single_value->field_delete_.log();
TTCN_Logger::log_event_str(", active := ");
single_value->field_active.log();
TTCN_Logger::log_event_str(", reserved0 := ");
single_value->field_reserved0.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 Q933__PvcStatus_template::log_match(const Q933__PvcStatus& 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_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dlci__high.match(match_value.dlci__high(), legacy)){
TTCN_Logger::log_logmatch_info(".dlci_high");
single_value->field_dlci__high.log_match(match_value.dlci__high(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext1.match(match_value.ext1(), legacy)){
TTCN_Logger::log_logmatch_info(".ext1");
single_value->field_ext1.log_match(match_value.ext1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dlci__low.match(match_value.dlci__low(), legacy)){
TTCN_Logger::log_logmatch_info(".dlci_low");
single_value->field_dlci__low.log_match(match_value.dlci__low(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare0.match(match_value.spare0(), legacy)){
TTCN_Logger::log_logmatch_info(".spare0");
single_value->field_spare0.log_match(match_value.spare0(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ext1__.match(match_value.ext1__(), legacy)){
TTCN_Logger::log_logmatch_info(".ext1_");
single_value->field_ext1__.log_match(match_value.ext1__(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare0__.match(match_value.spare0__(), legacy)){
TTCN_Logger::log_logmatch_info(".spare0_");
single_value->field_spare0__.log_match(match_value.spare0__(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_new_.match(match_value.new_(), legacy)){
TTCN_Logger::log_logmatch_info(".new");
single_value->field_new_.log_match(match_value.new_(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_delete_.match(match_value.delete_(), legacy)){
TTCN_Logger::log_logmatch_info(".delete");
single_value->field_delete_.log_match(match_value.delete_(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_active.match(match_value.active(), legacy)){
TTCN_Logger::log_logmatch_info(".active");
single_value->field_active.log_match(match_value.active(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved0.match(match_value.reserved0(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved0");
single_value->field_reserved0.log_match(match_value.reserved0(), 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("{ spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", dlci_high := ");
single_value->field_dlci__high.log_match(match_value.dlci__high(), legacy);
TTCN_Logger::log_event_str(", ext1 := ");
single_value->field_ext1.log_match(match_value.ext1(), legacy);
TTCN_Logger::log_event_str(", dlci_low := ");
single_value->field_dlci__low.log_match(match_value.dlci__low(), legacy);
TTCN_Logger::log_event_str(", spare0 := ");
single_value->field_spare0.log_match(match_value.spare0(), legacy);
TTCN_Logger::log_event_str(", ext1_ := ");
single_value->field_ext1__.log_match(match_value.ext1__(), legacy);
TTCN_Logger::log_event_str(", spare0_ := ");
single_value->field_spare0__.log_match(match_value.spare0__(), legacy);
TTCN_Logger::log_event_str(", new := ");
single_value->field_new_.log_match(match_value.new_(), legacy);
TTCN_Logger::log_event_str(", delete := ");
single_value->field_delete_.log_match(match_value.delete_(), legacy);
TTCN_Logger::log_event_str(", active := ");
single_value->field_active.log_match(match_value.active(), legacy);
TTCN_Logger::log_event_str(", reserved0 := ");
single_value->field_reserved0.log_match(match_value.reserved0(), 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 Q933__PvcStatus_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (spare().is_bound()) spare().set_implicit_omit();
if (dlci__high().is_bound()) dlci__high().set_implicit_omit();
if (ext1().is_bound()) ext1().set_implicit_omit();
if (dlci__low().is_bound()) dlci__low().set_implicit_omit();
if (spare0().is_bound()) spare0().set_implicit_omit();
if (ext1__().is_bound()) ext1__().set_implicit_omit();
if (spare0__().is_bound()) spare0__().set_implicit_omit();
if (new_().is_bound()) new_().set_implicit_omit();
if (delete_().is_bound()) delete_().set_implicit_omit();
if (active().is_bound()) active().set_implicit_omit();
if (reserved0().is_bound()) reserved0().set_implicit_omit();
}

void Q933__PvcStatus_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_spare.encode_text(text_buf);
single_value->field_dlci__high.encode_text(text_buf);
single_value->field_ext1.encode_text(text_buf);
single_value->field_dlci__low.encode_text(text_buf);
single_value->field_spare0.encode_text(text_buf);
single_value->field_ext1__.encode_text(text_buf);
single_value->field_spare0__.encode_text(text_buf);
single_value->field_new_.encode_text(text_buf);
single_value->field_delete_.encode_text(text_buf);
single_value->field_active.encode_text(text_buf);
single_value->field_reserved0.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 @Q933_Types.Q933_PvcStatus.");
}
}

void Q933__PvcStatus_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_spare.decode_text(text_buf);
single_value->field_dlci__high.decode_text(text_buf);
single_value->field_ext1.decode_text(text_buf);
single_value->field_dlci__low.decode_text(text_buf);
single_value->field_spare0.decode_text(text_buf);
single_value->field_ext1__.decode_text(text_buf);
single_value->field_spare0__.decode_text(text_buf);
single_value->field_new_.decode_text(text_buf);
single_value->field_delete_.decode_text(text_buf);
single_value->field_active.decode_text(text_buf);
single_value->field_reserved0.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 Q933__PvcStatus_template[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 @Q933_Types.Q933_PvcStatus.");
}
}

void Q933__PvcStatus_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: {
    Q933__PvcStatus_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (11<param.get_size()) {
      param.error("record template of type @Q933_Types.Q933_PvcStatus has 11 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dlci__high().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ext1().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dlci__low().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare0().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ext1__().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare0__().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) new_().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) delete_().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) active().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) reserved0().set_param(*param.get_elem(10));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dlci_high")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dlci__high().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dlci_low")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dlci__low().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare0")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare0().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ext1_")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ext1__().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare0_")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare0__().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "new")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          new_().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "delete")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          delete_().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "active")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          active().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved0")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved0().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @Q933_Types.Q933_PvcStatus: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933__PvcStatus_template* precondition = new Q933__PvcStatus_template;
    precondition->set_param(*param.get_elem(0));
    Q933__PvcStatus_template* implied_template = new Q933__PvcStatus_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Q933__PvcStatus_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@Q933_Types.Q933_PvcStatus");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933__PvcStatus_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_spare.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_dlci__high.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_ext1.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_dlci__low.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_spare0.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_ext1__.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_spare0__.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_new_.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_delete_.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_active.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
single_value->field_reserved0.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatus");
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 : "@Q933_Types.Q933_PvcStatus");
}

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

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

Q933__PvcStatusIE::Q933__PvcStatusIE()
{
}

Q933__PvcStatusIE::Q933__PvcStatusIE(const Q933__IEI& par_iei,
    const INTEGER& par_len,
    const Q933__PvcStatusRec& par_pvc__status)
  :   field_iei(par_iei),
  field_len(par_len),
  field_pvc__status(par_pvc__status)
{
}

Q933__PvcStatusIE::Q933__PvcStatusIE(const Q933__PvcStatusIE& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Q933_Types.Q933_PvcStatusIE.");
if (other_value.iei().is_bound()) field_iei = other_value.iei();
else field_iei.clean_up();
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.pvc__status().is_bound()) field_pvc__status = other_value.pvc__status();
else field_pvc__status.clean_up();
}

void Q933__PvcStatusIE::clean_up()
{
field_iei.clean_up();
field_len.clean_up();
field_pvc__status.clean_up();
}

const TTCN_Typedescriptor_t* Q933__PvcStatusIE::get_descriptor() const { return &Q933__PvcStatusIE_descr_; }
Q933__PvcStatusIE& Q933__PvcStatusIE::operator=(const Q933__PvcStatusIE& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Q933_Types.Q933_PvcStatusIE.");
  if (other_value.iei().is_bound()) field_iei = other_value.iei();
  else field_iei.clean_up();
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.pvc__status().is_bound()) field_pvc__status = other_value.pvc__status();
  else field_pvc__status.clean_up();
}
return *this;
}

boolean Q933__PvcStatusIE::operator==(const Q933__PvcStatusIE& other_value) const
{
return field_iei==other_value.field_iei
  && field_len==other_value.field_len
  && field_pvc__status==other_value.field_pvc__status;
}

boolean Q933__PvcStatusIE::is_bound() const
{
return (field_iei.is_bound())
  || (field_len.is_bound())
  || (field_pvc__status.is_bound());
}
boolean Q933__PvcStatusIE::is_value() const
{
return field_iei.is_value()
  && field_len.is_value()
  && field_pvc__status.is_value();
}
void Q933__PvcStatusIE::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ iei := ");
field_iei.log();
TTCN_Logger::log_event_str(", len := ");
field_len.log();
TTCN_Logger::log_event_str(", pvc_status := ");
field_pvc__status.log();
TTCN_Logger::log_event_str(" }");
}

void Q933__PvcStatusIE::set_implicit_omit()
{
if (iei().is_bound()) iei().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (pvc__status().is_bound()) pvc__status().set_implicit_omit();
}

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

void Q933__PvcStatusIE::encode_text(Text_Buf& text_buf) const
{
field_iei.encode_text(text_buf);
field_len.encode_text(text_buf);
field_pvc__status.encode_text(text_buf);
}

void Q933__PvcStatusIE::decode_text(Text_Buf& text_buf)
{
field_iei.decode_text(text_buf);
field_len.decode_text(text_buf);
field_pvc__status.decode_text(text_buf);
}

void Q933__PvcStatusIE::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 Q933__PvcStatusIE::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 Q933__PvcStatusIE::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, Q933__PvcStatusIE_iei_descr_.raw->forceomit);
  decoded_field_length = field_iei.RAW_decode(Q933__PvcStatusIE_iei_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, Q933__PvcStatusIE_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(Q933__PvcStatusIE_len_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_len.convert_to_Integer(Q933__PvcStatusIE_len_descr_);
  field_len = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, Q933__PvcStatusIE_pvc__status_descr_.raw->forceomit);
  decoded_field_length = field_pvc__status.RAW_decode(Q933__PvcStatusIE_pvc__status_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  if (field_iei != Q933__IEI::Q933__IEI__PVC__STATUS) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int Q933__PvcStatusIE::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, Q933__PvcStatusIE_iei_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Q933__PvcStatusIE_len_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Q933__PvcStatusIE_pvc__status_descr_.raw);
  encoded_length += field_iei.RAW_encode(Q933__PvcStatusIE_iei_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &Q933__PvcStatusIE_len_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_pvc__status.RAW_encode(Q933__PvcStatusIE_pvc__status_descr_, *myleaf.body.node.nodes[2]);
  if (field_iei != Q933__IEI::Q933__IEI__PVC__STATUS) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+1;
  int new_pos0[]={0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
  Q933__IEI new_val = Q933__IEI::Q933__IEI__PVC__STATUS;
  new_val.RAW_encode(Q933__PvcStatusIE_iei_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 Q933__PvcStatusIE_template::single_value_struct {
Q933__IEI_template field_iei;
INTEGER_template field_len;
Q933__PvcStatusRec_template field_pvc__status;
};

void Q933__PvcStatusIE_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_iei = ANY_VALUE;
single_value->field_len = ANY_VALUE;
single_value->field_pvc__status = ANY_VALUE;
}
}
}

void Q933__PvcStatusIE_template::copy_value(const Q933__PvcStatusIE& other_value)
{
single_value = new single_value_struct;
if (other_value.iei().is_bound()) {
  single_value->field_iei = other_value.iei();
} else {
  single_value->field_iei.clean_up();
}
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.pvc__status().is_bound()) {
  single_value->field_pvc__status = other_value.pvc__status();
} else {
  single_value->field_pvc__status.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933__PvcStatusIE_template::copy_template(const Q933__PvcStatusIE_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.iei().get_selection()) {
single_value->field_iei = other_value.iei();
} else {
single_value->field_iei.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pvc__status().get_selection()) {
single_value->field_pvc__status = other_value.pvc__status();
} else {
single_value->field_pvc__status.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new Q933__PvcStatusIE_template[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 Q933__PvcStatusIE_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__PvcStatusIE_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 @Q933_Types.Q933_PvcStatusIE.");
break;
}
set_selection(other_value);
}

Q933__PvcStatusIE_template::Q933__PvcStatusIE_template()
{
}

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

Q933__PvcStatusIE_template::Q933__PvcStatusIE_template(const Q933__PvcStatusIE& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933__PvcStatusIE_template::match(const Q933__PvcStatusIE& 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.iei().is_bound()) return FALSE;
if(!single_value->field_iei.match(other_value.iei(), legacy))return FALSE;
if(!other_value.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.pvc__status().is_bound()) return FALSE;
if(!single_value->field_pvc__status.match(other_value.pvc__status(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @Q933_Types.Q933_PvcStatusIE.");
}
return FALSE;
}

boolean Q933__PvcStatusIE_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_iei.is_bound()
 || single_value->field_len.is_bound()
 || single_value->field_pvc__status.is_bound();
}

boolean Q933__PvcStatusIE_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_iei.is_value()
 && single_value->field_len.is_value()
 && single_value->field_pvc__status.is_value();
}

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

Q933__PvcStatusIE Q933__PvcStatusIE_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 @Q933_Types.Q933_PvcStatusIE.");
Q933__PvcStatusIE ret_val;
if (single_value->field_iei.is_bound()) {
ret_val.iei() = single_value->field_iei.valueof();
}
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_pvc__status.is_bound()) {
ret_val.pvc__status() = single_value->field_pvc__status.valueof();
}
return ret_val;
}

void Q933__PvcStatusIE_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 @Q933_Types.Q933_PvcStatusIE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933__PvcStatusIE_template[list_length];
}

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

Q933__IEI_template& Q933__PvcStatusIE_template::iei()
{
set_specific();
return single_value->field_iei;
}

const Q933__IEI_template& Q933__PvcStatusIE_template::iei() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field iei of a non-specific template of type @Q933_Types.Q933_PvcStatusIE.");
return single_value->field_iei;
}

INTEGER_template& Q933__PvcStatusIE_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& Q933__PvcStatusIE_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @Q933_Types.Q933_PvcStatusIE.");
return single_value->field_len;
}

Q933__PvcStatusRec_template& Q933__PvcStatusIE_template::pvc__status()
{
set_specific();
return single_value->field_pvc__status;
}

const Q933__PvcStatusRec_template& Q933__PvcStatusIE_template::pvc__status() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pvc_status of a non-specific template of type @Q933_Types.Q933_PvcStatusIE.");
return single_value->field_pvc__status;
}

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

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

void Q933__PvcStatusIE_template::log_match(const Q933__PvcStatusIE& 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_iei.match(match_value.iei(), legacy)){
TTCN_Logger::log_logmatch_info(".iei");
single_value->field_iei.log_match(match_value.iei(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pvc__status.match(match_value.pvc__status(), legacy)){
TTCN_Logger::log_logmatch_info(".pvc_status");
single_value->field_pvc__status.log_match(match_value.pvc__status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ iei := ");
single_value->field_iei.log_match(match_value.iei(), legacy);
TTCN_Logger::log_event_str(", len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", pvc_status := ");
single_value->field_pvc__status.log_match(match_value.pvc__status(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void Q933__PvcStatusIE_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (iei().is_bound()) iei().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (pvc__status().is_bound()) pvc__status().set_implicit_omit();
}

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

void Q933__PvcStatusIE_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_iei.decode_text(text_buf);
single_value->field_len.decode_text(text_buf);
single_value->field_pvc__status.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new Q933__PvcStatusIE_template[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 @Q933_Types.Q933_PvcStatusIE.");
}
}

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

void Q933__PvcStatusIE_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_iei.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatusIE");
single_value->field_len.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatusIE");
single_value->field_pvc__status.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PvcStatusIE");
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 : "@Q933_Types.Q933_PvcStatusIE");
}

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

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

Q933__STATEUS__ENQ__Msg::Q933__STATEUS__ENQ__Msg()
{
}

Q933__STATEUS__ENQ__Msg::Q933__STATEUS__ENQ__Msg(const Q933__ReportTypeIE& par_rep__type,
    const Q933__LinkIntegrityIE& par_link__int)
  :   field_rep__type(par_rep__type),
  field_link__int(par_link__int)
{
}

Q933__STATEUS__ENQ__Msg::Q933__STATEUS__ENQ__Msg(const Q933__STATEUS__ENQ__Msg& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Q933_Types.Q933_STATEUS_ENQ_Msg.");
if (other_value.rep__type().is_bound()) field_rep__type = other_value.rep__type();
else field_rep__type.clean_up();
if (other_value.link__int().is_bound()) field_link__int = other_value.link__int();
else field_link__int.clean_up();
}

void Q933__STATEUS__ENQ__Msg::clean_up()
{
field_rep__type.clean_up();
field_link__int.clean_up();
}

const TTCN_Typedescriptor_t* Q933__STATEUS__ENQ__Msg::get_descriptor() const { return &Q933__STATEUS__ENQ__Msg_descr_; }
Q933__STATEUS__ENQ__Msg& Q933__STATEUS__ENQ__Msg::operator=(const Q933__STATEUS__ENQ__Msg& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Q933_Types.Q933_STATEUS_ENQ_Msg.");
  if (other_value.rep__type().is_bound()) field_rep__type = other_value.rep__type();
  else field_rep__type.clean_up();
  if (other_value.link__int().is_bound()) field_link__int = other_value.link__int();
  else field_link__int.clean_up();
}
return *this;
}

boolean Q933__STATEUS__ENQ__Msg::operator==(const Q933__STATEUS__ENQ__Msg& other_value) const
{
return field_rep__type==other_value.field_rep__type
  && field_link__int==other_value.field_link__int;
}

boolean Q933__STATEUS__ENQ__Msg::is_bound() const
{
return (field_rep__type.is_bound())
  || (field_link__int.is_bound());
}
boolean Q933__STATEUS__ENQ__Msg::is_value() const
{
return field_rep__type.is_value()
  && field_link__int.is_value();
}
void Q933__STATEUS__ENQ__Msg::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rep_type := ");
field_rep__type.log();
TTCN_Logger::log_event_str(", link_int := ");
field_link__int.log();
TTCN_Logger::log_event_str(" }");
}

void Q933__STATEUS__ENQ__Msg::set_implicit_omit()
{
if (rep__type().is_bound()) rep__type().set_implicit_omit();
if (link__int().is_bound()) link__int().set_implicit_omit();
}

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

void Q933__STATEUS__ENQ__Msg::encode_text(Text_Buf& text_buf) const
{
field_rep__type.encode_text(text_buf);
field_link__int.encode_text(text_buf);
}

void Q933__STATEUS__ENQ__Msg::decode_text(Text_Buf& text_buf)
{
field_rep__type.decode_text(text_buf);
field_link__int.decode_text(text_buf);
}

void Q933__STATEUS__ENQ__Msg::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 Q933__STATEUS__ENQ__Msg::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 Q933__STATEUS__ENQ__Msg::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, Q933__STATEUS__ENQ__Msg_rep__type_descr_.raw->forceomit);
  decoded_field_length = field_rep__type.RAW_decode(Q933__STATEUS__ENQ__Msg_rep__type_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, Q933__STATEUS__ENQ__Msg_link__int_descr_.raw->forceomit);
  decoded_field_length = field_link__int.RAW_decode(Q933__STATEUS__ENQ__Msg_link__int_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 Q933__STATEUS__ENQ__Msg::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, Q933__STATEUS__ENQ__Msg_rep__type_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Q933__STATEUS__ENQ__Msg_link__int_descr_.raw);
  encoded_length += field_rep__type.RAW_encode(Q933__STATEUS__ENQ__Msg_rep__type_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_link__int.RAW_encode(Q933__STATEUS__ENQ__Msg_link__int_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct Q933__STATEUS__ENQ__Msg_template::single_value_struct {
Q933__ReportTypeIE_template field_rep__type;
Q933__LinkIntegrityIE_template field_link__int;
};

void Q933__STATEUS__ENQ__Msg_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_rep__type = ANY_VALUE;
single_value->field_link__int = ANY_VALUE;
}
}
}

void Q933__STATEUS__ENQ__Msg_template::copy_value(const Q933__STATEUS__ENQ__Msg& other_value)
{
single_value = new single_value_struct;
if (other_value.rep__type().is_bound()) {
  single_value->field_rep__type = other_value.rep__type();
} else {
  single_value->field_rep__type.clean_up();
}
if (other_value.link__int().is_bound()) {
  single_value->field_link__int = other_value.link__int();
} else {
  single_value->field_link__int.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933__STATEUS__ENQ__Msg_template::copy_template(const Q933__STATEUS__ENQ__Msg_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rep__type().get_selection()) {
single_value->field_rep__type = other_value.rep__type();
} else {
single_value->field_rep__type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.link__int().get_selection()) {
single_value->field_link__int = other_value.link__int();
} else {
single_value->field_link__int.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 Q933__STATEUS__ENQ__Msg_template[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 Q933__STATEUS__ENQ__Msg_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__STATEUS__ENQ__Msg_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 @Q933_Types.Q933_STATEUS_ENQ_Msg.");
break;
}
set_selection(other_value);
}

Q933__STATEUS__ENQ__Msg_template::Q933__STATEUS__ENQ__Msg_template()
{
}

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

Q933__STATEUS__ENQ__Msg_template::Q933__STATEUS__ENQ__Msg_template(const Q933__STATEUS__ENQ__Msg& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933__STATEUS__ENQ__Msg_template::match(const Q933__STATEUS__ENQ__Msg& 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.rep__type().is_bound()) return FALSE;
if(!single_value->field_rep__type.match(other_value.rep__type(), legacy))return FALSE;
if(!other_value.link__int().is_bound()) return FALSE;
if(!single_value->field_link__int.match(other_value.link__int(), 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 @Q933_Types.Q933_STATEUS_ENQ_Msg.");
}
return FALSE;
}

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

boolean Q933__STATEUS__ENQ__Msg_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rep__type.is_value()
 && single_value->field_link__int.is_value();
}

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

Q933__STATEUS__ENQ__Msg Q933__STATEUS__ENQ__Msg_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 @Q933_Types.Q933_STATEUS_ENQ_Msg.");
Q933__STATEUS__ENQ__Msg ret_val;
if (single_value->field_rep__type.is_bound()) {
ret_val.rep__type() = single_value->field_rep__type.valueof();
}
if (single_value->field_link__int.is_bound()) {
ret_val.link__int() = single_value->field_link__int.valueof();
}
return ret_val;
}

void Q933__STATEUS__ENQ__Msg_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 @Q933_Types.Q933_STATEUS_ENQ_Msg.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933__STATEUS__ENQ__Msg_template[list_length];
}

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

Q933__ReportTypeIE_template& Q933__STATEUS__ENQ__Msg_template::rep__type()
{
set_specific();
return single_value->field_rep__type;
}

const Q933__ReportTypeIE_template& Q933__STATEUS__ENQ__Msg_template::rep__type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rep_type of a non-specific template of type @Q933_Types.Q933_STATEUS_ENQ_Msg.");
return single_value->field_rep__type;
}

Q933__LinkIntegrityIE_template& Q933__STATEUS__ENQ__Msg_template::link__int()
{
set_specific();
return single_value->field_link__int;
}

const Q933__LinkIntegrityIE_template& Q933__STATEUS__ENQ__Msg_template::link__int() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field link_int of a non-specific template of type @Q933_Types.Q933_STATEUS_ENQ_Msg.");
return single_value->field_link__int;
}

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

void Q933__STATEUS__ENQ__Msg_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rep_type := ");
single_value->field_rep__type.log();
TTCN_Logger::log_event_str(", link_int := ");
single_value->field_link__int.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 Q933__STATEUS__ENQ__Msg_template::log_match(const Q933__STATEUS__ENQ__Msg& 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_rep__type.match(match_value.rep__type(), legacy)){
TTCN_Logger::log_logmatch_info(".rep_type");
single_value->field_rep__type.log_match(match_value.rep__type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_link__int.match(match_value.link__int(), legacy)){
TTCN_Logger::log_logmatch_info(".link_int");
single_value->field_link__int.log_match(match_value.link__int(), 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("{ rep_type := ");
single_value->field_rep__type.log_match(match_value.rep__type(), legacy);
TTCN_Logger::log_event_str(", link_int := ");
single_value->field_link__int.log_match(match_value.link__int(), 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 Q933__STATEUS__ENQ__Msg_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rep__type().is_bound()) rep__type().set_implicit_omit();
if (link__int().is_bound()) link__int().set_implicit_omit();
}

void Q933__STATEUS__ENQ__Msg_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rep__type.encode_text(text_buf);
single_value->field_link__int.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 @Q933_Types.Q933_STATEUS_ENQ_Msg.");
}
}

void Q933__STATEUS__ENQ__Msg_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_rep__type.decode_text(text_buf);
single_value->field_link__int.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 Q933__STATEUS__ENQ__Msg_template[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 @Q933_Types.Q933_STATEUS_ENQ_Msg.");
}
}

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

void Q933__STATEUS__ENQ__Msg_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_rep__type.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_STATEUS_ENQ_Msg");
single_value->field_link__int.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_STATEUS_ENQ_Msg");
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 : "@Q933_Types.Q933_STATEUS_ENQ_Msg");
}

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

boolean Q933__STATEUS__ENQ__Msg_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 Q933__Payload::copy_value(const Q933__Payload& other_value)
{
switch (other_value.union_selection) {
case ALT_status:
field_status = new Q933__STATUS__Msg(*other_value.field_status);
break;
case ALT_status__enq:
field_status__enq = new Q933__STATEUS__ENQ__Msg(*other_value.field_status__enq);
break;
case ALT_other:
field_other = new OCTETSTRING(*other_value.field_other);
break;
default:
TTCN_error("Assignment of an unbound union value of type @Q933_Types.Q933_Payload.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean Q933__Payload::operator==(const Q933__Payload& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @Q933_Types.Q933_Payload.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @Q933_Types.Q933_Payload.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_status:
return *field_status == *other_value.field_status;
case ALT_status__enq:
return *field_status__enq == *other_value.field_status__enq;
case ALT_other:
return *field_other == *other_value.field_other;
default:
return FALSE;
}
}

Q933__STATUS__Msg& Q933__Payload::status()
{
if (union_selection != ALT_status) {
clean_up();
field_status = new Q933__STATUS__Msg;
union_selection = ALT_status;
}
return *field_status;
}

const Q933__STATUS__Msg& Q933__Payload::status() const
{
if (union_selection != ALT_status) TTCN_error("Using non-selected field status in a value of union type @Q933_Types.Q933_Payload.");
return *field_status;
}

Q933__STATEUS__ENQ__Msg& Q933__Payload::status__enq()
{
if (union_selection != ALT_status__enq) {
clean_up();
field_status__enq = new Q933__STATEUS__ENQ__Msg;
union_selection = ALT_status__enq;
}
return *field_status__enq;
}

const Q933__STATEUS__ENQ__Msg& Q933__Payload::status__enq() const
{
if (union_selection != ALT_status__enq) TTCN_error("Using non-selected field status_enq in a value of union type @Q933_Types.Q933_Payload.");
return *field_status__enq;
}

OCTETSTRING& Q933__Payload::other()
{
if (union_selection != ALT_other) {
clean_up();
field_other = new OCTETSTRING;
union_selection = ALT_other;
}
return *field_other;
}

const OCTETSTRING& Q933__Payload::other() const
{
if (union_selection != ALT_other) TTCN_error("Using non-selected field other in a value of union type @Q933_Types.Q933_Payload.");
return *field_other;
}

boolean Q933__Payload::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 @Q933_Types.Q933_Payload.");
return union_selection == checked_selection;
}

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

boolean Q933__Payload::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_status: return field_status->is_value();
case ALT_status__enq: return field_status__enq->is_value();
case ALT_other: return field_other->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void Q933__Payload::clean_up()
{
switch (union_selection) {
case ALT_status:
  delete field_status;
  break;
case ALT_status__enq:
  delete field_status__enq;
  break;
case ALT_other:
  delete field_other;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void Q933__Payload::log() const
{
switch (union_selection) {
case ALT_status:
TTCN_Logger::log_event_str("{ status := ");
field_status->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_status__enq:
TTCN_Logger::log_event_str("{ status_enq := ");
field_status__enq->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_other:
TTCN_Logger::log_event_str("{ other := ");
field_other->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void Q933__Payload::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, "status")) {
    status().set_param(*mp_last);
    if (!status().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "status_enq")) {
    status__enq().set_param(*mp_last);
    if (!status__enq().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "other")) {
    other().set_param(*mp_last);
    if (!other().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @Q933_Types.Q933_Payload.", last_name);
}

void Q933__Payload::set_implicit_omit()
{
switch (union_selection) {
case ALT_status:
field_status->set_implicit_omit(); break;
case ALT_status__enq:
field_status__enq->set_implicit_omit(); break;
case ALT_other:
field_other->set_implicit_omit(); break;
default: break;
}
}

void Q933__Payload::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_status:
field_status->encode_text(text_buf);
break;
case ALT_status__enq:
field_status__enq->encode_text(text_buf);
break;
case ALT_other:
field_other->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @Q933_Types.Q933_Payload.");
}
}

void Q933__Payload::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_status:
status().decode_text(text_buf);
break;
case ALT_status__enq:
status__enq().decode_text(text_buf);
break;
case ALT_other:
other().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @Q933_Types.Q933_Payload.");
}
}

void Q933__Payload::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 Q933__Payload::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 Q933__Payload::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, Q933__Payload_status_descr_.raw->forceomit);
      decoded_length = status().RAW_decode(Q933__Payload_status_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, Q933__Payload_status__enq_descr_.raw->forceomit);
      decoded_length = status__enq().RAW_decode(Q933__Payload_status__enq_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, Q933__Payload_other_descr_.raw->forceomit);
      decoded_length = other().RAW_decode(Q933__Payload_other_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, Q933__Payload_status_descr_.raw->forceomit);
      decoded_length = status().RAW_decode(Q933__Payload_status_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, Q933__Payload_status__enq_descr_.raw->forceomit);
      decoded_length = status__enq().RAW_decode(Q933__Payload_status__enq_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, Q933__Payload_other_descr_.raw->forceomit);
      decoded_length = other().RAW_decode(Q933__Payload_other_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int Q933__Payload::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_status:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, Q933__Payload_status_descr_.raw);
    encoded_length = field_status->RAW_encode(Q933__Payload_status_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &Q933__Payload_status_descr_;
    break;
  case ALT_status__enq:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, Q933__Payload_status__enq_descr_.raw);
    encoded_length = field_status__enq->RAW_encode(Q933__Payload_status__enq_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &Q933__Payload_status__enq_descr_;
    break;
  case ALT_other:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, Q933__Payload_other_descr_.raw);
    encoded_length = field_other->RAW_encode(Q933__Payload_other_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &Q933__Payload_other_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void Q933__Payload_template::copy_value(const Q933__Payload& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case Q933__Payload::ALT_status:
single_value.field_status = new Q933__STATUS__Msg_template(other_value.status());
break;
case Q933__Payload::ALT_status__enq:
single_value.field_status__enq = new Q933__STATEUS__ENQ__Msg_template(other_value.status__enq());
break;
case Q933__Payload::ALT_other:
single_value.field_other = new OCTETSTRING_template(other_value.other());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @Q933_Types.Q933_Payload.");
}
set_selection(SPECIFIC_VALUE);
}

void Q933__Payload_template::copy_template(const Q933__Payload_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 Q933__Payload::ALT_status:
single_value.field_status = new Q933__STATUS__Msg_template(*other_value.single_value.field_status);
break;
case Q933__Payload::ALT_status__enq:
single_value.field_status__enq = new Q933__STATEUS__ENQ__Msg_template(*other_value.single_value.field_status__enq);
break;
case Q933__Payload::ALT_other:
single_value.field_other = new OCTETSTRING_template(*other_value.single_value.field_other);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @Q933_Types.Q933_Payload.");
}
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 Q933__Payload_template[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 Q933__Payload_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__Payload_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 @Q933_Types.Q933_Payload.");
}
set_selection(other_value);
}

Q933__Payload_template::Q933__Payload_template()
{
}

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

Q933__Payload_template::Q933__Payload_template(const Q933__Payload& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void Q933__Payload_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Q933__Payload::ALT_status:
delete single_value.field_status;
break;
case Q933__Payload::ALT_status__enq:
delete single_value.field_status__enq;
break;
case Q933__Payload::ALT_other:
delete single_value.field_other;
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;
}

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

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

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

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

boolean Q933__Payload_template::match(const Q933__Payload& 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:
{
Q933__Payload::union_selection_type value_selection = other_value.get_selection();
if (value_selection == Q933__Payload::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case Q933__Payload::ALT_status:
return single_value.field_status->match(other_value.status(), legacy);
case Q933__Payload::ALT_status__enq:
return single_value.field_status__enq->match(other_value.status__enq(), legacy);
case Q933__Payload::ALT_other:
return single_value.field_other->match(other_value.other(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @Q933_Types.Q933_Payload.");
}
}
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 @Q933_Types.Q933_Payload.");
}
return FALSE;
}

boolean Q933__Payload_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case Q933__Payload::ALT_status:
return single_value.field_status->is_value();
case Q933__Payload::ALT_status__enq:
return single_value.field_status__enq->is_value();
case Q933__Payload::ALT_other:
return single_value.field_other->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @Q933_Types.Q933_Payload.");
}
}

Q933__Payload Q933__Payload_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 @Q933_Types.Q933_Payload.");
Q933__Payload ret_val;
switch (single_value.union_selection) {
case Q933__Payload::ALT_status:
ret_val.status() = single_value.field_status->valueof();
break;
case Q933__Payload::ALT_status__enq:
ret_val.status__enq() = single_value.field_status__enq->valueof();
break;
case Q933__Payload::ALT_other:
ret_val.other() = single_value.field_other->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @Q933_Types.Q933_Payload.");
}
return ret_val;
}

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

Q933__STATUS__Msg_template& Q933__Payload_template::status()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Q933__Payload::ALT_status) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_status = new Q933__STATUS__Msg_template(ANY_VALUE);
else single_value.field_status = new Q933__STATUS__Msg_template;
single_value.union_selection = Q933__Payload::ALT_status;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_status;
}

const Q933__STATUS__Msg_template& Q933__Payload_template::status() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field status in a non-specific template of union type @Q933_Types.Q933_Payload.");
if (single_value.union_selection != Q933__Payload::ALT_status) TTCN_error("Accessing non-selected field status in a template of union type @Q933_Types.Q933_Payload.");
return *single_value.field_status;
}

Q933__STATEUS__ENQ__Msg_template& Q933__Payload_template::status__enq()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Q933__Payload::ALT_status__enq) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_status__enq = new Q933__STATEUS__ENQ__Msg_template(ANY_VALUE);
else single_value.field_status__enq = new Q933__STATEUS__ENQ__Msg_template;
single_value.union_selection = Q933__Payload::ALT_status__enq;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_status__enq;
}

const Q933__STATEUS__ENQ__Msg_template& Q933__Payload_template::status__enq() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field status_enq in a non-specific template of union type @Q933_Types.Q933_Payload.");
if (single_value.union_selection != Q933__Payload::ALT_status__enq) TTCN_error("Accessing non-selected field status_enq in a template of union type @Q933_Types.Q933_Payload.");
return *single_value.field_status__enq;
}

OCTETSTRING_template& Q933__Payload_template::other()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Q933__Payload::ALT_other) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_other = new OCTETSTRING_template(ANY_VALUE);
else single_value.field_other = new OCTETSTRING_template;
single_value.union_selection = Q933__Payload::ALT_other;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_other;
}

const OCTETSTRING_template& Q933__Payload_template::other() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field other in a non-specific template of union type @Q933_Types.Q933_Payload.");
if (single_value.union_selection != Q933__Payload::ALT_other) TTCN_error("Accessing non-selected field other in a template of union type @Q933_Types.Q933_Payload.");
return *single_value.field_other;
}

boolean Q933__Payload_template::ischosen(Q933__Payload::union_selection_type checked_selection) const
{
if (checked_selection == Q933__Payload::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @Q933_Types.Q933_Payload.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == Q933__Payload::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @Q933_Types.Q933_Payload.");
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 @Q933_Types.Q933_Payload 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 Q933__Payload_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case Q933__Payload::ALT_status:
TTCN_Logger::log_event_str("{ status := ");
single_value.field_status->log();
TTCN_Logger::log_event_str(" }");
break;
case Q933__Payload::ALT_status__enq:
TTCN_Logger::log_event_str("{ status_enq := ");
single_value.field_status__enq->log();
TTCN_Logger::log_event_str(" }");
break;
case Q933__Payload::ALT_other:
TTCN_Logger::log_event_str("{ other := ");
single_value.field_other->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 Q933__Payload_template::log_match(const Q933__Payload& 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 Q933__Payload::ALT_status:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".status");
single_value.field_status->log_match(match_value.status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ status := ");
single_value.field_status->log_match(match_value.status(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Q933__Payload::ALT_status__enq:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".status_enq");
single_value.field_status__enq->log_match(match_value.status__enq(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ status_enq := ");
single_value.field_status__enq->log_match(match_value.status__enq(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case Q933__Payload::ALT_other:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".other");
single_value.field_other->log_match(match_value.other(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ other := ");
single_value.field_other->log_match(match_value.other(), 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 Q933__Payload_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case Q933__Payload::ALT_status:
single_value.field_status->set_implicit_omit(); break;
case Q933__Payload::ALT_status__enq:
single_value.field_status__enq->set_implicit_omit(); break;
case Q933__Payload::ALT_other:
single_value.field_other->set_implicit_omit(); break;
default: break;
}
}

void Q933__Payload_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 Q933__Payload::ALT_status:
single_value.field_status->encode_text(text_buf);
break;
case Q933__Payload::ALT_status__enq:
single_value.field_status__enq->encode_text(text_buf);
break;
case Q933__Payload::ALT_other:
single_value.field_other->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @Q933_Types.Q933_Payload.");
}
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 @Q933_Types.Q933_Payload.");
}
}

void Q933__Payload_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = Q933__Payload::UNBOUND_VALUE;
Q933__Payload::union_selection_type new_selection = (Q933__Payload::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case Q933__Payload::ALT_status:
single_value.field_status = new Q933__STATUS__Msg_template;
single_value.field_status->decode_text(text_buf);
break;
case Q933__Payload::ALT_status__enq:
single_value.field_status__enq = new Q933__STATEUS__ENQ__Msg_template;
single_value.field_status__enq->decode_text(text_buf);
break;
case Q933__Payload::ALT_other:
single_value.field_other = new OCTETSTRING_template;
single_value.field_other->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @Q933_Types.Q933_Payload.");
}
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 Q933__Payload_template[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 @Q933_Types.Q933_Payload.");
}
}

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

boolean Q933__Payload_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 Q933__Payload_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 `@Q933_Types.Q933_Payload'");
    }
    if (strcmp("status", param_field) == 0) {
      status().set_param(param);
      return;
    } else if (strcmp("status_enq", param_field) == 0) {
      status__enq().set_param(param);
      return;
    } else if (strcmp("other", param_field) == 0) {
      other().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@Q933_Types.Q933_Payload'", 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: {
    Q933__Payload_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", "@Q933_Types.Q933_Payload");
    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, "status")) {
      status().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "status_enq")) {
      status__enq().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "other")) {
      other().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @Q933_Types.Q933_Payload.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933__Payload_template* precondition = new Q933__Payload_template;
    precondition->set_param(*m_p->get_elem(0));
    Q933__Payload_template* implied_template = new Q933__Payload_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = Q933__Payload_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@Q933_Types.Q933_Payload");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933__Payload_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 Q933__Payload::ALT_status:
single_value.field_status->check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_Payload");
return;
case Q933__Payload::ALT_status__enq:
single_value.field_status__enq->check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_Payload");
return;
case Q933__Payload::ALT_other:
single_value.field_other->check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_Payload");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @Q933_Types.Q933_Payload.");
}
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 : "@Q933_Types.Q933_Payload");
}

Q933__PDU::Q933__PDU()
{
}

Q933__PDU::Q933__PDU(const OCTETSTRING& par_prot__disc,
    const OCTETSTRING& par_call__ref,
    const Q931__Types::Q931__MessageType& par_msg__type,
    const Q933__Payload& par_body)
  :   field_prot__disc(par_prot__disc),
  field_call__ref(par_call__ref),
  field_msg__type(par_msg__type),
  field_body(par_body)
{
}

Q933__PDU::Q933__PDU(const Q933__PDU& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Q933_Types.Q933_PDU.");
if (other_value.prot__disc().is_bound()) field_prot__disc = other_value.prot__disc();
else field_prot__disc.clean_up();
if (other_value.call__ref().is_bound()) field_call__ref = other_value.call__ref();
else field_call__ref.clean_up();
if (other_value.msg__type().is_bound()) field_msg__type = other_value.msg__type();
else field_msg__type.clean_up();
if (other_value.body().is_bound()) field_body = other_value.body();
else field_body.clean_up();
}

void Q933__PDU::clean_up()
{
field_prot__disc.clean_up();
field_call__ref.clean_up();
field_msg__type.clean_up();
field_body.clean_up();
}

const TTCN_Typedescriptor_t* Q933__PDU::get_descriptor() const { return &Q933__PDU_descr_; }
Q933__PDU& Q933__PDU::operator=(const Q933__PDU& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Q933_Types.Q933_PDU.");
  if (other_value.prot__disc().is_bound()) field_prot__disc = other_value.prot__disc();
  else field_prot__disc.clean_up();
  if (other_value.call__ref().is_bound()) field_call__ref = other_value.call__ref();
  else field_call__ref.clean_up();
  if (other_value.msg__type().is_bound()) field_msg__type = other_value.msg__type();
  else field_msg__type.clean_up();
  if (other_value.body().is_bound()) field_body = other_value.body();
  else field_body.clean_up();
}
return *this;
}

boolean Q933__PDU::operator==(const Q933__PDU& other_value) const
{
return field_prot__disc==other_value.field_prot__disc
  && field_call__ref==other_value.field_call__ref
  && field_msg__type==other_value.field_msg__type
  && field_body==other_value.field_body;
}

boolean Q933__PDU::is_bound() const
{
return (field_prot__disc.is_bound())
  || (field_call__ref.is_bound())
  || (field_msg__type.is_bound())
  || (field_body.is_bound());
}
boolean Q933__PDU::is_value() const
{
return field_prot__disc.is_value()
  && field_call__ref.is_value()
  && field_msg__type.is_value()
  && field_body.is_value();
}
void Q933__PDU::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ prot_disc := ");
field_prot__disc.log();
TTCN_Logger::log_event_str(", call_ref := ");
field_call__ref.log();
TTCN_Logger::log_event_str(", msg_type := ");
field_msg__type.log();
TTCN_Logger::log_event_str(", body := ");
field_body.log();
TTCN_Logger::log_event_str(" }");
}

void Q933__PDU::set_implicit_omit()
{
if (prot__disc().is_bound()) prot__disc().set_implicit_omit();
if (call__ref().is_bound()) call__ref().set_implicit_omit();
if (msg__type().is_bound()) msg__type().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void Q933__PDU::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 @Q933_Types.Q933_PDU 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) prot__disc().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) call__ref().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msg__type().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) body().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(), "prot_disc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          prot__disc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "call_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          call__ref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @Q933_Types.Q933_PDU: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@Q933_Types.Q933_PDU");
  }
}

void Q933__PDU::encode_text(Text_Buf& text_buf) const
{
field_prot__disc.encode_text(text_buf);
field_call__ref.encode_text(text_buf);
field_msg__type.encode_text(text_buf);
field_body.encode_text(text_buf);
}

void Q933__PDU::decode_text(Text_Buf& text_buf)
{
field_prot__disc.decode_text(text_buf);
field_call__ref.decode_text(text_buf);
field_msg__type.decode_text(text_buf);
field_body.decode_text(text_buf);
}

void Q933__PDU::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 Q933__PDU::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 Q933__PDU::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, Q933__PDU_prot__disc_descr_.raw->forceomit);
  decoded_field_length = field_prot__disc.RAW_decode(Q933__PDU_prot__disc_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, Q933__PDU_call__ref_descr_.raw->forceomit);
  decoded_field_length = field_call__ref.RAW_decode(Q933__PDU_call__ref_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, Q933__PDU_msg__type_descr_.raw->forceomit);
  decoded_field_length = field_msg__type.RAW_decode(Q933__PDU_msg__type_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_msg__type == Q931__Types::Q931__MessageType::Q931__MSGT__STATUS) selected_field = 0;
  else if (field_msg__type == Q931__Types::Q931__MessageType::Q931__MSGT__STATUS__ENQ) selected_field = 1;
  else selected_field = 2;
  RAW_Force_Omit field_3_force_omit(3, force_omit, Q933__PDU_body_descr_.raw->forceomit);
  decoded_field_length = field_body.RAW_decode(Q933__PDU_body_descr_, p_buf, limit, local_top_order, no_err, selected_field, 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 Q933__PDU::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, Q933__PDU_prot__disc_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Q933__PDU_call__ref_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Q933__PDU_msg__type_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, Q933__PDU_body_descr_.raw);
  encoded_length += field_prot__disc.RAW_encode(Q933__PDU_prot__disc_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_call__ref.RAW_encode(Q933__PDU_call__ref_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_msg__type.RAW_encode(Q933__PDU_msg__type_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_body.RAW_encode(Q933__PDU_body_descr_, *myleaf.body.node.nodes[3]);
  switch (field_body.get_selection()) {
  case Q933__Payload::ALT_status:
  if (field_msg__type != Q931__Types::Q931__MessageType::Q931__MSGT__STATUS) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  Q931__Types::Q931__MessageType new_val(Q931__Types::Q931__MessageType::Q931__MSGT__STATUS);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(Q933__PDU_msg__type_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 Q933__Payload::ALT_status__enq:
  if (field_msg__type != Q931__Types::Q931__MessageType::Q931__MSGT__STATUS__ENQ) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 2 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  Q931__Types::Q931__MessageType new_val(Q931__Types::Q931__MessageType::Q931__MSGT__STATUS__ENQ);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(Q933__PDU_msg__type_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 Q933__PDU_template::single_value_struct {
OCTETSTRING_template field_prot__disc;
OCTETSTRING_template field_call__ref;
Q931__Types::Q931__MessageType_template field_msg__type;
Q933__Payload_template field_body;
};

void Q933__PDU_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_prot__disc = ANY_VALUE;
single_value->field_call__ref = ANY_VALUE;
single_value->field_msg__type = ANY_VALUE;
single_value->field_body = ANY_VALUE;
}
}
}

void Q933__PDU_template::copy_value(const Q933__PDU& other_value)
{
single_value = new single_value_struct;
if (other_value.prot__disc().is_bound()) {
  single_value->field_prot__disc = other_value.prot__disc();
} else {
  single_value->field_prot__disc.clean_up();
}
if (other_value.call__ref().is_bound()) {
  single_value->field_call__ref = other_value.call__ref();
} else {
  single_value->field_call__ref.clean_up();
}
if (other_value.msg__type().is_bound()) {
  single_value->field_msg__type = other_value.msg__type();
} else {
  single_value->field_msg__type.clean_up();
}
if (other_value.body().is_bound()) {
  single_value->field_body = other_value.body();
} else {
  single_value->field_body.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933__PDU_template::copy_template(const Q933__PDU_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.prot__disc().get_selection()) {
single_value->field_prot__disc = other_value.prot__disc();
} else {
single_value->field_prot__disc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.call__ref().get_selection()) {
single_value->field_call__ref = other_value.call__ref();
} else {
single_value->field_call__ref.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msg__type().get_selection()) {
single_value->field_msg__type = other_value.msg__type();
} else {
single_value->field_msg__type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.body().get_selection()) {
single_value->field_body = other_value.body();
} else {
single_value->field_body.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 Q933__PDU_template[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 Q933__PDU_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933__PDU_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 @Q933_Types.Q933_PDU.");
break;
}
set_selection(other_value);
}

Q933__PDU_template::Q933__PDU_template()
{
}

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

Q933__PDU_template::Q933__PDU_template(const Q933__PDU& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933__PDU_template::match(const Q933__PDU& 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.prot__disc().is_bound()) return FALSE;
if(!single_value->field_prot__disc.match(other_value.prot__disc(), legacy))return FALSE;
if(!other_value.call__ref().is_bound()) return FALSE;
if(!single_value->field_call__ref.match(other_value.call__ref(), legacy))return FALSE;
if(!other_value.msg__type().is_bound()) return FALSE;
if(!single_value->field_msg__type.match(other_value.msg__type(), legacy))return FALSE;
if(!other_value.body().is_bound()) return FALSE;
if(!single_value->field_body.match(other_value.body(), 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 @Q933_Types.Q933_PDU.");
}
return FALSE;
}

boolean Q933__PDU_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_prot__disc.is_bound()
 || single_value->field_call__ref.is_bound()
 || single_value->field_msg__type.is_bound()
 || single_value->field_body.is_bound();
}

boolean Q933__PDU_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_prot__disc.is_value()
 && single_value->field_call__ref.is_value()
 && single_value->field_msg__type.is_value()
 && single_value->field_body.is_value();
}

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

Q933__PDU Q933__PDU_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 @Q933_Types.Q933_PDU.");
Q933__PDU ret_val;
if (single_value->field_prot__disc.is_bound()) {
ret_val.prot__disc() = single_value->field_prot__disc.valueof();
}
if (single_value->field_call__ref.is_bound()) {
ret_val.call__ref() = single_value->field_call__ref.valueof();
}
if (single_value->field_msg__type.is_bound()) {
ret_val.msg__type() = single_value->field_msg__type.valueof();
}
if (single_value->field_body.is_bound()) {
ret_val.body() = single_value->field_body.valueof();
}
return ret_val;
}

void Q933__PDU_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 @Q933_Types.Q933_PDU.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933__PDU_template[list_length];
}

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

OCTETSTRING_template& Q933__PDU_template::prot__disc()
{
set_specific();
return single_value->field_prot__disc;
}

const OCTETSTRING_template& Q933__PDU_template::prot__disc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field prot_disc of a non-specific template of type @Q933_Types.Q933_PDU.");
return single_value->field_prot__disc;
}

OCTETSTRING_template& Q933__PDU_template::call__ref()
{
set_specific();
return single_value->field_call__ref;
}

const OCTETSTRING_template& Q933__PDU_template::call__ref() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field call_ref of a non-specific template of type @Q933_Types.Q933_PDU.");
return single_value->field_call__ref;
}

Q931__Types::Q931__MessageType_template& Q933__PDU_template::msg__type()
{
set_specific();
return single_value->field_msg__type;
}

const Q931__Types::Q931__MessageType_template& Q933__PDU_template::msg__type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msg_type of a non-specific template of type @Q933_Types.Q933_PDU.");
return single_value->field_msg__type;
}

Q933__Payload_template& Q933__PDU_template::body()
{
set_specific();
return single_value->field_body;
}

const Q933__Payload_template& Q933__PDU_template::body() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field body of a non-specific template of type @Q933_Types.Q933_PDU.");
return single_value->field_body;
}

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

void Q933__PDU_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ prot_disc := ");
single_value->field_prot__disc.log();
TTCN_Logger::log_event_str(", call_ref := ");
single_value->field_call__ref.log();
TTCN_Logger::log_event_str(", msg_type := ");
single_value->field_msg__type.log();
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.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 Q933__PDU_template::log_match(const Q933__PDU& 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_prot__disc.match(match_value.prot__disc(), legacy)){
TTCN_Logger::log_logmatch_info(".prot_disc");
single_value->field_prot__disc.log_match(match_value.prot__disc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_call__ref.match(match_value.call__ref(), legacy)){
TTCN_Logger::log_logmatch_info(".call_ref");
single_value->field_call__ref.log_match(match_value.call__ref(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msg__type.match(match_value.msg__type(), legacy)){
TTCN_Logger::log_logmatch_info(".msg_type");
single_value->field_msg__type.log_match(match_value.msg__type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_body.match(match_value.body(), legacy)){
TTCN_Logger::log_logmatch_info(".body");
single_value->field_body.log_match(match_value.body(), 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("{ prot_disc := ");
single_value->field_prot__disc.log_match(match_value.prot__disc(), legacy);
TTCN_Logger::log_event_str(", call_ref := ");
single_value->field_call__ref.log_match(match_value.call__ref(), legacy);
TTCN_Logger::log_event_str(", msg_type := ");
single_value->field_msg__type.log_match(match_value.msg__type(), legacy);
TTCN_Logger::log_event_str(", body := ");
single_value->field_body.log_match(match_value.body(), 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 Q933__PDU_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (prot__disc().is_bound()) prot__disc().set_implicit_omit();
if (call__ref().is_bound()) call__ref().set_implicit_omit();
if (msg__type().is_bound()) msg__type().set_implicit_omit();
if (body().is_bound()) body().set_implicit_omit();
}

void Q933__PDU_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_prot__disc.encode_text(text_buf);
single_value->field_call__ref.encode_text(text_buf);
single_value->field_msg__type.encode_text(text_buf);
single_value->field_body.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 @Q933_Types.Q933_PDU.");
}
}

void Q933__PDU_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_prot__disc.decode_text(text_buf);
single_value->field_call__ref.decode_text(text_buf);
single_value->field_msg__type.decode_text(text_buf);
single_value->field_body.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 Q933__PDU_template[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 @Q933_Types.Q933_PDU.");
}
}

void Q933__PDU_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: {
    Q933__PDU_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 @Q933_Types.Q933_PDU 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) prot__disc().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) call__ref().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msg__type().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) body().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(), "prot_disc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          prot__disc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "call_ref")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          call__ref().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "body")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          body().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @Q933_Types.Q933_PDU: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933__PDU_template* precondition = new Q933__PDU_template;
    precondition->set_param(*param.get_elem(0));
    Q933__PDU_template* implied_template = new Q933__PDU_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Q933__PDU_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@Q933_Types.Q933_PDU");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933__PDU_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_prot__disc.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PDU");
single_value->field_call__ref.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PDU");
single_value->field_msg__type.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PDU");
single_value->field_body.check_restriction(t_res, t_name ? t_name : "@Q933_Types.Q933_PDU");
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 : "@Q933_Types.Q933_PDU");
}

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

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


/* Bodies of functions, altsteps and testcases */

void Q933__IEI_encoder(const Q933__IEI& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__IEI_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__IEI_decoder(OCTETSTRING& input_stream, Q933__IEI& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__IEI_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__ReportTypeIE_iei_encoder(const Q933__IEI& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__ReportTypeIE_iei_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__ReportTypeIE_iei_decoder(OCTETSTRING& input_stream, Q933__IEI& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__ReportTypeIE_iei_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__ReportTypeIE_len_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__ReportTypeIE_len_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__ReportTypeIE_len_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__ReportTypeIE_len_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__TypeOfReport_encoder(const Q933__TypeOfReport& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_TypeOfReport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__TypeOfReport_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__TypeOfReport_decoder(OCTETSTRING& input_stream, Q933__TypeOfReport& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_TypeOfReport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__TypeOfReport_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__ReportTypeIE_type__of__rep_encoder(const Q933__TypeOfReport& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_TypeOfReport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__ReportTypeIE_type__of__rep_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__ReportTypeIE_type__of__rep_decoder(OCTETSTRING& input_stream, Q933__TypeOfReport& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_TypeOfReport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__ReportTypeIE_type__of__rep_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__ReportTypeIE_encoder(const Q933__ReportTypeIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_ReportTypeIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__ReportTypeIE_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__ReportTypeIE_decoder(OCTETSTRING& input_stream, Q933__ReportTypeIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_ReportTypeIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__ReportTypeIE_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__STATUS__Msg_rep__type_encoder(const Q933__ReportTypeIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_ReportTypeIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__STATUS__Msg_rep__type_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__STATUS__Msg_rep__type_decoder(OCTETSTRING& input_stream, Q933__ReportTypeIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_ReportTypeIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__STATUS__Msg_rep__type_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__LinkIntegrityIE_iei_encoder(const Q933__IEI& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__LinkIntegrityIE_iei_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__LinkIntegrityIE_iei_decoder(OCTETSTRING& input_stream, Q933__IEI& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__LinkIntegrityIE_iei_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__LinkIntegrityIE_len_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__LinkIntegrityIE_len_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__LinkIntegrityIE_len_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__LinkIntegrityIE_len_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__LinkIntegrityIE_send__seq__nr_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__LinkIntegrityIE_send__seq__nr_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__LinkIntegrityIE_send__seq__nr_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__LinkIntegrityIE_send__seq__nr_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__LinkIntegrityIE_recv__seq__nr_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__LinkIntegrityIE_recv__seq__nr_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__LinkIntegrityIE_recv__seq__nr_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__LinkIntegrityIE_recv__seq__nr_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__LinkIntegrityIE_encoder(const Q933__LinkIntegrityIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_LinkIntegrityIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__LinkIntegrityIE_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__LinkIntegrityIE_decoder(OCTETSTRING& input_stream, Q933__LinkIntegrityIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_LinkIntegrityIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__LinkIntegrityIE_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__STATUS__Msg_link__int_encoder(const Q933__LinkIntegrityIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_LinkIntegrityIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__STATUS__Msg_link__int_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__STATUS__Msg_link__int_decoder(OCTETSTRING& input_stream, Q933__LinkIntegrityIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_LinkIntegrityIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__STATUS__Msg_link__int_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatusIE_iei_encoder(const Q933__IEI& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatusIE_iei_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatusIE_iei_decoder(OCTETSTRING& input_stream, Q933__IEI& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_IEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatusIE_iei_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatusIE_len_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatusIE_len_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatusIE_len_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatusIE_len_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

boolean operator==(null_type, const Q933__PvcStatusRec& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @Q933_Types.Q933_PvcStatusRec.");
return other_value.val_ptr->n_elements == 0;
}

void Q933__PvcStatus_spare_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_spare_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_spare_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_spare_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_dlci__high_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_dlci__high_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_dlci__high_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_dlci__high_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_ext1_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_ext1_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_ext1_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_ext1_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_dlci__low_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_dlci__low_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_dlci__low_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_dlci__low_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_spare0_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_spare0_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_spare0_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_spare0_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_ext1___encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_ext1___descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_ext1___decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_ext1___descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_spare0___encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_spare0___descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_spare0___decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_spare0___descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_new__encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_new__descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_new__decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_new__descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_delete__encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_delete__descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_delete__decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_delete__descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_active_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_active_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_active_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_active_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_reserved0_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_reserved0_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_reserved0_decoder(OCTETSTRING& input_stream, BITSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_reserved0_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatus_encoder(const Q933__PvcStatus& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatus_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatus_decoder(OCTETSTRING& input_stream, Q933__PvcStatus& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatus_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatusRec_0_encoder(const Q933__PvcStatus& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatusRec_0_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatusRec_0_decoder(OCTETSTRING& input_stream, Q933__PvcStatus& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatusRec_0_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatusRec_encoder(const Q933__PvcStatusRec& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusRec' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatusRec_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatusRec_decoder(OCTETSTRING& input_stream, Q933__PvcStatusRec& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusRec' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatusRec_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatusIE_pvc__status_encoder(const Q933__PvcStatusRec& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusRec' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatusIE_pvc__status_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatusIE_pvc__status_decoder(OCTETSTRING& input_stream, Q933__PvcStatusRec& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusRec' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatusIE_pvc__status_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PvcStatusIE_encoder(const Q933__PvcStatusIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PvcStatusIE_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PvcStatusIE_decoder(OCTETSTRING& input_stream, Q933__PvcStatusIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PvcStatusIE_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__STATUS__Msg_pvc__status_encoder(const Q933__PvcStatusIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__STATUS__Msg_pvc__status_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__STATUS__Msg_pvc__status_decoder(OCTETSTRING& input_stream, Q933__PvcStatusIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PvcStatusIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__STATUS__Msg_pvc__status_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__STATUS__Msg_encoder(const Q933__STATUS__Msg& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATUS_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__STATUS__Msg_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__STATUS__Msg_decoder(OCTETSTRING& input_stream, Q933__STATUS__Msg& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATUS_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__STATUS__Msg_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__STATEUS__ENQ__Msg_rep__type_encoder(const Q933__ReportTypeIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_ReportTypeIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__STATEUS__ENQ__Msg_rep__type_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__STATEUS__ENQ__Msg_rep__type_decoder(OCTETSTRING& input_stream, Q933__ReportTypeIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_ReportTypeIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__STATEUS__ENQ__Msg_rep__type_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__STATEUS__ENQ__Msg_link__int_encoder(const Q933__LinkIntegrityIE& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_LinkIntegrityIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__STATEUS__ENQ__Msg_link__int_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__STATEUS__ENQ__Msg_link__int_decoder(OCTETSTRING& input_stream, Q933__LinkIntegrityIE& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_LinkIntegrityIE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__STATEUS__ENQ__Msg_link__int_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__STATEUS__ENQ__Msg_encoder(const Q933__STATEUS__ENQ__Msg& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATEUS_ENQ_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__STATEUS__ENQ__Msg_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__STATEUS__ENQ__Msg_decoder(OCTETSTRING& input_stream, Q933__STATEUS__ENQ__Msg& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATEUS_ENQ_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__STATEUS__ENQ__Msg_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__Payload_status_encoder(const Q933__STATUS__Msg& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATUS_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__Payload_status_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__Payload_status_decoder(OCTETSTRING& input_stream, Q933__STATUS__Msg& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATUS_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__Payload_status_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__Payload_status__enq_encoder(const Q933__STATEUS__ENQ__Msg& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATEUS_ENQ_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__Payload_status__enq_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__Payload_status__enq_decoder(OCTETSTRING& input_stream, Q933__STATEUS__ENQ__Msg& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_STATEUS_ENQ_Msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__Payload_status__enq_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__Payload_other_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__Payload_other_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__Payload_other_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__Payload_other_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__Payload_encoder(const Q933__Payload& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_Payload' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__Payload_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__Payload_decoder(OCTETSTRING& input_stream, Q933__Payload& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_Payload' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__Payload_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PDU_prot__disc_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PDU_prot__disc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PDU_prot__disc_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PDU_prot__disc_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PDU_call__ref_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PDU_call__ref_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PDU_call__ref_decoder(OCTETSTRING& input_stream, OCTETSTRING& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PDU_call__ref_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PDU_msg__type_encoder(const Q931__Types::Q931__MessageType& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q931_Types.Q931_MessageType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PDU_msg__type_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PDU_msg__type_decoder(OCTETSTRING& input_stream, Q931__Types::Q931__MessageType& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q931_Types.Q931_MessageType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PDU_msg__type_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PDU_body_encoder(const Q933__Payload& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_Payload' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PDU_body_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PDU_body_decoder(OCTETSTRING& input_stream, Q933__Payload& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_Payload' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PDU_body_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void Q933__PDU_encoder(const Q933__PDU& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PDU' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(Q933__PDU_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER Q933__PDU_decoder(OCTETSTRING& input_stream, Q933__PDU& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Q933_Types.Q933_PDU' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(Q933__PDU_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

OCTETSTRING enc__Q933__PDU(const Q933__PDU& si)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_Q933_PDU(): Encoding @Q933_Types.Q933_PDU: ");
si.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
si.encode(Q933__PDU_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW, 0);
OCTETSTRING ret_val;
ttcn_buffer.get_string(ret_val);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_Q933_PDU(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

Q933__PDU dec__Q933__PDU(const OCTETSTRING& stream)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_Q933_PDU(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
Q933__PDU ret_val;
ret_val.decode(Q933__PDU_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_Q933_PDU(): Decoded @Q933_Types.Q933_PDU: ");
ret_val.log();
TTCN_Logger::end_event();
}
if (TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) {
if (ttcn_buffer.get_pos() < ttcn_buffer.get_len()) {
ttcn_buffer.cut();
OCTETSTRING tmp_os;
ttcn_buffer.get_string(tmp_os);
TTCN_Logger::begin_event_log2str();
tmp_os.log();
CHARSTRING remaining_stream = TTCN_Logger::end_event_log2str();
TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_EXTRA_DATA, "dec_Q933_PDU(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

Q933__PDU_template tr__Q933__STATUS__ENQ(const Q933__TypeOfReport_template& rep__type)
{
TTCN_Location current_location("Q933_Types.ttcn", 120, TTCN_Location::LOCATION_TEMPLATE, "tr_Q933_STATUS_ENQ");
Q933__PDU_template ret_val(tr__Q933__LMI__PDU);
ret_val.msg__type() = Q931__Types::Q931__MessageType::Q931__MSGT__STATUS__ENQ;
{
Q933__STATEUS__ENQ__Msg_template& tmp_1 = ret_val.body().status__enq();
tmp_1.rep__type() = tr__Q933__RepTypeIE(rep__type);
tmp_1.link__int() = ANY_VALUE;
}
return ret_val;
}

Q933__PDU_template ts__Q933__STATUS__ENQ(const Q933__TypeOfReport_template& rep__type, const Q933__LinkIntegrityIE_template& link__int)
{
TTCN_Location current_location("Q933_Types.ttcn", 131, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933_STATUS_ENQ");
Q933__PDU_template ret_val(ts__Q933__LMI__PDU);
ret_val.msg__type() = Q931__Types::Q931__MessageType::Q931__MSGT__STATUS__ENQ;
{
Q933__STATEUS__ENQ__Msg_template& tmp_2 = ret_val.body().status__enq();
tmp_2.rep__type() = ts__Q933__RepTypeIE(rep__type);
tmp_2.link__int() = link__int;
}
return ret_val;
}

Q933__PDU_template tr__Q933__STATUS(const Q933__TypeOfReport_template& rep__type, const Q933__LinkIntegrityIE_template& link__int, const Q933__PvcStatusIE_template& pvc__sts)
{
TTCN_Location current_location("Q933_Types.ttcn", 143, TTCN_Location::LOCATION_TEMPLATE, "tr_Q933_STATUS");
Q933__PDU_template ret_val(tr__Q933__LMI__PDU);
ret_val.msg__type() = Q931__Types::Q931__MessageType::Q931__MSGT__STATUS;
{
Q933__STATUS__Msg_template& tmp_3 = ret_val.body().status();
tmp_3.rep__type() = tr__Q933__RepTypeIE(rep__type);
tmp_3.link__int() = link__int;
tmp_3.pvc__status() = pvc__sts;
}
return ret_val;
}

Q933__PDU_template ts__Q933__STATUS(const Q933__TypeOfReport_template& rep__type, const Q933__LinkIntegrityIE_template& link__int, const Q933__PvcStatusIE_template& pvc__sts)
{
TTCN_Location current_location("Q933_Types.ttcn", 157, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933_STATUS");
Q933__PDU_template ret_val(ts__Q933__LMI__PDU);
ret_val.msg__type() = Q931__Types::Q931__MessageType::Q931__MSGT__STATUS;
{
Q933__STATUS__Msg_template& tmp_4 = ret_val.body().status();
tmp_4.rep__type() = ts__Q933__RepTypeIE(rep__type);
tmp_4.link__int() = link__int;
tmp_4.pvc__status() = pvc__sts;
}
return ret_val;
}

Q933__LinkIntegrityIE_template tr__Q933__LinkIntIE(const INTEGER_template& send__seq__nr, const INTEGER_template& recv__seq__nr)
{
TTCN_Location current_location("Q933_Types.ttcn", 172, TTCN_Location::LOCATION_TEMPLATE, "tr_Q933_LinkIntIE");
Q933__LinkIntegrityIE_template ret_val;
ret_val.iei() = Q933__IEI::Q933__IEI__LINK__INTEGRITY;
ret_val.len() = 2;
ret_val.send__seq__nr() = send__seq__nr;
ret_val.recv__seq__nr() = recv__seq__nr;
return ret_val;
}

Q933__LinkIntegrityIE_template ts__Q933__LinkIntIE(const INTEGER_template& send__seq__nr, const INTEGER_template& recv__seq__nr)
{
TTCN_Location current_location("Q933_Types.ttcn", 179, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933_LinkIntIE");
Q933__LinkIntegrityIE_template ret_val;
ret_val.iei() = Q933__IEI::Q933__IEI__LINK__INTEGRITY;
ret_val.len() = 2;
ret_val.send__seq__nr() = send__seq__nr;
ret_val.recv__seq__nr() = recv__seq__nr;
return ret_val;
}

Q933__PvcStatus_template tr__Q933__PvcStatus(const INTEGER& dlci, const BOOLEAN_template& new_, const BOOLEAN_template& delete_, const BOOLEAN_template& active)
{
TTCN_Location current_location("Q933_Types.ttcn", 187, TTCN_Location::LOCATION_TEMPLATE, "tr_Q933_PvcStatus");
Q933__PvcStatus_template ret_val;
ret_val.spare() = bs_0;
ret_val.dlci__high() = substr(int2bit(dlci, 10), 0, 6);
ret_val.ext1() = bs_1;
ret_val.dlci__low() = substr(int2bit(dlci, 10), 6, 4);
ret_val.spare0() = bs_2;
ret_val.ext1__() = bs_1;
ret_val.spare0__() = bs_2;
ret_val.new_() = new_;
ret_val.delete_() = delete_;
ret_val.active() = active;
ret_val.reserved0() = bs_3;
return ret_val;
}

Q933__PvcStatus_template ts__Q933__PvcStatus(const INTEGER& dlci, const BOOLEAN& new_, const BOOLEAN& delete_, const BOOLEAN& active)
{
TTCN_Location current_location("Q933_Types.ttcn", 203, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933_PvcStatus");
Q933__PvcStatus_template ret_val;
ret_val.spare() = bs_0;
ret_val.dlci__high() = substr(int2bit(dlci, 10), 0, 6);
ret_val.ext1() = bs_1;
ret_val.dlci__low() = substr(int2bit(dlci, 10), 6, 4);
ret_val.spare0() = bs_2;
ret_val.ext1__() = bs_1;
ret_val.spare0__() = bs_2;
ret_val.new_() = new_;
ret_val.delete_() = delete_;
ret_val.active() = active;
ret_val.reserved0() = bs_3;
return ret_val;
}

Q933__PvcStatusIE_template tr__Q933__PvcStatusIE(const Q933__PvcStatusRec_template& srec)
{
TTCN_Location current_location("Q933_Types.ttcn", 217, TTCN_Location::LOCATION_TEMPLATE, "tr_Q933_PvcStatusIE");
Q933__PvcStatusIE_template ret_val;
ret_val.iei() = Q933__IEI::Q933__IEI__PVC__STATUS;
ret_val.len() = ANY_VALUE;
ret_val.pvc__status() = srec;
return ret_val;
}

Q933__PvcStatusIE_template ts__Q933__PvcStatusIE(const Q933__PvcStatusRec_template& srec)
{
TTCN_Location current_location("Q933_Types.ttcn", 223, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933_PvcStatusIE");
Q933__PvcStatusIE_template ret_val;
ret_val.iei() = Q933__IEI::Q933__IEI__PVC__STATUS;
ret_val.len() = 0;
ret_val.pvc__status() = srec;
return ret_val;
}

Q933__ReportTypeIE_template tr__Q933__RepTypeIE(const Q933__TypeOfReport_template& rept)
{
TTCN_Location current_location("Q933_Types.ttcn", 229, TTCN_Location::LOCATION_TEMPLATE, "tr_Q933_RepTypeIE");
Q933__ReportTypeIE_template ret_val;
ret_val.iei() = Q933__IEI::Q933__IEI__REPORT__TYPE;
ret_val.len() = ANY_VALUE;
ret_val.type__of__rep() = rept;
return ret_val;
}

Q933__ReportTypeIE_template ts__Q933__RepTypeIE(const Q933__TypeOfReport_template& rept)
{
TTCN_Location current_location("Q933_Types.ttcn", 235, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933_RepTypeIE");
Q933__ReportTypeIE_template ret_val;
ret_val.iei() = Q933__IEI::Q933__IEI__REPORT__TYPE;
ret_val.len() = 0;
ret_val.type__of__rep() = rept;
return ret_val;
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("Q933_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Q933_Types");
Osmocom__Types::module_object.pre_init_module();
Q931__Types::module_object.pre_init_module();
module_object.add_function("enc_Q933_PDU", (genericfunc_t)&enc__Q933__PDU, NULL);
module_object.add_function("dec_Q933_PDU", (genericfunc_t)&dec__Q933__PDU, NULL);
}

void post_init_module()
{
TTCN_Location current_location("Q933_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Q933_Types");
Osmocom__Types::module_object.post_init_module();
Q931__Types::module_object.post_init_module();
current_location.update_lineno(106);
/* Q933_Types.ttcn, line 106 */
template_tr__Q933__LMI__PDU.prot__disc() = os_0;
template_tr__Q933__LMI__PDU.call__ref() = os_1;
{
Q931__Types::Q931__MessageType_template& tmp_0 = template_tr__Q933__LMI__PDU.msg__type();
tmp_0.set_type(VALUE_LIST, 2);
tmp_0.list_item(0) = Q931__Types::Q931__MessageType::Q931__MSGT__STATUS;
tmp_0.list_item(1) = Q931__Types::Q931__MessageType::Q931__MSGT__STATUS__ENQ;
}
template_tr__Q933__LMI__PDU.body() = ANY_VALUE;
current_location.update_lineno(113);
/* Q933_Types.ttcn, line 113 */
template_ts__Q933__LMI__PDU.prot__disc() = os_0;
template_ts__Q933__LMI__PDU.call__ref() = os_1;
template_ts__Q933__LMI__PDU.check_restriction(TR_VALUE);
current_location.update_lineno(120);
/* Q933_Types.ttcn, line 120 */
template_tr__Q933__STATUS__ENQ_rep__type_defval = ANY_VALUE;
current_location.update_lineno(143);
/* Q933_Types.ttcn, line 143 */
template_tr__Q933__STATUS_rep__type_defval = ANY_VALUE;
current_location.update_lineno(144);
/* Q933_Types.ttcn, line 144 */
template_tr__Q933__STATUS_link__int_defval = ANY_OR_OMIT;
current_location.update_lineno(145);
/* Q933_Types.ttcn, line 145 */
template_tr__Q933__STATUS_pvc__sts_defval = ANY_OR_OMIT;
current_location.update_lineno(159);
/* Q933_Types.ttcn, line 159 */
template_ts__Q933__STATUS_pvc__sts_defval = OMIT_VALUE;
current_location.update_lineno(229);
/* Q933_Types.ttcn, line 229 */
template_tr__Q933__RepTypeIE_rept_defval = ANY_VALUE;
}


} /* end of namespace */
