// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version 9.0.0
// The generation of user and time information were disabled by the -D flag.

// Copyright (c) 2000-2023 Ericsson Telecom AB

// Do not edit this file unless you know what you are doing.

/* Including header files */

#include "MTP3asp_Types.hh"

namespace MTP3asp__Types {

/* Literal string constants */

const unsigned char bs_0_bits[] = { 0 },
bs_1_bits[] = { 0 };
extern const BITSTRING bs_0(2, bs_0_bits),
bs_1(4, bs_1_bits);
const unsigned char module_checksum[] = { 0x53, 0xf8, 0x31, 0x48, 0x29, 0x56, 0x67, 0x15, 0x6d, 0x6f, 0x2e, 0xdc, 0x7e, 0xf9, 0x32, 0x00 };

/* Global variable definitions */

const TTCN_RAWdescriptor_t MTP3__Field__sio_ni_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,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       MTP3__Field__sio_ni_xer_ = { {"ni>\n", "ni>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__Field__sio_ni_descr_ = { "@MTP3asp_Types.MTP3_Field_sio.ni", &BITSTRING_ber_, &MTP3__Field__sio_ni_raw_, NULL, &MTP3__Field__sio_ni_xer_, &BITSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__Field__sio_ni_default_coding("RAW");
const TTCN_RAWdescriptor_t MTP3__Field__sio_prio_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,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       MTP3__Field__sio_prio_xer_ = { {"prio>\n", "prio>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__Field__sio_prio_descr_ = { "@MTP3asp_Types.MTP3_Field_sio.prio", &BITSTRING_ber_, &MTP3__Field__sio_prio_raw_, NULL, &MTP3__Field__sio_prio_xer_, &BITSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__Field__sio_prio_default_coding("RAW");
const TTCN_RAWdescriptor_t MTP3__Field__sio_si_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,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       MTP3__Field__sio_si_xer_ = { {"si>\n", "si>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__Field__sio_si_descr_ = { "@MTP3asp_Types.MTP3_Field_sio.si", &BITSTRING_ber_, &MTP3__Field__sio_si_raw_, NULL, &MTP3__Field__sio_si_xer_, &BITSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__Field__sio_si_default_coding("RAW");
const TTCN_RAWdescriptor_t MTP3__Field__sio_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,NULL,false};
// No XER for MTP3__Field__sio
const TTCN_Typedescriptor_t MTP3__Field__sio_descr_ = { "@MTP3asp_Types.MTP3_Field_sio", NULL, &MTP3__Field__sio_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__Field__sio_default_coding("RAW");
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERind_sio_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERind_opc_raw_ = {32,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__MTP3__TRANSFERind_opc_xer_ = { {"opc>\n", "opc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERind_opc_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERind.opc", &INTEGER_ber_, &ASP__MTP3__TRANSFERind_opc_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERind_opc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERind_opc_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERind_dpc_raw_ = {32,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__MTP3__TRANSFERind_dpc_xer_ = { {"dpc>\n", "dpc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERind_dpc_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERind.dpc", &INTEGER_ber_, &ASP__MTP3__TRANSFERind_dpc_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERind_dpc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERind_dpc_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERind_sls_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__MTP3__TRANSFERind_sls_xer_ = { {"sls>\n", "sls>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERind_sls_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERind.sls", &INTEGER_ber_, &ASP__MTP3__TRANSFERind_sls_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERind_sls_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERind_sls_default_coding("RAW");
const XERdescriptor_t       ASP__MTP3__TRANSFERind_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ASP__MTP3__TRANSFERind_data_oer_ext_arr_[0] = {};
const int ASP__MTP3__TRANSFERind_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t ASP__MTP3__TRANSFERind_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ASP__MTP3__TRANSFERind_data_oer_ext_arr_, 0, ASP__MTP3__TRANSFERind_data_oer_p_};
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERind_data_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERind.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ASP__MTP3__TRANSFERind_data_xer_, &OCTETSTRING_json_, &ASP__MTP3__TRANSFERind_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERind_data_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERind_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for ASP__MTP3__TRANSFERind
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERind_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERind", NULL, &ASP__MTP3__TRANSFERind_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERind_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__PAUSE_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for ASP__MTP3__PAUSE
const TTCN_Typedescriptor_t ASP__MTP3__PAUSE_descr_ = { "@MTP3asp_Types.ASP_MTP3_PAUSE", NULL, &ASP__MTP3__PAUSE_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__PAUSE_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__RESUME_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for ASP__MTP3__RESUME
const TTCN_Typedescriptor_t ASP__MTP3__RESUME_descr_ = { "@MTP3asp_Types.ASP_MTP3_RESUME", NULL, &ASP__MTP3__RESUME_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__RESUME_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__STATUS_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for ASP__MTP3__STATUS
const TTCN_Typedescriptor_t ASP__MTP3__STATUS_descr_ = { "@MTP3asp_Types.ASP_MTP3_STATUS", NULL, &ASP__MTP3__STATUS_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__STATUS_default_coding("RAW");
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq_sio_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERreq_opc_raw_ = {32,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__MTP3__TRANSFERreq_opc_xer_ = { {"opc>\n", "opc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq_opc_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERreq.opc", &INTEGER_ber_, &ASP__MTP3__TRANSFERreq_opc_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERreq_opc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq_opc_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERreq_dpc_raw_ = {32,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__MTP3__TRANSFERreq_dpc_xer_ = { {"dpc>\n", "dpc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq_dpc_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERreq.dpc", &INTEGER_ber_, &ASP__MTP3__TRANSFERreq_dpc_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERreq_dpc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq_dpc_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERreq_sls_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__MTP3__TRANSFERreq_sls_xer_ = { {"sls>\n", "sls>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq_sls_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERreq.sls", &INTEGER_ber_, &ASP__MTP3__TRANSFERreq_sls_raw_, &INTEGER_text_, &ASP__MTP3__TRANSFERreq_sls_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq_sls_default_coding("RAW");
const XERdescriptor_t       ASP__MTP3__TRANSFERreq_data_xer_ = { {"data>\n", "data>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ASP__MTP3__TRANSFERreq_data_oer_ext_arr_[0] = {};
const int ASP__MTP3__TRANSFERreq_data_oer_p_[0] = {};
const TTCN_OERdescriptor_t ASP__MTP3__TRANSFERreq_data_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ASP__MTP3__TRANSFERreq_data_oer_ext_arr_, 0, ASP__MTP3__TRANSFERreq_data_oer_p_};
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq_data_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERreq.data", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &ASP__MTP3__TRANSFERreq_data_xer_, &OCTETSTRING_json_, &ASP__MTP3__TRANSFERreq_data_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq_data_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__MTP3__TRANSFERreq_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for ASP__MTP3__TRANSFERreq
const TTCN_Typedescriptor_t ASP__MTP3__TRANSFERreq_descr_ = { "@MTP3asp_Types.ASP_MTP3_TRANSFERreq", NULL, &ASP__MTP3__TRANSFERreq_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__MTP3__TRANSFERreq_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__REGISTER__M3UA_ni_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__REGISTER__M3UA_ni_xer_ = { {"ni>\n", "ni>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__REGISTER__M3UA_ni_descr_ = { "@MTP3asp_Types.ASP_REGISTER_M3UA.ni", &INTEGER_ber_, &ASP__REGISTER__M3UA_ni_raw_, &INTEGER_text_, &ASP__REGISTER__M3UA_ni_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__REGISTER__M3UA_ni_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__REGISTER__M3UA_sut__pc_raw_ = {32,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__REGISTER__M3UA_sut__pc_xer_ = { {"sut_pc>\n", "sut_pc>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__REGISTER__M3UA_sut__pc_descr_ = { "@MTP3asp_Types.ASP_REGISTER_M3UA.sut_pc", &INTEGER_ber_, &ASP__REGISTER__M3UA_sut__pc_raw_, &INTEGER_text_, &ASP__REGISTER__M3UA_sut__pc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__REGISTER__M3UA_sut__pc_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__REGISTER__M3UA_tester__pc_raw_ = {32,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__REGISTER__M3UA_tester__pc_xer_ = { {"tester_pc>\n", "tester_pc>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__REGISTER__M3UA_tester__pc_descr_ = { "@MTP3asp_Types.ASP_REGISTER_M3UA.tester_pc", &INTEGER_ber_, &ASP__REGISTER__M3UA_tester__pc_raw_, &INTEGER_text_, &ASP__REGISTER__M3UA_tester__pc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__REGISTER__M3UA_tester__pc_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__REGISTER__M3UA_m3ua__version_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       ASP__REGISTER__M3UA_m3ua__version_xer_ = { {"m3ua_version>\n", "m3ua_version>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__REGISTER__M3UA_m3ua__version_descr_ = { "@MTP3asp_Types.ASP_REGISTER_M3UA.m3ua_version", &INTEGER_ber_, &ASP__REGISTER__M3UA_m3ua__version_raw_, &INTEGER_text_, &ASP__REGISTER__M3UA_m3ua__version_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__REGISTER__M3UA_m3ua__version_default_coding("RAW");
const XERdescriptor_t       ASP__REGISTER__M3UA_entity_xer_ = { {"entity>\n", "entity>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ASP__REGISTER__M3UA_entity_descr_ = { "@MTP3asp_Types.ASP_REGISTER_M3UA.entity", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ASP__REGISTER__M3UA_entity_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__REGISTER__M3UA_entity_default_coding("RAW");
const TTCN_RAWdescriptor_t ASP__REGISTER__M3UA_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for ASP__REGISTER__M3UA
const TTCN_Typedescriptor_t ASP__REGISTER__M3UA_descr_ = { "@MTP3asp_Types.ASP_REGISTER_M3UA", NULL, &ASP__REGISTER__M3UA_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ASP__REGISTER__M3UA_default_coding("RAW");
INTEGER const_reg__ok__status;
const INTEGER& reg__ok__status = const_reg__ok__status;
INTEGER const_reg__error__status;
const INTEGER& reg__error__status = const_reg__error__status;
INTEGER const_unreg__ok__status;
const INTEGER& unreg__ok__status = const_unreg__ok__status;
INTEGER const_unreg__error__status;
const INTEGER& unreg__error__status = const_unreg__error__status;
INTEGER const_send__error__status;
const INTEGER& send__error__status = const_send__error__status;
INTEGER const_kill__status;
const INTEGER& kill__status = const_kill__status;
INTEGER const_SCTP__COMLOST__pause;
const INTEGER& SCTP__COMLOST__pause = const_SCTP__COMLOST__pause;
INTEGER const_M3UA__ASPDN__pause;
const INTEGER& M3UA__ASPDN__pause = const_M3UA__ASPDN__pause;
INTEGER const_M3UA__ASPIA__pause;
const INTEGER& M3UA__ASPIA__pause = const_M3UA__ASPIA__pause;
INTEGER const_ok__resume;
const INTEGER& ok__resume = const_ok__resume;
const TTCN_RAWdescriptor_t MTP3__to__SCTPserver__data_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for MTP3__to__SCTPserver__data
const TTCN_Typedescriptor_t MTP3__to__SCTPserver__data_descr_ = { "@MTP3asp_Types.MTP3_to_SCTPserver_data", NULL, &MTP3__to__SCTPserver__data_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_transfer__ind_default_coding("RAW");
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_transfer__req_default_coding("RAW");
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_register__default_coding("RAW");
const XERdescriptor_t       MTP3__to__SCTPserver__data_unregister_xer_ = { {"unregister>\n", "unregister>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__to__SCTPserver__data_unregister_descr_ = { "@MTP3asp_Types.MTP3_to_SCTPserver_data.unregister", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MTP3__to__SCTPserver__data_unregister_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_unregister_default_coding("RAW");
const XERdescriptor_t       MTP3__to__SCTPserver__data_status_xer_ = { {"status>\n", "status>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__to__SCTPserver__data_status_descr_ = { "@MTP3asp_Types.MTP3_to_SCTPserver_data.status", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MTP3__to__SCTPserver__data_status_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_status_default_coding("RAW");
const XERdescriptor_t       MTP3__to__SCTPserver__data_pause_xer_ = { {"pause>\n", "pause>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__to__SCTPserver__data_pause_descr_ = { "@MTP3asp_Types.MTP3_to_SCTPserver_data.pause", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MTP3__to__SCTPserver__data_pause_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_pause_default_coding("RAW");
const XERdescriptor_t       MTP3__to__SCTPserver__data_resume_xer_ = { {"resume>\n", "resume>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__to__SCTPserver__data_resume_descr_ = { "@MTP3asp_Types.MTP3_to_SCTPserver_data.resume", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MTP3__to__SCTPserver__data_resume_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_resume_default_coding("RAW");
UNIVERSAL_CHARSTRING MTP3__to__SCTPserver__data_default_coding("RAW");
INTEGER const_transfer__ind__msgType;
const INTEGER& transfer__ind__msgType = const_transfer__ind__msgType;
INTEGER const_transfer__req__msgType;
const INTEGER& transfer__req__msgType = const_transfer__req__msgType;
INTEGER const_register__msgType;
const INTEGER& register__msgType = const_register__msgType;
INTEGER const_unregister__msgType;
const INTEGER& unregister__msgType = const_unregister__msgType;
INTEGER const_status__msgType;
const INTEGER& status__msgType = const_status__msgType;
INTEGER const_pause__msgType;
const INTEGER& pause__msgType = const_pause__msgType;
INTEGER const_resume__msgType;
const INTEGER& resume__msgType = const_resume__msgType;
const XERdescriptor_t       MTP3__to__M3UAserver__msg_msgType_xer_ = { {"msgType>\n", "msgType>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__to__M3UAserver__msg_msgType_descr_ = { "@MTP3asp_Types.MTP3_to_M3UAserver_msg.msgType", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &MTP3__to__M3UAserver__msg_msgType_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__M3UAserver__msg_msgType_default_coding("RAW");
const TTCN_RAWdescriptor_t MTP3__to__M3UAserver__msg_msgLength_raw_ = {32,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t       MTP3__to__M3UAserver__msg_msgLength_xer_ = { {"msgLength>\n", "msgLength>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MTP3__to__M3UAserver__msg_msgLength_descr_ = { "@MTP3asp_Types.MTP3_to_M3UAserver_msg.msgLength", &INTEGER_ber_, &MTP3__to__M3UAserver__msg_msgLength_raw_, &INTEGER_text_, &MTP3__to__M3UAserver__msg_msgLength_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__M3UAserver__msg_msgLength_default_coding("RAW");
const TTCN_RAWdescriptor_t MTP3__to__M3UAserver__msg_data_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for MTP3__to__M3UAserver__msg_data
const TTCN_Typedescriptor_t MTP3__to__M3UAserver__msg_data_descr_ = { "@MTP3asp_Types.MTP3_to_M3UAserver_msg.data", NULL, &MTP3__to__M3UAserver__msg_data_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__M3UAserver__msg_data_default_coding("RAW");
const TTCN_RAWdescriptor_t MTP3__to__M3UAserver__msg_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for MTP3__to__M3UAserver__msg
const TTCN_Typedescriptor_t MTP3__to__M3UAserver__msg_descr_ = { "@MTP3asp_Types.MTP3_to_M3UAserver_msg", NULL, &MTP3__to__M3UAserver__msg_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MTP3__to__M3UAserver__msg_default_coding("RAW");
ASP__MTP3__TRANSFERind_template template_tr__ASP__MTP3__TRANSFERind;
const ASP__MTP3__TRANSFERind_template& tr__ASP__MTP3__TRANSFERind = template_tr__ASP__MTP3__TRANSFERind;
ASP__MTP3__TRANSFERreq_template template_tr__ASP__MTP3__TRANSFERreq;
const ASP__MTP3__TRANSFERreq_template& tr__ASP__MTP3__TRANSFERreq = template_tr__ASP__MTP3__TRANSFERreq;
ASP__MTP3__TRANSFERind_template template_tr__ASP__MTP3__TRANSFERind__stc;
const ASP__MTP3__TRANSFERind_template& tr__ASP__MTP3__TRANSFERind__stc = template_tr__ASP__MTP3__TRANSFERind__stc;
TTCN_Module module_object("MTP3asp_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_9,
  current_runtime_version.requires_minor_version_0,
  current_runtime_version.requires_patch_level_0,  current_runtime_version.requires_runtime_1);

/* Member functions of C++ classes */

MTP3__Field__sio::MTP3__Field__sio()
{
}

MTP3__Field__sio::MTP3__Field__sio(const BITSTRING& par_ni,
    const BITSTRING& par_prio,
    const BITSTRING& par_si)
  :   field_ni(par_ni),
  field_prio(par_prio),
  field_si(par_si)
{
}

MTP3__Field__sio::MTP3__Field__sio(const MTP3__Field__sio& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MTP3asp_Types.MTP3_Field_sio.");
if (other_value.ni().is_bound()) field_ni = other_value.ni();
else field_ni.clean_up();
if (other_value.prio().is_bound()) field_prio = other_value.prio();
else field_prio.clean_up();
if (other_value.si().is_bound()) field_si = other_value.si();
else field_si.clean_up();
}

void MTP3__Field__sio::clean_up()
{
field_ni.clean_up();
field_prio.clean_up();
field_si.clean_up();
}

const TTCN_Typedescriptor_t* MTP3__Field__sio::get_descriptor() const { return &MTP3__Field__sio_descr_; }
MTP3__Field__sio& MTP3__Field__sio::operator=(const MTP3__Field__sio& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MTP3asp_Types.MTP3_Field_sio.");
  if (other_value.ni().is_bound()) field_ni = other_value.ni();
  else field_ni.clean_up();
  if (other_value.prio().is_bound()) field_prio = other_value.prio();
  else field_prio.clean_up();
  if (other_value.si().is_bound()) field_si = other_value.si();
  else field_si.clean_up();
}
return *this;
}

boolean MTP3__Field__sio::operator==(const MTP3__Field__sio& other_value) const
{
return field_ni==other_value.field_ni
  && field_prio==other_value.field_prio
  && field_si==other_value.field_si;
}

boolean MTP3__Field__sio::is_bound() const
{
return (field_ni.is_bound())
  || (field_prio.is_bound())
  || (field_si.is_bound());
}
boolean MTP3__Field__sio::is_value() const
{
return field_ni.is_value()
  && field_prio.is_value()
  && field_si.is_value();
}
void MTP3__Field__sio::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ni := ");
field_ni.log();
TTCN_Logger::log_event_str(", prio := ");
field_prio.log();
TTCN_Logger::log_event_str(", si := ");
field_si.log();
TTCN_Logger::log_event_str(" }");
}

void MTP3__Field__sio::set_implicit_omit()
{
if (ni().is_bound()) ni().set_implicit_omit();
if (prio().is_bound()) prio().set_implicit_omit();
if (si().is_bound()) si().set_implicit_omit();
}

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

void MTP3__Field__sio::encode_text(Text_Buf& text_buf) const
{
field_ni.encode_text(text_buf);
field_prio.encode_text(text_buf);
field_si.encode_text(text_buf);
}

void MTP3__Field__sio::decode_text(Text_Buf& text_buf)
{
field_ni.decode_text(text_buf);
field_prio.decode_text(text_buf);
field_si.decode_text(text_buf);
}

void MTP3__Field__sio::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MTP3__Field__sio::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MTP3__Field__sio::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, MTP3__Field__sio_ni_descr_.raw->forceomit);
  decoded_field_length = field_ni.RAW_decode(MTP3__Field__sio_ni_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, MTP3__Field__sio_prio_descr_.raw->forceomit);
  decoded_field_length = field_prio.RAW_decode(MTP3__Field__sio_prio_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, MTP3__Field__sio_si_descr_.raw->forceomit);
  decoded_field_length = field_si.RAW_decode(MTP3__Field__sio_si_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MTP3__Field__sio::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, MTP3__Field__sio_ni_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MTP3__Field__sio_prio_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MTP3__Field__sio_si_descr_.raw);
  encoded_length += field_ni.RAW_encode(MTP3__Field__sio_ni_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_prio.RAW_encode(MTP3__Field__sio_prio_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_si.RAW_encode(MTP3__Field__sio_si_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct MTP3__Field__sio_template::single_value_struct {
BITSTRING_template field_ni;
BITSTRING_template field_prio;
BITSTRING_template field_si;
};

void MTP3__Field__sio_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_ni = ANY_VALUE;
single_value->field_prio = ANY_VALUE;
single_value->field_si = ANY_VALUE;
}
}
}

void MTP3__Field__sio_template::copy_value(const MTP3__Field__sio& other_value)
{
single_value = new single_value_struct;
if (other_value.ni().is_bound()) {
  single_value->field_ni = other_value.ni();
} else {
  single_value->field_ni.clean_up();
}
if (other_value.prio().is_bound()) {
  single_value->field_prio = other_value.prio();
} else {
  single_value->field_prio.clean_up();
}
if (other_value.si().is_bound()) {
  single_value->field_si = other_value.si();
} else {
  single_value->field_si.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MTP3__Field__sio_template::copy_template(const MTP3__Field__sio_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ni().get_selection()) {
single_value->field_ni = other_value.ni();
} else {
single_value->field_ni.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.prio().get_selection()) {
single_value->field_prio = other_value.prio();
} else {
single_value->field_prio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si().get_selection()) {
single_value->field_si = other_value.si();
} else {
single_value->field_si.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 MTP3__Field__sio_template[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 MTP3__Field__sio_template(*other_value.implication_.precondition);
implication_.implied_template = new MTP3__Field__sio_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 @MTP3asp_Types.MTP3_Field_sio.");
break;
}
set_selection(other_value);
}

MTP3__Field__sio_template::MTP3__Field__sio_template()
{
}

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

MTP3__Field__sio_template::MTP3__Field__sio_template(const MTP3__Field__sio& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean MTP3__Field__sio_template::match(const MTP3__Field__sio& 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.ni().is_bound()) return FALSE;
if(!single_value->field_ni.match(other_value.ni(), legacy))return FALSE;
if(!other_value.prio().is_bound()) return FALSE;
if(!single_value->field_prio.match(other_value.prio(), legacy))return FALSE;
if(!other_value.si().is_bound()) return FALSE;
if(!single_value->field_si.match(other_value.si(), 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 @MTP3asp_Types.MTP3_Field_sio.");
}
return FALSE;
}

boolean MTP3__Field__sio_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_ni.is_bound()
 || single_value->field_prio.is_bound()
 || single_value->field_si.is_bound();
}

boolean MTP3__Field__sio_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ni.is_value()
 && single_value->field_prio.is_value()
 && single_value->field_si.is_value();
}

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

MTP3__Field__sio MTP3__Field__sio_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 @MTP3asp_Types.MTP3_Field_sio.");
MTP3__Field__sio ret_val;
if (single_value->field_ni.is_bound()) {
ret_val.ni() = single_value->field_ni.valueof();
}
if (single_value->field_prio.is_bound()) {
ret_val.prio() = single_value->field_prio.valueof();
}
if (single_value->field_si.is_bound()) {
ret_val.si() = single_value->field_si.valueof();
}
return ret_val;
}

void MTP3__Field__sio_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 @MTP3asp_Types.MTP3_Field_sio.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MTP3__Field__sio_template[list_length];
}

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

BITSTRING_template& MTP3__Field__sio_template::ni()
{
set_specific();
return single_value->field_ni;
}

const BITSTRING_template& MTP3__Field__sio_template::ni() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ni of a non-specific template of type @MTP3asp_Types.MTP3_Field_sio.");
return single_value->field_ni;
}

BITSTRING_template& MTP3__Field__sio_template::prio()
{
set_specific();
return single_value->field_prio;
}

const BITSTRING_template& MTP3__Field__sio_template::prio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field prio of a non-specific template of type @MTP3asp_Types.MTP3_Field_sio.");
return single_value->field_prio;
}

BITSTRING_template& MTP3__Field__sio_template::si()
{
set_specific();
return single_value->field_si;
}

const BITSTRING_template& MTP3__Field__sio_template::si() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si of a non-specific template of type @MTP3asp_Types.MTP3_Field_sio.");
return single_value->field_si;
}

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

void MTP3__Field__sio_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ni := ");
single_value->field_ni.log();
TTCN_Logger::log_event_str(", prio := ");
single_value->field_prio.log();
TTCN_Logger::log_event_str(", si := ");
single_value->field_si.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 MTP3__Field__sio_template::log_match(const MTP3__Field__sio& 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_ni.match(match_value.ni(), legacy)){
TTCN_Logger::log_logmatch_info(".ni");
single_value->field_ni.log_match(match_value.ni(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_prio.match(match_value.prio(), legacy)){
TTCN_Logger::log_logmatch_info(".prio");
single_value->field_prio.log_match(match_value.prio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si.match(match_value.si(), legacy)){
TTCN_Logger::log_logmatch_info(".si");
single_value->field_si.log_match(match_value.si(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}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("{ ni := ");
single_value->field_ni.log_match(match_value.ni(), legacy);
TTCN_Logger::log_event_str(", prio := ");
single_value->field_prio.log_match(match_value.prio(), legacy);
TTCN_Logger::log_event_str(", si := ");
single_value->field_si.log_match(match_value.si(), 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 MTP3__Field__sio_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ni.encode_text(text_buf);
single_value->field_prio.encode_text(text_buf);
single_value->field_si.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 @MTP3asp_Types.MTP3_Field_sio.");
}
}

void MTP3__Field__sio_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_ni.decode_text(text_buf);
single_value->field_prio.decode_text(text_buf);
single_value->field_si.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 MTP3__Field__sio_template[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 @MTP3asp_Types.MTP3_Field_sio.");
}
}

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

void MTP3__Field__sio_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_ni.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_Field_sio");
single_value->field_prio.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_Field_sio");
single_value->field_si.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_Field_sio");
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 : "@MTP3asp_Types.MTP3_Field_sio");
}

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

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

ASP__MTP3__TRANSFERind::ASP__MTP3__TRANSFERind()
{
}

ASP__MTP3__TRANSFERind::ASP__MTP3__TRANSFERind(const MTP3__Field__sio& par_sio,
    const INTEGER& par_opc,
    const INTEGER& par_dpc,
    const INTEGER& par_sls,
    const OCTETSTRING& par_data)
  :   field_sio(par_sio),
  field_opc(par_opc),
  field_dpc(par_dpc),
  field_sls(par_sls),
  field_data(par_data)
{
}

ASP__MTP3__TRANSFERind::ASP__MTP3__TRANSFERind(const ASP__MTP3__TRANSFERind& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
if (other_value.sio().is_bound()) field_sio = other_value.sio();
else field_sio.clean_up();
if (other_value.opc().is_bound()) field_opc = other_value.opc();
else field_opc.clean_up();
if (other_value.dpc().is_bound()) field_dpc = other_value.dpc();
else field_dpc.clean_up();
if (other_value.sls().is_bound()) field_sls = other_value.sls();
else field_sls.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void ASP__MTP3__TRANSFERind::clean_up()
{
field_sio.clean_up();
field_opc.clean_up();
field_dpc.clean_up();
field_sls.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* ASP__MTP3__TRANSFERind::get_descriptor() const { return &ASP__MTP3__TRANSFERind_descr_; }
ASP__MTP3__TRANSFERind& ASP__MTP3__TRANSFERind::operator=(const ASP__MTP3__TRANSFERind& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
  if (other_value.sio().is_bound()) field_sio = other_value.sio();
  else field_sio.clean_up();
  if (other_value.opc().is_bound()) field_opc = other_value.opc();
  else field_opc.clean_up();
  if (other_value.dpc().is_bound()) field_dpc = other_value.dpc();
  else field_dpc.clean_up();
  if (other_value.sls().is_bound()) field_sls = other_value.sls();
  else field_sls.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean ASP__MTP3__TRANSFERind::operator==(const ASP__MTP3__TRANSFERind& other_value) const
{
return field_sio==other_value.field_sio
  && field_opc==other_value.field_opc
  && field_dpc==other_value.field_dpc
  && field_sls==other_value.field_sls
  && field_data==other_value.field_data;
}

boolean ASP__MTP3__TRANSFERind::is_bound() const
{
return (field_sio.is_bound())
  || (field_opc.is_bound())
  || (field_dpc.is_bound())
  || (field_sls.is_bound())
  || (field_data.is_bound());
}
boolean ASP__MTP3__TRANSFERind::is_value() const
{
return field_sio.is_value()
  && field_opc.is_value()
  && field_dpc.is_value()
  && field_sls.is_value()
  && field_data.is_value();
}
void ASP__MTP3__TRANSFERind::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sio := ");
field_sio.log();
TTCN_Logger::log_event_str(", opc := ");
field_opc.log();
TTCN_Logger::log_event_str(", dpc := ");
field_dpc.log();
TTCN_Logger::log_event_str(", sls := ");
field_sls.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__MTP3__TRANSFERind::set_implicit_omit()
{
if (sio().is_bound()) sio().set_implicit_omit();
if (opc().is_bound()) opc().set_implicit_omit();
if (dpc().is_bound()) dpc().set_implicit_omit();
if (sls().is_bound()) sls().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

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

void ASP__MTP3__TRANSFERind::encode_text(Text_Buf& text_buf) const
{
field_sio.encode_text(text_buf);
field_opc.encode_text(text_buf);
field_dpc.encode_text(text_buf);
field_sls.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void ASP__MTP3__TRANSFERind::decode_text(Text_Buf& text_buf)
{
field_sio.decode_text(text_buf);
field_opc.decode_text(text_buf);
field_dpc.decode_text(text_buf);
field_sls.decode_text(text_buf);
field_data.decode_text(text_buf);
}

void ASP__MTP3__TRANSFERind::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ASP__MTP3__TRANSFERind::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ASP__MTP3__TRANSFERind::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, MTP3__Field__sio_descr_.raw->forceomit);
  decoded_field_length = field_sio.RAW_decode(MTP3__Field__sio_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, ASP__MTP3__TRANSFERind_opc_descr_.raw->forceomit);
  decoded_field_length = field_opc.RAW_decode(ASP__MTP3__TRANSFERind_opc_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, ASP__MTP3__TRANSFERind_dpc_descr_.raw->forceomit);
  decoded_field_length = field_dpc.RAW_decode(ASP__MTP3__TRANSFERind_dpc_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, ASP__MTP3__TRANSFERind_sls_descr_.raw->forceomit);
  decoded_field_length = field_sls.RAW_decode(ASP__MTP3__TRANSFERind_sls_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(OCTETSTRING_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ASP__MTP3__TRANSFERind::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MTP3__Field__sio_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ASP__MTP3__TRANSFERind_opc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ASP__MTP3__TRANSFERind_dpc_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ASP__MTP3__TRANSFERind_sls_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, OCTETSTRING_descr_.raw);
  encoded_length += field_sio.RAW_encode(MTP3__Field__sio_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_opc.RAW_encode(ASP__MTP3__TRANSFERind_opc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dpc.RAW_encode(ASP__MTP3__TRANSFERind_dpc_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_sls.RAW_encode(ASP__MTP3__TRANSFERind_sls_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_data.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct ASP__MTP3__TRANSFERind_template::single_value_struct {
MTP3__Field__sio_template field_sio;
INTEGER_template field_opc;
INTEGER_template field_dpc;
INTEGER_template field_sls;
OCTETSTRING_template field_data;
};

void ASP__MTP3__TRANSFERind_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_sio = ANY_VALUE;
single_value->field_opc = ANY_VALUE;
single_value->field_dpc = ANY_VALUE;
single_value->field_sls = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void ASP__MTP3__TRANSFERind_template::copy_value(const ASP__MTP3__TRANSFERind& other_value)
{
single_value = new single_value_struct;
if (other_value.sio().is_bound()) {
  single_value->field_sio = other_value.sio();
} else {
  single_value->field_sio.clean_up();
}
if (other_value.opc().is_bound()) {
  single_value->field_opc = other_value.opc();
} else {
  single_value->field_opc.clean_up();
}
if (other_value.dpc().is_bound()) {
  single_value->field_dpc = other_value.dpc();
} else {
  single_value->field_dpc.clean_up();
}
if (other_value.sls().is_bound()) {
  single_value->field_sls = other_value.sls();
} else {
  single_value->field_sls.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__MTP3__TRANSFERind_template::copy_template(const ASP__MTP3__TRANSFERind_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sio().get_selection()) {
single_value->field_sio = other_value.sio();
} else {
single_value->field_sio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.opc().get_selection()) {
single_value->field_opc = other_value.opc();
} else {
single_value->field_opc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dpc().get_selection()) {
single_value->field_dpc = other_value.dpc();
} else {
single_value->field_dpc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sls().get_selection()) {
single_value->field_sls = other_value.sls();
} else {
single_value->field_sls.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ASP__MTP3__TRANSFERind_template[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 ASP__MTP3__TRANSFERind_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__MTP3__TRANSFERind_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 @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
break;
}
set_selection(other_value);
}

ASP__MTP3__TRANSFERind_template::ASP__MTP3__TRANSFERind_template()
{
}

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

ASP__MTP3__TRANSFERind_template::ASP__MTP3__TRANSFERind_template(const ASP__MTP3__TRANSFERind& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__MTP3__TRANSFERind_template::match(const ASP__MTP3__TRANSFERind& 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.sio().is_bound()) return FALSE;
if(!single_value->field_sio.match(other_value.sio(), legacy))return FALSE;
if(!other_value.opc().is_bound()) return FALSE;
if(!single_value->field_opc.match(other_value.opc(), legacy))return FALSE;
if(!other_value.dpc().is_bound()) return FALSE;
if(!single_value->field_dpc.match(other_value.dpc(), legacy))return FALSE;
if(!other_value.sls().is_bound()) return FALSE;
if(!single_value->field_sls.match(other_value.sls(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.data(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
}
return FALSE;
}

boolean ASP__MTP3__TRANSFERind_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_sio.is_bound()
 || single_value->field_opc.is_bound()
 || single_value->field_dpc.is_bound()
 || single_value->field_sls.is_bound()
 || single_value->field_data.is_bound();
}

boolean ASP__MTP3__TRANSFERind_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sio.is_value()
 && single_value->field_opc.is_value()
 && single_value->field_dpc.is_value()
 && single_value->field_sls.is_value()
 && single_value->field_data.is_value();
}

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

ASP__MTP3__TRANSFERind ASP__MTP3__TRANSFERind_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 @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
ASP__MTP3__TRANSFERind ret_val;
if (single_value->field_sio.is_bound()) {
ret_val.sio() = single_value->field_sio.valueof();
}
if (single_value->field_opc.is_bound()) {
ret_val.opc() = single_value->field_opc.valueof();
}
if (single_value->field_dpc.is_bound()) {
ret_val.dpc() = single_value->field_dpc.valueof();
}
if (single_value->field_sls.is_bound()) {
ret_val.sls() = single_value->field_sls.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void ASP__MTP3__TRANSFERind_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 @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__MTP3__TRANSFERind_template[list_length];
}

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

MTP3__Field__sio_template& ASP__MTP3__TRANSFERind_template::sio()
{
set_specific();
return single_value->field_sio;
}

const MTP3__Field__sio_template& ASP__MTP3__TRANSFERind_template::sio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sio of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
return single_value->field_sio;
}

INTEGER_template& ASP__MTP3__TRANSFERind_template::opc()
{
set_specific();
return single_value->field_opc;
}

const INTEGER_template& ASP__MTP3__TRANSFERind_template::opc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field opc of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
return single_value->field_opc;
}

INTEGER_template& ASP__MTP3__TRANSFERind_template::dpc()
{
set_specific();
return single_value->field_dpc;
}

const INTEGER_template& ASP__MTP3__TRANSFERind_template::dpc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dpc of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
return single_value->field_dpc;
}

INTEGER_template& ASP__MTP3__TRANSFERind_template::sls()
{
set_specific();
return single_value->field_sls;
}

const INTEGER_template& ASP__MTP3__TRANSFERind_template::sls() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sls of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
return single_value->field_sls;
}

OCTETSTRING_template& ASP__MTP3__TRANSFERind_template::data()
{
set_specific();
return single_value->field_data;
}

const OCTETSTRING_template& ASP__MTP3__TRANSFERind_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
return single_value->field_data;
}

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

void ASP__MTP3__TRANSFERind_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sio := ");
single_value->field_sio.log();
TTCN_Logger::log_event_str(", opc := ");
single_value->field_opc.log();
TTCN_Logger::log_event_str(", dpc := ");
single_value->field_dpc.log();
TTCN_Logger::log_event_str(", sls := ");
single_value->field_sls.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void ASP__MTP3__TRANSFERind_template::log_match(const ASP__MTP3__TRANSFERind& 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_sio.match(match_value.sio(), legacy)){
TTCN_Logger::log_logmatch_info(".sio");
single_value->field_sio.log_match(match_value.sio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_opc.match(match_value.opc(), legacy)){
TTCN_Logger::log_logmatch_info(".opc");
single_value->field_opc.log_match(match_value.opc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dpc.match(match_value.dpc(), legacy)){
TTCN_Logger::log_logmatch_info(".dpc");
single_value->field_dpc.log_match(match_value.dpc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sls.match(match_value.sls(), legacy)){
TTCN_Logger::log_logmatch_info(".sls");
single_value->field_sls.log_match(match_value.sls(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ sio := ");
single_value->field_sio.log_match(match_value.sio(), legacy);
TTCN_Logger::log_event_str(", opc := ");
single_value->field_opc.log_match(match_value.opc(), legacy);
TTCN_Logger::log_event_str(", dpc := ");
single_value->field_dpc.log_match(match_value.dpc(), legacy);
TTCN_Logger::log_event_str(", sls := ");
single_value->field_sls.log_match(match_value.sls(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void ASP__MTP3__TRANSFERind_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_sio.decode_text(text_buf);
single_value->field_opc.decode_text(text_buf);
single_value->field_dpc.decode_text(text_buf);
single_value->field_sls.decode_text(text_buf);
single_value->field_data.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ASP__MTP3__TRANSFERind_template[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 @MTP3asp_Types.ASP_MTP3_TRANSFERind.");
}
}

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

void ASP__MTP3__TRANSFERind_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_sio.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERind");
single_value->field_opc.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERind");
single_value->field_dpc.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERind");
single_value->field_sls.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERind");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERind");
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 : "@MTP3asp_Types.ASP_MTP3_TRANSFERind");
}

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

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

ASP__MTP3__PAUSE::ASP__MTP3__PAUSE()
{
bound_flag = FALSE;
}

ASP__MTP3__PAUSE::ASP__MTP3__PAUSE(null_type)
{
bound_flag = TRUE;
}

ASP__MTP3__PAUSE::ASP__MTP3__PAUSE(const ASP__MTP3__PAUSE& other_value)
{
other_value.must_bound("Copying an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
bound_flag = TRUE;
}

ASP__MTP3__PAUSE& ASP__MTP3__PAUSE::operator=(null_type)
{
bound_flag = TRUE;
return *this;
}

ASP__MTP3__PAUSE& ASP__MTP3__PAUSE::operator=(const ASP__MTP3__PAUSE& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
bound_flag = TRUE;
return *this;
}

boolean ASP__MTP3__PAUSE::operator==(null_type) const
{
must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
return TRUE;
}

boolean ASP__MTP3__PAUSE::operator==(const ASP__MTP3__PAUSE& other_value) const
{
must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
other_value.must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
return TRUE;
}

void ASP__MTP3__PAUSE::log() const
{
if (bound_flag) TTCN_Logger::log_event_str("{ }");
else TTCN_Logger::log_event_unbound();
}

void ASP__MTP3__PAUSE::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "empty record/set value (i.e. { })");
  if (param.get_type()!=Module_Param::MP_Value_List || param.get_size()>0) {
    param.type_error("empty record/set value (i.e. { })", "@MTP3asp_Types.ASP_MTP3_PAUSE");
  }
  bound_flag = TRUE;
}

void ASP__MTP3__PAUSE::encode_text(Text_Buf& /*text_buf*/) const
{
must_bound("Text encoder: Encoding an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
}

void ASP__MTP3__PAUSE::decode_text(Text_Buf& /*text_buf*/)
{
bound_flag = TRUE;
}

void ASP__MTP3__PAUSE::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ASP__MTP3__PAUSE::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ASP__MTP3__PAUSE::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& /*myleaf*/) const
{
if (!bound_flag) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type %s.", p_td.name);
return 0;
}

int ASP__MTP3__PAUSE::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int, raw_order_t, boolean, int, boolean, const RAW_Force_Omit*)
{
bound_flag = TRUE;
return p_buf.increase_pos_padd(p_td.raw->prepadding) + p_buf.increase_pos_padd(p_td.raw->padding);
}

void ASP__MTP3__PAUSE_template::copy_template(const ASP__MTP3__PAUSE_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 ASP__MTP3__PAUSE_template[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 ASP__MTP3__PAUSE_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__MTP3__PAUSE_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 @MTP3asp_Types.ASP_MTP3_PAUSE.");
break;
}
}

ASP__MTP3__PAUSE_template::ASP__MTP3__PAUSE_template()
{
}

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

ASP__MTP3__PAUSE_template::ASP__MTP3__PAUSE_template(null_type)
 : Base_Template(SPECIFIC_VALUE)
{
}

ASP__MTP3__PAUSE_template::ASP__MTP3__PAUSE_template(const ASP__MTP3__PAUSE& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
}

ASP__MTP3__PAUSE_template::ASP__MTP3__PAUSE_template(const OPTIONAL<ASP__MTP3__PAUSE>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MTP3asp_Types.ASP_MTP3_PAUSE from an unbound optional field.");
}
}

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

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

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

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

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

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

ASP__MTP3__PAUSE_template& ASP__MTP3__PAUSE_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

ASP__MTP3__PAUSE_template& ASP__MTP3__PAUSE_template::operator=(const ASP__MTP3__PAUSE& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

ASP__MTP3__PAUSE_template& ASP__MTP3__PAUSE_template::operator=(const OPTIONAL<ASP__MTP3__PAUSE>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
}
return *this;
}

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

boolean ASP__MTP3__PAUSE_template::match(null_type other_value,boolean) const
{
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
return TRUE;
case OMIT_VALUE:
return FALSE;
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 type @MTP3asp_Types.ASP_MTP3_PAUSE.");
}
return FALSE;
}

boolean ASP__MTP3__PAUSE_template::match(const ASP__MTP3__PAUSE& other_value, boolean) const
{
if (!other_value.is_bound()) return FALSE;
return match(NULL_VALUE);
}

ASP__MTP3__PAUSE ASP__MTP3__PAUSE_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 @MTP3asp_Types.ASP_MTP3_PAUSE.");
return NULL_VALUE;
}

void ASP__MTP3__PAUSE_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 @MTP3asp_Types.ASP_MTP3_PAUSE.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__MTP3__PAUSE_template[list_length];
}

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

void ASP__MTP3__PAUSE_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
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 ASP__MTP3__PAUSE_template::log_match(const ASP__MTP3__PAUSE& 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 ASP__MTP3__PAUSE_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 @MTP3asp_Types.ASP_MTP3_PAUSE.");
}
}

void ASP__MTP3__PAUSE_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ASP__MTP3__PAUSE_template[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 @MTP3asp_Types.ASP_MTP3_PAUSE.");
}
}

void ASP__MTP3__PAUSE_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "empty record/set template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ASP__MTP3__PAUSE_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_Value_List:
    if (param.get_size()>0) param.type_error("empty record/set template", "@MTP3asp_Types.ASP_MTP3_PAUSE");
    *this = NULL_VALUE;
    break;
  case Module_Param::MP_Implication_Template: {
    ASP__MTP3__PAUSE_template* precondition = new ASP__MTP3__PAUSE_template;
    precondition->set_param(*param.get_elem(0));
    ASP__MTP3__PAUSE_template* implied_template = new ASP__MTP3__PAUSE_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__MTP3__PAUSE_template(precondition, implied_template);
  } break;
  default:
    param.type_error("empty record/set template", "@MTP3asp_Types.ASP_MTP3_PAUSE");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__MTP3__PAUSE_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;
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 : "@MTP3asp_Types.ASP_MTP3_PAUSE");
}

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

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

ASP__MTP3__RESUME::ASP__MTP3__RESUME()
{
bound_flag = FALSE;
}

ASP__MTP3__RESUME::ASP__MTP3__RESUME(null_type)
{
bound_flag = TRUE;
}

ASP__MTP3__RESUME::ASP__MTP3__RESUME(const ASP__MTP3__RESUME& other_value)
{
other_value.must_bound("Copying an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
bound_flag = TRUE;
}

ASP__MTP3__RESUME& ASP__MTP3__RESUME::operator=(null_type)
{
bound_flag = TRUE;
return *this;
}

ASP__MTP3__RESUME& ASP__MTP3__RESUME::operator=(const ASP__MTP3__RESUME& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
bound_flag = TRUE;
return *this;
}

boolean ASP__MTP3__RESUME::operator==(null_type) const
{
must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
return TRUE;
}

boolean ASP__MTP3__RESUME::operator==(const ASP__MTP3__RESUME& other_value) const
{
must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
other_value.must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
return TRUE;
}

void ASP__MTP3__RESUME::log() const
{
if (bound_flag) TTCN_Logger::log_event_str("{ }");
else TTCN_Logger::log_event_unbound();
}

void ASP__MTP3__RESUME::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "empty record/set value (i.e. { })");
  if (param.get_type()!=Module_Param::MP_Value_List || param.get_size()>0) {
    param.type_error("empty record/set value (i.e. { })", "@MTP3asp_Types.ASP_MTP3_RESUME");
  }
  bound_flag = TRUE;
}

void ASP__MTP3__RESUME::encode_text(Text_Buf& /*text_buf*/) const
{
must_bound("Text encoder: Encoding an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
}

void ASP__MTP3__RESUME::decode_text(Text_Buf& /*text_buf*/)
{
bound_flag = TRUE;
}

void ASP__MTP3__RESUME::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ASP__MTP3__RESUME::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ASP__MTP3__RESUME::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& /*myleaf*/) const
{
if (!bound_flag) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type %s.", p_td.name);
return 0;
}

int ASP__MTP3__RESUME::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int, raw_order_t, boolean, int, boolean, const RAW_Force_Omit*)
{
bound_flag = TRUE;
return p_buf.increase_pos_padd(p_td.raw->prepadding) + p_buf.increase_pos_padd(p_td.raw->padding);
}

void ASP__MTP3__RESUME_template::copy_template(const ASP__MTP3__RESUME_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 ASP__MTP3__RESUME_template[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 ASP__MTP3__RESUME_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__MTP3__RESUME_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 @MTP3asp_Types.ASP_MTP3_RESUME.");
break;
}
}

ASP__MTP3__RESUME_template::ASP__MTP3__RESUME_template()
{
}

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

ASP__MTP3__RESUME_template::ASP__MTP3__RESUME_template(null_type)
 : Base_Template(SPECIFIC_VALUE)
{
}

ASP__MTP3__RESUME_template::ASP__MTP3__RESUME_template(const ASP__MTP3__RESUME& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
}

ASP__MTP3__RESUME_template::ASP__MTP3__RESUME_template(const OPTIONAL<ASP__MTP3__RESUME>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MTP3asp_Types.ASP_MTP3_RESUME from an unbound optional field.");
}
}

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

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

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

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

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

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

ASP__MTP3__RESUME_template& ASP__MTP3__RESUME_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

ASP__MTP3__RESUME_template& ASP__MTP3__RESUME_template::operator=(const ASP__MTP3__RESUME& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

ASP__MTP3__RESUME_template& ASP__MTP3__RESUME_template::operator=(const OPTIONAL<ASP__MTP3__RESUME>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MTP3asp_Types.ASP_MTP3_RESUME.");
}
return *this;
}

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

boolean ASP__MTP3__RESUME_template::match(null_type other_value,boolean) const
{
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
return TRUE;
case OMIT_VALUE:
return FALSE;
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 type @MTP3asp_Types.ASP_MTP3_RESUME.");
}
return FALSE;
}

boolean ASP__MTP3__RESUME_template::match(const ASP__MTP3__RESUME& other_value, boolean) const
{
if (!other_value.is_bound()) return FALSE;
return match(NULL_VALUE);
}

ASP__MTP3__RESUME ASP__MTP3__RESUME_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 @MTP3asp_Types.ASP_MTP3_RESUME.");
return NULL_VALUE;
}

void ASP__MTP3__RESUME_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 @MTP3asp_Types.ASP_MTP3_RESUME.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__MTP3__RESUME_template[list_length];
}

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

void ASP__MTP3__RESUME_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
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 ASP__MTP3__RESUME_template::log_match(const ASP__MTP3__RESUME& 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 ASP__MTP3__RESUME_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 @MTP3asp_Types.ASP_MTP3_RESUME.");
}
}

void ASP__MTP3__RESUME_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ASP__MTP3__RESUME_template[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 @MTP3asp_Types.ASP_MTP3_RESUME.");
}
}

void ASP__MTP3__RESUME_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "empty record/set template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ASP__MTP3__RESUME_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_Value_List:
    if (param.get_size()>0) param.type_error("empty record/set template", "@MTP3asp_Types.ASP_MTP3_RESUME");
    *this = NULL_VALUE;
    break;
  case Module_Param::MP_Implication_Template: {
    ASP__MTP3__RESUME_template* precondition = new ASP__MTP3__RESUME_template;
    precondition->set_param(*param.get_elem(0));
    ASP__MTP3__RESUME_template* implied_template = new ASP__MTP3__RESUME_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__MTP3__RESUME_template(precondition, implied_template);
  } break;
  default:
    param.type_error("empty record/set template", "@MTP3asp_Types.ASP_MTP3_RESUME");
  }
  is_ifpresent = param.get_ifpresent();
}

void ASP__MTP3__RESUME_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;
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 : "@MTP3asp_Types.ASP_MTP3_RESUME");
}

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

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

ASP__MTP3__STATUS::ASP__MTP3__STATUS()
{
bound_flag = FALSE;
}

ASP__MTP3__STATUS::ASP__MTP3__STATUS(null_type)
{
bound_flag = TRUE;
}

ASP__MTP3__STATUS::ASP__MTP3__STATUS(const ASP__MTP3__STATUS& other_value)
{
other_value.must_bound("Copying an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
bound_flag = TRUE;
}

ASP__MTP3__STATUS& ASP__MTP3__STATUS::operator=(null_type)
{
bound_flag = TRUE;
return *this;
}

ASP__MTP3__STATUS& ASP__MTP3__STATUS::operator=(const ASP__MTP3__STATUS& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
bound_flag = TRUE;
return *this;
}

boolean ASP__MTP3__STATUS::operator==(null_type) const
{
must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
return TRUE;
}

boolean ASP__MTP3__STATUS::operator==(const ASP__MTP3__STATUS& other_value) const
{
must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
other_value.must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
return TRUE;
}

void ASP__MTP3__STATUS::log() const
{
if (bound_flag) TTCN_Logger::log_event_str("{ }");
else TTCN_Logger::log_event_unbound();
}

void ASP__MTP3__STATUS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "empty record/set value (i.e. { })");
  if (param.get_type()!=Module_Param::MP_Value_List || param.get_size()>0) {
    param.type_error("empty record/set value (i.e. { })", "@MTP3asp_Types.ASP_MTP3_STATUS");
  }
  bound_flag = TRUE;
}

void ASP__MTP3__STATUS::encode_text(Text_Buf& /*text_buf*/) const
{
must_bound("Text encoder: Encoding an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
}

void ASP__MTP3__STATUS::decode_text(Text_Buf& /*text_buf*/)
{
bound_flag = TRUE;
}

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

void ASP__MTP3__STATUS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ASP__MTP3__STATUS::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& /*myleaf*/) const
{
if (!bound_flag) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type %s.", p_td.name);
return 0;
}

int ASP__MTP3__STATUS::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int, raw_order_t, boolean, int, boolean, const RAW_Force_Omit*)
{
bound_flag = TRUE;
return p_buf.increase_pos_padd(p_td.raw->prepadding) + p_buf.increase_pos_padd(p_td.raw->padding);
}

void ASP__MTP3__STATUS_template::copy_template(const ASP__MTP3__STATUS_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 ASP__MTP3__STATUS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new ASP__MTP3__STATUS_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__MTP3__STATUS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @MTP3asp_Types.ASP_MTP3_STATUS.");
break;
}
}

ASP__MTP3__STATUS_template::ASP__MTP3__STATUS_template()
{
}

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

ASP__MTP3__STATUS_template::ASP__MTP3__STATUS_template(null_type)
 : Base_Template(SPECIFIC_VALUE)
{
}

ASP__MTP3__STATUS_template::ASP__MTP3__STATUS_template(const ASP__MTP3__STATUS& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
}

ASP__MTP3__STATUS_template::ASP__MTP3__STATUS_template(const OPTIONAL<ASP__MTP3__STATUS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @MTP3asp_Types.ASP_MTP3_STATUS from an unbound optional field.");
}
}

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

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

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

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

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

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

ASP__MTP3__STATUS_template& ASP__MTP3__STATUS_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

ASP__MTP3__STATUS_template& ASP__MTP3__STATUS_template::operator=(const ASP__MTP3__STATUS& other_value)
{
other_value.must_bound("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
return *this;
}

ASP__MTP3__STATUS_template& ASP__MTP3__STATUS_template::operator=(const OPTIONAL<ASP__MTP3__STATUS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @MTP3asp_Types.ASP_MTP3_STATUS.");
}
return *this;
}

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

boolean ASP__MTP3__STATUS_template::match(null_type other_value,boolean) const
{
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
return TRUE;
case OMIT_VALUE:
return FALSE;
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 type @MTP3asp_Types.ASP_MTP3_STATUS.");
}
return FALSE;
}

boolean ASP__MTP3__STATUS_template::match(const ASP__MTP3__STATUS& other_value, boolean) const
{
if (!other_value.is_bound()) return FALSE;
return match(NULL_VALUE);
}

ASP__MTP3__STATUS ASP__MTP3__STATUS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @MTP3asp_Types.ASP_MTP3_STATUS.");
return NULL_VALUE;
}

void ASP__MTP3__STATUS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @MTP3asp_Types.ASP_MTP3_STATUS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__MTP3__STATUS_template[list_length];
}

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

void ASP__MTP3__STATUS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
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 ASP__MTP3__STATUS_template::log_match(const ASP__MTP3__STATUS& 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 ASP__MTP3__STATUS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
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 @MTP3asp_Types.ASP_MTP3_STATUS.");
}
}

void ASP__MTP3__STATUS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
case SPECIFIC_VALUE:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ASP__MTP3__STATUS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @MTP3asp_Types.ASP_MTP3_STATUS.");
}
}

void ASP__MTP3__STATUS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "empty record/set template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ASP__MTP3__STATUS_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_Value_List:
    if (param.get_size()>0) param.type_error("empty record/set template", "@MTP3asp_Types.ASP_MTP3_STATUS");
    *this = NULL_VALUE;
    break;
  case Module_Param::MP_Implication_Template: {
    ASP__MTP3__STATUS_template* precondition = new ASP__MTP3__STATUS_template;
    precondition->set_param(*param.get_elem(0));
    ASP__MTP3__STATUS_template* implied_template = new ASP__MTP3__STATUS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ASP__MTP3__STATUS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("empty record/set template", "@MTP3asp_Types.ASP_MTP3_STATUS");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

ASP__MTP3__TRANSFERreq::ASP__MTP3__TRANSFERreq()
{
}

ASP__MTP3__TRANSFERreq::ASP__MTP3__TRANSFERreq(const MTP3__Field__sio& par_sio,
    const INTEGER& par_opc,
    const INTEGER& par_dpc,
    const INTEGER& par_sls,
    const OCTETSTRING& par_data)
  :   field_sio(par_sio),
  field_opc(par_opc),
  field_dpc(par_dpc),
  field_sls(par_sls),
  field_data(par_data)
{
}

ASP__MTP3__TRANSFERreq::ASP__MTP3__TRANSFERreq(const ASP__MTP3__TRANSFERreq& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
if (other_value.sio().is_bound()) field_sio = other_value.sio();
else field_sio.clean_up();
if (other_value.opc().is_bound()) field_opc = other_value.opc();
else field_opc.clean_up();
if (other_value.dpc().is_bound()) field_dpc = other_value.dpc();
else field_dpc.clean_up();
if (other_value.sls().is_bound()) field_sls = other_value.sls();
else field_sls.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void ASP__MTP3__TRANSFERreq::clean_up()
{
field_sio.clean_up();
field_opc.clean_up();
field_dpc.clean_up();
field_sls.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* ASP__MTP3__TRANSFERreq::get_descriptor() const { return &ASP__MTP3__TRANSFERreq_descr_; }
ASP__MTP3__TRANSFERreq& ASP__MTP3__TRANSFERreq::operator=(const ASP__MTP3__TRANSFERreq& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
  if (other_value.sio().is_bound()) field_sio = other_value.sio();
  else field_sio.clean_up();
  if (other_value.opc().is_bound()) field_opc = other_value.opc();
  else field_opc.clean_up();
  if (other_value.dpc().is_bound()) field_dpc = other_value.dpc();
  else field_dpc.clean_up();
  if (other_value.sls().is_bound()) field_sls = other_value.sls();
  else field_sls.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean ASP__MTP3__TRANSFERreq::operator==(const ASP__MTP3__TRANSFERreq& other_value) const
{
return field_sio==other_value.field_sio
  && field_opc==other_value.field_opc
  && field_dpc==other_value.field_dpc
  && field_sls==other_value.field_sls
  && field_data==other_value.field_data;
}

boolean ASP__MTP3__TRANSFERreq::is_bound() const
{
return (field_sio.is_bound())
  || (field_opc.is_bound())
  || (field_dpc.is_bound())
  || (field_sls.is_bound())
  || (field_data.is_bound());
}
boolean ASP__MTP3__TRANSFERreq::is_value() const
{
return field_sio.is_value()
  && field_opc.is_value()
  && field_dpc.is_value()
  && field_sls.is_value()
  && field_data.is_value();
}
void ASP__MTP3__TRANSFERreq::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sio := ");
field_sio.log();
TTCN_Logger::log_event_str(", opc := ");
field_opc.log();
TTCN_Logger::log_event_str(", dpc := ");
field_dpc.log();
TTCN_Logger::log_event_str(", sls := ");
field_sls.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__MTP3__TRANSFERreq::set_implicit_omit()
{
if (sio().is_bound()) sio().set_implicit_omit();
if (opc().is_bound()) opc().set_implicit_omit();
if (dpc().is_bound()) dpc().set_implicit_omit();
if (sls().is_bound()) sls().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

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

void ASP__MTP3__TRANSFERreq::encode_text(Text_Buf& text_buf) const
{
field_sio.encode_text(text_buf);
field_opc.encode_text(text_buf);
field_dpc.encode_text(text_buf);
field_sls.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void ASP__MTP3__TRANSFERreq::decode_text(Text_Buf& text_buf)
{
field_sio.decode_text(text_buf);
field_opc.decode_text(text_buf);
field_dpc.decode_text(text_buf);
field_sls.decode_text(text_buf);
field_data.decode_text(text_buf);
}

void ASP__MTP3__TRANSFERreq::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ASP__MTP3__TRANSFERreq::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ASP__MTP3__TRANSFERreq::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, MTP3__Field__sio_descr_.raw->forceomit);
  decoded_field_length = field_sio.RAW_decode(MTP3__Field__sio_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, ASP__MTP3__TRANSFERreq_opc_descr_.raw->forceomit);
  decoded_field_length = field_opc.RAW_decode(ASP__MTP3__TRANSFERreq_opc_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, ASP__MTP3__TRANSFERreq_dpc_descr_.raw->forceomit);
  decoded_field_length = field_dpc.RAW_decode(ASP__MTP3__TRANSFERreq_dpc_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, ASP__MTP3__TRANSFERreq_sls_descr_.raw->forceomit);
  decoded_field_length = field_sls.RAW_decode(ASP__MTP3__TRANSFERreq_sls_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_4_force_omit(4, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(OCTETSTRING_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ASP__MTP3__TRANSFERreq::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MTP3__Field__sio_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ASP__MTP3__TRANSFERreq_opc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ASP__MTP3__TRANSFERreq_dpc_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ASP__MTP3__TRANSFERreq_sls_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, OCTETSTRING_descr_.raw);
  encoded_length += field_sio.RAW_encode(MTP3__Field__sio_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_opc.RAW_encode(ASP__MTP3__TRANSFERreq_opc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dpc.RAW_encode(ASP__MTP3__TRANSFERreq_dpc_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_sls.RAW_encode(ASP__MTP3__TRANSFERreq_sls_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_data.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct ASP__MTP3__TRANSFERreq_template::single_value_struct {
MTP3__Field__sio_template field_sio;
INTEGER_template field_opc;
INTEGER_template field_dpc;
INTEGER_template field_sls;
OCTETSTRING_template field_data;
};

void ASP__MTP3__TRANSFERreq_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_sio = ANY_VALUE;
single_value->field_opc = ANY_VALUE;
single_value->field_dpc = ANY_VALUE;
single_value->field_sls = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void ASP__MTP3__TRANSFERreq_template::copy_value(const ASP__MTP3__TRANSFERreq& other_value)
{
single_value = new single_value_struct;
if (other_value.sio().is_bound()) {
  single_value->field_sio = other_value.sio();
} else {
  single_value->field_sio.clean_up();
}
if (other_value.opc().is_bound()) {
  single_value->field_opc = other_value.opc();
} else {
  single_value->field_opc.clean_up();
}
if (other_value.dpc().is_bound()) {
  single_value->field_dpc = other_value.dpc();
} else {
  single_value->field_dpc.clean_up();
}
if (other_value.sls().is_bound()) {
  single_value->field_sls = other_value.sls();
} else {
  single_value->field_sls.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__MTP3__TRANSFERreq_template::copy_template(const ASP__MTP3__TRANSFERreq_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sio().get_selection()) {
single_value->field_sio = other_value.sio();
} else {
single_value->field_sio.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.opc().get_selection()) {
single_value->field_opc = other_value.opc();
} else {
single_value->field_opc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dpc().get_selection()) {
single_value->field_dpc = other_value.dpc();
} else {
single_value->field_dpc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sls().get_selection()) {
single_value->field_sls = other_value.sls();
} else {
single_value->field_sls.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ASP__MTP3__TRANSFERreq_template[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 ASP__MTP3__TRANSFERreq_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__MTP3__TRANSFERreq_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 @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
break;
}
set_selection(other_value);
}

ASP__MTP3__TRANSFERreq_template::ASP__MTP3__TRANSFERreq_template()
{
}

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

ASP__MTP3__TRANSFERreq_template::ASP__MTP3__TRANSFERreq_template(const ASP__MTP3__TRANSFERreq& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__MTP3__TRANSFERreq_template::match(const ASP__MTP3__TRANSFERreq& 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.sio().is_bound()) return FALSE;
if(!single_value->field_sio.match(other_value.sio(), legacy))return FALSE;
if(!other_value.opc().is_bound()) return FALSE;
if(!single_value->field_opc.match(other_value.opc(), legacy))return FALSE;
if(!other_value.dpc().is_bound()) return FALSE;
if(!single_value->field_dpc.match(other_value.dpc(), legacy))return FALSE;
if(!other_value.sls().is_bound()) return FALSE;
if(!single_value->field_sls.match(other_value.sls(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.data(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
}
return FALSE;
}

boolean ASP__MTP3__TRANSFERreq_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_sio.is_bound()
 || single_value->field_opc.is_bound()
 || single_value->field_dpc.is_bound()
 || single_value->field_sls.is_bound()
 || single_value->field_data.is_bound();
}

boolean ASP__MTP3__TRANSFERreq_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sio.is_value()
 && single_value->field_opc.is_value()
 && single_value->field_dpc.is_value()
 && single_value->field_sls.is_value()
 && single_value->field_data.is_value();
}

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

ASP__MTP3__TRANSFERreq ASP__MTP3__TRANSFERreq_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 @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
ASP__MTP3__TRANSFERreq ret_val;
if (single_value->field_sio.is_bound()) {
ret_val.sio() = single_value->field_sio.valueof();
}
if (single_value->field_opc.is_bound()) {
ret_val.opc() = single_value->field_opc.valueof();
}
if (single_value->field_dpc.is_bound()) {
ret_val.dpc() = single_value->field_dpc.valueof();
}
if (single_value->field_sls.is_bound()) {
ret_val.sls() = single_value->field_sls.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void ASP__MTP3__TRANSFERreq_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 @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__MTP3__TRANSFERreq_template[list_length];
}

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

MTP3__Field__sio_template& ASP__MTP3__TRANSFERreq_template::sio()
{
set_specific();
return single_value->field_sio;
}

const MTP3__Field__sio_template& ASP__MTP3__TRANSFERreq_template::sio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sio of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
return single_value->field_sio;
}

INTEGER_template& ASP__MTP3__TRANSFERreq_template::opc()
{
set_specific();
return single_value->field_opc;
}

const INTEGER_template& ASP__MTP3__TRANSFERreq_template::opc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field opc of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
return single_value->field_opc;
}

INTEGER_template& ASP__MTP3__TRANSFERreq_template::dpc()
{
set_specific();
return single_value->field_dpc;
}

const INTEGER_template& ASP__MTP3__TRANSFERreq_template::dpc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dpc of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
return single_value->field_dpc;
}

INTEGER_template& ASP__MTP3__TRANSFERreq_template::sls()
{
set_specific();
return single_value->field_sls;
}

const INTEGER_template& ASP__MTP3__TRANSFERreq_template::sls() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sls of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
return single_value->field_sls;
}

OCTETSTRING_template& ASP__MTP3__TRANSFERreq_template::data()
{
set_specific();
return single_value->field_data;
}

const OCTETSTRING_template& ASP__MTP3__TRANSFERreq_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
return single_value->field_data;
}

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

void ASP__MTP3__TRANSFERreq_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sio := ");
single_value->field_sio.log();
TTCN_Logger::log_event_str(", opc := ");
single_value->field_opc.log();
TTCN_Logger::log_event_str(", dpc := ");
single_value->field_dpc.log();
TTCN_Logger::log_event_str(", sls := ");
single_value->field_sls.log();
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void ASP__MTP3__TRANSFERreq_template::log_match(const ASP__MTP3__TRANSFERreq& 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_sio.match(match_value.sio(), legacy)){
TTCN_Logger::log_logmatch_info(".sio");
single_value->field_sio.log_match(match_value.sio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_opc.match(match_value.opc(), legacy)){
TTCN_Logger::log_logmatch_info(".opc");
single_value->field_opc.log_match(match_value.opc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dpc.match(match_value.dpc(), legacy)){
TTCN_Logger::log_logmatch_info(".dpc");
single_value->field_dpc.log_match(match_value.dpc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sls.match(match_value.sls(), legacy)){
TTCN_Logger::log_logmatch_info(".sls");
single_value->field_sls.log_match(match_value.sls(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ sio := ");
single_value->field_sio.log_match(match_value.sio(), legacy);
TTCN_Logger::log_event_str(", opc := ");
single_value->field_opc.log_match(match_value.opc(), legacy);
TTCN_Logger::log_event_str(", dpc := ");
single_value->field_dpc.log_match(match_value.dpc(), legacy);
TTCN_Logger::log_event_str(", sls := ");
single_value->field_sls.log_match(match_value.sls(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void ASP__MTP3__TRANSFERreq_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_sio.decode_text(text_buf);
single_value->field_opc.decode_text(text_buf);
single_value->field_dpc.decode_text(text_buf);
single_value->field_sls.decode_text(text_buf);
single_value->field_data.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ASP__MTP3__TRANSFERreq_template[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 @MTP3asp_Types.ASP_MTP3_TRANSFERreq.");
}
}

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

void ASP__MTP3__TRANSFERreq_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_sio.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERreq");
single_value->field_opc.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERreq");
single_value->field_dpc.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERreq");
single_value->field_sls.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERreq");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_MTP3_TRANSFERreq");
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 : "@MTP3asp_Types.ASP_MTP3_TRANSFERreq");
}

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

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

ASP__REGISTER__M3UA::ASP__REGISTER__M3UA()
{
}

ASP__REGISTER__M3UA::ASP__REGISTER__M3UA(const INTEGER& par_ni,
    const INTEGER& par_sut__pc,
    const INTEGER& par_tester__pc,
    const INTEGER& par_m3ua__version,
    const CHARSTRING& par_entity)
  :   field_ni(par_ni),
  field_sut__pc(par_sut__pc),
  field_tester__pc(par_tester__pc),
  field_m3ua__version(par_m3ua__version),
  field_entity(par_entity)
{
}

ASP__REGISTER__M3UA::ASP__REGISTER__M3UA(const ASP__REGISTER__M3UA& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MTP3asp_Types.ASP_REGISTER_M3UA.");
if (other_value.ni().is_bound()) field_ni = other_value.ni();
else field_ni.clean_up();
if (other_value.sut__pc().is_bound()) field_sut__pc = other_value.sut__pc();
else field_sut__pc.clean_up();
if (other_value.tester__pc().is_bound()) field_tester__pc = other_value.tester__pc();
else field_tester__pc.clean_up();
if (other_value.m3ua__version().is_bound()) field_m3ua__version = other_value.m3ua__version();
else field_m3ua__version.clean_up();
if (other_value.entity().is_bound()) field_entity = other_value.entity();
else field_entity.clean_up();
}

void ASP__REGISTER__M3UA::clean_up()
{
field_ni.clean_up();
field_sut__pc.clean_up();
field_tester__pc.clean_up();
field_m3ua__version.clean_up();
field_entity.clean_up();
}

const TTCN_Typedescriptor_t* ASP__REGISTER__M3UA::get_descriptor() const { return &ASP__REGISTER__M3UA_descr_; }
ASP__REGISTER__M3UA& ASP__REGISTER__M3UA::operator=(const ASP__REGISTER__M3UA& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MTP3asp_Types.ASP_REGISTER_M3UA.");
  if (other_value.ni().is_bound()) field_ni = other_value.ni();
  else field_ni.clean_up();
  if (other_value.sut__pc().is_bound()) field_sut__pc = other_value.sut__pc();
  else field_sut__pc.clean_up();
  if (other_value.tester__pc().is_bound()) field_tester__pc = other_value.tester__pc();
  else field_tester__pc.clean_up();
  if (other_value.m3ua__version().is_bound()) field_m3ua__version = other_value.m3ua__version();
  else field_m3ua__version.clean_up();
  if (other_value.entity().is_bound()) field_entity = other_value.entity();
  else field_entity.clean_up();
}
return *this;
}

boolean ASP__REGISTER__M3UA::operator==(const ASP__REGISTER__M3UA& other_value) const
{
return field_ni==other_value.field_ni
  && field_sut__pc==other_value.field_sut__pc
  && field_tester__pc==other_value.field_tester__pc
  && field_m3ua__version==other_value.field_m3ua__version
  && field_entity==other_value.field_entity;
}

boolean ASP__REGISTER__M3UA::is_bound() const
{
return (field_ni.is_bound())
  || (field_sut__pc.is_bound())
  || (field_tester__pc.is_bound())
  || (field_m3ua__version.is_bound())
  || (field_entity.is_bound());
}
boolean ASP__REGISTER__M3UA::is_value() const
{
return field_ni.is_value()
  && field_sut__pc.is_value()
  && field_tester__pc.is_value()
  && field_m3ua__version.is_value()
  && field_entity.is_value();
}
void ASP__REGISTER__M3UA::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ni := ");
field_ni.log();
TTCN_Logger::log_event_str(", sut_pc := ");
field_sut__pc.log();
TTCN_Logger::log_event_str(", tester_pc := ");
field_tester__pc.log();
TTCN_Logger::log_event_str(", m3ua_version := ");
field_m3ua__version.log();
TTCN_Logger::log_event_str(", entity := ");
field_entity.log();
TTCN_Logger::log_event_str(" }");
}

void ASP__REGISTER__M3UA::set_implicit_omit()
{
if (ni().is_bound()) ni().set_implicit_omit();
if (sut__pc().is_bound()) sut__pc().set_implicit_omit();
if (tester__pc().is_bound()) tester__pc().set_implicit_omit();
if (m3ua__version().is_bound()) m3ua__version().set_implicit_omit();
if (entity().is_bound()) entity().set_implicit_omit();
}

void ASP__REGISTER__M3UA::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @MTP3asp_Types.ASP_REGISTER_M3UA has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ni().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sut__pc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tester__pc().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) m3ua__version().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) entity().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ni")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ni().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sut_pc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sut__pc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tester_pc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tester__pc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "m3ua_version")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          m3ua__version().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "entity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          entity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MTP3asp_Types.ASP_REGISTER_M3UA: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MTP3asp_Types.ASP_REGISTER_M3UA");
  }
}

void ASP__REGISTER__M3UA::encode_text(Text_Buf& text_buf) const
{
field_ni.encode_text(text_buf);
field_sut__pc.encode_text(text_buf);
field_tester__pc.encode_text(text_buf);
field_m3ua__version.encode_text(text_buf);
field_entity.encode_text(text_buf);
}

void ASP__REGISTER__M3UA::decode_text(Text_Buf& text_buf)
{
field_ni.decode_text(text_buf);
field_sut__pc.decode_text(text_buf);
field_tester__pc.decode_text(text_buf);
field_m3ua__version.decode_text(text_buf);
field_entity.decode_text(text_buf);
}

void ASP__REGISTER__M3UA::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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void ASP__REGISTER__M3UA::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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int ASP__REGISTER__M3UA::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, ASP__REGISTER__M3UA_ni_descr_.raw->forceomit);
  decoded_field_length = field_ni.RAW_decode(ASP__REGISTER__M3UA_ni_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, ASP__REGISTER__M3UA_sut__pc_descr_.raw->forceomit);
  decoded_field_length = field_sut__pc.RAW_decode(ASP__REGISTER__M3UA_sut__pc_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, ASP__REGISTER__M3UA_tester__pc_descr_.raw->forceomit);
  decoded_field_length = field_tester__pc.RAW_decode(ASP__REGISTER__M3UA_tester__pc_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, ASP__REGISTER__M3UA_m3ua__version_descr_.raw->forceomit);
  decoded_field_length = field_m3ua__version.RAW_decode(ASP__REGISTER__M3UA_m3ua__version_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, CHARSTRING_descr_.raw->forceomit);
  decoded_field_length = field_entity.RAW_decode(CHARSTRING_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ASP__REGISTER__M3UA::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 5;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(5);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, ASP__REGISTER__M3UA_ni_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ASP__REGISTER__M3UA_sut__pc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ASP__REGISTER__M3UA_tester__pc_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ASP__REGISTER__M3UA_m3ua__version_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, CHARSTRING_descr_.raw);
  encoded_length += field_ni.RAW_encode(ASP__REGISTER__M3UA_ni_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_sut__pc.RAW_encode(ASP__REGISTER__M3UA_sut__pc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_tester__pc.RAW_encode(ASP__REGISTER__M3UA_tester__pc_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_m3ua__version.RAW_encode(ASP__REGISTER__M3UA_m3ua__version_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_entity.RAW_encode(CHARSTRING_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct ASP__REGISTER__M3UA_template::single_value_struct {
INTEGER_template field_ni;
INTEGER_template field_sut__pc;
INTEGER_template field_tester__pc;
INTEGER_template field_m3ua__version;
CHARSTRING_template field_entity;
};

void ASP__REGISTER__M3UA_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_ni = ANY_VALUE;
single_value->field_sut__pc = ANY_VALUE;
single_value->field_tester__pc = ANY_VALUE;
single_value->field_m3ua__version = ANY_VALUE;
single_value->field_entity = ANY_VALUE;
}
}
}

void ASP__REGISTER__M3UA_template::copy_value(const ASP__REGISTER__M3UA& other_value)
{
single_value = new single_value_struct;
if (other_value.ni().is_bound()) {
  single_value->field_ni = other_value.ni();
} else {
  single_value->field_ni.clean_up();
}
if (other_value.sut__pc().is_bound()) {
  single_value->field_sut__pc = other_value.sut__pc();
} else {
  single_value->field_sut__pc.clean_up();
}
if (other_value.tester__pc().is_bound()) {
  single_value->field_tester__pc = other_value.tester__pc();
} else {
  single_value->field_tester__pc.clean_up();
}
if (other_value.m3ua__version().is_bound()) {
  single_value->field_m3ua__version = other_value.m3ua__version();
} else {
  single_value->field_m3ua__version.clean_up();
}
if (other_value.entity().is_bound()) {
  single_value->field_entity = other_value.entity();
} else {
  single_value->field_entity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ASP__REGISTER__M3UA_template::copy_template(const ASP__REGISTER__M3UA_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ni().get_selection()) {
single_value->field_ni = other_value.ni();
} else {
single_value->field_ni.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sut__pc().get_selection()) {
single_value->field_sut__pc = other_value.sut__pc();
} else {
single_value->field_sut__pc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tester__pc().get_selection()) {
single_value->field_tester__pc = other_value.tester__pc();
} else {
single_value->field_tester__pc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.m3ua__version().get_selection()) {
single_value->field_m3ua__version = other_value.m3ua__version();
} else {
single_value->field_m3ua__version.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.entity().get_selection()) {
single_value->field_entity = other_value.entity();
} else {
single_value->field_entity.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 ASP__REGISTER__M3UA_template[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 ASP__REGISTER__M3UA_template(*other_value.implication_.precondition);
implication_.implied_template = new ASP__REGISTER__M3UA_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 @MTP3asp_Types.ASP_REGISTER_M3UA.");
break;
}
set_selection(other_value);
}

ASP__REGISTER__M3UA_template::ASP__REGISTER__M3UA_template()
{
}

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

ASP__REGISTER__M3UA_template::ASP__REGISTER__M3UA_template(const ASP__REGISTER__M3UA& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ASP__REGISTER__M3UA_template::match(const ASP__REGISTER__M3UA& 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.ni().is_bound()) return FALSE;
if(!single_value->field_ni.match(other_value.ni(), legacy))return FALSE;
if(!other_value.sut__pc().is_bound()) return FALSE;
if(!single_value->field_sut__pc.match(other_value.sut__pc(), legacy))return FALSE;
if(!other_value.tester__pc().is_bound()) return FALSE;
if(!single_value->field_tester__pc.match(other_value.tester__pc(), legacy))return FALSE;
if(!other_value.m3ua__version().is_bound()) return FALSE;
if(!single_value->field_m3ua__version.match(other_value.m3ua__version(), legacy))return FALSE;
if(!other_value.entity().is_bound()) return FALSE;
if(!single_value->field_entity.match(other_value.entity(), 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 @MTP3asp_Types.ASP_REGISTER_M3UA.");
}
return FALSE;
}

boolean ASP__REGISTER__M3UA_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_ni.is_bound()
 || single_value->field_sut__pc.is_bound()
 || single_value->field_tester__pc.is_bound()
 || single_value->field_m3ua__version.is_bound()
 || single_value->field_entity.is_bound();
}

boolean ASP__REGISTER__M3UA_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ni.is_value()
 && single_value->field_sut__pc.is_value()
 && single_value->field_tester__pc.is_value()
 && single_value->field_m3ua__version.is_value()
 && single_value->field_entity.is_value();
}

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

ASP__REGISTER__M3UA ASP__REGISTER__M3UA_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 @MTP3asp_Types.ASP_REGISTER_M3UA.");
ASP__REGISTER__M3UA ret_val;
if (single_value->field_ni.is_bound()) {
ret_val.ni() = single_value->field_ni.valueof();
}
if (single_value->field_sut__pc.is_bound()) {
ret_val.sut__pc() = single_value->field_sut__pc.valueof();
}
if (single_value->field_tester__pc.is_bound()) {
ret_val.tester__pc() = single_value->field_tester__pc.valueof();
}
if (single_value->field_m3ua__version.is_bound()) {
ret_val.m3ua__version() = single_value->field_m3ua__version.valueof();
}
if (single_value->field_entity.is_bound()) {
ret_val.entity() = single_value->field_entity.valueof();
}
return ret_val;
}

void ASP__REGISTER__M3UA_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 @MTP3asp_Types.ASP_REGISTER_M3UA.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ASP__REGISTER__M3UA_template[list_length];
}

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

INTEGER_template& ASP__REGISTER__M3UA_template::ni()
{
set_specific();
return single_value->field_ni;
}

const INTEGER_template& ASP__REGISTER__M3UA_template::ni() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ni of a non-specific template of type @MTP3asp_Types.ASP_REGISTER_M3UA.");
return single_value->field_ni;
}

INTEGER_template& ASP__REGISTER__M3UA_template::sut__pc()
{
set_specific();
return single_value->field_sut__pc;
}

const INTEGER_template& ASP__REGISTER__M3UA_template::sut__pc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sut_pc of a non-specific template of type @MTP3asp_Types.ASP_REGISTER_M3UA.");
return single_value->field_sut__pc;
}

INTEGER_template& ASP__REGISTER__M3UA_template::tester__pc()
{
set_specific();
return single_value->field_tester__pc;
}

const INTEGER_template& ASP__REGISTER__M3UA_template::tester__pc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tester_pc of a non-specific template of type @MTP3asp_Types.ASP_REGISTER_M3UA.");
return single_value->field_tester__pc;
}

INTEGER_template& ASP__REGISTER__M3UA_template::m3ua__version()
{
set_specific();
return single_value->field_m3ua__version;
}

const INTEGER_template& ASP__REGISTER__M3UA_template::m3ua__version() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field m3ua_version of a non-specific template of type @MTP3asp_Types.ASP_REGISTER_M3UA.");
return single_value->field_m3ua__version;
}

CHARSTRING_template& ASP__REGISTER__M3UA_template::entity()
{
set_specific();
return single_value->field_entity;
}

const CHARSTRING_template& ASP__REGISTER__M3UA_template::entity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field entity of a non-specific template of type @MTP3asp_Types.ASP_REGISTER_M3UA.");
return single_value->field_entity;
}

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

void ASP__REGISTER__M3UA_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ni := ");
single_value->field_ni.log();
TTCN_Logger::log_event_str(", sut_pc := ");
single_value->field_sut__pc.log();
TTCN_Logger::log_event_str(", tester_pc := ");
single_value->field_tester__pc.log();
TTCN_Logger::log_event_str(", m3ua_version := ");
single_value->field_m3ua__version.log();
TTCN_Logger::log_event_str(", entity := ");
single_value->field_entity.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 ASP__REGISTER__M3UA_template::log_match(const ASP__REGISTER__M3UA& 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_ni.match(match_value.ni(), legacy)){
TTCN_Logger::log_logmatch_info(".ni");
single_value->field_ni.log_match(match_value.ni(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sut__pc.match(match_value.sut__pc(), legacy)){
TTCN_Logger::log_logmatch_info(".sut_pc");
single_value->field_sut__pc.log_match(match_value.sut__pc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tester__pc.match(match_value.tester__pc(), legacy)){
TTCN_Logger::log_logmatch_info(".tester_pc");
single_value->field_tester__pc.log_match(match_value.tester__pc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_m3ua__version.match(match_value.m3ua__version(), legacy)){
TTCN_Logger::log_logmatch_info(".m3ua_version");
single_value->field_m3ua__version.log_match(match_value.m3ua__version(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_entity.match(match_value.entity(), legacy)){
TTCN_Logger::log_logmatch_info(".entity");
single_value->field_entity.log_match(match_value.entity(), 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("{ ni := ");
single_value->field_ni.log_match(match_value.ni(), legacy);
TTCN_Logger::log_event_str(", sut_pc := ");
single_value->field_sut__pc.log_match(match_value.sut__pc(), legacy);
TTCN_Logger::log_event_str(", tester_pc := ");
single_value->field_tester__pc.log_match(match_value.tester__pc(), legacy);
TTCN_Logger::log_event_str(", m3ua_version := ");
single_value->field_m3ua__version.log_match(match_value.m3ua__version(), legacy);
TTCN_Logger::log_event_str(", entity := ");
single_value->field_entity.log_match(match_value.entity(), 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 ASP__REGISTER__M3UA_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ni.encode_text(text_buf);
single_value->field_sut__pc.encode_text(text_buf);
single_value->field_tester__pc.encode_text(text_buf);
single_value->field_m3ua__version.encode_text(text_buf);
single_value->field_entity.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 @MTP3asp_Types.ASP_REGISTER_M3UA.");
}
}

void ASP__REGISTER__M3UA_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_ni.decode_text(text_buf);
single_value->field_sut__pc.decode_text(text_buf);
single_value->field_tester__pc.decode_text(text_buf);
single_value->field_m3ua__version.decode_text(text_buf);
single_value->field_entity.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 ASP__REGISTER__M3UA_template[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 @MTP3asp_Types.ASP_REGISTER_M3UA.");
}
}

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

void ASP__REGISTER__M3UA_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_ni.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_REGISTER_M3UA");
single_value->field_sut__pc.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_REGISTER_M3UA");
single_value->field_tester__pc.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_REGISTER_M3UA");
single_value->field_m3ua__version.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_REGISTER_M3UA");
single_value->field_entity.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.ASP_REGISTER_M3UA");
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 : "@MTP3asp_Types.ASP_REGISTER_M3UA");
}

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

boolean ASP__REGISTER__M3UA_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 MTP3__to__SCTPserver__data::copy_value(const MTP3__to__SCTPserver__data& other_value)
{
switch (other_value.union_selection) {
case ALT_transfer__ind:
field_transfer__ind = new ASP__MTP3__TRANSFERind(*other_value.field_transfer__ind);
break;
case ALT_transfer__req:
field_transfer__req = new ASP__MTP3__TRANSFERreq(*other_value.field_transfer__req);
break;
case ALT_register_:
field_register_ = new ASP__REGISTER__M3UA(*other_value.field_register_);
break;
case ALT_unregister:
field_unregister = new INTEGER(*other_value.field_unregister);
break;
case ALT_status:
field_status = new INTEGER(*other_value.field_status);
break;
case ALT_pause:
field_pause = new INTEGER(*other_value.field_pause);
break;
case ALT_resume:
field_resume = new INTEGER(*other_value.field_resume);
break;
default:
TTCN_error("Assignment of an unbound union value of type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean MTP3__to__SCTPserver__data::operator==(const MTP3__to__SCTPserver__data& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_transfer__ind:
return *field_transfer__ind == *other_value.field_transfer__ind;
case ALT_transfer__req:
return *field_transfer__req == *other_value.field_transfer__req;
case ALT_register_:
return *field_register_ == *other_value.field_register_;
case ALT_unregister:
return *field_unregister == *other_value.field_unregister;
case ALT_status:
return *field_status == *other_value.field_status;
case ALT_pause:
return *field_pause == *other_value.field_pause;
case ALT_resume:
return *field_resume == *other_value.field_resume;
default:
return FALSE;
}
}

ASP__MTP3__TRANSFERind& MTP3__to__SCTPserver__data::transfer__ind()
{
if (union_selection != ALT_transfer__ind) {
clean_up();
field_transfer__ind = new ASP__MTP3__TRANSFERind;
union_selection = ALT_transfer__ind;
}
return *field_transfer__ind;
}

const ASP__MTP3__TRANSFERind& MTP3__to__SCTPserver__data::transfer__ind() const
{
if (union_selection != ALT_transfer__ind) TTCN_error("Using non-selected field transfer_ind in a value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *field_transfer__ind;
}

ASP__MTP3__TRANSFERreq& MTP3__to__SCTPserver__data::transfer__req()
{
if (union_selection != ALT_transfer__req) {
clean_up();
field_transfer__req = new ASP__MTP3__TRANSFERreq;
union_selection = ALT_transfer__req;
}
return *field_transfer__req;
}

const ASP__MTP3__TRANSFERreq& MTP3__to__SCTPserver__data::transfer__req() const
{
if (union_selection != ALT_transfer__req) TTCN_error("Using non-selected field transfer_req in a value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *field_transfer__req;
}

ASP__REGISTER__M3UA& MTP3__to__SCTPserver__data::register_()
{
if (union_selection != ALT_register_) {
clean_up();
field_register_ = new ASP__REGISTER__M3UA;
union_selection = ALT_register_;
}
return *field_register_;
}

const ASP__REGISTER__M3UA& MTP3__to__SCTPserver__data::register_() const
{
if (union_selection != ALT_register_) TTCN_error("Using non-selected field register in a value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *field_register_;
}

INTEGER& MTP3__to__SCTPserver__data::unregister()
{
if (union_selection != ALT_unregister) {
clean_up();
field_unregister = new INTEGER;
union_selection = ALT_unregister;
}
return *field_unregister;
}

const INTEGER& MTP3__to__SCTPserver__data::unregister() const
{
if (union_selection != ALT_unregister) TTCN_error("Using non-selected field unregister in a value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *field_unregister;
}

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

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

INTEGER& MTP3__to__SCTPserver__data::pause()
{
if (union_selection != ALT_pause) {
clean_up();
field_pause = new INTEGER;
union_selection = ALT_pause;
}
return *field_pause;
}

const INTEGER& MTP3__to__SCTPserver__data::pause() const
{
if (union_selection != ALT_pause) TTCN_error("Using non-selected field pause in a value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *field_pause;
}

INTEGER& MTP3__to__SCTPserver__data::resume()
{
if (union_selection != ALT_resume) {
clean_up();
field_resume = new INTEGER;
union_selection = ALT_resume;
}
return *field_resume;
}

const INTEGER& MTP3__to__SCTPserver__data::resume() const
{
if (union_selection != ALT_resume) TTCN_error("Using non-selected field resume in a value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *field_resume;
}

boolean MTP3__to__SCTPserver__data::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 @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return union_selection == checked_selection;
}

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

boolean MTP3__to__SCTPserver__data::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_transfer__ind: return field_transfer__ind->is_value();
case ALT_transfer__req: return field_transfer__req->is_value();
case ALT_register_: return field_register_->is_value();
case ALT_unregister: return field_unregister->is_value();
case ALT_status: return field_status->is_value();
case ALT_pause: return field_pause->is_value();
case ALT_resume: return field_resume->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void MTP3__to__SCTPserver__data::clean_up()
{
switch (union_selection) {
case ALT_transfer__ind:
  delete field_transfer__ind;
  break;
case ALT_transfer__req:
  delete field_transfer__req;
  break;
case ALT_register_:
  delete field_register_;
  break;
case ALT_unregister:
  delete field_unregister;
  break;
case ALT_status:
  delete field_status;
  break;
case ALT_pause:
  delete field_pause;
  break;
case ALT_resume:
  delete field_resume;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void MTP3__to__SCTPserver__data::log() const
{
switch (union_selection) {
case ALT_transfer__ind:
TTCN_Logger::log_event_str("{ transfer_ind := ");
field_transfer__ind->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_transfer__req:
TTCN_Logger::log_event_str("{ transfer_req := ");
field_transfer__req->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_register_:
TTCN_Logger::log_event_str("{ register := ");
field_register_->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_unregister:
TTCN_Logger::log_event_str("{ unregister := ");
field_unregister->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_status:
TTCN_Logger::log_event_str("{ status := ");
field_status->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_pause:
TTCN_Logger::log_event_str("{ pause := ");
field_pause->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_resume:
TTCN_Logger::log_event_str("{ resume := ");
field_resume->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void MTP3__to__SCTPserver__data::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, "transfer_ind")) {
    transfer__ind().set_param(*mp_last);
    if (!transfer__ind().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "transfer_req")) {
    transfer__req().set_param(*mp_last);
    if (!transfer__req().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "register")) {
    register_().set_param(*mp_last);
    if (!register_().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "unregister")) {
    unregister().set_param(*mp_last);
    if (!unregister().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "status")) {
    status().set_param(*mp_last);
    if (!status().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "pause")) {
    pause().set_param(*mp_last);
    if (!pause().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "resume")) {
    resume().set_param(*mp_last);
    if (!resume().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @MTP3asp_Types.MTP3_to_SCTPserver_data.", last_name);
}

void MTP3__to__SCTPserver__data::set_implicit_omit()
{
switch (union_selection) {
case ALT_transfer__ind:
field_transfer__ind->set_implicit_omit(); break;
case ALT_transfer__req:
field_transfer__req->set_implicit_omit(); break;
case ALT_register_:
field_register_->set_implicit_omit(); break;
case ALT_unregister:
field_unregister->set_implicit_omit(); break;
case ALT_status:
field_status->set_implicit_omit(); break;
case ALT_pause:
field_pause->set_implicit_omit(); break;
case ALT_resume:
field_resume->set_implicit_omit(); break;
default: break;
}
}

void MTP3__to__SCTPserver__data::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_transfer__ind:
field_transfer__ind->encode_text(text_buf);
break;
case ALT_transfer__req:
field_transfer__req->encode_text(text_buf);
break;
case ALT_register_:
field_register_->encode_text(text_buf);
break;
case ALT_unregister:
field_unregister->encode_text(text_buf);
break;
case ALT_status:
field_status->encode_text(text_buf);
break;
case ALT_pause:
field_pause->encode_text(text_buf);
break;
case ALT_resume:
field_resume->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
}

void MTP3__to__SCTPserver__data::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_transfer__ind:
transfer__ind().decode_text(text_buf);
break;
case ALT_transfer__req:
transfer__req().decode_text(text_buf);
break;
case ALT_register_:
register_().decode_text(text_buf);
break;
case ALT_unregister:
unregister().decode_text(text_buf);
break;
case ALT_status:
status().decode_text(text_buf);
break;
case ALT_pause:
pause().decode_text(text_buf);
break;
case ALT_resume:
resume().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
}

void MTP3__to__SCTPserver__data::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MTP3__to__SCTPserver__data::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MTP3__to__SCTPserver__data::RAW_decode(
const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, 
raw_order_t top_bit_ord, boolean no_err, int 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, ASP__MTP3__TRANSFERind_descr_.raw->forceomit);
      decoded_length = transfer__ind().RAW_decode(ASP__MTP3__TRANSFERind_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, ASP__MTP3__TRANSFERreq_descr_.raw->forceomit);
      decoded_length = transfer__req().RAW_decode(ASP__MTP3__TRANSFERreq_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, ASP__REGISTER__M3UA_descr_.raw->forceomit);
      decoded_length = register_().RAW_decode(ASP__REGISTER__M3UA_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 3: {
      RAW_Force_Omit field_force_omit(3, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = unregister().RAW_decode(INTEGER_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 4: {
      RAW_Force_Omit field_force_omit(4, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = status().RAW_decode(INTEGER_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 5: {
      RAW_Force_Omit field_force_omit(5, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = pause().RAW_decode(INTEGER_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 6: {
      RAW_Force_Omit field_force_omit(6, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = resume().RAW_decode(INTEGER_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, ASP__MTP3__TRANSFERind_descr_.raw->forceomit);
      decoded_length = transfer__ind().RAW_decode(ASP__MTP3__TRANSFERind_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, ASP__MTP3__TRANSFERreq_descr_.raw->forceomit);
      decoded_length = transfer__req().RAW_decode(ASP__MTP3__TRANSFERreq_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, ASP__REGISTER__M3UA_descr_.raw->forceomit);
      decoded_length = register_().RAW_decode(ASP__REGISTER__M3UA_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_3_force_omit(3, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = unregister().RAW_decode(INTEGER_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_3_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_4_force_omit(4, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = status().RAW_decode(INTEGER_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_4_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_5_force_omit(5, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = pause().RAW_decode(INTEGER_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_5_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_6_force_omit(6, force_omit, INTEGER_descr_.raw->forceomit);
      decoded_length = resume().RAW_decode(INTEGER_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_6_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int MTP3__to__SCTPserver__data::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  memset(myleaf.body.node.nodes, 0, 7 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_transfer__ind:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, ASP__MTP3__TRANSFERind_descr_.raw);
    encoded_length = field_transfer__ind->RAW_encode(ASP__MTP3__TRANSFERind_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &ASP__MTP3__TRANSFERind_descr_;
    break;
  case ALT_transfer__req:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, ASP__MTP3__TRANSFERreq_descr_.raw);
    encoded_length = field_transfer__req->RAW_encode(ASP__MTP3__TRANSFERreq_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &ASP__MTP3__TRANSFERreq_descr_;
    break;
  case ALT_register_:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, ASP__REGISTER__M3UA_descr_.raw);
    encoded_length = field_register_->RAW_encode(ASP__REGISTER__M3UA_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &ASP__REGISTER__M3UA_descr_;
    break;
  case ALT_unregister:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, INTEGER_descr_.raw);
    encoded_length = field_unregister->RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &INTEGER_descr_;
    break;
  case ALT_status:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, INTEGER_descr_.raw);
    encoded_length = field_status->RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &INTEGER_descr_;
    break;
  case ALT_pause:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, INTEGER_descr_.raw);
    encoded_length = field_pause->RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &INTEGER_descr_;
    break;
  case ALT_resume:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, INTEGER_descr_.raw);
    encoded_length = field_resume->RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &INTEGER_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void MTP3__to__SCTPserver__data_template::copy_value(const MTP3__to__SCTPserver__data& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
single_value.field_transfer__ind = new ASP__MTP3__TRANSFERind_template(other_value.transfer__ind());
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
single_value.field_transfer__req = new ASP__MTP3__TRANSFERreq_template(other_value.transfer__req());
break;
case MTP3__to__SCTPserver__data::ALT_register_:
single_value.field_register_ = new ASP__REGISTER__M3UA_template(other_value.register_());
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
single_value.field_unregister = new INTEGER_template(other_value.unregister());
break;
case MTP3__to__SCTPserver__data::ALT_status:
single_value.field_status = new INTEGER_template(other_value.status());
break;
case MTP3__to__SCTPserver__data::ALT_pause:
single_value.field_pause = new INTEGER_template(other_value.pause());
break;
case MTP3__to__SCTPserver__data::ALT_resume:
single_value.field_resume = new INTEGER_template(other_value.resume());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
set_selection(SPECIFIC_VALUE);
}

void MTP3__to__SCTPserver__data_template::copy_template(const MTP3__to__SCTPserver__data_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 MTP3__to__SCTPserver__data::ALT_transfer__ind:
single_value.field_transfer__ind = new ASP__MTP3__TRANSFERind_template(*other_value.single_value.field_transfer__ind);
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
single_value.field_transfer__req = new ASP__MTP3__TRANSFERreq_template(*other_value.single_value.field_transfer__req);
break;
case MTP3__to__SCTPserver__data::ALT_register_:
single_value.field_register_ = new ASP__REGISTER__M3UA_template(*other_value.single_value.field_register_);
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
single_value.field_unregister = new INTEGER_template(*other_value.single_value.field_unregister);
break;
case MTP3__to__SCTPserver__data::ALT_status:
single_value.field_status = new INTEGER_template(*other_value.single_value.field_status);
break;
case MTP3__to__SCTPserver__data::ALT_pause:
single_value.field_pause = new INTEGER_template(*other_value.single_value.field_pause);
break;
case MTP3__to__SCTPserver__data::ALT_resume:
single_value.field_resume = new INTEGER_template(*other_value.single_value.field_resume);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
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 MTP3__to__SCTPserver__data_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MTP3__to__SCTPserver__data_template(*other_value.implication_.precondition);
implication_.implied_template = new MTP3__to__SCTPserver__data_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
set_selection(other_value);
}

MTP3__to__SCTPserver__data_template::MTP3__to__SCTPserver__data_template()
{
}

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

MTP3__to__SCTPserver__data_template::MTP3__to__SCTPserver__data_template(const MTP3__to__SCTPserver__data& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void MTP3__to__SCTPserver__data_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
delete single_value.field_transfer__ind;
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
delete single_value.field_transfer__req;
break;
case MTP3__to__SCTPserver__data::ALT_register_:
delete single_value.field_register_;
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
delete single_value.field_unregister;
break;
case MTP3__to__SCTPserver__data::ALT_status:
delete single_value.field_status;
break;
case MTP3__to__SCTPserver__data::ALT_pause:
delete single_value.field_pause;
break;
case MTP3__to__SCTPserver__data::ALT_resume:
delete single_value.field_resume;
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;
}

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

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

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

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

boolean MTP3__to__SCTPserver__data_template::match(const MTP3__to__SCTPserver__data& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
MTP3__to__SCTPserver__data::union_selection_type value_selection = other_value.get_selection();
if (value_selection == MTP3__to__SCTPserver__data::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
return single_value.field_transfer__ind->match(other_value.transfer__ind(), legacy);
case MTP3__to__SCTPserver__data::ALT_transfer__req:
return single_value.field_transfer__req->match(other_value.transfer__req(), legacy);
case MTP3__to__SCTPserver__data::ALT_register_:
return single_value.field_register_->match(other_value.register_(), legacy);
case MTP3__to__SCTPserver__data::ALT_unregister:
return single_value.field_unregister->match(other_value.unregister(), legacy);
case MTP3__to__SCTPserver__data::ALT_status:
return single_value.field_status->match(other_value.status(), legacy);
case MTP3__to__SCTPserver__data::ALT_pause:
return single_value.field_pause->match(other_value.pause(), legacy);
case MTP3__to__SCTPserver__data::ALT_resume:
return single_value.field_resume->match(other_value.resume(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
}
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 @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
return FALSE;
}

boolean MTP3__to__SCTPserver__data_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
return single_value.field_transfer__ind->is_value();
case MTP3__to__SCTPserver__data::ALT_transfer__req:
return single_value.field_transfer__req->is_value();
case MTP3__to__SCTPserver__data::ALT_register_:
return single_value.field_register_->is_value();
case MTP3__to__SCTPserver__data::ALT_unregister:
return single_value.field_unregister->is_value();
case MTP3__to__SCTPserver__data::ALT_status:
return single_value.field_status->is_value();
case MTP3__to__SCTPserver__data::ALT_pause:
return single_value.field_pause->is_value();
case MTP3__to__SCTPserver__data::ALT_resume:
return single_value.field_resume->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
}

MTP3__to__SCTPserver__data MTP3__to__SCTPserver__data_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
MTP3__to__SCTPserver__data ret_val;
switch (single_value.union_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
ret_val.transfer__ind() = single_value.field_transfer__ind->valueof();
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
ret_val.transfer__req() = single_value.field_transfer__req->valueof();
break;
case MTP3__to__SCTPserver__data::ALT_register_:
ret_val.register_() = single_value.field_register_->valueof();
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
ret_val.unregister() = single_value.field_unregister->valueof();
break;
case MTP3__to__SCTPserver__data::ALT_status:
ret_val.status() = single_value.field_status->valueof();
break;
case MTP3__to__SCTPserver__data::ALT_pause:
ret_val.pause() = single_value.field_pause->valueof();
break;
case MTP3__to__SCTPserver__data::ALT_resume:
ret_val.resume() = single_value.field_resume->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
return ret_val;
}

MTP3__to__SCTPserver__data_template& MTP3__to__SCTPserver__data_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 @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return value_list.list_value[list_index];
}
void MTP3__to__SCTPserver__data_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MTP3__to__SCTPserver__data_template[list_length];
}

ASP__MTP3__TRANSFERind_template& MTP3__to__SCTPserver__data_template::transfer__ind()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MTP3__to__SCTPserver__data::ALT_transfer__ind) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_transfer__ind = new ASP__MTP3__TRANSFERind_template(ANY_VALUE);
else single_value.field_transfer__ind = new ASP__MTP3__TRANSFERind_template;
single_value.union_selection = MTP3__to__SCTPserver__data::ALT_transfer__ind;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_transfer__ind;
}

const ASP__MTP3__TRANSFERind_template& MTP3__to__SCTPserver__data_template::transfer__ind() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field transfer_ind in a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (single_value.union_selection != MTP3__to__SCTPserver__data::ALT_transfer__ind) TTCN_error("Accessing non-selected field transfer_ind in a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *single_value.field_transfer__ind;
}

ASP__MTP3__TRANSFERreq_template& MTP3__to__SCTPserver__data_template::transfer__req()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MTP3__to__SCTPserver__data::ALT_transfer__req) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_transfer__req = new ASP__MTP3__TRANSFERreq_template(ANY_VALUE);
else single_value.field_transfer__req = new ASP__MTP3__TRANSFERreq_template;
single_value.union_selection = MTP3__to__SCTPserver__data::ALT_transfer__req;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_transfer__req;
}

const ASP__MTP3__TRANSFERreq_template& MTP3__to__SCTPserver__data_template::transfer__req() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field transfer_req in a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (single_value.union_selection != MTP3__to__SCTPserver__data::ALT_transfer__req) TTCN_error("Accessing non-selected field transfer_req in a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *single_value.field_transfer__req;
}

ASP__REGISTER__M3UA_template& MTP3__to__SCTPserver__data_template::register_()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MTP3__to__SCTPserver__data::ALT_register_) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_register_ = new ASP__REGISTER__M3UA_template(ANY_VALUE);
else single_value.field_register_ = new ASP__REGISTER__M3UA_template;
single_value.union_selection = MTP3__to__SCTPserver__data::ALT_register_;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_register_;
}

const ASP__REGISTER__M3UA_template& MTP3__to__SCTPserver__data_template::register_() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field register in a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (single_value.union_selection != MTP3__to__SCTPserver__data::ALT_register_) TTCN_error("Accessing non-selected field register in a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *single_value.field_register_;
}

INTEGER_template& MTP3__to__SCTPserver__data_template::unregister()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MTP3__to__SCTPserver__data::ALT_unregister) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_unregister = new INTEGER_template(ANY_VALUE);
else single_value.field_unregister = new INTEGER_template;
single_value.union_selection = MTP3__to__SCTPserver__data::ALT_unregister;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_unregister;
}

const INTEGER_template& MTP3__to__SCTPserver__data_template::unregister() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field unregister in a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (single_value.union_selection != MTP3__to__SCTPserver__data::ALT_unregister) TTCN_error("Accessing non-selected field unregister in a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *single_value.field_unregister;
}

INTEGER_template& MTP3__to__SCTPserver__data_template::status()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MTP3__to__SCTPserver__data::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 INTEGER_template(ANY_VALUE);
else single_value.field_status = new INTEGER_template;
single_value.union_selection = MTP3__to__SCTPserver__data::ALT_status;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_status;
}

const INTEGER_template& MTP3__to__SCTPserver__data_template::status() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field status in a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (single_value.union_selection != MTP3__to__SCTPserver__data::ALT_status) TTCN_error("Accessing non-selected field status in a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *single_value.field_status;
}

INTEGER_template& MTP3__to__SCTPserver__data_template::pause()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MTP3__to__SCTPserver__data::ALT_pause) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pause = new INTEGER_template(ANY_VALUE);
else single_value.field_pause = new INTEGER_template;
single_value.union_selection = MTP3__to__SCTPserver__data::ALT_pause;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_pause;
}

const INTEGER_template& MTP3__to__SCTPserver__data_template::pause() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pause in a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (single_value.union_selection != MTP3__to__SCTPserver__data::ALT_pause) TTCN_error("Accessing non-selected field pause in a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *single_value.field_pause;
}

INTEGER_template& MTP3__to__SCTPserver__data_template::resume()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MTP3__to__SCTPserver__data::ALT_resume) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_resume = new INTEGER_template(ANY_VALUE);
else single_value.field_resume = new INTEGER_template;
single_value.union_selection = MTP3__to__SCTPserver__data::ALT_resume;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_resume;
}

const INTEGER_template& MTP3__to__SCTPserver__data_template::resume() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field resume in a non-specific template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
if (single_value.union_selection != MTP3__to__SCTPserver__data::ALT_resume) TTCN_error("Accessing non-selected field resume in a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
return *single_value.field_resume;
}

boolean MTP3__to__SCTPserver__data_template::ischosen(MTP3__to__SCTPserver__data::union_selection_type checked_selection) const
{
if (checked_selection == MTP3__to__SCTPserver__data::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == MTP3__to__SCTPserver__data::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
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 @MTP3asp_Types.MTP3_to_SCTPserver_data 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 MTP3__to__SCTPserver__data_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
TTCN_Logger::log_event_str("{ transfer_ind := ");
single_value.field_transfer__ind->log();
TTCN_Logger::log_event_str(" }");
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
TTCN_Logger::log_event_str("{ transfer_req := ");
single_value.field_transfer__req->log();
TTCN_Logger::log_event_str(" }");
break;
case MTP3__to__SCTPserver__data::ALT_register_:
TTCN_Logger::log_event_str("{ register := ");
single_value.field_register_->log();
TTCN_Logger::log_event_str(" }");
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
TTCN_Logger::log_event_str("{ unregister := ");
single_value.field_unregister->log();
TTCN_Logger::log_event_str(" }");
break;
case MTP3__to__SCTPserver__data::ALT_status:
TTCN_Logger::log_event_str("{ status := ");
single_value.field_status->log();
TTCN_Logger::log_event_str(" }");
break;
case MTP3__to__SCTPserver__data::ALT_pause:
TTCN_Logger::log_event_str("{ pause := ");
single_value.field_pause->log();
TTCN_Logger::log_event_str(" }");
break;
case MTP3__to__SCTPserver__data::ALT_resume:
TTCN_Logger::log_event_str("{ resume := ");
single_value.field_resume->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 MTP3__to__SCTPserver__data_template::log_match(const MTP3__to__SCTPserver__data& 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 MTP3__to__SCTPserver__data::ALT_transfer__ind:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".transfer_ind");
single_value.field_transfer__ind->log_match(match_value.transfer__ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ transfer_ind := ");
single_value.field_transfer__ind->log_match(match_value.transfer__ind(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".transfer_req");
single_value.field_transfer__req->log_match(match_value.transfer__req(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ transfer_req := ");
single_value.field_transfer__req->log_match(match_value.transfer__req(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case MTP3__to__SCTPserver__data::ALT_register_:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".register");
single_value.field_register_->log_match(match_value.register_(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ register := ");
single_value.field_register_->log_match(match_value.register_(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".unregister");
single_value.field_unregister->log_match(match_value.unregister(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ unregister := ");
single_value.field_unregister->log_match(match_value.unregister(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case MTP3__to__SCTPserver__data::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 MTP3__to__SCTPserver__data::ALT_pause:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".pause");
single_value.field_pause->log_match(match_value.pause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ pause := ");
single_value.field_pause->log_match(match_value.pause(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case MTP3__to__SCTPserver__data::ALT_resume:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".resume");
single_value.field_resume->log_match(match_value.resume(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ resume := ");
single_value.field_resume->log_match(match_value.resume(), 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 MTP3__to__SCTPserver__data_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 MTP3__to__SCTPserver__data::ALT_transfer__ind:
single_value.field_transfer__ind->encode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
single_value.field_transfer__req->encode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_register_:
single_value.field_register_->encode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
single_value.field_unregister->encode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_status:
single_value.field_status->encode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_pause:
single_value.field_pause->encode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_resume:
single_value.field_resume->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
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 @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
}

void MTP3__to__SCTPserver__data_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = MTP3__to__SCTPserver__data::UNBOUND_VALUE;
MTP3__to__SCTPserver__data::union_selection_type new_selection = (MTP3__to__SCTPserver__data::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
single_value.field_transfer__ind = new ASP__MTP3__TRANSFERind_template;
single_value.field_transfer__ind->decode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
single_value.field_transfer__req = new ASP__MTP3__TRANSFERreq_template;
single_value.field_transfer__req->decode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_register_:
single_value.field_register_ = new ASP__REGISTER__M3UA_template;
single_value.field_register_->decode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_unregister:
single_value.field_unregister = new INTEGER_template;
single_value.field_unregister->decode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_status:
single_value.field_status = new INTEGER_template;
single_value.field_status->decode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_pause:
single_value.field_pause = new INTEGER_template;
single_value.field_pause->decode_text(text_buf);
break;
case MTP3__to__SCTPserver__data::ALT_resume:
single_value.field_resume = new INTEGER_template;
single_value.field_resume->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
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 MTP3__to__SCTPserver__data_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
}

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

boolean MTP3__to__SCTPserver__data_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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 MTP3__to__SCTPserver__data_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 `@MTP3asp_Types.MTP3_to_SCTPserver_data'");
    }
    if (strcmp("transfer_ind", param_field) == 0) {
      transfer__ind().set_param(param);
      return;
    } else if (strcmp("transfer_req", param_field) == 0) {
      transfer__req().set_param(param);
      return;
    } else if (strcmp("register", param_field) == 0) {
      register_().set_param(param);
      return;
    } else if (strcmp("unregister", param_field) == 0) {
      unregister().set_param(param);
      return;
    } else if (strcmp("status", param_field) == 0) {
      status().set_param(param);
      return;
    } else if (strcmp("pause", param_field) == 0) {
      pause().set_param(param);
      return;
    } else if (strcmp("resume", param_field) == 0) {
      resume().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@MTP3asp_Types.MTP3_to_SCTPserver_data'", 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: {
    MTP3__to__SCTPserver__data_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", "@MTP3asp_Types.MTP3_to_SCTPserver_data");
    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, "transfer_ind")) {
      transfer__ind().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "transfer_req")) {
      transfer__req().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "register")) {
      register_().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "unregister")) {
      unregister().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "status")) {
      status().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "pause")) {
      pause().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "resume")) {
      resume().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @MTP3asp_Types.MTP3_to_SCTPserver_data.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    MTP3__to__SCTPserver__data_template* precondition = new MTP3__to__SCTPserver__data_template;
    precondition->set_param(*m_p->get_elem(0));
    MTP3__to__SCTPserver__data_template* implied_template = new MTP3__to__SCTPserver__data_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = MTP3__to__SCTPserver__data_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@MTP3asp_Types.MTP3_to_SCTPserver_data");
  }
  is_ifpresent = param.get_ifpresent();
}

void MTP3__to__SCTPserver__data_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case MTP3__to__SCTPserver__data::ALT_transfer__ind:
single_value.field_transfer__ind->check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
return;
case MTP3__to__SCTPserver__data::ALT_transfer__req:
single_value.field_transfer__req->check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
return;
case MTP3__to__SCTPserver__data::ALT_register_:
single_value.field_register_->check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
return;
case MTP3__to__SCTPserver__data::ALT_unregister:
single_value.field_unregister->check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
return;
case MTP3__to__SCTPserver__data::ALT_status:
single_value.field_status->check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
return;
case MTP3__to__SCTPserver__data::ALT_pause:
single_value.field_pause->check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
return;
case MTP3__to__SCTPserver__data::ALT_resume:
single_value.field_resume->check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @MTP3asp_Types.MTP3_to_SCTPserver_data.");
}
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 : "@MTP3asp_Types.MTP3_to_SCTPserver_data");
}

MTP3__to__M3UAserver__msg::MTP3__to__M3UAserver__msg()
{
}

MTP3__to__M3UAserver__msg::MTP3__to__M3UAserver__msg(const INTEGER& par_msgType,
    const INTEGER& par_msgLength,
    const MTP3__to__SCTPserver__data& par_data)
  :   field_msgType(par_msgType),
  field_msgLength(par_msgLength),
  field_data(par_data)
{
}

MTP3__to__M3UAserver__msg::MTP3__to__M3UAserver__msg(const MTP3__to__M3UAserver__msg& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
if (other_value.msgType().is_bound()) field_msgType = other_value.msgType();
else field_msgType.clean_up();
if (other_value.msgLength().is_bound()) field_msgLength = other_value.msgLength();
else field_msgLength.clean_up();
if (other_value.data().is_bound()) field_data = other_value.data();
else field_data.clean_up();
}

void MTP3__to__M3UAserver__msg::clean_up()
{
field_msgType.clean_up();
field_msgLength.clean_up();
field_data.clean_up();
}

const TTCN_Typedescriptor_t* MTP3__to__M3UAserver__msg::get_descriptor() const { return &MTP3__to__M3UAserver__msg_descr_; }
MTP3__to__M3UAserver__msg& MTP3__to__M3UAserver__msg::operator=(const MTP3__to__M3UAserver__msg& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
  if (other_value.msgType().is_bound()) field_msgType = other_value.msgType();
  else field_msgType.clean_up();
  if (other_value.msgLength().is_bound()) field_msgLength = other_value.msgLength();
  else field_msgLength.clean_up();
  if (other_value.data().is_bound()) field_data = other_value.data();
  else field_data.clean_up();
}
return *this;
}

boolean MTP3__to__M3UAserver__msg::operator==(const MTP3__to__M3UAserver__msg& other_value) const
{
return field_msgType==other_value.field_msgType
  && field_msgLength==other_value.field_msgLength
  && field_data==other_value.field_data;
}

boolean MTP3__to__M3UAserver__msg::is_bound() const
{
return (field_msgType.is_bound())
  || (field_msgLength.is_bound())
  || (field_data.is_bound());
}
boolean MTP3__to__M3UAserver__msg::is_value() const
{
return field_msgType.is_value()
  && field_msgLength.is_value()
  && field_data.is_value();
}
void MTP3__to__M3UAserver__msg::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ msgType := ");
field_msgType.log();
TTCN_Logger::log_event_str(", msgLength := ");
field_msgLength.log();
TTCN_Logger::log_event_str(", data := ");
field_data.log();
TTCN_Logger::log_event_str(" }");
}

void MTP3__to__M3UAserver__msg::set_implicit_omit()
{
if (msgType().is_bound()) msgType().set_implicit_omit();
if (msgLength().is_bound()) msgLength().set_implicit_omit();
if (data().is_bound()) data().set_implicit_omit();
}

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

void MTP3__to__M3UAserver__msg::encode_text(Text_Buf& text_buf) const
{
field_msgType.encode_text(text_buf);
field_msgLength.encode_text(text_buf);
field_data.encode_text(text_buf);
}

void MTP3__to__M3UAserver__msg::decode_text(Text_Buf& text_buf)
{
field_msgType.decode_text(text_buf);
field_msgLength.decode_text(text_buf);
field_data.decode_text(text_buf);
}

void MTP3__to__M3UAserver__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;}
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MTP3__to__M3UAserver__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;}
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MTP3__to__M3UAserver__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;
  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;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, INTEGER_descr_.raw->forceomit);
  decoded_field_length = field_msgType.RAW_decode(INTEGER_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  RAW_Force_Omit field_1_force_omit(1, force_omit, MTP3__to__M3UAserver__msg_msgLength_descr_.raw->forceomit);
  decoded_field_length = field_msgLength.RAW_decode(MTP3__to__M3UAserver__msg_msgLength_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_msgLength.convert_to_Integer(MTP3__to__M3UAserver__msg_msgLength_descr_);
  field_msgLength = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  value_of_length_field1 -= decoded_field_length;
  if (value_of_length_field1 < 0) return -1;
  if (field_msgType == 0) selected_field = 0;
  else if (field_msgType == 1) selected_field = 1;
  else if (field_msgType == 2) selected_field = 2;
  else if (field_msgType == 3) selected_field = 3;
  else if (field_msgType == 4) selected_field = 4;
  else if (field_msgType == 5) selected_field = 5;
  else if (field_msgType == 6) selected_field = 6;
  else selected_field = -1;
  RAW_Force_Omit field_2_force_omit(2, force_omit, MTP3__to__M3UAserver__msg_data_descr_.raw->forceomit);
  decoded_field_length = field_data.RAW_decode(MTP3__to__M3UAserver__msg_data_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, selected_field, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MTP3__to__M3UAserver__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, INTEGER_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MTP3__to__M3UAserver__msg_msgLength_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MTP3__to__M3UAserver__msg_data_descr_.raw);
  encoded_length += field_msgType.RAW_encode(INTEGER_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 32;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &MTP3__to__M3UAserver__msg_msgLength_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(3);
  myleaf.body.node.nodes[1]->length = 32;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[0]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[0]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_data.RAW_encode(MTP3__to__M3UAserver__msg_data_descr_, *myleaf.body.node.nodes[2]);
  switch (field_data.get_selection()) {
  case MTP3__to__SCTPserver__data::ALT_transfer__ind:
  if (field_msgType != 0) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  INTEGER new_val(0);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(INTEGER_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 MTP3__to__SCTPserver__data::ALT_transfer__req:
  if (field_msgType != 1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  INTEGER new_val(1);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(INTEGER_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 MTP3__to__SCTPserver__data::ALT_register_:
  if (field_msgType != 2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  INTEGER new_val(2);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(INTEGER_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 MTP3__to__SCTPserver__data::ALT_unregister:
  if (field_msgType != 3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  INTEGER new_val(3);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(INTEGER_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 MTP3__to__SCTPserver__data::ALT_status:
  if (field_msgType != 4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  INTEGER new_val(4);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(INTEGER_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 MTP3__to__SCTPserver__data::ALT_pause:
  if (field_msgType != 5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  INTEGER new_val(5);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(INTEGER_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 MTP3__to__SCTPserver__data::ALT_resume:
  if (field_msgType != 6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 0 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  INTEGER new_val(6);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(INTEGER_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 MTP3__to__M3UAserver__msg_template::single_value_struct {
INTEGER_template field_msgType;
INTEGER_template field_msgLength;
MTP3__to__SCTPserver__data_template field_data;
};

void MTP3__to__M3UAserver__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_msgType = ANY_VALUE;
single_value->field_msgLength = ANY_VALUE;
single_value->field_data = ANY_VALUE;
}
}
}

void MTP3__to__M3UAserver__msg_template::copy_value(const MTP3__to__M3UAserver__msg& other_value)
{
single_value = new single_value_struct;
if (other_value.msgType().is_bound()) {
  single_value->field_msgType = other_value.msgType();
} else {
  single_value->field_msgType.clean_up();
}
if (other_value.msgLength().is_bound()) {
  single_value->field_msgLength = other_value.msgLength();
} else {
  single_value->field_msgLength.clean_up();
}
if (other_value.data().is_bound()) {
  single_value->field_data = other_value.data();
} else {
  single_value->field_data.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MTP3__to__M3UAserver__msg_template::copy_template(const MTP3__to__M3UAserver__msg_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.msgType().get_selection()) {
single_value->field_msgType = other_value.msgType();
} else {
single_value->field_msgType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msgLength().get_selection()) {
single_value->field_msgLength = other_value.msgLength();
} else {
single_value->field_msgLength.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) {
single_value->field_data = other_value.data();
} else {
single_value->field_data.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MTP3__to__M3UAserver__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 MTP3__to__M3UAserver__msg_template(*other_value.implication_.precondition);
implication_.implied_template = new MTP3__to__M3UAserver__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 @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
break;
}
set_selection(other_value);
}

MTP3__to__M3UAserver__msg_template::MTP3__to__M3UAserver__msg_template()
{
}

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

MTP3__to__M3UAserver__msg_template::MTP3__to__M3UAserver__msg_template(const MTP3__to__M3UAserver__msg& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

MTP3__to__M3UAserver__msg_template& MTP3__to__M3UAserver__msg_template::operator=(const OPTIONAL<MTP3__to__M3UAserver__msg>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MTP3__to__M3UAserver__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 @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
}
return *this;
}

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

boolean MTP3__to__M3UAserver__msg_template::match(const MTP3__to__M3UAserver__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.msgType().is_bound()) return FALSE;
if(!single_value->field_msgType.match(other_value.msgType(), legacy))return FALSE;
if(!other_value.msgLength().is_bound()) return FALSE;
if(!single_value->field_msgLength.match(other_value.msgLength(), legacy))return FALSE;
if(!other_value.data().is_bound()) return FALSE;
if(!single_value->field_data.match(other_value.data(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
}
return FALSE;
}

boolean MTP3__to__M3UAserver__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_msgType.is_bound()
 || single_value->field_msgLength.is_bound()
 || single_value->field_data.is_bound();
}

boolean MTP3__to__M3UAserver__msg_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_msgType.is_value()
 && single_value->field_msgLength.is_value()
 && single_value->field_data.is_value();
}

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

MTP3__to__M3UAserver__msg MTP3__to__M3UAserver__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 @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
MTP3__to__M3UAserver__msg ret_val;
if (single_value->field_msgType.is_bound()) {
ret_val.msgType() = single_value->field_msgType.valueof();
}
if (single_value->field_msgLength.is_bound()) {
ret_val.msgLength() = single_value->field_msgLength.valueof();
}
if (single_value->field_data.is_bound()) {
ret_val.data() = single_value->field_data.valueof();
}
return ret_val;
}

void MTP3__to__M3UAserver__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 @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MTP3__to__M3UAserver__msg_template[list_length];
}

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

INTEGER_template& MTP3__to__M3UAserver__msg_template::msgType()
{
set_specific();
return single_value->field_msgType;
}

const INTEGER_template& MTP3__to__M3UAserver__msg_template::msgType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgType of a non-specific template of type @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
return single_value->field_msgType;
}

INTEGER_template& MTP3__to__M3UAserver__msg_template::msgLength()
{
set_specific();
return single_value->field_msgLength;
}

const INTEGER_template& MTP3__to__M3UAserver__msg_template::msgLength() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgLength of a non-specific template of type @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
return single_value->field_msgLength;
}

MTP3__to__SCTPserver__data_template& MTP3__to__M3UAserver__msg_template::data()
{
set_specific();
return single_value->field_data;
}

const MTP3__to__SCTPserver__data_template& MTP3__to__M3UAserver__msg_template::data() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field data of a non-specific template of type @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
return single_value->field_data;
}

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

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

void MTP3__to__M3UAserver__msg_template::log_match(const MTP3__to__M3UAserver__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_msgType.match(match_value.msgType(), legacy)){
TTCN_Logger::log_logmatch_info(".msgType");
single_value->field_msgType.log_match(match_value.msgType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msgLength.match(match_value.msgLength(), legacy)){
TTCN_Logger::log_logmatch_info(".msgLength");
single_value->field_msgLength.log_match(match_value.msgLength(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_data.match(match_value.data(), legacy)){
TTCN_Logger::log_logmatch_info(".data");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ msgType := ");
single_value->field_msgType.log_match(match_value.msgType(), legacy);
TTCN_Logger::log_event_str(", msgLength := ");
single_value->field_msgLength.log_match(match_value.msgLength(), legacy);
TTCN_Logger::log_event_str(", data := ");
single_value->field_data.log_match(match_value.data(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

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

void MTP3__to__M3UAserver__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_msgType.decode_text(text_buf);
single_value->field_msgLength.decode_text(text_buf);
single_value->field_data.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MTP3__to__M3UAserver__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 @MTP3asp_Types.MTP3_to_M3UAserver_msg.");
}
}

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

void MTP3__to__M3UAserver__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_msgType.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_M3UAserver_msg");
single_value->field_msgLength.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_M3UAserver_msg");
single_value->field_data.check_restriction(t_res, t_name ? t_name : "@MTP3asp_Types.MTP3_to_M3UAserver_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 : "@MTP3asp_Types.MTP3_to_M3UAserver_msg");
}

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

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


/* Bodies of functions, altsteps and testcases */

OCTETSTRING enc__MTP3__to__M3UAserver__msg(const MTP3__to__M3UAserver__msg& pdu)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_MTP3_to_M3UAserver_msg(): Encoding @MTP3asp_Types.MTP3_to_M3UAserver_msg: ");
pdu.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
pdu.encode(MTP3__to__M3UAserver__msg_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_MTP3_to_M3UAserver_msg(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

MTP3__to__M3UAserver__msg dec__MTP3__to__M3UAserver__msg(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_MTP3_to_M3UAserver_msg(): 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);
MTP3__to__M3UAserver__msg ret_val;
ret_val.decode(MTP3__to__M3UAserver__msg_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_MTP3_to_M3UAserver_msg(): Decoded @MTP3asp_Types.MTP3_to_M3UAserver_msg: ");
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_MTP3_to_M3UAserver_msg(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

void MTP3__Field__sio_ni_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(MTP3__Field__sio_ni_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__Field__sio_ni_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(MTP3__Field__sio_ni_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 MTP3__Field__sio_prio_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(MTP3__Field__sio_prio_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__Field__sio_prio_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(MTP3__Field__sio_prio_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 MTP3__Field__sio_si_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(MTP3__Field__sio_si_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__Field__sio_si_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(MTP3__Field__sio_si_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 MTP3__Field__sio_encoder(const MTP3__Field__sio& 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 `@MTP3asp_Types.MTP3_Field_sio' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(MTP3__Field__sio_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__Field__sio_decoder(OCTETSTRING& input_stream, MTP3__Field__sio& 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 `@MTP3asp_Types.MTP3_Field_sio' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(MTP3__Field__sio_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 ASP__MTP3__TRANSFERind_opc_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(ASP__MTP3__TRANSFERind_opc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERind_opc_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(ASP__MTP3__TRANSFERind_opc_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 ASP__MTP3__TRANSFERind_dpc_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(ASP__MTP3__TRANSFERind_dpc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERind_dpc_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(ASP__MTP3__TRANSFERind_dpc_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 ASP__MTP3__TRANSFERind_sls_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(ASP__MTP3__TRANSFERind_sls_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERind_sls_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(ASP__MTP3__TRANSFERind_sls_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 ASP__MTP3__TRANSFERind_data_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(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERind_data_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(OCTETSTRING_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 ASP__MTP3__TRANSFERind_encoder(const ASP__MTP3__TRANSFERind& 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 `@MTP3asp_Types.ASP_MTP3_TRANSFERind' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__MTP3__TRANSFERind_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERind_decoder(OCTETSTRING& input_stream, ASP__MTP3__TRANSFERind& 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 `@MTP3asp_Types.ASP_MTP3_TRANSFERind' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__MTP3__TRANSFERind_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 ASP__MTP3__PAUSE& other_value)
{
other_value.must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_PAUSE.");
return TRUE;
}

void ASP__MTP3__PAUSE_encoder(const ASP__MTP3__PAUSE& 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 `@MTP3asp_Types.ASP_MTP3_PAUSE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__MTP3__PAUSE_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__PAUSE_decoder(OCTETSTRING& input_stream, ASP__MTP3__PAUSE& 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 `@MTP3asp_Types.ASP_MTP3_PAUSE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__MTP3__PAUSE_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 ASP__MTP3__RESUME& other_value)
{
other_value.must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_RESUME.");
return TRUE;
}

void ASP__MTP3__RESUME_encoder(const ASP__MTP3__RESUME& 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 `@MTP3asp_Types.ASP_MTP3_RESUME' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__MTP3__RESUME_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__RESUME_decoder(OCTETSTRING& input_stream, ASP__MTP3__RESUME& 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 `@MTP3asp_Types.ASP_MTP3_RESUME' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__MTP3__RESUME_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 ASP__MTP3__STATUS& other_value)
{
other_value.must_bound("Comparison of an unbound value of type @MTP3asp_Types.ASP_MTP3_STATUS.");
return TRUE;
}

void ASP__MTP3__STATUS_encoder(const ASP__MTP3__STATUS& 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 `@MTP3asp_Types.ASP_MTP3_STATUS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__MTP3__STATUS_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__STATUS_decoder(OCTETSTRING& input_stream, ASP__MTP3__STATUS& 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 `@MTP3asp_Types.ASP_MTP3_STATUS' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__MTP3__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 ASP__MTP3__TRANSFERreq_opc_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(ASP__MTP3__TRANSFERreq_opc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERreq_opc_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(ASP__MTP3__TRANSFERreq_opc_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 ASP__MTP3__TRANSFERreq_dpc_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(ASP__MTP3__TRANSFERreq_dpc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERreq_dpc_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(ASP__MTP3__TRANSFERreq_dpc_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 ASP__MTP3__TRANSFERreq_sls_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(ASP__MTP3__TRANSFERreq_sls_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERreq_sls_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(ASP__MTP3__TRANSFERreq_sls_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 ASP__MTP3__TRANSFERreq_data_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(OCTETSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERreq_data_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(OCTETSTRING_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 ASP__MTP3__TRANSFERreq_encoder(const ASP__MTP3__TRANSFERreq& 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 `@MTP3asp_Types.ASP_MTP3_TRANSFERreq' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__MTP3__TRANSFERreq_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__MTP3__TRANSFERreq_decoder(OCTETSTRING& input_stream, ASP__MTP3__TRANSFERreq& 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 `@MTP3asp_Types.ASP_MTP3_TRANSFERreq' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__MTP3__TRANSFERreq_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 ASP__REGISTER__M3UA_ni_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(ASP__REGISTER__M3UA_ni_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__REGISTER__M3UA_ni_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(ASP__REGISTER__M3UA_ni_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 ASP__REGISTER__M3UA_sut__pc_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(ASP__REGISTER__M3UA_sut__pc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__REGISTER__M3UA_sut__pc_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(ASP__REGISTER__M3UA_sut__pc_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 ASP__REGISTER__M3UA_tester__pc_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(ASP__REGISTER__M3UA_tester__pc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__REGISTER__M3UA_tester__pc_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(ASP__REGISTER__M3UA_tester__pc_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 ASP__REGISTER__M3UA_m3ua__version_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(ASP__REGISTER__M3UA_m3ua__version_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__REGISTER__M3UA_m3ua__version_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(ASP__REGISTER__M3UA_m3ua__version_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 ASP__REGISTER__M3UA_entity_encoder(const CHARSTRING& 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 `charstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CHARSTRING_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__REGISTER__M3UA_entity_decoder(OCTETSTRING& input_stream, CHARSTRING& 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 `charstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CHARSTRING_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 ASP__REGISTER__M3UA_encoder(const ASP__REGISTER__M3UA& 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 `@MTP3asp_Types.ASP_REGISTER_M3UA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ASP__REGISTER__M3UA_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ASP__REGISTER__M3UA_decoder(OCTETSTRING& input_stream, ASP__REGISTER__M3UA& 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 `@MTP3asp_Types.ASP_REGISTER_M3UA' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ASP__REGISTER__M3UA_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 MTP3__to__SCTPserver__data_unregister_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(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__SCTPserver__data_unregister_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(INTEGER_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 MTP3__to__SCTPserver__data_status_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(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__SCTPserver__data_status_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(INTEGER_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 MTP3__to__SCTPserver__data_pause_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(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__SCTPserver__data_pause_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(INTEGER_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 MTP3__to__SCTPserver__data_resume_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(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__SCTPserver__data_resume_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(INTEGER_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 MTP3__to__SCTPserver__data_encoder(const MTP3__to__SCTPserver__data& 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 `@MTP3asp_Types.MTP3_to_SCTPserver_data' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(MTP3__to__SCTPserver__data_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__SCTPserver__data_decoder(OCTETSTRING& input_stream, MTP3__to__SCTPserver__data& 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 `@MTP3asp_Types.MTP3_to_SCTPserver_data' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(MTP3__to__SCTPserver__data_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 MTP3__to__M3UAserver__msg_msgType_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(INTEGER_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__M3UAserver__msg_msgType_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(INTEGER_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 MTP3__to__M3UAserver__msg_msgLength_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(MTP3__to__M3UAserver__msg_msgLength_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__M3UAserver__msg_msgLength_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(MTP3__to__M3UAserver__msg_msgLength_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 MTP3__to__M3UAserver__msg_data_encoder(const MTP3__to__SCTPserver__data& 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 `@MTP3asp_Types.MTP3_to_SCTPserver_data' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(MTP3__to__M3UAserver__msg_data_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__M3UAserver__msg_data_decoder(OCTETSTRING& input_stream, MTP3__to__SCTPserver__data& 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 `@MTP3asp_Types.MTP3_to_SCTPserver_data' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(MTP3__to__M3UAserver__msg_data_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 MTP3__to__M3UAserver__msg_encoder(const MTP3__to__M3UAserver__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 `@MTP3asp_Types.MTP3_to_M3UAserver_msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(MTP3__to__M3UAserver__msg_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER MTP3__to__M3UAserver__msg_decoder(OCTETSTRING& input_stream, MTP3__to__M3UAserver__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 `@MTP3asp_Types.MTP3_to_M3UAserver_msg' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(MTP3__to__M3UAserver__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;
}
}

ASP__MTP3__TRANSFERind_template t__ASP__MTP3__TRANSFERind(const MTP3__Field__sio_template& pl__SIO, const INTEGER_template& pl__OPC, const INTEGER_template& pl__DPC, const INTEGER_template& pl__SLS, const OCTETSTRING_template& pl__data)
{
TTCN_Location current_location("MTP3asp_Types.ttcn", 192, TTCN_Location::LOCATION_TEMPLATE, "t_ASP_MTP3_TRANSFERind");
ASP__MTP3__TRANSFERind_template ret_val;
ret_val.sio() = pl__SIO;
ret_val.opc() = pl__OPC;
ret_val.dpc() = pl__DPC;
ret_val.sls() = pl__SLS;
ret_val.data() = pl__data;
return ret_val;
}

ASP__MTP3__TRANSFERind_template tr__ASP__MTP3__TRANSFERind__sio(const BITSTRING_template& pl__NI, const BITSTRING_template& pl__PRIO, const BITSTRING_template& pl__SI, const INTEGER_template& pl__OPC, const INTEGER_template& pl__DPC, const INTEGER_template& pl__SLS, const OCTETSTRING_template& pl__data)
{
TTCN_Location current_location("MTP3asp_Types.ttcn", 208, TTCN_Location::LOCATION_TEMPLATE, "tr_ASP_MTP3_TRANSFERind_sio");
ASP__MTP3__TRANSFERind_template ret_val;
{
MTP3__Field__sio_template& tmp_0 = ret_val.sio();
tmp_0.ni() = pl__NI;
tmp_0.prio() = pl__PRIO;
tmp_0.si() = pl__SI;
}
ret_val.opc() = pl__OPC;
ret_val.dpc() = pl__DPC;
ret_val.sls() = pl__SLS;
ret_val.data() = pl__data;
return ret_val;
}

ASP__MTP3__TRANSFERreq_template t__ASP__MTP3__TRANSFERreq(const MTP3__Field__sio& pl__SIO, const INTEGER& pl__OPC, const INTEGER& pl__DPC, const INTEGER& pl__SLS, const OCTETSTRING& pl__data)
{
TTCN_Location current_location("MTP3asp_Types.ttcn", 240, TTCN_Location::LOCATION_TEMPLATE, "t_ASP_MTP3_TRANSFERreq");
ASP__MTP3__TRANSFERreq_template ret_val;
ret_val.sio() = pl__SIO;
ret_val.opc() = pl__OPC;
ret_val.dpc() = pl__DPC;
ret_val.sls() = pl__SLS;
ret_val.data() = pl__data;
return ret_val;
}

ASP__MTP3__TRANSFERreq_template tr__ASP__MTP3__TRANSFERreq__sio(const BITSTRING_template& pl__NI, const BITSTRING_template& pl__PRIO, const BITSTRING_template& pl__SI, const INTEGER_template& pl__OPC, const INTEGER_template& pl__DPC, const INTEGER_template& pl__SLS, const OCTETSTRING_template& pl__data)
{
TTCN_Location current_location("MTP3asp_Types.ttcn", 256, TTCN_Location::LOCATION_TEMPLATE, "tr_ASP_MTP3_TRANSFERreq_sio");
ASP__MTP3__TRANSFERreq_template ret_val;
{
MTP3__Field__sio_template& tmp_1 = ret_val.sio();
tmp_1.ni() = pl__NI;
tmp_1.prio() = pl__PRIO;
tmp_1.si() = pl__SI;
}
ret_val.opc() = pl__OPC;
ret_val.dpc() = pl__DPC;
ret_val.sls() = pl__SLS;
ret_val.data() = pl__data;
return ret_val;
}

ASP__MTP3__TRANSFERreq_template t__ASP__MTP3__TRANSFERreq__stc(const OCTETSTRING_template& pl__data)
{
TTCN_Location current_location("MTP3asp_Types.ttcn", 302, TTCN_Location::LOCATION_TEMPLATE, "t_ASP_MTP3_TRANSFERreq_stc");
ASP__MTP3__TRANSFERreq_template ret_val;
{
MTP3__Field__sio_template& tmp_3 = ret_val.sio();
tmp_3.ni() = bs_0;
tmp_3.prio() = bs_0;
tmp_3.si() = bs_1;
}
ret_val.opc() = 0;
ret_val.dpc() = 0;
ret_val.sls() = 0;
ret_val.data() = pl__data;
return ret_val;
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("MTP3asp_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MTP3asp_Types");
module_object.add_function("enc_MTP3_to_M3UAserver_msg", (genericfunc_t)&enc__MTP3__to__M3UAserver__msg, NULL);
module_object.add_function("dec_MTP3_to_M3UAserver_msg", (genericfunc_t)&dec__MTP3__to__M3UAserver__msg, NULL);
current_location.update_lineno(122);
/* MTP3asp_Types.ttcn, line 122 */
const_reg__ok__status = 0;
current_location.update_lineno(123);
/* MTP3asp_Types.ttcn, line 123 */
const_reg__error__status = 1;
current_location.update_lineno(124);
/* MTP3asp_Types.ttcn, line 124 */
const_unreg__ok__status = 2;
current_location.update_lineno(125);
/* MTP3asp_Types.ttcn, line 125 */
const_unreg__error__status = 3;
current_location.update_lineno(127);
/* MTP3asp_Types.ttcn, line 127 */
const_send__error__status = 5;
current_location.update_lineno(128);
/* MTP3asp_Types.ttcn, line 128 */
const_kill__status = 255;
current_location.update_lineno(131);
/* MTP3asp_Types.ttcn, line 131 */
const_SCTP__COMLOST__pause = 0;
current_location.update_lineno(132);
/* MTP3asp_Types.ttcn, line 132 */
const_M3UA__ASPDN__pause = 1;
current_location.update_lineno(133);
/* MTP3asp_Types.ttcn, line 133 */
const_M3UA__ASPIA__pause = 2;
current_location.update_lineno(136);
/* MTP3asp_Types.ttcn, line 136 */
const_ok__resume = 0;
current_location.update_lineno(150);
/* MTP3asp_Types.ttcn, line 150 */
const_transfer__ind__msgType = 0;
current_location.update_lineno(151);
/* MTP3asp_Types.ttcn, line 151 */
const_transfer__req__msgType = 1;
current_location.update_lineno(152);
/* MTP3asp_Types.ttcn, line 152 */
const_register__msgType = 2;
current_location.update_lineno(153);
/* MTP3asp_Types.ttcn, line 153 */
const_unregister__msgType = 3;
current_location.update_lineno(154);
/* MTP3asp_Types.ttcn, line 154 */
const_status__msgType = 4;
current_location.update_lineno(155);
/* MTP3asp_Types.ttcn, line 155 */
const_pause__msgType = 5;
current_location.update_lineno(156);
/* MTP3asp_Types.ttcn, line 156 */
const_resume__msgType = 6;
}

void post_init_module()
{
TTCN_Location current_location("MTP3asp_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "MTP3asp_Types");
current_location.update_lineno(231);
/* MTP3asp_Types.ttcn, line 231 */
template_tr__ASP__MTP3__TRANSFERind.sio() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERind.opc() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERind.dpc() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERind.sls() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERind.data() = ANY_VALUE;
current_location.update_lineno(279);
/* MTP3asp_Types.ttcn, line 279 */
template_tr__ASP__MTP3__TRANSFERreq.sio() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERreq.opc() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERreq.dpc() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERreq.sls() = ANY_VALUE;
template_tr__ASP__MTP3__TRANSFERreq.data() = ANY_VALUE;
current_location.update_lineno(288);
/* MTP3asp_Types.ttcn, line 288 */
{
MTP3__Field__sio_template& tmp_2 = template_tr__ASP__MTP3__TRANSFERind__stc.sio();
tmp_2.ni() = bs_0;
tmp_2.prio() = bs_0;
tmp_2.si() = bs_1;
}
template_tr__ASP__MTP3__TRANSFERind__stc.opc() = 0;
template_tr__ASP__MTP3__TRANSFERind__stc.dpc() = 0;
template_tr__ASP__MTP3__TRANSFERind__stc.sls() = 0;
template_tr__ASP__MTP3__TRANSFERind__stc.data() = ANY_VALUE;
}


} /* end of namespace */
