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

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

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

/* Including header files */

#include "GSM_SystemInformation.hh"

namespace GSM__SystemInformation {

/* Literal string constants */

const unsigned char bs_0_bits[] = { 0 };
extern const BITSTRING bs_0(2, bs_0_bits);
const unsigned char os_2_octets[] = { 43 },
os_0_octets[] = { 100 },
os_1_octets[] = { 114 };
extern const OCTETSTRING os_2(1, os_2_octets),
os_0(1, os_0_octets),
os_1(1, os_1_octets);
const unsigned char pp_0[] = { 0x2b };
const unsigned char module_checksum[] = { 0xe9, 0xb8, 0x84, 0x94, 0x48, 0x24, 0xd3, 0x8c, 0x28, 0x18, 0xbb, 0xcd, 0xb1, 0xa9, 0x42, 0x9c };

/* Global variable definitions */

const TTCN_RAWdescriptor_t ArfcnOrMaio_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ArfcnOrMaio
const TTCN_Typedescriptor_t ArfcnOrMaio_descr_ = { "@GSM_SystemInformation.ArfcnOrMaio", NULL, &ArfcnOrMaio_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t ArfcnOrMaio_arfcn_raw_ = {12,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ArfcnOrMaio_arfcn_xer_ = { {"arfcn>\n", "arfcn>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ArfcnOrMaio_arfcn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ArfcnOrMaio_arfcn_descr_ = { "@GSM_SystemInformation.ArfcnOrMaio.arfcn", &INTEGER_ber_, &ArfcnOrMaio_arfcn_raw_, &INTEGER_text_, &ArfcnOrMaio_arfcn_xer_, &INTEGER_json_, &ArfcnOrMaio_arfcn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ArfcnOrMaio_arfcn_default_coding("RAW");
const TTCN_RAWdescriptor_t ArfcnOrMaio_maio__hsn_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ArfcnOrMaio_maio__hsn
const TTCN_Typedescriptor_t ArfcnOrMaio_maio__hsn_descr_ = { "@GSM_SystemInformation.ArfcnOrMaio.maio_hsn", NULL, &ArfcnOrMaio_maio__hsn_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ArfcnOrMaio_maio__hsn_default_coding("RAW");
UNIVERSAL_CHARSTRING ArfcnOrMaio_default_coding("RAW");
const TTCN_RAWdescriptor_t SysinfoCellIdentity_raw_ = {16,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SysinfoCellIdentity_xer_ = { {"SysinfoCellIdentity>\n", "SysinfoCellIdentity>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SysinfoCellIdentity_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SysinfoCellIdentity_descr_ = { "@GSM_SystemInformation.SysinfoCellIdentity", &INTEGER_ber_, &SysinfoCellIdentity_raw_, &INTEGER_text_, &SysinfoCellIdentity_xer_, &INTEGER_json_, &SysinfoCellIdentity_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SysinfoCellIdentity_default_coding("RAW");
const TTCN_RAWdescriptor_t CellChannelDescription_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellChannelDescription_xer_ = { {"CellChannelDescription>\n", "CellChannelDescription>\n"}, {24, 24}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CellChannelDescription_oer_ext_arr_[0] = {};
const int CellChannelDescription_oer_p_[0] = {};
const TTCN_OERdescriptor_t CellChannelDescription_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CellChannelDescription_oer_ext_arr_, 0, CellChannelDescription_oer_p_};
const TTCN_Typedescriptor_t CellChannelDescription_descr_ = { "@GSM_SystemInformation.CellChannelDescription", &OCTETSTRING_ber_, &CellChannelDescription_raw_, &OCTETSTRING_text_, &CellChannelDescription_xer_, &OCTETSTRING_json_, &CellChannelDescription_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellChannelDescription_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptions__DTX_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_CHAR_CODING,NULL,false};
// No XER for CellOptions__DTX
const TTCN_Typedescriptor_t CellOptions__DTX_descr_ = { "@GSM_SystemInformation.CellOptions_DTX", NULL, &CellOptions__DTX_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptions__DTX_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptions_dn__ind_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellOptions_dn__ind_xer_ = { {"dn_ind>\n", "dn_ind>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CellOptions_dn__ind_oer_ext_arr_[0] = {};
const int CellOptions_dn__ind_oer_p_[0] = {};
const TTCN_OERdescriptor_t CellOptions_dn__ind_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CellOptions_dn__ind_oer_ext_arr_, 0, CellOptions_dn__ind_oer_p_};
const TTCN_Typedescriptor_t CellOptions_dn__ind_descr_ = { "@GSM_SystemInformation.CellOptions.dn_ind", &BOOLEAN_ber_, &CellOptions_dn__ind_raw_, &BOOLEAN_text_, &CellOptions_dn__ind_xer_, &BOOLEAN_json_, &CellOptions_dn__ind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptions_dn__ind_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptions_pwrc_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellOptions_pwrc_xer_ = { {"pwrc>\n", "pwrc>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CellOptions_pwrc_oer_ext_arr_[0] = {};
const int CellOptions_pwrc_oer_p_[0] = {};
const TTCN_OERdescriptor_t CellOptions_pwrc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CellOptions_pwrc_oer_ext_arr_, 0, CellOptions_pwrc_oer_p_};
const TTCN_Typedescriptor_t CellOptions_pwrc_descr_ = { "@GSM_SystemInformation.CellOptions.pwrc", &BOOLEAN_ber_, &CellOptions_pwrc_raw_, &BOOLEAN_text_, &CellOptions_pwrc_xer_, &BOOLEAN_json_, &CellOptions_pwrc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptions_pwrc_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptions_dtx_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_CHAR_CODING,NULL,false};
// No XER for CellOptions_dtx
const TTCN_Typedescriptor_t CellOptions_dtx_descr_ = { "@GSM_SystemInformation.CellOptions.dtx", NULL, &CellOptions_dtx_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptions_dtx_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptions_radio__link__tout__div4_raw_ = {4,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellOptions_radio__link__tout__div4_xer_ = { {"radio_link_tout_div4>\n", "radio_link_tout_div4>\n"}, {22, 22}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellOptions_radio__link__tout__div4_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellOptions_radio__link__tout__div4_descr_ = { "@GSM_SystemInformation.CellOptions.radio_link_tout_div4", &INTEGER_ber_, &CellOptions_radio__link__tout__div4_raw_, &INTEGER_text_, &CellOptions_radio__link__tout__div4_xer_, &INTEGER_json_, &CellOptions_radio__link__tout__div4_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptions_radio__link__tout__div4_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptions_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CellOptions
const TTCN_Typedescriptor_t CellOptions_descr_ = { "@GSM_SystemInformation.CellOptions", NULL, &CellOptions_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptions_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptionsSacch_dtx__ext_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellOptionsSacch_dtx__ext_xer_ = { {"dtx_ext>\n", "dtx_ext>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellOptionsSacch_dtx__ext_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellOptionsSacch_dtx__ext_descr_ = { "@GSM_SystemInformation.CellOptionsSacch.dtx_ext", &BITSTRING_ber_, &CellOptionsSacch_dtx__ext_raw_, NULL, &CellOptionsSacch_dtx__ext_xer_, &BITSTRING_json_, &CellOptionsSacch_dtx__ext_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptionsSacch_dtx__ext_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptionsSacch_pwrc_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellOptionsSacch_pwrc_xer_ = { {"pwrc>\n", "pwrc>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CellOptionsSacch_pwrc_oer_ext_arr_[0] = {};
const int CellOptionsSacch_pwrc_oer_p_[0] = {};
const TTCN_OERdescriptor_t CellOptionsSacch_pwrc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CellOptionsSacch_pwrc_oer_ext_arr_, 0, CellOptionsSacch_pwrc_oer_p_};
const TTCN_Typedescriptor_t CellOptionsSacch_pwrc_descr_ = { "@GSM_SystemInformation.CellOptionsSacch.pwrc", &BOOLEAN_ber_, &CellOptionsSacch_pwrc_raw_, &BOOLEAN_text_, &CellOptionsSacch_pwrc_xer_, &BOOLEAN_json_, &CellOptionsSacch_pwrc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptionsSacch_pwrc_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptionsSacch_dtx_raw_ = {2,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,2,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellOptionsSacch_dtx_xer_ = { {"dtx>\n", "dtx>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellOptionsSacch_dtx_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellOptionsSacch_dtx_descr_ = { "@GSM_SystemInformation.CellOptionsSacch.dtx", &BITSTRING_ber_, &CellOptionsSacch_dtx_raw_, NULL, &CellOptionsSacch_dtx_xer_, &BITSTRING_json_, &CellOptionsSacch_dtx_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptionsSacch_dtx_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptionsSacch_radio__link__timeout_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellOptionsSacch_radio__link__timeout_xer_ = { {"radio_link_timeout>\n", "radio_link_timeout>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellOptionsSacch_radio__link__timeout_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellOptionsSacch_radio__link__timeout_descr_ = { "@GSM_SystemInformation.CellOptionsSacch.radio_link_timeout", &BITSTRING_ber_, &CellOptionsSacch_radio__link__timeout_raw_, NULL, &CellOptionsSacch_radio__link__timeout_xer_, &BITSTRING_json_, &CellOptionsSacch_radio__link__timeout_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptionsSacch_radio__link__timeout_default_coding("RAW");
const TTCN_RAWdescriptor_t CellOptionsSacch_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CellOptionsSacch
const TTCN_Typedescriptor_t CellOptionsSacch_descr_ = { "@GSM_SystemInformation.CellOptionsSacch", NULL, &CellOptionsSacch_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellOptionsSacch_default_coding("RAW");
const TTCN_RAWdescriptor_t CellSelectionParameters_cell__resel__hyst__2dB_raw_ = {3,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellSelectionParameters_cell__resel__hyst__2dB_xer_ = { {"cell_resel_hyst_2dB>\n", "cell_resel_hyst_2dB>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellSelectionParameters_cell__resel__hyst__2dB_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellSelectionParameters_cell__resel__hyst__2dB_descr_ = { "@GSM_SystemInformation.CellSelectionParameters.cell_resel_hyst_2dB", &INTEGER_ber_, &CellSelectionParameters_cell__resel__hyst__2dB_raw_, &INTEGER_text_, &CellSelectionParameters_cell__resel__hyst__2dB_xer_, &INTEGER_json_, &CellSelectionParameters_cell__resel__hyst__2dB_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellSelectionParameters_cell__resel__hyst__2dB_default_coding("RAW");
const TTCN_RAWdescriptor_t CellSelectionParameters_ms__txpwr__max__cch_raw_ = {5,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellSelectionParameters_ms__txpwr__max__cch_xer_ = { {"ms_txpwr_max_cch>\n", "ms_txpwr_max_cch>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellSelectionParameters_ms__txpwr__max__cch_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellSelectionParameters_ms__txpwr__max__cch_descr_ = { "@GSM_SystemInformation.CellSelectionParameters.ms_txpwr_max_cch", &INTEGER_ber_, &CellSelectionParameters_ms__txpwr__max__cch_raw_, &INTEGER_text_, &CellSelectionParameters_ms__txpwr__max__cch_xer_, &INTEGER_json_, &CellSelectionParameters_ms__txpwr__max__cch_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellSelectionParameters_ms__txpwr__max__cch_default_coding("RAW");
const TTCN_RAWdescriptor_t CellSelectionParameters_acs_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellSelectionParameters_acs_xer_ = { {"acs>\n", "acs>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellSelectionParameters_acs_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellSelectionParameters_acs_descr_ = { "@GSM_SystemInformation.CellSelectionParameters.acs", &BITSTRING_ber_, &CellSelectionParameters_acs_raw_, NULL, &CellSelectionParameters_acs_xer_, &BITSTRING_json_, &CellSelectionParameters_acs_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellSelectionParameters_acs_default_coding("RAW");
const TTCN_RAWdescriptor_t CellSelectionParameters_neci_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellSelectionParameters_neci_xer_ = { {"neci>\n", "neci>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CellSelectionParameters_neci_oer_ext_arr_[0] = {};
const int CellSelectionParameters_neci_oer_p_[0] = {};
const TTCN_OERdescriptor_t CellSelectionParameters_neci_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CellSelectionParameters_neci_oer_ext_arr_, 0, CellSelectionParameters_neci_oer_p_};
const TTCN_Typedescriptor_t CellSelectionParameters_neci_descr_ = { "@GSM_SystemInformation.CellSelectionParameters.neci", &BOOLEAN_ber_, &CellSelectionParameters_neci_raw_, &BOOLEAN_text_, &CellSelectionParameters_neci_xer_, &BOOLEAN_json_, &CellSelectionParameters_neci_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellSelectionParameters_neci_default_coding("RAW");
const TTCN_RAWdescriptor_t CellSelectionParameters_rxlev__access__min_raw_ = {6,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       CellSelectionParameters_rxlev__access__min_xer_ = { {"rxlev_access_min>\n", "rxlev_access_min>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CellSelectionParameters_rxlev__access__min_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CellSelectionParameters_rxlev__access__min_descr_ = { "@GSM_SystemInformation.CellSelectionParameters.rxlev_access_min", &INTEGER_ber_, &CellSelectionParameters_rxlev__access__min_raw_, &INTEGER_text_, &CellSelectionParameters_rxlev__access__min_xer_, &INTEGER_json_, &CellSelectionParameters_rxlev__access__min_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellSelectionParameters_rxlev__access__min_default_coding("RAW");
const TTCN_RAWdescriptor_t CellSelectionParameters_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CellSelectionParameters
const TTCN_Typedescriptor_t CellSelectionParameters_descr_ = { "@GSM_SystemInformation.CellSelectionParameters", NULL, &CellSelectionParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CellSelectionParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t CtrlChanDesc__CC_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for CtrlChanDesc__CC
const TTCN_Typedescriptor_t CtrlChanDesc__CC_descr_ = { "@GSM_SystemInformation.CtrlChanDesc_CC", NULL, &CtrlChanDesc__CC_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CtrlChanDesc__CC_default_coding("RAW");
const TTCN_RAWdescriptor_t CBQ3_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_CHAR_CODING,NULL,false};
// No XER for CBQ3
const TTCN_Typedescriptor_t CBQ3_descr_ = { "@GSM_SystemInformation.CBQ3", NULL, &CBQ3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CBQ3_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_msc__r99_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ControlChannelDescription_msc__r99_xer_ = { {"msc_r99>\n", "msc_r99>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ControlChannelDescription_msc__r99_oer_ext_arr_[0] = {};
const int ControlChannelDescription_msc__r99_oer_p_[0] = {};
const TTCN_OERdescriptor_t ControlChannelDescription_msc__r99_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ControlChannelDescription_msc__r99_oer_ext_arr_, 0, ControlChannelDescription_msc__r99_oer_p_};
const TTCN_Typedescriptor_t ControlChannelDescription_msc__r99_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.msc_r99", &BOOLEAN_ber_, &ControlChannelDescription_msc__r99_raw_, &BOOLEAN_text_, &ControlChannelDescription_msc__r99_xer_, &BOOLEAN_json_, &ControlChannelDescription_msc__r99_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_msc__r99_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_att_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ControlChannelDescription_att_xer_ = { {"att>\n", "att>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ControlChannelDescription_att_oer_ext_arr_[0] = {};
const int ControlChannelDescription_att_oer_p_[0] = {};
const TTCN_OERdescriptor_t ControlChannelDescription_att_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ControlChannelDescription_att_oer_ext_arr_, 0, ControlChannelDescription_att_oer_p_};
const TTCN_Typedescriptor_t ControlChannelDescription_att_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.att", &BOOLEAN_ber_, &ControlChannelDescription_att_raw_, &BOOLEAN_text_, &ControlChannelDescription_att_xer_, &BOOLEAN_json_, &ControlChannelDescription_att_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_att_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_bs__ag__blks__res_raw_ = {3,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ControlChannelDescription_bs__ag__blks__res_xer_ = { {"bs_ag_blks_res>\n", "bs_ag_blks_res>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ControlChannelDescription_bs__ag__blks__res_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ControlChannelDescription_bs__ag__blks__res_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.bs_ag_blks_res", &INTEGER_ber_, &ControlChannelDescription_bs__ag__blks__res_raw_, &INTEGER_text_, &ControlChannelDescription_bs__ag__blks__res_xer_, &INTEGER_json_, &ControlChannelDescription_bs__ag__blks__res_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_bs__ag__blks__res_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_ccch__conf_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ControlChannelDescription_ccch__conf
const TTCN_Typedescriptor_t ControlChannelDescription_ccch__conf_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.ccch_conf", NULL, &ControlChannelDescription_ccch__conf_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_ccch__conf_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_si22ind_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ControlChannelDescription_si22ind_xer_ = { {"si22ind>\n", "si22ind>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ControlChannelDescription_si22ind_oer_ext_arr_[0] = {};
const int ControlChannelDescription_si22ind_oer_p_[0] = {};
const TTCN_OERdescriptor_t ControlChannelDescription_si22ind_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ControlChannelDescription_si22ind_oer_ext_arr_, 0, ControlChannelDescription_si22ind_oer_p_};
const TTCN_Typedescriptor_t ControlChannelDescription_si22ind_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.si22ind", &BOOLEAN_ber_, &ControlChannelDescription_si22ind_raw_, &BOOLEAN_text_, &ControlChannelDescription_si22ind_xer_, &BOOLEAN_json_, &ControlChannelDescription_si22ind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_si22ind_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_cbq3_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_CHAR_CODING,NULL,false};
// No XER for ControlChannelDescription_cbq3
const TTCN_Typedescriptor_t ControlChannelDescription_cbq3_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.cbq3", NULL, &ControlChannelDescription_cbq3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_cbq3_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_spare_raw_ = {2,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,2,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ControlChannelDescription_spare_xer_ = { {"spare>\n", "spare>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ControlChannelDescription_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ControlChannelDescription_spare_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.spare", &BITSTRING_ber_, &ControlChannelDescription_spare_raw_, NULL, &ControlChannelDescription_spare_xer_, &BITSTRING_json_, &ControlChannelDescription_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_bs__pa__mfrms_raw_ = {3,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ControlChannelDescription_bs__pa__mfrms_xer_ = { {"bs_pa_mfrms>\n", "bs_pa_mfrms>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ControlChannelDescription_bs__pa__mfrms_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ControlChannelDescription_bs__pa__mfrms_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.bs_pa_mfrms", &INTEGER_ber_, &ControlChannelDescription_bs__pa__mfrms_raw_, &INTEGER_text_, &ControlChannelDescription_bs__pa__mfrms_xer_, &INTEGER_json_, &ControlChannelDescription_bs__pa__mfrms_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_bs__pa__mfrms_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_t3212_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       ControlChannelDescription_t3212_xer_ = { {"t3212>\n", "t3212>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ControlChannelDescription_t3212_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ControlChannelDescription_t3212_descr_ = { "@GSM_SystemInformation.ControlChannelDescription.t3212", &INTEGER_ber_, &ControlChannelDescription_t3212_raw_, &INTEGER_text_, &ControlChannelDescription_t3212_xer_, &INTEGER_json_, &ControlChannelDescription_t3212_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_t3212_default_coding("RAW");
const TTCN_RAWdescriptor_t ControlChannelDescription_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for ControlChannelDescription
const TTCN_Typedescriptor_t ControlChannelDescription_descr_ = { "@GSM_SystemInformation.ControlChannelDescription", NULL, &ControlChannelDescription_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ControlChannelDescription_default_coding("RAW");
ControlChannelDescription_template template_t__ControlChannelDescription;
const ControlChannelDescription_template& t__ControlChannelDescription = template_t__ControlChannelDescription;
const TTCN_RAWdescriptor_t NeighbourCellDescription_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       NeighbourCellDescription_xer_ = { {"NeighbourCellDescription>\n", "NeighbourCellDescription>\n"}, {26, 26}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int NeighbourCellDescription_oer_ext_arr_[0] = {};
const int NeighbourCellDescription_oer_p_[0] = {};
const TTCN_OERdescriptor_t NeighbourCellDescription_oer_ = { -1, TRUE, -1, FALSE, 0, 0, NeighbourCellDescription_oer_ext_arr_, 0, NeighbourCellDescription_oer_p_};
const TTCN_Typedescriptor_t NeighbourCellDescription_descr_ = { "@GSM_SystemInformation.NeighbourCellDescription", &OCTETSTRING_ber_, &NeighbourCellDescription_raw_, &OCTETSTRING_text_, &NeighbourCellDescription_xer_, &OCTETSTRING_json_, &NeighbourCellDescription_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NeighbourCellDescription_default_coding("RAW");
const TTCN_RAWdescriptor_t NeighbourCellDescription2_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       NeighbourCellDescription2_xer_ = { {"NeighbourCellDescription2>\n", "NeighbourCellDescription2>\n"}, {27, 27}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int NeighbourCellDescription2_oer_ext_arr_[0] = {};
const int NeighbourCellDescription2_oer_p_[0] = {};
const TTCN_OERdescriptor_t NeighbourCellDescription2_oer_ = { -1, TRUE, -1, FALSE, 0, 0, NeighbourCellDescription2_oer_ext_arr_, 0, NeighbourCellDescription2_oer_p_};
const TTCN_Typedescriptor_t NeighbourCellDescription2_descr_ = { "@GSM_SystemInformation.NeighbourCellDescription2", &OCTETSTRING_ber_, &NeighbourCellDescription2_raw_, &OCTETSTRING_text_, &NeighbourCellDescription2_xer_, &OCTETSTRING_json_, &NeighbourCellDescription2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NeighbourCellDescription2_default_coding("RAW");
const TTCN_RAWdescriptor_t AccessControlClass_raw_ = {16,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       AccessControlClass_xer_ = { {"AccessControlClass>\n", "AccessControlClass>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t AccessControlClass_descr_ = { "@GSM_SystemInformation.AccessControlClass", &BITSTRING_ber_, &AccessControlClass_raw_, NULL, &AccessControlClass_xer_, &BITSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING AccessControlClass_default_coding("RAW");
const TTCN_RAWdescriptor_t RachCtrlPar__MR_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_CHAR_CODING,NULL,false};
// No XER for RachCtrlPar__MR
const TTCN_Typedescriptor_t RachCtrlPar__MR_descr_ = { "@GSM_SystemInformation.RachCtrlPar_MR", NULL, &RachCtrlPar__MR_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RachCtrlPar__MR_default_coding("RAW");
const TTCN_RAWdescriptor_t RachControlParameters_max__retrans_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_CHAR_CODING,NULL,false};
// No XER for RachControlParameters_max__retrans
const TTCN_Typedescriptor_t RachControlParameters_max__retrans_descr_ = { "@GSM_SystemInformation.RachControlParameters.max_retrans", NULL, &RachControlParameters_max__retrans_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RachControlParameters_max__retrans_default_coding("RAW");
const TTCN_RAWdescriptor_t RachControlParameters_tx__integer_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RachControlParameters_tx__integer_xer_ = { {"tx_integer>\n", "tx_integer>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RachControlParameters_tx__integer_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RachControlParameters_tx__integer_descr_ = { "@GSM_SystemInformation.RachControlParameters.tx_integer", &BITSTRING_ber_, &RachControlParameters_tx__integer_raw_, NULL, &RachControlParameters_tx__integer_xer_, &BITSTRING_json_, &RachControlParameters_tx__integer_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RachControlParameters_tx__integer_default_coding("RAW");
const TTCN_RAWdescriptor_t RachControlParameters_cell__barr__access_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RachControlParameters_cell__barr__access_xer_ = { {"cell_barr_access>\n", "cell_barr_access>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RachControlParameters_cell__barr__access_oer_ext_arr_[0] = {};
const int RachControlParameters_cell__barr__access_oer_p_[0] = {};
const TTCN_OERdescriptor_t RachControlParameters_cell__barr__access_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RachControlParameters_cell__barr__access_oer_ext_arr_, 0, RachControlParameters_cell__barr__access_oer_p_};
const TTCN_Typedescriptor_t RachControlParameters_cell__barr__access_descr_ = { "@GSM_SystemInformation.RachControlParameters.cell_barr_access", &BOOLEAN_ber_, &RachControlParameters_cell__barr__access_raw_, &BOOLEAN_text_, &RachControlParameters_cell__barr__access_xer_, &BOOLEAN_json_, &RachControlParameters_cell__barr__access_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RachControlParameters_cell__barr__access_default_coding("RAW");
const TTCN_RAWdescriptor_t RachControlParameters_re__not__allowed_raw_ = {1,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RachControlParameters_re__not__allowed_xer_ = { {"re_not_allowed>\n", "re_not_allowed>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RachControlParameters_re__not__allowed_oer_ext_arr_[0] = {};
const int RachControlParameters_re__not__allowed_oer_p_[0] = {};
const TTCN_OERdescriptor_t RachControlParameters_re__not__allowed_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RachControlParameters_re__not__allowed_oer_ext_arr_, 0, RachControlParameters_re__not__allowed_oer_p_};
const TTCN_Typedescriptor_t RachControlParameters_re__not__allowed_descr_ = { "@GSM_SystemInformation.RachControlParameters.re_not_allowed", &BOOLEAN_ber_, &RachControlParameters_re__not__allowed_raw_, &BOOLEAN_text_, &RachControlParameters_re__not__allowed_xer_, &BOOLEAN_json_, &RachControlParameters_re__not__allowed_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RachControlParameters_re__not__allowed_default_coding("RAW");
const TTCN_RAWdescriptor_t RachControlParameters_acc_raw_ = {16,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RachControlParameters_acc_xer_ = { {"acc>\n", "acc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RachControlParameters_acc_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RachControlParameters_acc_descr_ = { "@GSM_SystemInformation.RachControlParameters.acc", &BITSTRING_ber_, &RachControlParameters_acc_raw_, NULL, &RachControlParameters_acc_xer_, &BITSTRING_json_, &RachControlParameters_acc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RachControlParameters_acc_default_coding("RAW");
const TTCN_RAWdescriptor_t RachControlParameters_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RachControlParameters
const TTCN_Typedescriptor_t RachControlParameters_descr_ = { "@GSM_SystemInformation.RachControlParameters", NULL, &RachControlParameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RachControlParameters_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType1_cell__chan__desc_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType1_cell__chan__desc_xer_ = { {"cell_chan_desc>\n", "cell_chan_desc>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType1_cell__chan__desc_oer_ext_arr_[0] = {};
const int SystemInformationType1_cell__chan__desc_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType1_cell__chan__desc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType1_cell__chan__desc_oer_ext_arr_, 0, SystemInformationType1_cell__chan__desc_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType1_cell__chan__desc_descr_ = { "@GSM_SystemInformation.SystemInformationType1.cell_chan_desc", &OCTETSTRING_ber_, &SystemInformationType1_cell__chan__desc_raw_, &OCTETSTRING_text_, &SystemInformationType1_cell__chan__desc_xer_, &OCTETSTRING_json_, &SystemInformationType1_cell__chan__desc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType1_cell__chan__desc_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType1_rach__control_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType1_rach__control
const TTCN_Typedescriptor_t SystemInformationType1_rach__control_descr_ = { "@GSM_SystemInformation.SystemInformationType1.rach_control", NULL, &SystemInformationType1_rach__control_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType1_rach__control_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType1_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType1_rest__octets_xer_ = { {"rest_octets>\n", "rest_octets>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType1_rest__octets_oer_ext_arr_[0] = {};
const int SystemInformationType1_rest__octets_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType1_rest__octets_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType1_rest__octets_oer_ext_arr_, 0, SystemInformationType1_rest__octets_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType1_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType1.rest_octets", &OCTETSTRING_ber_, &SystemInformationType1_rest__octets_raw_, &OCTETSTRING_text_, &SystemInformationType1_rest__octets_xer_, &OCTETSTRING_json_, &SystemInformationType1_rest__octets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType1_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType1_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType1
const TTCN_Typedescriptor_t SystemInformationType1_descr_ = { "@GSM_SystemInformation.SystemInformationType1", NULL, &SystemInformationType1_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType1_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2_bcch__freq__list_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType2_bcch__freq__list_xer_ = { {"bcch_freq_list>\n", "bcch_freq_list>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType2_bcch__freq__list_oer_ext_arr_[0] = {};
const int SystemInformationType2_bcch__freq__list_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType2_bcch__freq__list_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType2_bcch__freq__list_oer_ext_arr_, 0, SystemInformationType2_bcch__freq__list_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType2_bcch__freq__list_descr_ = { "@GSM_SystemInformation.SystemInformationType2.bcch_freq_list", &OCTETSTRING_ber_, &SystemInformationType2_bcch__freq__list_raw_, &OCTETSTRING_text_, &SystemInformationType2_bcch__freq__list_xer_, &OCTETSTRING_json_, &SystemInformationType2_bcch__freq__list_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2_bcch__freq__list_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2_ncc__permitted_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,8,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType2_ncc__permitted_xer_ = { {"ncc_permitted>\n", "ncc_permitted>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SystemInformationType2_ncc__permitted_descr_ = { "@GSM_SystemInformation.SystemInformationType2.ncc_permitted", &BITSTRING_ber_, &SystemInformationType2_ncc__permitted_raw_, NULL, &SystemInformationType2_ncc__permitted_xer_, &BITSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2_ncc__permitted_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2_rach__control_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType2_rach__control
const TTCN_Typedescriptor_t SystemInformationType2_rach__control_descr_ = { "@GSM_SystemInformation.SystemInformationType2.rach_control", NULL, &SystemInformationType2_rach__control_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2_rach__control_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType2
const TTCN_Typedescriptor_t SystemInformationType2_descr_ = { "@GSM_SystemInformation.SystemInformationType2", NULL, &SystemInformationType2_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2bis_extd__bcch__freq__list_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType2bis_extd__bcch__freq__list_xer_ = { {"extd_bcch_freq_list>\n", "extd_bcch_freq_list>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType2bis_extd__bcch__freq__list_oer_ext_arr_[0] = {};
const int SystemInformationType2bis_extd__bcch__freq__list_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType2bis_extd__bcch__freq__list_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType2bis_extd__bcch__freq__list_oer_ext_arr_, 0, SystemInformationType2bis_extd__bcch__freq__list_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType2bis_extd__bcch__freq__list_descr_ = { "@GSM_SystemInformation.SystemInformationType2bis.extd_bcch_freq_list", &OCTETSTRING_ber_, &SystemInformationType2bis_extd__bcch__freq__list_raw_, &OCTETSTRING_text_, &SystemInformationType2bis_extd__bcch__freq__list_xer_, &OCTETSTRING_json_, &SystemInformationType2bis_extd__bcch__freq__list_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2bis_extd__bcch__freq__list_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2bis_rach__control_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType2bis_rach__control
const TTCN_Typedescriptor_t SystemInformationType2bis_rach__control_descr_ = { "@GSM_SystemInformation.SystemInformationType2bis.rach_control", NULL, &SystemInformationType2bis_rach__control_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2bis_rach__control_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2bis_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType2bis_rest__octets_xer_ = { {"rest_octets>\n", "rest_octets>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType2bis_rest__octets_oer_ext_arr_[0] = {};
const int SystemInformationType2bis_rest__octets_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType2bis_rest__octets_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType2bis_rest__octets_oer_ext_arr_, 0, SystemInformationType2bis_rest__octets_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType2bis_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType2bis.rest_octets", &OCTETSTRING_ber_, &SystemInformationType2bis_rest__octets_raw_, &OCTETSTRING_text_, &SystemInformationType2bis_rest__octets_xer_, &OCTETSTRING_json_, &SystemInformationType2bis_rest__octets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2bis_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2bis_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType2bis
const TTCN_Typedescriptor_t SystemInformationType2bis_descr_ = { "@GSM_SystemInformation.SystemInformationType2bis", NULL, &SystemInformationType2bis_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2bis_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2ter_extd__bcch__freq__list_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType2ter_extd__bcch__freq__list_xer_ = { {"extd_bcch_freq_list>\n", "extd_bcch_freq_list>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType2ter_extd__bcch__freq__list_oer_ext_arr_[0] = {};
const int SystemInformationType2ter_extd__bcch__freq__list_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType2ter_extd__bcch__freq__list_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType2ter_extd__bcch__freq__list_oer_ext_arr_, 0, SystemInformationType2ter_extd__bcch__freq__list_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType2ter_extd__bcch__freq__list_descr_ = { "@GSM_SystemInformation.SystemInformationType2ter.extd_bcch_freq_list", &OCTETSTRING_ber_, &SystemInformationType2ter_extd__bcch__freq__list_raw_, &OCTETSTRING_text_, &SystemInformationType2ter_extd__bcch__freq__list_xer_, &OCTETSTRING_json_, &SystemInformationType2ter_extd__bcch__freq__list_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2ter_extd__bcch__freq__list_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2ter_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType2ter_rest__octets_xer_ = { {"rest_octets>\n", "rest_octets>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType2ter_rest__octets_oer_ext_arr_[0] = {};
const int SystemInformationType2ter_rest__octets_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType2ter_rest__octets_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType2ter_rest__octets_oer_ext_arr_, 0, SystemInformationType2ter_rest__octets_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType2ter_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType2ter.rest_octets", &OCTETSTRING_ber_, &SystemInformationType2ter_rest__octets_raw_, &OCTETSTRING_text_, &SystemInformationType2ter_rest__octets_xer_, &OCTETSTRING_json_, &SystemInformationType2ter_rest__octets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2ter_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2ter_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType2ter
const TTCN_Typedescriptor_t SystemInformationType2ter_descr_ = { "@GSM_SystemInformation.SystemInformationType2ter", NULL, &SystemInformationType2ter_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2ter_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2quater_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType2quater_rest__octets
const TTCN_Typedescriptor_t SystemInformationType2quater_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType2quater.rest_octets", NULL, &SystemInformationType2quater_rest__octets_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2quater_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType2quater_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType2quater
const TTCN_Typedescriptor_t SystemInformationType2quater_descr_ = { "@GSM_SystemInformation.SystemInformationType2quater", NULL, &SystemInformationType2quater_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType2quater_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_cell__id_raw_ = {16,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType3_cell__id_xer_ = { {"cell_id>\n", "cell_id>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SystemInformationType3_cell__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SystemInformationType3_cell__id_descr_ = { "@GSM_SystemInformation.SystemInformationType3.cell_id", &INTEGER_ber_, &SystemInformationType3_cell__id_raw_, &INTEGER_text_, &SystemInformationType3_cell__id_xer_, &INTEGER_json_, &SystemInformationType3_cell__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_cell__id_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_lai_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType3_lai
const TTCN_Typedescriptor_t SystemInformationType3_lai_descr_ = { "@GSM_SystemInformation.SystemInformationType3.lai", NULL, &SystemInformationType3_lai_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_lai_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_ctrl__chan__desc_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType3_ctrl__chan__desc
const TTCN_Typedescriptor_t SystemInformationType3_ctrl__chan__desc_descr_ = { "@GSM_SystemInformation.SystemInformationType3.ctrl_chan_desc", NULL, &SystemInformationType3_ctrl__chan__desc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_ctrl__chan__desc_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_cell__options_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType3_cell__options
const TTCN_Typedescriptor_t SystemInformationType3_cell__options_descr_ = { "@GSM_SystemInformation.SystemInformationType3.cell_options", NULL, &SystemInformationType3_cell__options_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_cell__options_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_cell__sel__par_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType3_cell__sel__par
const TTCN_Typedescriptor_t SystemInformationType3_cell__sel__par_descr_ = { "@GSM_SystemInformation.SystemInformationType3.cell_sel_par", NULL, &SystemInformationType3_cell__sel__par_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_cell__sel__par_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_rach__control_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType3_rach__control
const TTCN_Typedescriptor_t SystemInformationType3_rach__control_descr_ = { "@GSM_SystemInformation.SystemInformationType3.rach_control", NULL, &SystemInformationType3_rach__control_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_rach__control_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType3_rest__octets
const TTCN_Typedescriptor_t SystemInformationType3_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType3.rest_octets", NULL, &SystemInformationType3_rest__octets_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType3_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType3
const TTCN_Typedescriptor_t SystemInformationType3_descr_ = { "@GSM_SystemInformation.SystemInformationType3", NULL, &SystemInformationType3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType3_default_coding("RAW");
SystemInformationType3_template template_t__SI3;
const SystemInformationType3_template& t__SI3 = template_t__SI3;
const TTCN_RAWdescriptor_t SystemInformationType4_lai_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType4_lai
const TTCN_Typedescriptor_t SystemInformationType4_lai_descr_ = { "@GSM_SystemInformation.SystemInformationType4.lai", NULL, &SystemInformationType4_lai_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType4_lai_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType4_cell__sel__par_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType4_cell__sel__par
const TTCN_Typedescriptor_t SystemInformationType4_cell__sel__par_descr_ = { "@GSM_SystemInformation.SystemInformationType4.cell_sel_par", NULL, &SystemInformationType4_cell__sel__par_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType4_cell__sel__par_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType4_rach__control_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType4_rach__control
const TTCN_Typedescriptor_t SystemInformationType4_rach__control_descr_ = { "@GSM_SystemInformation.SystemInformationType4.rach_control", NULL, &SystemInformationType4_rach__control_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType4_rach__control_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType4_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType4_rest__octets
const TTCN_Typedescriptor_t SystemInformationType4_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType4.rest_octets", NULL, &SystemInformationType4_rest__octets_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType4_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType4_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType4
const TTCN_Typedescriptor_t SystemInformationType4_descr_ = { "@GSM_SystemInformation.SystemInformationType4", NULL, &SystemInformationType4_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SystemInformationType4_cbch__chan__desc_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType4_cbch__chan__desc
const TTCN_Typedescriptor_t SystemInformationType4_cbch__chan__desc_descr_ = { "@GSM_SystemInformation.SystemInformationType4.cbch_chan_desc", NULL, &SystemInformationType4_cbch__chan__desc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType4_cbch__chan__desc_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType4_cbch__mobile__alloc_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType4_cbch__mobile__alloc
const TTCN_Typedescriptor_t SystemInformationType4_cbch__mobile__alloc_descr_ = { "@GSM_SystemInformation.SystemInformationType4.cbch_mobile_alloc", NULL, &SystemInformationType4_cbch__mobile__alloc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType4_cbch__mobile__alloc_default_coding("RAW");
UNIVERSAL_CHARSTRING SystemInformationType4_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType5_bcch__freq__list_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType5_bcch__freq__list_xer_ = { {"bcch_freq_list>\n", "bcch_freq_list>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType5_bcch__freq__list_oer_ext_arr_[0] = {};
const int SystemInformationType5_bcch__freq__list_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType5_bcch__freq__list_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType5_bcch__freq__list_oer_ext_arr_, 0, SystemInformationType5_bcch__freq__list_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType5_bcch__freq__list_descr_ = { "@GSM_SystemInformation.SystemInformationType5.bcch_freq_list", &OCTETSTRING_ber_, &SystemInformationType5_bcch__freq__list_raw_, &OCTETSTRING_text_, &SystemInformationType5_bcch__freq__list_xer_, &OCTETSTRING_json_, &SystemInformationType5_bcch__freq__list_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType5_bcch__freq__list_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType5_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType5
const TTCN_Typedescriptor_t SystemInformationType5_descr_ = { "@GSM_SystemInformation.SystemInformationType5", NULL, &SystemInformationType5_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType5_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType5bis_extd__bcch__freq__list_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType5bis_extd__bcch__freq__list_xer_ = { {"extd_bcch_freq_list>\n", "extd_bcch_freq_list>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType5bis_extd__bcch__freq__list_oer_ext_arr_[0] = {};
const int SystemInformationType5bis_extd__bcch__freq__list_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType5bis_extd__bcch__freq__list_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType5bis_extd__bcch__freq__list_oer_ext_arr_, 0, SystemInformationType5bis_extd__bcch__freq__list_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType5bis_extd__bcch__freq__list_descr_ = { "@GSM_SystemInformation.SystemInformationType5bis.extd_bcch_freq_list", &OCTETSTRING_ber_, &SystemInformationType5bis_extd__bcch__freq__list_raw_, &OCTETSTRING_text_, &SystemInformationType5bis_extd__bcch__freq__list_xer_, &OCTETSTRING_json_, &SystemInformationType5bis_extd__bcch__freq__list_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType5bis_extd__bcch__freq__list_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType5bis_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType5bis
const TTCN_Typedescriptor_t SystemInformationType5bis_descr_ = { "@GSM_SystemInformation.SystemInformationType5bis", NULL, &SystemInformationType5bis_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType5bis_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType5ter_extd__bcch__freq__list_raw_ = {128,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType5ter_extd__bcch__freq__list_xer_ = { {"extd_bcch_freq_list>\n", "extd_bcch_freq_list>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationType5ter_extd__bcch__freq__list_oer_ext_arr_[0] = {};
const int SystemInformationType5ter_extd__bcch__freq__list_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationType5ter_extd__bcch__freq__list_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationType5ter_extd__bcch__freq__list_oer_ext_arr_, 0, SystemInformationType5ter_extd__bcch__freq__list_oer_p_};
const TTCN_Typedescriptor_t SystemInformationType5ter_extd__bcch__freq__list_descr_ = { "@GSM_SystemInformation.SystemInformationType5ter.extd_bcch_freq_list", &OCTETSTRING_ber_, &SystemInformationType5ter_extd__bcch__freq__list_raw_, &OCTETSTRING_text_, &SystemInformationType5ter_extd__bcch__freq__list_xer_, &OCTETSTRING_json_, &SystemInformationType5ter_extd__bcch__freq__list_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType5ter_extd__bcch__freq__list_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType5ter_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType5ter
const TTCN_Typedescriptor_t SystemInformationType5ter_descr_ = { "@GSM_SystemInformation.SystemInformationType5ter", NULL, &SystemInformationType5ter_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType5ter_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType6_cell__id_raw_ = {16,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType6_cell__id_xer_ = { {"cell_id>\n", "cell_id>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SystemInformationType6_cell__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SystemInformationType6_cell__id_descr_ = { "@GSM_SystemInformation.SystemInformationType6.cell_id", &INTEGER_ber_, &SystemInformationType6_cell__id_raw_, &INTEGER_text_, &SystemInformationType6_cell__id_xer_, &INTEGER_json_, &SystemInformationType6_cell__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType6_cell__id_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType6_lai_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType6_lai
const TTCN_Typedescriptor_t SystemInformationType6_lai_descr_ = { "@GSM_SystemInformation.SystemInformationType6.lai", NULL, &SystemInformationType6_lai_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType6_lai_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType6_cell__options_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType6_cell__options
const TTCN_Typedescriptor_t SystemInformationType6_cell__options_descr_ = { "@GSM_SystemInformation.SystemInformationType6.cell_options", NULL, &SystemInformationType6_cell__options_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType6_cell__options_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType6_ncc__permitted_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,8,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationType6_ncc__permitted_xer_ = { {"ncc_permitted>\n", "ncc_permitted>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SystemInformationType6_ncc__permitted_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SystemInformationType6_ncc__permitted_descr_ = { "@GSM_SystemInformation.SystemInformationType6.ncc_permitted", &BITSTRING_ber_, &SystemInformationType6_ncc__permitted_raw_, NULL, &SystemInformationType6_ncc__permitted_xer_, &BITSTRING_json_, &SystemInformationType6_ncc__permitted_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType6_ncc__permitted_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType6_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType6_rest__octets
const TTCN_Typedescriptor_t SystemInformationType6_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType6.rest_octets", NULL, &SystemInformationType6_rest__octets_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType6_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType6_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType6
const TTCN_Typedescriptor_t SystemInformationType6_descr_ = { "@GSM_SystemInformation.SystemInformationType6", NULL, &SystemInformationType6_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType6_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType13_rest__octets_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,8,0,0,8,8,pp_0,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType13_rest__octets
const TTCN_Typedescriptor_t SystemInformationType13_rest__octets_descr_ = { "@GSM_SystemInformation.SystemInformationType13.rest_octets", NULL, &SystemInformationType13_rest__octets_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType13_rest__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationType13_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationType13
const TTCN_Typedescriptor_t SystemInformationType13_descr_ = { "@GSM_SystemInformation.SystemInformationType13", NULL, &SystemInformationType13_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationType13_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion
const TTCN_Typedescriptor_t SystemInformationUnion_descr_ = { "@GSM_SystemInformation.SystemInformationUnion", NULL, &SystemInformationUnion_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t SystemInformationUnion_si1_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si1
const TTCN_Typedescriptor_t SystemInformationUnion_si1_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si1", NULL, &SystemInformationUnion_si1_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si1_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si2_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si2
const TTCN_Typedescriptor_t SystemInformationUnion_si2_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si2", NULL, &SystemInformationUnion_si2_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si2_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si2bis_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si2bis
const TTCN_Typedescriptor_t SystemInformationUnion_si2bis_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si2bis", NULL, &SystemInformationUnion_si2bis_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si2bis_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si2ter_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si2ter
const TTCN_Typedescriptor_t SystemInformationUnion_si2ter_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si2ter", NULL, &SystemInformationUnion_si2ter_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si2ter_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si2quater_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si2quater
const TTCN_Typedescriptor_t SystemInformationUnion_si2quater_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si2quater", NULL, &SystemInformationUnion_si2quater_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si2quater_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si3_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si3
const TTCN_Typedescriptor_t SystemInformationUnion_si3_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si3", NULL, &SystemInformationUnion_si3_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si3_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si4_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si4
const TTCN_Typedescriptor_t SystemInformationUnion_si4_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si4", NULL, &SystemInformationUnion_si4_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si4_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si5_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si5
const TTCN_Typedescriptor_t SystemInformationUnion_si5_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si5", NULL, &SystemInformationUnion_si5_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si5_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si5bis_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si5bis
const TTCN_Typedescriptor_t SystemInformationUnion_si5bis_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si5bis", NULL, &SystemInformationUnion_si5bis_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si5bis_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si5ter_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si5ter
const TTCN_Typedescriptor_t SystemInformationUnion_si5ter_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si5ter", NULL, &SystemInformationUnion_si5ter_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si5ter_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si6_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si6
const TTCN_Typedescriptor_t SystemInformationUnion_si6_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si6", NULL, &SystemInformationUnion_si6_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si6_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_si13_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformationUnion_si13
const TTCN_Typedescriptor_t SystemInformationUnion_si13_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.si13", NULL, &SystemInformationUnion_si13_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_si13_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformationUnion_other_raw_ = {0,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       SystemInformationUnion_other_xer_ = { {"other>\n", "other>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationUnion_other_oer_ext_arr_[0] = {};
const int SystemInformationUnion_other_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationUnion_other_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationUnion_other_oer_ext_arr_, 0, SystemInformationUnion_other_oer_p_};
const TTCN_Typedescriptor_t SystemInformationUnion_other_descr_ = { "@GSM_SystemInformation.SystemInformationUnion.other", &OCTETSTRING_ber_, &SystemInformationUnion_other_raw_, &OCTETSTRING_text_, &SystemInformationUnion_other_xer_, &OCTETSTRING_json_, &SystemInformationUnion_other_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationUnion_other_default_coding("RAW");
UNIVERSAL_CHARSTRING SystemInformationUnion_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformation_header_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformation_header
const TTCN_Typedescriptor_t SystemInformation_header_descr_ = { "@GSM_SystemInformation.SystemInformation.header", NULL, &SystemInformation_header_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformation_header_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformation_payload_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformation_payload
const TTCN_Typedescriptor_t SystemInformation_payload_descr_ = { "@GSM_SystemInformation.SystemInformation.payload", NULL, &SystemInformation_payload_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformation_payload_default_coding("RAW");
const TTCN_RAWdescriptor_t SystemInformation_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for SystemInformation
const TTCN_Typedescriptor_t SystemInformation_descr_ = { "@GSM_SystemInformation.SystemInformation", NULL, &SystemInformation_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformation_default_coding("RAW");
TTCN_Module module_object("GSM_SystemInformation", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

/* Member functions of C++ classes */

void ArfcnOrMaio::copy_value(const ArfcnOrMaio& other_value)
{
switch (other_value.union_selection) {
case ALT_arfcn:
field_arfcn = new INTEGER(*other_value.field_arfcn);
break;
case ALT_maio__hsn:
field_maio__hsn = new GSM__RR__Types::MaioHsn(*other_value.field_maio__hsn);
break;
default:
TTCN_error("Assignment of an unbound union value of type @GSM_SystemInformation.ArfcnOrMaio.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean ArfcnOrMaio::operator==(const ArfcnOrMaio& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @GSM_SystemInformation.ArfcnOrMaio.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @GSM_SystemInformation.ArfcnOrMaio.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_arfcn:
return *field_arfcn == *other_value.field_arfcn;
case ALT_maio__hsn:
return *field_maio__hsn == *other_value.field_maio__hsn;
default:
return FALSE;
}
}

INTEGER& ArfcnOrMaio::arfcn()
{
if (union_selection != ALT_arfcn) {
clean_up();
field_arfcn = new INTEGER;
union_selection = ALT_arfcn;
}
return *field_arfcn;
}

const INTEGER& ArfcnOrMaio::arfcn() const
{
if (union_selection != ALT_arfcn) TTCN_error("Using non-selected field arfcn in a value of union type @GSM_SystemInformation.ArfcnOrMaio.");
return *field_arfcn;
}

GSM__RR__Types::MaioHsn& ArfcnOrMaio::maio__hsn()
{
if (union_selection != ALT_maio__hsn) {
clean_up();
field_maio__hsn = new GSM__RR__Types::MaioHsn;
union_selection = ALT_maio__hsn;
}
return *field_maio__hsn;
}

const GSM__RR__Types::MaioHsn& ArfcnOrMaio::maio__hsn() const
{
if (union_selection != ALT_maio__hsn) TTCN_error("Using non-selected field maio_hsn in a value of union type @GSM_SystemInformation.ArfcnOrMaio.");
return *field_maio__hsn;
}

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

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

boolean ArfcnOrMaio::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_arfcn: return field_arfcn->is_value();
case ALT_maio__hsn: return field_maio__hsn->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void ArfcnOrMaio::clean_up()
{
switch (union_selection) {
case ALT_arfcn:
  delete field_arfcn;
  break;
case ALT_maio__hsn:
  delete field_maio__hsn;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void ArfcnOrMaio::log() const
{
switch (union_selection) {
case ALT_arfcn:
TTCN_Logger::log_event_str("{ arfcn := ");
field_arfcn->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_maio__hsn:
TTCN_Logger::log_event_str("{ maio_hsn := ");
field_maio__hsn->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void ArfcnOrMaio::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, "arfcn")) {
    arfcn().set_param(*mp_last);
    if (!arfcn().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "maio_hsn")) {
    maio__hsn().set_param(*mp_last);
    if (!maio__hsn().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @GSM_SystemInformation.ArfcnOrMaio.", last_name);
}

void ArfcnOrMaio::set_implicit_omit()
{
switch (union_selection) {
case ALT_arfcn:
field_arfcn->set_implicit_omit(); break;
case ALT_maio__hsn:
field_maio__hsn->set_implicit_omit(); break;
default: break;
}
}

void ArfcnOrMaio::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_arfcn:
field_arfcn->encode_text(text_buf);
break;
case ALT_maio__hsn:
field_maio__hsn->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @GSM_SystemInformation.ArfcnOrMaio.");
}
}

void ArfcnOrMaio::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_arfcn:
arfcn().decode_text(text_buf);
break;
case ALT_maio__hsn:
maio__hsn().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @GSM_SystemInformation.ArfcnOrMaio.");
}
}

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

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

int ArfcnOrMaio::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, ArfcnOrMaio_arfcn_descr_.raw->forceomit);
      decoded_length = arfcn().RAW_decode(ArfcnOrMaio_arfcn_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, ArfcnOrMaio_maio__hsn_descr_.raw->forceomit);
      decoded_length = maio__hsn().RAW_decode(ArfcnOrMaio_maio__hsn_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, ArfcnOrMaio_arfcn_descr_.raw->forceomit);
      decoded_length = arfcn().RAW_decode(ArfcnOrMaio_arfcn_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, ArfcnOrMaio_maio__hsn_descr_.raw->forceomit);
      decoded_length = maio__hsn().RAW_decode(ArfcnOrMaio_maio__hsn_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int ArfcnOrMaio::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  memset(myleaf.body.node.nodes, 0, 2 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_arfcn:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, ArfcnOrMaio_arfcn_descr_.raw);
    encoded_length = field_arfcn->RAW_encode(ArfcnOrMaio_arfcn_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &ArfcnOrMaio_arfcn_descr_;
    break;
  case ALT_maio__hsn:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, ArfcnOrMaio_maio__hsn_descr_.raw);
    encoded_length = field_maio__hsn->RAW_encode(ArfcnOrMaio_maio__hsn_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &ArfcnOrMaio_maio__hsn_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void ArfcnOrMaio_template::copy_value(const ArfcnOrMaio& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case ArfcnOrMaio::ALT_arfcn:
single_value.field_arfcn = new INTEGER_template(other_value.arfcn());
break;
case ArfcnOrMaio::ALT_maio__hsn:
single_value.field_maio__hsn = new GSM__RR__Types::MaioHsn_template(other_value.maio__hsn());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @GSM_SystemInformation.ArfcnOrMaio.");
}
set_selection(SPECIFIC_VALUE);
}

void ArfcnOrMaio_template::copy_template(const ArfcnOrMaio_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 ArfcnOrMaio::ALT_arfcn:
single_value.field_arfcn = new INTEGER_template(*other_value.single_value.field_arfcn);
break;
case ArfcnOrMaio::ALT_maio__hsn:
single_value.field_maio__hsn = new GSM__RR__Types::MaioHsn_template(*other_value.single_value.field_maio__hsn);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @GSM_SystemInformation.ArfcnOrMaio.");
}
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 ArfcnOrMaio_template[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 ArfcnOrMaio_template(*other_value.implication_.precondition);
implication_.implied_template = new ArfcnOrMaio_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 @GSM_SystemInformation.ArfcnOrMaio.");
}
set_selection(other_value);
}

ArfcnOrMaio_template::ArfcnOrMaio_template()
{
}

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

ArfcnOrMaio_template::ArfcnOrMaio_template(const ArfcnOrMaio& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void ArfcnOrMaio_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ArfcnOrMaio::ALT_arfcn:
delete single_value.field_arfcn;
break;
case ArfcnOrMaio::ALT_maio__hsn:
delete single_value.field_maio__hsn;
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;
}

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

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

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

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

boolean ArfcnOrMaio_template::match(const ArfcnOrMaio& 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:
{
ArfcnOrMaio::union_selection_type value_selection = other_value.get_selection();
if (value_selection == ArfcnOrMaio::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case ArfcnOrMaio::ALT_arfcn:
return single_value.field_arfcn->match(other_value.arfcn(), legacy);
case ArfcnOrMaio::ALT_maio__hsn:
return single_value.field_maio__hsn->match(other_value.maio__hsn(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
}
}
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 @GSM_SystemInformation.ArfcnOrMaio.");
}
return FALSE;
}

boolean ArfcnOrMaio_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case ArfcnOrMaio::ALT_arfcn:
return single_value.field_arfcn->is_value();
case ArfcnOrMaio::ALT_maio__hsn:
return single_value.field_maio__hsn->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
}
}

ArfcnOrMaio ArfcnOrMaio_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 @GSM_SystemInformation.ArfcnOrMaio.");
ArfcnOrMaio ret_val;
switch (single_value.union_selection) {
case ArfcnOrMaio::ALT_arfcn:
ret_val.arfcn() = single_value.field_arfcn->valueof();
break;
case ArfcnOrMaio::ALT_maio__hsn:
ret_val.maio__hsn() = single_value.field_maio__hsn->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
}
return ret_val;
}

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

INTEGER_template& ArfcnOrMaio_template::arfcn()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ArfcnOrMaio::ALT_arfcn) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_arfcn = new INTEGER_template(ANY_VALUE);
else single_value.field_arfcn = new INTEGER_template;
single_value.union_selection = ArfcnOrMaio::ALT_arfcn;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_arfcn;
}

const INTEGER_template& ArfcnOrMaio_template::arfcn() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field arfcn in a non-specific template of union type @GSM_SystemInformation.ArfcnOrMaio.");
if (single_value.union_selection != ArfcnOrMaio::ALT_arfcn) TTCN_error("Accessing non-selected field arfcn in a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
return *single_value.field_arfcn;
}

GSM__RR__Types::MaioHsn_template& ArfcnOrMaio_template::maio__hsn()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ArfcnOrMaio::ALT_maio__hsn) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_maio__hsn = new GSM__RR__Types::MaioHsn_template(ANY_VALUE);
else single_value.field_maio__hsn = new GSM__RR__Types::MaioHsn_template;
single_value.union_selection = ArfcnOrMaio::ALT_maio__hsn;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_maio__hsn;
}

const GSM__RR__Types::MaioHsn_template& ArfcnOrMaio_template::maio__hsn() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field maio_hsn in a non-specific template of union type @GSM_SystemInformation.ArfcnOrMaio.");
if (single_value.union_selection != ArfcnOrMaio::ALT_maio__hsn) TTCN_error("Accessing non-selected field maio_hsn in a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
return *single_value.field_maio__hsn;
}

boolean ArfcnOrMaio_template::ischosen(ArfcnOrMaio::union_selection_type checked_selection) const
{
if (checked_selection == ArfcnOrMaio::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @GSM_SystemInformation.ArfcnOrMaio.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == ArfcnOrMaio::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
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 @GSM_SystemInformation.ArfcnOrMaio 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 ArfcnOrMaio_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case ArfcnOrMaio::ALT_arfcn:
TTCN_Logger::log_event_str("{ arfcn := ");
single_value.field_arfcn->log();
TTCN_Logger::log_event_str(" }");
break;
case ArfcnOrMaio::ALT_maio__hsn:
TTCN_Logger::log_event_str("{ maio_hsn := ");
single_value.field_maio__hsn->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 ArfcnOrMaio_template::log_match(const ArfcnOrMaio& 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 ArfcnOrMaio::ALT_arfcn:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".arfcn");
single_value.field_arfcn->log_match(match_value.arfcn(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ arfcn := ");
single_value.field_arfcn->log_match(match_value.arfcn(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case ArfcnOrMaio::ALT_maio__hsn:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".maio_hsn");
single_value.field_maio__hsn->log_match(match_value.maio__hsn(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ maio_hsn := ");
single_value.field_maio__hsn->log_match(match_value.maio__hsn(), 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 ArfcnOrMaio_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case ArfcnOrMaio::ALT_arfcn:
single_value.field_arfcn->set_implicit_omit(); break;
case ArfcnOrMaio::ALT_maio__hsn:
single_value.field_maio__hsn->set_implicit_omit(); break;
default: break;
}
}

void ArfcnOrMaio_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 ArfcnOrMaio::ALT_arfcn:
single_value.field_arfcn->encode_text(text_buf);
break;
case ArfcnOrMaio::ALT_maio__hsn:
single_value.field_maio__hsn->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
}
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 @GSM_SystemInformation.ArfcnOrMaio.");
}
}

void ArfcnOrMaio_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = ArfcnOrMaio::UNBOUND_VALUE;
ArfcnOrMaio::union_selection_type new_selection = (ArfcnOrMaio::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case ArfcnOrMaio::ALT_arfcn:
single_value.field_arfcn = new INTEGER_template;
single_value.field_arfcn->decode_text(text_buf);
break;
case ArfcnOrMaio::ALT_maio__hsn:
single_value.field_maio__hsn = new GSM__RR__Types::MaioHsn_template;
single_value.field_maio__hsn->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @GSM_SystemInformation.ArfcnOrMaio.");
}
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 ArfcnOrMaio_template[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 @GSM_SystemInformation.ArfcnOrMaio.");
}
}

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

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

void ArfcnOrMaio_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 ArfcnOrMaio::ALT_arfcn:
single_value.field_arfcn->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ArfcnOrMaio");
return;
case ArfcnOrMaio::ALT_maio__hsn:
single_value.field_maio__hsn->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ArfcnOrMaio");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @GSM_SystemInformation.ArfcnOrMaio.");
}
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 : "@GSM_SystemInformation.ArfcnOrMaio");
}

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

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

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

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

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

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

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

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

boolean CellOptions__DTX::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
return enum_value == other_value;
}

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

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

boolean CellOptions__DTX::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
return enum_value < other_value;
}

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

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

boolean CellOptions__DTX::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
return enum_value > other_value;
}

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

const char *CellOptions__DTX::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case MS__MAY__USE__UL__DTX: return "MS_MAY_USE_UL_DTX";
case MS__SHALL__USE__UL__DTX: return "MS_SHALL_USE_UL_DTX";
case MS__SHALL__NOT__USE__UL__DTX: return "MS_SHALL_NOT_USE_UL_DTX";
default:
return "<unknown>";
}
}

CellOptions__DTX::enum_type CellOptions__DTX::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "MS_MAY_USE_UL_DTX")) return MS__MAY__USE__UL__DTX;
if (!strcmp(str_par, "MS_SHALL_USE_UL_DTX")) return MS__SHALL__USE__UL__DTX;
if (!strcmp(str_par, "MS_SHALL_NOT_USE_UL_DTX")) return MS__SHALL__NOT__USE__UL__DTX;
}
return UNKNOWN_VALUE;
}

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

int CellOptions__DTX::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.CellOptions_DTX.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int CellOptions__DTX::enum2int(const CellOptions__DTX& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.CellOptions_DTX.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

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

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

void CellOptions__DTX::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void CellOptions__DTX::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@GSM_SystemInformation.CellOptions_DTX");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @GSM_SystemInformation.CellOptions_DTX.");
  }
}

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

void CellOptions__DTX::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @GSM_SystemInformation.CellOptions_DTX.", enum_value);
}

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

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

int CellOptions__DTX::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int CellOptions__DTX::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void CellOptions__DTX_template::copy_template(const CellOptions__DTX_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CellOptions__DTX_template[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 CellOptions__DTX_template(*other_value.implication_.precondition);
implication_.implied_template = new CellOptions__DTX_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
}
}

CellOptions__DTX_template::CellOptions__DTX_template()
{
}

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

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

CellOptions__DTX_template::CellOptions__DTX_template(CellOptions__DTX::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

CellOptions__DTX_template::CellOptions__DTX_template(const CellOptions__DTX& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == CellOptions__DTX::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
single_value = other_value.enum_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

CellOptions__DTX_template& CellOptions__DTX_template::operator=(const OPTIONAL<CellOptions__DTX>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CellOptions__DTX::enum_type)(const CellOptions__DTX&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
}
return *this;
}

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

boolean CellOptions__DTX_template::match(CellOptions__DTX::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
}
return FALSE;
}

boolean CellOptions__DTX_template::match(const CellOptions__DTX& other_value, boolean) const
{
if (other_value.enum_value == CellOptions__DTX::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @GSM_SystemInformation.CellOptions_DTX with an unbound value.");
return match(other_value.enum_value);
}

CellOptions__DTX::enum_type CellOptions__DTX_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
return single_value;
}

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

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

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

void CellOptions__DTX_template::log_match(const CellOptions__DTX& 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 CellOptions__DTX_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
}
}

void CellOptions__DTX_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (CellOptions__DTX::enum_type)text_buf.pull_int().get_val();
if (!CellOptions__DTX::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @GSM_SystemInformation.CellOptions_DTX.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CellOptions__DTX_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @GSM_SystemInformation.CellOptions_DTX.");
}
}

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

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

void CellOptions__DTX_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CellOptions__DTX_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    CellOptions__DTX::enum_type enum_val = CellOptions__DTX::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!CellOptions__DTX::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @GSM_SystemInformation.CellOptions_DTX.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    CellOptions__DTX_template* precondition = new CellOptions__DTX_template;
    precondition->set_param(*m_p->get_elem(0));
    CellOptions__DTX_template* implied_template = new CellOptions__DTX_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = CellOptions__DTX_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@GSM_SystemInformation.CellOptions_DTX");
  }
  is_ifpresent = param.get_ifpresent();
}

void CellOptions__DTX_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@GSM_SystemInformation.CellOptions_DTX");
}

CellOptions::CellOptions()
{
}

CellOptions::CellOptions(const BOOLEAN& par_dn__ind,
    const BOOLEAN& par_pwrc,
    const CellOptions__DTX& par_dtx,
    const INTEGER& par_radio__link__tout__div4)
  :   field_dn__ind(par_dn__ind),
  field_pwrc(par_pwrc),
  field_dtx(par_dtx),
  field_radio__link__tout__div4(par_radio__link__tout__div4)
{
}

CellOptions::CellOptions(const CellOptions& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.CellOptions.");
if (other_value.dn__ind().is_bound()) field_dn__ind = other_value.dn__ind();
else field_dn__ind.clean_up();
if (other_value.pwrc().is_bound()) field_pwrc = other_value.pwrc();
else field_pwrc.clean_up();
if (other_value.dtx().is_bound()) field_dtx = other_value.dtx();
else field_dtx.clean_up();
if (other_value.radio__link__tout__div4().is_bound()) field_radio__link__tout__div4 = other_value.radio__link__tout__div4();
else field_radio__link__tout__div4.clean_up();
}

void CellOptions::clean_up()
{
field_dn__ind.clean_up();
field_pwrc.clean_up();
field_dtx.clean_up();
field_radio__link__tout__div4.clean_up();
}

const TTCN_Typedescriptor_t* CellOptions::get_descriptor() const { return &CellOptions_descr_; }
CellOptions& CellOptions::operator=(const CellOptions& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.CellOptions.");
  if (other_value.dn__ind().is_bound()) field_dn__ind = other_value.dn__ind();
  else field_dn__ind.clean_up();
  if (other_value.pwrc().is_bound()) field_pwrc = other_value.pwrc();
  else field_pwrc.clean_up();
  if (other_value.dtx().is_bound()) field_dtx = other_value.dtx();
  else field_dtx.clean_up();
  if (other_value.radio__link__tout__div4().is_bound()) field_radio__link__tout__div4 = other_value.radio__link__tout__div4();
  else field_radio__link__tout__div4.clean_up();
}
return *this;
}

boolean CellOptions::operator==(const CellOptions& other_value) const
{
return field_dn__ind==other_value.field_dn__ind
  && field_pwrc==other_value.field_pwrc
  && field_dtx==other_value.field_dtx
  && field_radio__link__tout__div4==other_value.field_radio__link__tout__div4;
}

boolean CellOptions::is_bound() const
{
return (field_dn__ind.is_bound())
  || (field_pwrc.is_bound())
  || (field_dtx.is_bound())
  || (field_radio__link__tout__div4.is_bound());
}
boolean CellOptions::is_value() const
{
return field_dn__ind.is_value()
  && field_pwrc.is_value()
  && field_dtx.is_value()
  && field_radio__link__tout__div4.is_value();
}
void CellOptions::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dn_ind := ");
field_dn__ind.log();
TTCN_Logger::log_event_str(", pwrc := ");
field_pwrc.log();
TTCN_Logger::log_event_str(", dtx := ");
field_dtx.log();
TTCN_Logger::log_event_str(", radio_link_tout_div4 := ");
field_radio__link__tout__div4.log();
TTCN_Logger::log_event_str(" }");
}

void CellOptions::set_implicit_omit()
{
if (dn__ind().is_bound()) dn__ind().set_implicit_omit();
if (pwrc().is_bound()) pwrc().set_implicit_omit();
if (dtx().is_bound()) dtx().set_implicit_omit();
if (radio__link__tout__div4().is_bound()) radio__link__tout__div4().set_implicit_omit();
}

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

void CellOptions::encode_text(Text_Buf& text_buf) const
{
field_dn__ind.encode_text(text_buf);
field_pwrc.encode_text(text_buf);
field_dtx.encode_text(text_buf);
field_radio__link__tout__div4.encode_text(text_buf);
}

void CellOptions::decode_text(Text_Buf& text_buf)
{
field_dn__ind.decode_text(text_buf);
field_pwrc.decode_text(text_buf);
field_dtx.decode_text(text_buf);
field_radio__link__tout__div4.decode_text(text_buf);
}

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

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

int CellOptions::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, CellOptions_dn__ind_descr_.raw->forceomit);
  decoded_field_length = field_dn__ind.RAW_decode(CellOptions_dn__ind_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, CellOptions_pwrc_descr_.raw->forceomit);
  decoded_field_length = field_pwrc.RAW_decode(CellOptions_pwrc_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, CellOptions_dtx_descr_.raw->forceomit);
  decoded_field_length = field_dtx.RAW_decode(CellOptions_dtx_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, CellOptions_radio__link__tout__div4_descr_.raw->forceomit);
  decoded_field_length = field_radio__link__tout__div4.RAW_decode(CellOptions_radio__link__tout__div4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CellOptions::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, CellOptions_dn__ind_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CellOptions_pwrc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CellOptions_dtx_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, CellOptions_radio__link__tout__div4_descr_.raw);
  encoded_length += field_dn__ind.RAW_encode(CellOptions_dn__ind_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pwrc.RAW_encode(CellOptions_pwrc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dtx.RAW_encode(CellOptions_dtx_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_radio__link__tout__div4.RAW_encode(CellOptions_radio__link__tout__div4_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct CellOptions_template::single_value_struct {
BOOLEAN_template field_dn__ind;
BOOLEAN_template field_pwrc;
CellOptions__DTX_template field_dtx;
INTEGER_template field_radio__link__tout__div4;
};

void CellOptions_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_dn__ind = ANY_VALUE;
single_value->field_pwrc = ANY_VALUE;
single_value->field_dtx = ANY_VALUE;
single_value->field_radio__link__tout__div4 = ANY_VALUE;
}
}
}

void CellOptions_template::copy_value(const CellOptions& other_value)
{
single_value = new single_value_struct;
if (other_value.dn__ind().is_bound()) {
  single_value->field_dn__ind = other_value.dn__ind();
} else {
  single_value->field_dn__ind.clean_up();
}
if (other_value.pwrc().is_bound()) {
  single_value->field_pwrc = other_value.pwrc();
} else {
  single_value->field_pwrc.clean_up();
}
if (other_value.dtx().is_bound()) {
  single_value->field_dtx = other_value.dtx();
} else {
  single_value->field_dtx.clean_up();
}
if (other_value.radio__link__tout__div4().is_bound()) {
  single_value->field_radio__link__tout__div4 = other_value.radio__link__tout__div4();
} else {
  single_value->field_radio__link__tout__div4.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CellOptions_template::copy_template(const CellOptions_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dn__ind().get_selection()) {
single_value->field_dn__ind = other_value.dn__ind();
} else {
single_value->field_dn__ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pwrc().get_selection()) {
single_value->field_pwrc = other_value.pwrc();
} else {
single_value->field_pwrc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dtx().get_selection()) {
single_value->field_dtx = other_value.dtx();
} else {
single_value->field_dtx.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radio__link__tout__div4().get_selection()) {
single_value->field_radio__link__tout__div4 = other_value.radio__link__tout__div4();
} else {
single_value->field_radio__link__tout__div4.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 CellOptions_template[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 CellOptions_template(*other_value.implication_.precondition);
implication_.implied_template = new CellOptions_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 @GSM_SystemInformation.CellOptions.");
break;
}
set_selection(other_value);
}

CellOptions_template::CellOptions_template()
{
}

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

CellOptions_template::CellOptions_template(const CellOptions& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CellOptions_template::match(const CellOptions& 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.dn__ind().is_bound()) return FALSE;
if(!single_value->field_dn__ind.match(other_value.dn__ind(), legacy))return FALSE;
if(!other_value.pwrc().is_bound()) return FALSE;
if(!single_value->field_pwrc.match(other_value.pwrc(), legacy))return FALSE;
if(!other_value.dtx().is_bound()) return FALSE;
if(!single_value->field_dtx.match(other_value.dtx(), legacy))return FALSE;
if(!other_value.radio__link__tout__div4().is_bound()) return FALSE;
if(!single_value->field_radio__link__tout__div4.match(other_value.radio__link__tout__div4(), 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 @GSM_SystemInformation.CellOptions.");
}
return FALSE;
}

boolean CellOptions_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dn__ind.is_bound()
 || single_value->field_pwrc.is_bound()
 || single_value->field_dtx.is_bound()
 || single_value->field_radio__link__tout__div4.is_bound();
}

boolean CellOptions_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dn__ind.is_value()
 && single_value->field_pwrc.is_value()
 && single_value->field_dtx.is_value()
 && single_value->field_radio__link__tout__div4.is_value();
}

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

CellOptions CellOptions_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 @GSM_SystemInformation.CellOptions.");
CellOptions ret_val;
if (single_value->field_dn__ind.is_bound()) {
ret_val.dn__ind() = single_value->field_dn__ind.valueof();
}
if (single_value->field_pwrc.is_bound()) {
ret_val.pwrc() = single_value->field_pwrc.valueof();
}
if (single_value->field_dtx.is_bound()) {
ret_val.dtx() = single_value->field_dtx.valueof();
}
if (single_value->field_radio__link__tout__div4.is_bound()) {
ret_val.radio__link__tout__div4() = single_value->field_radio__link__tout__div4.valueof();
}
return ret_val;
}

void CellOptions_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 @GSM_SystemInformation.CellOptions.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CellOptions_template[list_length];
}

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

BOOLEAN_template& CellOptions_template::dn__ind()
{
set_specific();
return single_value->field_dn__ind;
}

const BOOLEAN_template& CellOptions_template::dn__ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dn_ind of a non-specific template of type @GSM_SystemInformation.CellOptions.");
return single_value->field_dn__ind;
}

BOOLEAN_template& CellOptions_template::pwrc()
{
set_specific();
return single_value->field_pwrc;
}

const BOOLEAN_template& CellOptions_template::pwrc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pwrc of a non-specific template of type @GSM_SystemInformation.CellOptions.");
return single_value->field_pwrc;
}

CellOptions__DTX_template& CellOptions_template::dtx()
{
set_specific();
return single_value->field_dtx;
}

const CellOptions__DTX_template& CellOptions_template::dtx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx of a non-specific template of type @GSM_SystemInformation.CellOptions.");
return single_value->field_dtx;
}

INTEGER_template& CellOptions_template::radio__link__tout__div4()
{
set_specific();
return single_value->field_radio__link__tout__div4;
}

const INTEGER_template& CellOptions_template::radio__link__tout__div4() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radio_link_tout_div4 of a non-specific template of type @GSM_SystemInformation.CellOptions.");
return single_value->field_radio__link__tout__div4;
}

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

void CellOptions_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dn_ind := ");
single_value->field_dn__ind.log();
TTCN_Logger::log_event_str(", pwrc := ");
single_value->field_pwrc.log();
TTCN_Logger::log_event_str(", dtx := ");
single_value->field_dtx.log();
TTCN_Logger::log_event_str(", radio_link_tout_div4 := ");
single_value->field_radio__link__tout__div4.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 CellOptions_template::log_match(const CellOptions& 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_dn__ind.match(match_value.dn__ind(), legacy)){
TTCN_Logger::log_logmatch_info(".dn_ind");
single_value->field_dn__ind.log_match(match_value.dn__ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pwrc.match(match_value.pwrc(), legacy)){
TTCN_Logger::log_logmatch_info(".pwrc");
single_value->field_pwrc.log_match(match_value.pwrc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dtx.match(match_value.dtx(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx");
single_value->field_dtx.log_match(match_value.dtx(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_radio__link__tout__div4.match(match_value.radio__link__tout__div4(), legacy)){
TTCN_Logger::log_logmatch_info(".radio_link_tout_div4");
single_value->field_radio__link__tout__div4.log_match(match_value.radio__link__tout__div4(), 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("{ dn_ind := ");
single_value->field_dn__ind.log_match(match_value.dn__ind(), legacy);
TTCN_Logger::log_event_str(", pwrc := ");
single_value->field_pwrc.log_match(match_value.pwrc(), legacy);
TTCN_Logger::log_event_str(", dtx := ");
single_value->field_dtx.log_match(match_value.dtx(), legacy);
TTCN_Logger::log_event_str(", radio_link_tout_div4 := ");
single_value->field_radio__link__tout__div4.log_match(match_value.radio__link__tout__div4(), 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 CellOptions_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dn__ind().is_bound()) dn__ind().set_implicit_omit();
if (pwrc().is_bound()) pwrc().set_implicit_omit();
if (dtx().is_bound()) dtx().set_implicit_omit();
if (radio__link__tout__div4().is_bound()) radio__link__tout__div4().set_implicit_omit();
}

void CellOptions_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dn__ind.encode_text(text_buf);
single_value->field_pwrc.encode_text(text_buf);
single_value->field_dtx.encode_text(text_buf);
single_value->field_radio__link__tout__div4.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 @GSM_SystemInformation.CellOptions.");
}
}

void CellOptions_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_dn__ind.decode_text(text_buf);
single_value->field_pwrc.decode_text(text_buf);
single_value->field_dtx.decode_text(text_buf);
single_value->field_radio__link__tout__div4.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 CellOptions_template[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 @GSM_SystemInformation.CellOptions.");
}
}

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

void CellOptions_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_dn__ind.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptions");
single_value->field_pwrc.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptions");
single_value->field_dtx.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptions");
single_value->field_radio__link__tout__div4.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptions");
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 : "@GSM_SystemInformation.CellOptions");
}

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

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

CellOptionsSacch::CellOptionsSacch()
{
}

CellOptionsSacch::CellOptionsSacch(const BITSTRING& par_dtx__ext,
    const BOOLEAN& par_pwrc,
    const BITSTRING& par_dtx,
    const BITSTRING& par_radio__link__timeout)
  :   field_dtx__ext(par_dtx__ext),
  field_pwrc(par_pwrc),
  field_dtx(par_dtx),
  field_radio__link__timeout(par_radio__link__timeout)
{
}

CellOptionsSacch::CellOptionsSacch(const CellOptionsSacch& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.CellOptionsSacch.");
if (other_value.dtx__ext().is_bound()) field_dtx__ext = other_value.dtx__ext();
else field_dtx__ext.clean_up();
if (other_value.pwrc().is_bound()) field_pwrc = other_value.pwrc();
else field_pwrc.clean_up();
if (other_value.dtx().is_bound()) field_dtx = other_value.dtx();
else field_dtx.clean_up();
if (other_value.radio__link__timeout().is_bound()) field_radio__link__timeout = other_value.radio__link__timeout();
else field_radio__link__timeout.clean_up();
}

void CellOptionsSacch::clean_up()
{
field_dtx__ext.clean_up();
field_pwrc.clean_up();
field_dtx.clean_up();
field_radio__link__timeout.clean_up();
}

const TTCN_Typedescriptor_t* CellOptionsSacch::get_descriptor() const { return &CellOptionsSacch_descr_; }
CellOptionsSacch& CellOptionsSacch::operator=(const CellOptionsSacch& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.CellOptionsSacch.");
  if (other_value.dtx__ext().is_bound()) field_dtx__ext = other_value.dtx__ext();
  else field_dtx__ext.clean_up();
  if (other_value.pwrc().is_bound()) field_pwrc = other_value.pwrc();
  else field_pwrc.clean_up();
  if (other_value.dtx().is_bound()) field_dtx = other_value.dtx();
  else field_dtx.clean_up();
  if (other_value.radio__link__timeout().is_bound()) field_radio__link__timeout = other_value.radio__link__timeout();
  else field_radio__link__timeout.clean_up();
}
return *this;
}

boolean CellOptionsSacch::operator==(const CellOptionsSacch& other_value) const
{
return field_dtx__ext==other_value.field_dtx__ext
  && field_pwrc==other_value.field_pwrc
  && field_dtx==other_value.field_dtx
  && field_radio__link__timeout==other_value.field_radio__link__timeout;
}

boolean CellOptionsSacch::is_bound() const
{
return (field_dtx__ext.is_bound())
  || (field_pwrc.is_bound())
  || (field_dtx.is_bound())
  || (field_radio__link__timeout.is_bound());
}
boolean CellOptionsSacch::is_value() const
{
return field_dtx__ext.is_value()
  && field_pwrc.is_value()
  && field_dtx.is_value()
  && field_radio__link__timeout.is_value();
}
void CellOptionsSacch::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dtx_ext := ");
field_dtx__ext.log();
TTCN_Logger::log_event_str(", pwrc := ");
field_pwrc.log();
TTCN_Logger::log_event_str(", dtx := ");
field_dtx.log();
TTCN_Logger::log_event_str(", radio_link_timeout := ");
field_radio__link__timeout.log();
TTCN_Logger::log_event_str(" }");
}

void CellOptionsSacch::set_implicit_omit()
{
if (dtx__ext().is_bound()) dtx__ext().set_implicit_omit();
if (pwrc().is_bound()) pwrc().set_implicit_omit();
if (dtx().is_bound()) dtx().set_implicit_omit();
if (radio__link__timeout().is_bound()) radio__link__timeout().set_implicit_omit();
}

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

void CellOptionsSacch::encode_text(Text_Buf& text_buf) const
{
field_dtx__ext.encode_text(text_buf);
field_pwrc.encode_text(text_buf);
field_dtx.encode_text(text_buf);
field_radio__link__timeout.encode_text(text_buf);
}

void CellOptionsSacch::decode_text(Text_Buf& text_buf)
{
field_dtx__ext.decode_text(text_buf);
field_pwrc.decode_text(text_buf);
field_dtx.decode_text(text_buf);
field_radio__link__timeout.decode_text(text_buf);
}

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

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

int CellOptionsSacch::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, CellOptionsSacch_dtx__ext_descr_.raw->forceomit);
  decoded_field_length = field_dtx__ext.RAW_decode(CellOptionsSacch_dtx__ext_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, CellOptionsSacch_pwrc_descr_.raw->forceomit);
  decoded_field_length = field_pwrc.RAW_decode(CellOptionsSacch_pwrc_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, CellOptionsSacch_dtx_descr_.raw->forceomit);
  decoded_field_length = field_dtx.RAW_decode(CellOptionsSacch_dtx_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, CellOptionsSacch_radio__link__timeout_descr_.raw->forceomit);
  decoded_field_length = field_radio__link__timeout.RAW_decode(CellOptionsSacch_radio__link__timeout_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int CellOptionsSacch::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, CellOptionsSacch_dtx__ext_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CellOptionsSacch_pwrc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CellOptionsSacch_dtx_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, CellOptionsSacch_radio__link__timeout_descr_.raw);
  encoded_length += field_dtx__ext.RAW_encode(CellOptionsSacch_dtx__ext_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_pwrc.RAW_encode(CellOptionsSacch_pwrc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dtx.RAW_encode(CellOptionsSacch_dtx_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_radio__link__timeout.RAW_encode(CellOptionsSacch_radio__link__timeout_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct CellOptionsSacch_template::single_value_struct {
BITSTRING_template field_dtx__ext;
BOOLEAN_template field_pwrc;
BITSTRING_template field_dtx;
BITSTRING_template field_radio__link__timeout;
};

void CellOptionsSacch_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_dtx__ext = ANY_VALUE;
single_value->field_pwrc = ANY_VALUE;
single_value->field_dtx = ANY_VALUE;
single_value->field_radio__link__timeout = ANY_VALUE;
}
}
}

void CellOptionsSacch_template::copy_value(const CellOptionsSacch& other_value)
{
single_value = new single_value_struct;
if (other_value.dtx__ext().is_bound()) {
  single_value->field_dtx__ext = other_value.dtx__ext();
} else {
  single_value->field_dtx__ext.clean_up();
}
if (other_value.pwrc().is_bound()) {
  single_value->field_pwrc = other_value.pwrc();
} else {
  single_value->field_pwrc.clean_up();
}
if (other_value.dtx().is_bound()) {
  single_value->field_dtx = other_value.dtx();
} else {
  single_value->field_dtx.clean_up();
}
if (other_value.radio__link__timeout().is_bound()) {
  single_value->field_radio__link__timeout = other_value.radio__link__timeout();
} else {
  single_value->field_radio__link__timeout.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CellOptionsSacch_template::copy_template(const CellOptionsSacch_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dtx__ext().get_selection()) {
single_value->field_dtx__ext = other_value.dtx__ext();
} else {
single_value->field_dtx__ext.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pwrc().get_selection()) {
single_value->field_pwrc = other_value.pwrc();
} else {
single_value->field_pwrc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dtx().get_selection()) {
single_value->field_dtx = other_value.dtx();
} else {
single_value->field_dtx.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radio__link__timeout().get_selection()) {
single_value->field_radio__link__timeout = other_value.radio__link__timeout();
} else {
single_value->field_radio__link__timeout.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 CellOptionsSacch_template[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 CellOptionsSacch_template(*other_value.implication_.precondition);
implication_.implied_template = new CellOptionsSacch_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 @GSM_SystemInformation.CellOptionsSacch.");
break;
}
set_selection(other_value);
}

CellOptionsSacch_template::CellOptionsSacch_template()
{
}

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

CellOptionsSacch_template::CellOptionsSacch_template(const CellOptionsSacch& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CellOptionsSacch_template::match(const CellOptionsSacch& 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.dtx__ext().is_bound()) return FALSE;
if(!single_value->field_dtx__ext.match(other_value.dtx__ext(), legacy))return FALSE;
if(!other_value.pwrc().is_bound()) return FALSE;
if(!single_value->field_pwrc.match(other_value.pwrc(), legacy))return FALSE;
if(!other_value.dtx().is_bound()) return FALSE;
if(!single_value->field_dtx.match(other_value.dtx(), legacy))return FALSE;
if(!other_value.radio__link__timeout().is_bound()) return FALSE;
if(!single_value->field_radio__link__timeout.match(other_value.radio__link__timeout(), 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 @GSM_SystemInformation.CellOptionsSacch.");
}
return FALSE;
}

boolean CellOptionsSacch_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dtx__ext.is_bound()
 || single_value->field_pwrc.is_bound()
 || single_value->field_dtx.is_bound()
 || single_value->field_radio__link__timeout.is_bound();
}

boolean CellOptionsSacch_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dtx__ext.is_value()
 && single_value->field_pwrc.is_value()
 && single_value->field_dtx.is_value()
 && single_value->field_radio__link__timeout.is_value();
}

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

CellOptionsSacch CellOptionsSacch_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 @GSM_SystemInformation.CellOptionsSacch.");
CellOptionsSacch ret_val;
if (single_value->field_dtx__ext.is_bound()) {
ret_val.dtx__ext() = single_value->field_dtx__ext.valueof();
}
if (single_value->field_pwrc.is_bound()) {
ret_val.pwrc() = single_value->field_pwrc.valueof();
}
if (single_value->field_dtx.is_bound()) {
ret_val.dtx() = single_value->field_dtx.valueof();
}
if (single_value->field_radio__link__timeout.is_bound()) {
ret_val.radio__link__timeout() = single_value->field_radio__link__timeout.valueof();
}
return ret_val;
}

void CellOptionsSacch_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 @GSM_SystemInformation.CellOptionsSacch.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CellOptionsSacch_template[list_length];
}

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

BITSTRING_template& CellOptionsSacch_template::dtx__ext()
{
set_specific();
return single_value->field_dtx__ext;
}

const BITSTRING_template& CellOptionsSacch_template::dtx__ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx_ext of a non-specific template of type @GSM_SystemInformation.CellOptionsSacch.");
return single_value->field_dtx__ext;
}

BOOLEAN_template& CellOptionsSacch_template::pwrc()
{
set_specific();
return single_value->field_pwrc;
}

const BOOLEAN_template& CellOptionsSacch_template::pwrc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pwrc of a non-specific template of type @GSM_SystemInformation.CellOptionsSacch.");
return single_value->field_pwrc;
}

BITSTRING_template& CellOptionsSacch_template::dtx()
{
set_specific();
return single_value->field_dtx;
}

const BITSTRING_template& CellOptionsSacch_template::dtx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx of a non-specific template of type @GSM_SystemInformation.CellOptionsSacch.");
return single_value->field_dtx;
}

BITSTRING_template& CellOptionsSacch_template::radio__link__timeout()
{
set_specific();
return single_value->field_radio__link__timeout;
}

const BITSTRING_template& CellOptionsSacch_template::radio__link__timeout() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radio_link_timeout of a non-specific template of type @GSM_SystemInformation.CellOptionsSacch.");
return single_value->field_radio__link__timeout;
}

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

void CellOptionsSacch_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dtx_ext := ");
single_value->field_dtx__ext.log();
TTCN_Logger::log_event_str(", pwrc := ");
single_value->field_pwrc.log();
TTCN_Logger::log_event_str(", dtx := ");
single_value->field_dtx.log();
TTCN_Logger::log_event_str(", radio_link_timeout := ");
single_value->field_radio__link__timeout.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 CellOptionsSacch_template::log_match(const CellOptionsSacch& 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_dtx__ext.match(match_value.dtx__ext(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx_ext");
single_value->field_dtx__ext.log_match(match_value.dtx__ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_pwrc.match(match_value.pwrc(), legacy)){
TTCN_Logger::log_logmatch_info(".pwrc");
single_value->field_pwrc.log_match(match_value.pwrc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dtx.match(match_value.dtx(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx");
single_value->field_dtx.log_match(match_value.dtx(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_radio__link__timeout.match(match_value.radio__link__timeout(), legacy)){
TTCN_Logger::log_logmatch_info(".radio_link_timeout");
single_value->field_radio__link__timeout.log_match(match_value.radio__link__timeout(), 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("{ dtx_ext := ");
single_value->field_dtx__ext.log_match(match_value.dtx__ext(), legacy);
TTCN_Logger::log_event_str(", pwrc := ");
single_value->field_pwrc.log_match(match_value.pwrc(), legacy);
TTCN_Logger::log_event_str(", dtx := ");
single_value->field_dtx.log_match(match_value.dtx(), legacy);
TTCN_Logger::log_event_str(", radio_link_timeout := ");
single_value->field_radio__link__timeout.log_match(match_value.radio__link__timeout(), 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 CellOptionsSacch_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dtx__ext().is_bound()) dtx__ext().set_implicit_omit();
if (pwrc().is_bound()) pwrc().set_implicit_omit();
if (dtx().is_bound()) dtx().set_implicit_omit();
if (radio__link__timeout().is_bound()) radio__link__timeout().set_implicit_omit();
}

void CellOptionsSacch_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dtx__ext.encode_text(text_buf);
single_value->field_pwrc.encode_text(text_buf);
single_value->field_dtx.encode_text(text_buf);
single_value->field_radio__link__timeout.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 @GSM_SystemInformation.CellOptionsSacch.");
}
}

void CellOptionsSacch_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_dtx__ext.decode_text(text_buf);
single_value->field_pwrc.decode_text(text_buf);
single_value->field_dtx.decode_text(text_buf);
single_value->field_radio__link__timeout.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 CellOptionsSacch_template[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 @GSM_SystemInformation.CellOptionsSacch.");
}
}

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

void CellOptionsSacch_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_dtx__ext.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptionsSacch");
single_value->field_pwrc.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptionsSacch");
single_value->field_dtx.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptionsSacch");
single_value->field_radio__link__timeout.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellOptionsSacch");
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 : "@GSM_SystemInformation.CellOptionsSacch");
}

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

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

CellSelectionParameters::CellSelectionParameters()
{
}

CellSelectionParameters::CellSelectionParameters(const INTEGER& par_cell__resel__hyst__2dB,
    const INTEGER& par_ms__txpwr__max__cch,
    const BITSTRING& par_acs,
    const BOOLEAN& par_neci,
    const INTEGER& par_rxlev__access__min)
  :   field_cell__resel__hyst__2dB(par_cell__resel__hyst__2dB),
  field_ms__txpwr__max__cch(par_ms__txpwr__max__cch),
  field_acs(par_acs),
  field_neci(par_neci),
  field_rxlev__access__min(par_rxlev__access__min)
{
}

CellSelectionParameters::CellSelectionParameters(const CellSelectionParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.CellSelectionParameters.");
if (other_value.cell__resel__hyst__2dB().is_bound()) field_cell__resel__hyst__2dB = other_value.cell__resel__hyst__2dB();
else field_cell__resel__hyst__2dB.clean_up();
if (other_value.ms__txpwr__max__cch().is_bound()) field_ms__txpwr__max__cch = other_value.ms__txpwr__max__cch();
else field_ms__txpwr__max__cch.clean_up();
if (other_value.acs().is_bound()) field_acs = other_value.acs();
else field_acs.clean_up();
if (other_value.neci().is_bound()) field_neci = other_value.neci();
else field_neci.clean_up();
if (other_value.rxlev__access__min().is_bound()) field_rxlev__access__min = other_value.rxlev__access__min();
else field_rxlev__access__min.clean_up();
}

void CellSelectionParameters::clean_up()
{
field_cell__resel__hyst__2dB.clean_up();
field_ms__txpwr__max__cch.clean_up();
field_acs.clean_up();
field_neci.clean_up();
field_rxlev__access__min.clean_up();
}

const TTCN_Typedescriptor_t* CellSelectionParameters::get_descriptor() const { return &CellSelectionParameters_descr_; }
CellSelectionParameters& CellSelectionParameters::operator=(const CellSelectionParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.CellSelectionParameters.");
  if (other_value.cell__resel__hyst__2dB().is_bound()) field_cell__resel__hyst__2dB = other_value.cell__resel__hyst__2dB();
  else field_cell__resel__hyst__2dB.clean_up();
  if (other_value.ms__txpwr__max__cch().is_bound()) field_ms__txpwr__max__cch = other_value.ms__txpwr__max__cch();
  else field_ms__txpwr__max__cch.clean_up();
  if (other_value.acs().is_bound()) field_acs = other_value.acs();
  else field_acs.clean_up();
  if (other_value.neci().is_bound()) field_neci = other_value.neci();
  else field_neci.clean_up();
  if (other_value.rxlev__access__min().is_bound()) field_rxlev__access__min = other_value.rxlev__access__min();
  else field_rxlev__access__min.clean_up();
}
return *this;
}

boolean CellSelectionParameters::operator==(const CellSelectionParameters& other_value) const
{
return field_cell__resel__hyst__2dB==other_value.field_cell__resel__hyst__2dB
  && field_ms__txpwr__max__cch==other_value.field_ms__txpwr__max__cch
  && field_acs==other_value.field_acs
  && field_neci==other_value.field_neci
  && field_rxlev__access__min==other_value.field_rxlev__access__min;
}

boolean CellSelectionParameters::is_bound() const
{
return (field_cell__resel__hyst__2dB.is_bound())
  || (field_ms__txpwr__max__cch.is_bound())
  || (field_acs.is_bound())
  || (field_neci.is_bound())
  || (field_rxlev__access__min.is_bound());
}
boolean CellSelectionParameters::is_value() const
{
return field_cell__resel__hyst__2dB.is_value()
  && field_ms__txpwr__max__cch.is_value()
  && field_acs.is_value()
  && field_neci.is_value()
  && field_rxlev__access__min.is_value();
}
void CellSelectionParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cell_resel_hyst_2dB := ");
field_cell__resel__hyst__2dB.log();
TTCN_Logger::log_event_str(", ms_txpwr_max_cch := ");
field_ms__txpwr__max__cch.log();
TTCN_Logger::log_event_str(", acs := ");
field_acs.log();
TTCN_Logger::log_event_str(", neci := ");
field_neci.log();
TTCN_Logger::log_event_str(", rxlev_access_min := ");
field_rxlev__access__min.log();
TTCN_Logger::log_event_str(" }");
}

void CellSelectionParameters::set_implicit_omit()
{
if (cell__resel__hyst__2dB().is_bound()) cell__resel__hyst__2dB().set_implicit_omit();
if (ms__txpwr__max__cch().is_bound()) ms__txpwr__max__cch().set_implicit_omit();
if (acs().is_bound()) acs().set_implicit_omit();
if (neci().is_bound()) neci().set_implicit_omit();
if (rxlev__access__min().is_bound()) rxlev__access__min().set_implicit_omit();
}

void CellSelectionParameters::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 @GSM_SystemInformation.CellSelectionParameters 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) cell__resel__hyst__2dB().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ms__txpwr__max__cch().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) acs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) neci().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rxlev__access__min().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(), "cell_resel_hyst_2dB")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__resel__hyst__2dB().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ms_txpwr_max_cch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__txpwr__max__cch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "neci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          neci().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxlev_access_min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev__access__min().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.CellSelectionParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@GSM_SystemInformation.CellSelectionParameters");
  }
}

void CellSelectionParameters::encode_text(Text_Buf& text_buf) const
{
field_cell__resel__hyst__2dB.encode_text(text_buf);
field_ms__txpwr__max__cch.encode_text(text_buf);
field_acs.encode_text(text_buf);
field_neci.encode_text(text_buf);
field_rxlev__access__min.encode_text(text_buf);
}

void CellSelectionParameters::decode_text(Text_Buf& text_buf)
{
field_cell__resel__hyst__2dB.decode_text(text_buf);
field_ms__txpwr__max__cch.decode_text(text_buf);
field_acs.decode_text(text_buf);
field_neci.decode_text(text_buf);
field_rxlev__access__min.decode_text(text_buf);
}

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

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

int CellSelectionParameters::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, CellSelectionParameters_cell__resel__hyst__2dB_descr_.raw->forceomit);
  decoded_field_length = field_cell__resel__hyst__2dB.RAW_decode(CellSelectionParameters_cell__resel__hyst__2dB_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, CellSelectionParameters_ms__txpwr__max__cch_descr_.raw->forceomit);
  decoded_field_length = field_ms__txpwr__max__cch.RAW_decode(CellSelectionParameters_ms__txpwr__max__cch_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, CellSelectionParameters_acs_descr_.raw->forceomit);
  decoded_field_length = field_acs.RAW_decode(CellSelectionParameters_acs_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, CellSelectionParameters_neci_descr_.raw->forceomit);
  decoded_field_length = field_neci.RAW_decode(CellSelectionParameters_neci_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, CellSelectionParameters_rxlev__access__min_descr_.raw->forceomit);
  decoded_field_length = field_rxlev__access__min.RAW_decode(CellSelectionParameters_rxlev__access__min_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 CellSelectionParameters::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, CellSelectionParameters_cell__resel__hyst__2dB_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CellSelectionParameters_ms__txpwr__max__cch_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, CellSelectionParameters_acs_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, CellSelectionParameters_neci_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, CellSelectionParameters_rxlev__access__min_descr_.raw);
  encoded_length += field_cell__resel__hyst__2dB.RAW_encode(CellSelectionParameters_cell__resel__hyst__2dB_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ms__txpwr__max__cch.RAW_encode(CellSelectionParameters_ms__txpwr__max__cch_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_acs.RAW_encode(CellSelectionParameters_acs_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_neci.RAW_encode(CellSelectionParameters_neci_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rxlev__access__min.RAW_encode(CellSelectionParameters_rxlev__access__min_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct CellSelectionParameters_template::single_value_struct {
INTEGER_template field_cell__resel__hyst__2dB;
INTEGER_template field_ms__txpwr__max__cch;
BITSTRING_template field_acs;
BOOLEAN_template field_neci;
INTEGER_template field_rxlev__access__min;
};

void CellSelectionParameters_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_cell__resel__hyst__2dB = ANY_VALUE;
single_value->field_ms__txpwr__max__cch = ANY_VALUE;
single_value->field_acs = ANY_VALUE;
single_value->field_neci = ANY_VALUE;
single_value->field_rxlev__access__min = ANY_VALUE;
}
}
}

void CellSelectionParameters_template::copy_value(const CellSelectionParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.cell__resel__hyst__2dB().is_bound()) {
  single_value->field_cell__resel__hyst__2dB = other_value.cell__resel__hyst__2dB();
} else {
  single_value->field_cell__resel__hyst__2dB.clean_up();
}
if (other_value.ms__txpwr__max__cch().is_bound()) {
  single_value->field_ms__txpwr__max__cch = other_value.ms__txpwr__max__cch();
} else {
  single_value->field_ms__txpwr__max__cch.clean_up();
}
if (other_value.acs().is_bound()) {
  single_value->field_acs = other_value.acs();
} else {
  single_value->field_acs.clean_up();
}
if (other_value.neci().is_bound()) {
  single_value->field_neci = other_value.neci();
} else {
  single_value->field_neci.clean_up();
}
if (other_value.rxlev__access__min().is_bound()) {
  single_value->field_rxlev__access__min = other_value.rxlev__access__min();
} else {
  single_value->field_rxlev__access__min.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CellSelectionParameters_template::copy_template(const CellSelectionParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cell__resel__hyst__2dB().get_selection()) {
single_value->field_cell__resel__hyst__2dB = other_value.cell__resel__hyst__2dB();
} else {
single_value->field_cell__resel__hyst__2dB.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ms__txpwr__max__cch().get_selection()) {
single_value->field_ms__txpwr__max__cch = other_value.ms__txpwr__max__cch();
} else {
single_value->field_ms__txpwr__max__cch.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.acs().get_selection()) {
single_value->field_acs = other_value.acs();
} else {
single_value->field_acs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.neci().get_selection()) {
single_value->field_neci = other_value.neci();
} else {
single_value->field_neci.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rxlev__access__min().get_selection()) {
single_value->field_rxlev__access__min = other_value.rxlev__access__min();
} else {
single_value->field_rxlev__access__min.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 CellSelectionParameters_template[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 CellSelectionParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new CellSelectionParameters_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 @GSM_SystemInformation.CellSelectionParameters.");
break;
}
set_selection(other_value);
}

CellSelectionParameters_template::CellSelectionParameters_template()
{
}

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

CellSelectionParameters_template::CellSelectionParameters_template(const CellSelectionParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean CellSelectionParameters_template::match(const CellSelectionParameters& 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.cell__resel__hyst__2dB().is_bound()) return FALSE;
if(!single_value->field_cell__resel__hyst__2dB.match(other_value.cell__resel__hyst__2dB(), legacy))return FALSE;
if(!other_value.ms__txpwr__max__cch().is_bound()) return FALSE;
if(!single_value->field_ms__txpwr__max__cch.match(other_value.ms__txpwr__max__cch(), legacy))return FALSE;
if(!other_value.acs().is_bound()) return FALSE;
if(!single_value->field_acs.match(other_value.acs(), legacy))return FALSE;
if(!other_value.neci().is_bound()) return FALSE;
if(!single_value->field_neci.match(other_value.neci(), legacy))return FALSE;
if(!other_value.rxlev__access__min().is_bound()) return FALSE;
if(!single_value->field_rxlev__access__min.match(other_value.rxlev__access__min(), 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 @GSM_SystemInformation.CellSelectionParameters.");
}
return FALSE;
}

boolean CellSelectionParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cell__resel__hyst__2dB.is_bound()
 || single_value->field_ms__txpwr__max__cch.is_bound()
 || single_value->field_acs.is_bound()
 || single_value->field_neci.is_bound()
 || single_value->field_rxlev__access__min.is_bound();
}

boolean CellSelectionParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cell__resel__hyst__2dB.is_value()
 && single_value->field_ms__txpwr__max__cch.is_value()
 && single_value->field_acs.is_value()
 && single_value->field_neci.is_value()
 && single_value->field_rxlev__access__min.is_value();
}

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

CellSelectionParameters CellSelectionParameters_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 @GSM_SystemInformation.CellSelectionParameters.");
CellSelectionParameters ret_val;
if (single_value->field_cell__resel__hyst__2dB.is_bound()) {
ret_val.cell__resel__hyst__2dB() = single_value->field_cell__resel__hyst__2dB.valueof();
}
if (single_value->field_ms__txpwr__max__cch.is_bound()) {
ret_val.ms__txpwr__max__cch() = single_value->field_ms__txpwr__max__cch.valueof();
}
if (single_value->field_acs.is_bound()) {
ret_val.acs() = single_value->field_acs.valueof();
}
if (single_value->field_neci.is_bound()) {
ret_val.neci() = single_value->field_neci.valueof();
}
if (single_value->field_rxlev__access__min.is_bound()) {
ret_val.rxlev__access__min() = single_value->field_rxlev__access__min.valueof();
}
return ret_val;
}

void CellSelectionParameters_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 @GSM_SystemInformation.CellSelectionParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CellSelectionParameters_template[list_length];
}

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

INTEGER_template& CellSelectionParameters_template::cell__resel__hyst__2dB()
{
set_specific();
return single_value->field_cell__resel__hyst__2dB;
}

const INTEGER_template& CellSelectionParameters_template::cell__resel__hyst__2dB() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_resel_hyst_2dB of a non-specific template of type @GSM_SystemInformation.CellSelectionParameters.");
return single_value->field_cell__resel__hyst__2dB;
}

INTEGER_template& CellSelectionParameters_template::ms__txpwr__max__cch()
{
set_specific();
return single_value->field_ms__txpwr__max__cch;
}

const INTEGER_template& CellSelectionParameters_template::ms__txpwr__max__cch() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ms_txpwr_max_cch of a non-specific template of type @GSM_SystemInformation.CellSelectionParameters.");
return single_value->field_ms__txpwr__max__cch;
}

BITSTRING_template& CellSelectionParameters_template::acs()
{
set_specific();
return single_value->field_acs;
}

const BITSTRING_template& CellSelectionParameters_template::acs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acs of a non-specific template of type @GSM_SystemInformation.CellSelectionParameters.");
return single_value->field_acs;
}

BOOLEAN_template& CellSelectionParameters_template::neci()
{
set_specific();
return single_value->field_neci;
}

const BOOLEAN_template& CellSelectionParameters_template::neci() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field neci of a non-specific template of type @GSM_SystemInformation.CellSelectionParameters.");
return single_value->field_neci;
}

INTEGER_template& CellSelectionParameters_template::rxlev__access__min()
{
set_specific();
return single_value->field_rxlev__access__min;
}

const INTEGER_template& CellSelectionParameters_template::rxlev__access__min() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rxlev_access_min of a non-specific template of type @GSM_SystemInformation.CellSelectionParameters.");
return single_value->field_rxlev__access__min;
}

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

void CellSelectionParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cell_resel_hyst_2dB := ");
single_value->field_cell__resel__hyst__2dB.log();
TTCN_Logger::log_event_str(", ms_txpwr_max_cch := ");
single_value->field_ms__txpwr__max__cch.log();
TTCN_Logger::log_event_str(", acs := ");
single_value->field_acs.log();
TTCN_Logger::log_event_str(", neci := ");
single_value->field_neci.log();
TTCN_Logger::log_event_str(", rxlev_access_min := ");
single_value->field_rxlev__access__min.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 CellSelectionParameters_template::log_match(const CellSelectionParameters& 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_cell__resel__hyst__2dB.match(match_value.cell__resel__hyst__2dB(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_resel_hyst_2dB");
single_value->field_cell__resel__hyst__2dB.log_match(match_value.cell__resel__hyst__2dB(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ms__txpwr__max__cch.match(match_value.ms__txpwr__max__cch(), legacy)){
TTCN_Logger::log_logmatch_info(".ms_txpwr_max_cch");
single_value->field_ms__txpwr__max__cch.log_match(match_value.ms__txpwr__max__cch(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_acs.match(match_value.acs(), legacy)){
TTCN_Logger::log_logmatch_info(".acs");
single_value->field_acs.log_match(match_value.acs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_neci.match(match_value.neci(), legacy)){
TTCN_Logger::log_logmatch_info(".neci");
single_value->field_neci.log_match(match_value.neci(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rxlev__access__min.match(match_value.rxlev__access__min(), legacy)){
TTCN_Logger::log_logmatch_info(".rxlev_access_min");
single_value->field_rxlev__access__min.log_match(match_value.rxlev__access__min(), 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("{ cell_resel_hyst_2dB := ");
single_value->field_cell__resel__hyst__2dB.log_match(match_value.cell__resel__hyst__2dB(), legacy);
TTCN_Logger::log_event_str(", ms_txpwr_max_cch := ");
single_value->field_ms__txpwr__max__cch.log_match(match_value.ms__txpwr__max__cch(), legacy);
TTCN_Logger::log_event_str(", acs := ");
single_value->field_acs.log_match(match_value.acs(), legacy);
TTCN_Logger::log_event_str(", neci := ");
single_value->field_neci.log_match(match_value.neci(), legacy);
TTCN_Logger::log_event_str(", rxlev_access_min := ");
single_value->field_rxlev__access__min.log_match(match_value.rxlev__access__min(), 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 CellSelectionParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cell__resel__hyst__2dB().is_bound()) cell__resel__hyst__2dB().set_implicit_omit();
if (ms__txpwr__max__cch().is_bound()) ms__txpwr__max__cch().set_implicit_omit();
if (acs().is_bound()) acs().set_implicit_omit();
if (neci().is_bound()) neci().set_implicit_omit();
if (rxlev__access__min().is_bound()) rxlev__access__min().set_implicit_omit();
}

void CellSelectionParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cell__resel__hyst__2dB.encode_text(text_buf);
single_value->field_ms__txpwr__max__cch.encode_text(text_buf);
single_value->field_acs.encode_text(text_buf);
single_value->field_neci.encode_text(text_buf);
single_value->field_rxlev__access__min.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 @GSM_SystemInformation.CellSelectionParameters.");
}
}

void CellSelectionParameters_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_cell__resel__hyst__2dB.decode_text(text_buf);
single_value->field_ms__txpwr__max__cch.decode_text(text_buf);
single_value->field_acs.decode_text(text_buf);
single_value->field_neci.decode_text(text_buf);
single_value->field_rxlev__access__min.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 CellSelectionParameters_template[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 @GSM_SystemInformation.CellSelectionParameters.");
}
}

void CellSelectionParameters_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: {
    CellSelectionParameters_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 @GSM_SystemInformation.CellSelectionParameters 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) cell__resel__hyst__2dB().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ms__txpwr__max__cch().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) acs().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) neci().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rxlev__access__min().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(), "cell_resel_hyst_2dB")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__resel__hyst__2dB().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ms_txpwr_max_cch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__txpwr__max__cch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "neci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          neci().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxlev_access_min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev__access__min().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.CellSelectionParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CellSelectionParameters_template* precondition = new CellSelectionParameters_template;
    precondition->set_param(*param.get_elem(0));
    CellSelectionParameters_template* implied_template = new CellSelectionParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CellSelectionParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@GSM_SystemInformation.CellSelectionParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void CellSelectionParameters_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_cell__resel__hyst__2dB.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellSelectionParameters");
single_value->field_ms__txpwr__max__cch.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellSelectionParameters");
single_value->field_acs.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellSelectionParameters");
single_value->field_neci.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellSelectionParameters");
single_value->field_rxlev__access__min.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.CellSelectionParameters");
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 : "@GSM_SystemInformation.CellSelectionParameters");
}

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

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

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

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

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

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

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

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

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

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

boolean CtrlChanDesc__CC::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
return enum_value == other_value;
}

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

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

boolean CtrlChanDesc__CC::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
return enum_value < other_value;
}

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

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

boolean CtrlChanDesc__CC::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
return enum_value > other_value;
}

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

const char *CtrlChanDesc__CC::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case CCHAN__DESC__1CCCH__NOT__COMBINED: return "CCHAN_DESC_1CCCH_NOT_COMBINED";
case CCHAN__DESC__1CCCH__COMBINED: return "CCHAN_DESC_1CCCH_COMBINED";
case CCHAN__DESC__2CCCH__NOT__COMBINED: return "CCHAN_DESC_2CCCH_NOT_COMBINED";
case CCHAN__DESC__3CCCH__NOT__COMBINED: return "CCHAN_DESC_3CCCH_NOT_COMBINED";
case CCHAN__DESC__4CCCH__NOT__COMBINED: return "CCHAN_DESC_4CCCH_NOT_COMBINED";
default:
return "<unknown>";
}
}

CtrlChanDesc__CC::enum_type CtrlChanDesc__CC::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "CCHAN_DESC_1CCCH_NOT_COMBINED")) return CCHAN__DESC__1CCCH__NOT__COMBINED;
if (!strcmp(str_par, "CCHAN_DESC_1CCCH_COMBINED")) return CCHAN__DESC__1CCCH__COMBINED;
if (!strcmp(str_par, "CCHAN_DESC_2CCCH_NOT_COMBINED")) return CCHAN__DESC__2CCCH__NOT__COMBINED;
if (!strcmp(str_par, "CCHAN_DESC_3CCCH_NOT_COMBINED")) return CCHAN__DESC__3CCCH__NOT__COMBINED;
if (!strcmp(str_par, "CCHAN_DESC_4CCCH_NOT_COMBINED")) return CCHAN__DESC__4CCCH__NOT__COMBINED;
}
return UNKNOWN_VALUE;
}

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

int CtrlChanDesc__CC::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int CtrlChanDesc__CC::enum2int(const CtrlChanDesc__CC& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

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

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

void CtrlChanDesc__CC::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void CtrlChanDesc__CC::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@GSM_SystemInformation.CtrlChanDesc_CC");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @GSM_SystemInformation.CtrlChanDesc_CC.");
  }
}

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

void CtrlChanDesc__CC::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.", enum_value);
}

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

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

int CtrlChanDesc__CC::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int CtrlChanDesc__CC::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void CtrlChanDesc__CC_template::copy_template(const CtrlChanDesc__CC_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CtrlChanDesc__CC_template[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 CtrlChanDesc__CC_template(*other_value.implication_.precondition);
implication_.implied_template = new CtrlChanDesc__CC_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
}
}

CtrlChanDesc__CC_template::CtrlChanDesc__CC_template()
{
}

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

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

CtrlChanDesc__CC_template::CtrlChanDesc__CC_template(CtrlChanDesc__CC::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

CtrlChanDesc__CC_template::CtrlChanDesc__CC_template(const CtrlChanDesc__CC& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == CtrlChanDesc__CC::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
single_value = other_value.enum_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

CtrlChanDesc__CC_template& CtrlChanDesc__CC_template::operator=(const OPTIONAL<CtrlChanDesc__CC>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (CtrlChanDesc__CC::enum_type)(const CtrlChanDesc__CC&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
}
return *this;
}

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

boolean CtrlChanDesc__CC_template::match(CtrlChanDesc__CC::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
}
return FALSE;
}

boolean CtrlChanDesc__CC_template::match(const CtrlChanDesc__CC& other_value, boolean) const
{
if (other_value.enum_value == CtrlChanDesc__CC::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC with an unbound value.");
return match(other_value.enum_value);
}

CtrlChanDesc__CC::enum_type CtrlChanDesc__CC_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
return single_value;
}

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

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

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

void CtrlChanDesc__CC_template::log_match(const CtrlChanDesc__CC& 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 CtrlChanDesc__CC_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
}
}

void CtrlChanDesc__CC_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (CtrlChanDesc__CC::enum_type)text_buf.pull_int().get_val();
if (!CtrlChanDesc__CC::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CtrlChanDesc__CC_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @GSM_SystemInformation.CtrlChanDesc_CC.");
}
}

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

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

void CtrlChanDesc__CC_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CtrlChanDesc__CC_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    CtrlChanDesc__CC::enum_type enum_val = CtrlChanDesc__CC::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!CtrlChanDesc__CC::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @GSM_SystemInformation.CtrlChanDesc_CC.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    CtrlChanDesc__CC_template* precondition = new CtrlChanDesc__CC_template;
    precondition->set_param(*m_p->get_elem(0));
    CtrlChanDesc__CC_template* implied_template = new CtrlChanDesc__CC_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = CtrlChanDesc__CC_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@GSM_SystemInformation.CtrlChanDesc_CC");
  }
  is_ifpresent = param.get_ifpresent();
}

void CtrlChanDesc__CC_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@GSM_SystemInformation.CtrlChanDesc_CC");
}

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

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

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

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

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

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

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

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

boolean CBQ3::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CBQ3.");
return enum_value == other_value;
}

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

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

boolean CBQ3::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CBQ3.");
return enum_value < other_value;
}

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

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

boolean CBQ3::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.CBQ3.");
return enum_value > other_value;
}

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

const char *CBQ3::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case CBQ3__IU__MODE__NOT__SUPPORTED: return "CBQ3_IU_MODE_NOT_SUPPORTED";
case CBQ3__IU__MODE__MS__BARRED: return "CBQ3_IU_MODE_MS_BARRED";
case CBQ3__IU__MODE__NOT__BARRED: return "CBQ3_IU_MODE_NOT_BARRED";
default:
return "<unknown>";
}
}

CBQ3::enum_type CBQ3::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "CBQ3_IU_MODE_NOT_SUPPORTED")) return CBQ3__IU__MODE__NOT__SUPPORTED;
if (!strcmp(str_par, "CBQ3_IU_MODE_MS_BARRED")) return CBQ3__IU__MODE__MS__BARRED;
if (!strcmp(str_par, "CBQ3_IU_MODE_NOT_BARRED")) return CBQ3__IU__MODE__NOT__BARRED;
}
return UNKNOWN_VALUE;
}

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

int CBQ3::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.CBQ3.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int CBQ3::enum2int(const CBQ3& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.CBQ3.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

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

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

void CBQ3::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void CBQ3::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@GSM_SystemInformation.CBQ3");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @GSM_SystemInformation.CBQ3.");
  }
}

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

void CBQ3::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @GSM_SystemInformation.CBQ3.", enum_value);
}

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

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

int CBQ3::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 2, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int CBQ3::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 2);
}

void CBQ3_template::copy_template(const CBQ3_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CBQ3_template[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 CBQ3_template(*other_value.implication_.precondition);
implication_.implied_template = new CBQ3_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CBQ3.");
}
}

CBQ3_template::CBQ3_template()
{
}

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

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

CBQ3_template::CBQ3_template(CBQ3::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean CBQ3_template::match(CBQ3::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CBQ3.");
}
return FALSE;
}

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

CBQ3::enum_type CBQ3_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @GSM_SystemInformation.CBQ3.");
return single_value;
}

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

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

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

void CBQ3_template::log_match(const CBQ3& 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 CBQ3_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.CBQ3.");
}
}

void CBQ3_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (CBQ3::enum_type)text_buf.pull_int().get_val();
if (!CBQ3::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @GSM_SystemInformation.CBQ3.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new CBQ3_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @GSM_SystemInformation.CBQ3.");
}
}

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

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

void CBQ3_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    CBQ3_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    CBQ3::enum_type enum_val = CBQ3::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!CBQ3::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @GSM_SystemInformation.CBQ3.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    CBQ3_template* precondition = new CBQ3_template;
    precondition->set_param(*m_p->get_elem(0));
    CBQ3_template* implied_template = new CBQ3_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = CBQ3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@GSM_SystemInformation.CBQ3");
  }
  is_ifpresent = param.get_ifpresent();
}

void CBQ3_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@GSM_SystemInformation.CBQ3");
}

ControlChannelDescription::ControlChannelDescription()
{
}

ControlChannelDescription::ControlChannelDescription(const BOOLEAN& par_msc__r99,
    const BOOLEAN& par_att,
    const INTEGER& par_bs__ag__blks__res,
    const CtrlChanDesc__CC& par_ccch__conf,
    const BOOLEAN& par_si22ind,
    const CBQ3& par_cbq3,
    const BITSTRING& par_spare,
    const INTEGER& par_bs__pa__mfrms,
    const INTEGER& par_t3212)
  :   field_msc__r99(par_msc__r99),
  field_att(par_att),
  field_bs__ag__blks__res(par_bs__ag__blks__res),
  field_ccch__conf(par_ccch__conf),
  field_si22ind(par_si22ind),
  field_cbq3(par_cbq3),
  field_spare(par_spare),
  field_bs__pa__mfrms(par_bs__pa__mfrms),
  field_t3212(par_t3212)
{
}

ControlChannelDescription::ControlChannelDescription(const ControlChannelDescription& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.ControlChannelDescription.");
if (other_value.msc__r99().is_bound()) field_msc__r99 = other_value.msc__r99();
else field_msc__r99.clean_up();
if (other_value.att().is_bound()) field_att = other_value.att();
else field_att.clean_up();
if (other_value.bs__ag__blks__res().is_bound()) field_bs__ag__blks__res = other_value.bs__ag__blks__res();
else field_bs__ag__blks__res.clean_up();
if (other_value.ccch__conf().is_bound()) field_ccch__conf = other_value.ccch__conf();
else field_ccch__conf.clean_up();
if (other_value.si22ind().is_bound()) field_si22ind = other_value.si22ind();
else field_si22ind.clean_up();
if (other_value.cbq3().is_bound()) field_cbq3 = other_value.cbq3();
else field_cbq3.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.bs__pa__mfrms().is_bound()) field_bs__pa__mfrms = other_value.bs__pa__mfrms();
else field_bs__pa__mfrms.clean_up();
if (other_value.t3212().is_bound()) field_t3212 = other_value.t3212();
else field_t3212.clean_up();
}

void ControlChannelDescription::clean_up()
{
field_msc__r99.clean_up();
field_att.clean_up();
field_bs__ag__blks__res.clean_up();
field_ccch__conf.clean_up();
field_si22ind.clean_up();
field_cbq3.clean_up();
field_spare.clean_up();
field_bs__pa__mfrms.clean_up();
field_t3212.clean_up();
}

const TTCN_Typedescriptor_t* ControlChannelDescription::get_descriptor() const { return &ControlChannelDescription_descr_; }
ControlChannelDescription& ControlChannelDescription::operator=(const ControlChannelDescription& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.ControlChannelDescription.");
  if (other_value.msc__r99().is_bound()) field_msc__r99 = other_value.msc__r99();
  else field_msc__r99.clean_up();
  if (other_value.att().is_bound()) field_att = other_value.att();
  else field_att.clean_up();
  if (other_value.bs__ag__blks__res().is_bound()) field_bs__ag__blks__res = other_value.bs__ag__blks__res();
  else field_bs__ag__blks__res.clean_up();
  if (other_value.ccch__conf().is_bound()) field_ccch__conf = other_value.ccch__conf();
  else field_ccch__conf.clean_up();
  if (other_value.si22ind().is_bound()) field_si22ind = other_value.si22ind();
  else field_si22ind.clean_up();
  if (other_value.cbq3().is_bound()) field_cbq3 = other_value.cbq3();
  else field_cbq3.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.bs__pa__mfrms().is_bound()) field_bs__pa__mfrms = other_value.bs__pa__mfrms();
  else field_bs__pa__mfrms.clean_up();
  if (other_value.t3212().is_bound()) field_t3212 = other_value.t3212();
  else field_t3212.clean_up();
}
return *this;
}

boolean ControlChannelDescription::operator==(const ControlChannelDescription& other_value) const
{
return field_msc__r99==other_value.field_msc__r99
  && field_att==other_value.field_att
  && field_bs__ag__blks__res==other_value.field_bs__ag__blks__res
  && field_ccch__conf==other_value.field_ccch__conf
  && field_si22ind==other_value.field_si22ind
  && field_cbq3==other_value.field_cbq3
  && field_spare==other_value.field_spare
  && field_bs__pa__mfrms==other_value.field_bs__pa__mfrms
  && field_t3212==other_value.field_t3212;
}

boolean ControlChannelDescription::is_bound() const
{
return (field_msc__r99.is_bound())
  || (field_att.is_bound())
  || (field_bs__ag__blks__res.is_bound())
  || (field_ccch__conf.is_bound())
  || (field_si22ind.is_bound())
  || (field_cbq3.is_bound())
  || (field_spare.is_bound())
  || (field_bs__pa__mfrms.is_bound())
  || (field_t3212.is_bound());
}
boolean ControlChannelDescription::is_value() const
{
return field_msc__r99.is_value()
  && field_att.is_value()
  && field_bs__ag__blks__res.is_value()
  && field_ccch__conf.is_value()
  && field_si22ind.is_value()
  && field_cbq3.is_value()
  && field_spare.is_value()
  && field_bs__pa__mfrms.is_value()
  && field_t3212.is_value();
}
void ControlChannelDescription::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ msc_r99 := ");
field_msc__r99.log();
TTCN_Logger::log_event_str(", att := ");
field_att.log();
TTCN_Logger::log_event_str(", bs_ag_blks_res := ");
field_bs__ag__blks__res.log();
TTCN_Logger::log_event_str(", ccch_conf := ");
field_ccch__conf.log();
TTCN_Logger::log_event_str(", si22ind := ");
field_si22ind.log();
TTCN_Logger::log_event_str(", cbq3 := ");
field_cbq3.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", bs_pa_mfrms := ");
field_bs__pa__mfrms.log();
TTCN_Logger::log_event_str(", t3212 := ");
field_t3212.log();
TTCN_Logger::log_event_str(" }");
}

void ControlChannelDescription::set_implicit_omit()
{
if (msc__r99().is_bound()) msc__r99().set_implicit_omit();
if (att().is_bound()) att().set_implicit_omit();
if (bs__ag__blks__res().is_bound()) bs__ag__blks__res().set_implicit_omit();
if (ccch__conf().is_bound()) ccch__conf().set_implicit_omit();
if (si22ind().is_bound()) si22ind().set_implicit_omit();
if (cbq3().is_bound()) cbq3().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (bs__pa__mfrms().is_bound()) bs__pa__mfrms().set_implicit_omit();
if (t3212().is_bound()) t3212().set_implicit_omit();
}

void ControlChannelDescription::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @GSM_SystemInformation.ControlChannelDescription has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) msc__r99().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) att().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bs__ag__blks__res().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ccch__conf().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) si22ind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cbq3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) bs__pa__mfrms().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) t3212().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msc_r99")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msc__r99().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "att")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          att().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_ag_blks_res")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__ag__blks__res().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ccch_conf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ccch__conf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si22ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si22ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cbq3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cbq3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_pa_mfrms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__pa__mfrms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3212")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3212().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.ControlChannelDescription: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@GSM_SystemInformation.ControlChannelDescription");
  }
}

void ControlChannelDescription::encode_text(Text_Buf& text_buf) const
{
field_msc__r99.encode_text(text_buf);
field_att.encode_text(text_buf);
field_bs__ag__blks__res.encode_text(text_buf);
field_ccch__conf.encode_text(text_buf);
field_si22ind.encode_text(text_buf);
field_cbq3.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_bs__pa__mfrms.encode_text(text_buf);
field_t3212.encode_text(text_buf);
}

void ControlChannelDescription::decode_text(Text_Buf& text_buf)
{
field_msc__r99.decode_text(text_buf);
field_att.decode_text(text_buf);
field_bs__ag__blks__res.decode_text(text_buf);
field_ccch__conf.decode_text(text_buf);
field_si22ind.decode_text(text_buf);
field_cbq3.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_bs__pa__mfrms.decode_text(text_buf);
field_t3212.decode_text(text_buf);
}

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

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

int ControlChannelDescription::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, ControlChannelDescription_msc__r99_descr_.raw->forceomit);
  decoded_field_length = field_msc__r99.RAW_decode(ControlChannelDescription_msc__r99_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, ControlChannelDescription_att_descr_.raw->forceomit);
  decoded_field_length = field_att.RAW_decode(ControlChannelDescription_att_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, ControlChannelDescription_bs__ag__blks__res_descr_.raw->forceomit);
  decoded_field_length = field_bs__ag__blks__res.RAW_decode(ControlChannelDescription_bs__ag__blks__res_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, ControlChannelDescription_ccch__conf_descr_.raw->forceomit);
  decoded_field_length = field_ccch__conf.RAW_decode(ControlChannelDescription_ccch__conf_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, ControlChannelDescription_si22ind_descr_.raw->forceomit);
  decoded_field_length = field_si22ind.RAW_decode(ControlChannelDescription_si22ind_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, ControlChannelDescription_cbq3_descr_.raw->forceomit);
  decoded_field_length = field_cbq3.RAW_decode(ControlChannelDescription_cbq3_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, ControlChannelDescription_spare_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(ControlChannelDescription_spare_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_7_force_omit(7, force_omit, ControlChannelDescription_bs__pa__mfrms_descr_.raw->forceomit);
  decoded_field_length = field_bs__pa__mfrms.RAW_decode(ControlChannelDescription_bs__pa__mfrms_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_8_force_omit(8, force_omit, ControlChannelDescription_t3212_descr_.raw->forceomit);
  decoded_field_length = field_t3212.RAW_decode(ControlChannelDescription_t3212_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int ControlChannelDescription::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 9;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(9);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, ControlChannelDescription_msc__r99_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ControlChannelDescription_att_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ControlChannelDescription_bs__ag__blks__res_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ControlChannelDescription_ccch__conf_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ControlChannelDescription_si22ind_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, ControlChannelDescription_cbq3_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, ControlChannelDescription_spare_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, ControlChannelDescription_bs__pa__mfrms_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, ControlChannelDescription_t3212_descr_.raw);
  encoded_length += field_msc__r99.RAW_encode(ControlChannelDescription_msc__r99_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_att.RAW_encode(ControlChannelDescription_att_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_bs__ag__blks__res.RAW_encode(ControlChannelDescription_bs__ag__blks__res_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_ccch__conf.RAW_encode(ControlChannelDescription_ccch__conf_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_si22ind.RAW_encode(ControlChannelDescription_si22ind_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_cbq3.RAW_encode(ControlChannelDescription_cbq3_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_spare.RAW_encode(ControlChannelDescription_spare_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_bs__pa__mfrms.RAW_encode(ControlChannelDescription_bs__pa__mfrms_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_t3212.RAW_encode(ControlChannelDescription_t3212_descr_, *myleaf.body.node.nodes[8]);
  return myleaf.length = encoded_length;
}

struct ControlChannelDescription_template::single_value_struct {
BOOLEAN_template field_msc__r99;
BOOLEAN_template field_att;
INTEGER_template field_bs__ag__blks__res;
CtrlChanDesc__CC_template field_ccch__conf;
BOOLEAN_template field_si22ind;
CBQ3_template field_cbq3;
BITSTRING_template field_spare;
INTEGER_template field_bs__pa__mfrms;
INTEGER_template field_t3212;
};

void ControlChannelDescription_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_msc__r99 = ANY_VALUE;
single_value->field_att = ANY_VALUE;
single_value->field_bs__ag__blks__res = ANY_VALUE;
single_value->field_ccch__conf = ANY_VALUE;
single_value->field_si22ind = ANY_VALUE;
single_value->field_cbq3 = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_bs__pa__mfrms = ANY_VALUE;
single_value->field_t3212 = ANY_VALUE;
}
}
}

void ControlChannelDescription_template::copy_value(const ControlChannelDescription& other_value)
{
single_value = new single_value_struct;
if (other_value.msc__r99().is_bound()) {
  single_value->field_msc__r99 = other_value.msc__r99();
} else {
  single_value->field_msc__r99.clean_up();
}
if (other_value.att().is_bound()) {
  single_value->field_att = other_value.att();
} else {
  single_value->field_att.clean_up();
}
if (other_value.bs__ag__blks__res().is_bound()) {
  single_value->field_bs__ag__blks__res = other_value.bs__ag__blks__res();
} else {
  single_value->field_bs__ag__blks__res.clean_up();
}
if (other_value.ccch__conf().is_bound()) {
  single_value->field_ccch__conf = other_value.ccch__conf();
} else {
  single_value->field_ccch__conf.clean_up();
}
if (other_value.si22ind().is_bound()) {
  single_value->field_si22ind = other_value.si22ind();
} else {
  single_value->field_si22ind.clean_up();
}
if (other_value.cbq3().is_bound()) {
  single_value->field_cbq3 = other_value.cbq3();
} else {
  single_value->field_cbq3.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.bs__pa__mfrms().is_bound()) {
  single_value->field_bs__pa__mfrms = other_value.bs__pa__mfrms();
} else {
  single_value->field_bs__pa__mfrms.clean_up();
}
if (other_value.t3212().is_bound()) {
  single_value->field_t3212 = other_value.t3212();
} else {
  single_value->field_t3212.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ControlChannelDescription_template::copy_template(const ControlChannelDescription_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.msc__r99().get_selection()) {
single_value->field_msc__r99 = other_value.msc__r99();
} else {
single_value->field_msc__r99.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.att().get_selection()) {
single_value->field_att = other_value.att();
} else {
single_value->field_att.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bs__ag__blks__res().get_selection()) {
single_value->field_bs__ag__blks__res = other_value.bs__ag__blks__res();
} else {
single_value->field_bs__ag__blks__res.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ccch__conf().get_selection()) {
single_value->field_ccch__conf = other_value.ccch__conf();
} else {
single_value->field_ccch__conf.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si22ind().get_selection()) {
single_value->field_si22ind = other_value.si22ind();
} else {
single_value->field_si22ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cbq3().get_selection()) {
single_value->field_cbq3 = other_value.cbq3();
} else {
single_value->field_cbq3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bs__pa__mfrms().get_selection()) {
single_value->field_bs__pa__mfrms = other_value.bs__pa__mfrms();
} else {
single_value->field_bs__pa__mfrms.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3212().get_selection()) {
single_value->field_t3212 = other_value.t3212();
} else {
single_value->field_t3212.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 ControlChannelDescription_template[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 ControlChannelDescription_template(*other_value.implication_.precondition);
implication_.implied_template = new ControlChannelDescription_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 @GSM_SystemInformation.ControlChannelDescription.");
break;
}
set_selection(other_value);
}

ControlChannelDescription_template::ControlChannelDescription_template()
{
}

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

ControlChannelDescription_template::ControlChannelDescription_template(const ControlChannelDescription& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ControlChannelDescription_template::match(const ControlChannelDescription& 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.msc__r99().is_bound()) return FALSE;
if(!single_value->field_msc__r99.match(other_value.msc__r99(), legacy))return FALSE;
if(!other_value.att().is_bound()) return FALSE;
if(!single_value->field_att.match(other_value.att(), legacy))return FALSE;
if(!other_value.bs__ag__blks__res().is_bound()) return FALSE;
if(!single_value->field_bs__ag__blks__res.match(other_value.bs__ag__blks__res(), legacy))return FALSE;
if(!other_value.ccch__conf().is_bound()) return FALSE;
if(!single_value->field_ccch__conf.match(other_value.ccch__conf(), legacy))return FALSE;
if(!other_value.si22ind().is_bound()) return FALSE;
if(!single_value->field_si22ind.match(other_value.si22ind(), legacy))return FALSE;
if(!other_value.cbq3().is_bound()) return FALSE;
if(!single_value->field_cbq3.match(other_value.cbq3(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.bs__pa__mfrms().is_bound()) return FALSE;
if(!single_value->field_bs__pa__mfrms.match(other_value.bs__pa__mfrms(), legacy))return FALSE;
if(!other_value.t3212().is_bound()) return FALSE;
if(!single_value->field_t3212.match(other_value.t3212(), 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 @GSM_SystemInformation.ControlChannelDescription.");
}
return FALSE;
}

boolean ControlChannelDescription_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_msc__r99.is_bound()
 || single_value->field_att.is_bound()
 || single_value->field_bs__ag__blks__res.is_bound()
 || single_value->field_ccch__conf.is_bound()
 || single_value->field_si22ind.is_bound()
 || single_value->field_cbq3.is_bound()
 || single_value->field_spare.is_bound()
 || single_value->field_bs__pa__mfrms.is_bound()
 || single_value->field_t3212.is_bound();
}

boolean ControlChannelDescription_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_msc__r99.is_value()
 && single_value->field_att.is_value()
 && single_value->field_bs__ag__blks__res.is_value()
 && single_value->field_ccch__conf.is_value()
 && single_value->field_si22ind.is_value()
 && single_value->field_cbq3.is_value()
 && single_value->field_spare.is_value()
 && single_value->field_bs__pa__mfrms.is_value()
 && single_value->field_t3212.is_value();
}

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

ControlChannelDescription ControlChannelDescription_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 @GSM_SystemInformation.ControlChannelDescription.");
ControlChannelDescription ret_val;
if (single_value->field_msc__r99.is_bound()) {
ret_val.msc__r99() = single_value->field_msc__r99.valueof();
}
if (single_value->field_att.is_bound()) {
ret_val.att() = single_value->field_att.valueof();
}
if (single_value->field_bs__ag__blks__res.is_bound()) {
ret_val.bs__ag__blks__res() = single_value->field_bs__ag__blks__res.valueof();
}
if (single_value->field_ccch__conf.is_bound()) {
ret_val.ccch__conf() = single_value->field_ccch__conf.valueof();
}
if (single_value->field_si22ind.is_bound()) {
ret_val.si22ind() = single_value->field_si22ind.valueof();
}
if (single_value->field_cbq3.is_bound()) {
ret_val.cbq3() = single_value->field_cbq3.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_bs__pa__mfrms.is_bound()) {
ret_val.bs__pa__mfrms() = single_value->field_bs__pa__mfrms.valueof();
}
if (single_value->field_t3212.is_bound()) {
ret_val.t3212() = single_value->field_t3212.valueof();
}
return ret_val;
}

void ControlChannelDescription_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 @GSM_SystemInformation.ControlChannelDescription.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ControlChannelDescription_template[list_length];
}

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

BOOLEAN_template& ControlChannelDescription_template::msc__r99()
{
set_specific();
return single_value->field_msc__r99;
}

const BOOLEAN_template& ControlChannelDescription_template::msc__r99() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msc_r99 of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_msc__r99;
}

BOOLEAN_template& ControlChannelDescription_template::att()
{
set_specific();
return single_value->field_att;
}

const BOOLEAN_template& ControlChannelDescription_template::att() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field att of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_att;
}

INTEGER_template& ControlChannelDescription_template::bs__ag__blks__res()
{
set_specific();
return single_value->field_bs__ag__blks__res;
}

const INTEGER_template& ControlChannelDescription_template::bs__ag__blks__res() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bs_ag_blks_res of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_bs__ag__blks__res;
}

CtrlChanDesc__CC_template& ControlChannelDescription_template::ccch__conf()
{
set_specific();
return single_value->field_ccch__conf;
}

const CtrlChanDesc__CC_template& ControlChannelDescription_template::ccch__conf() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ccch_conf of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_ccch__conf;
}

BOOLEAN_template& ControlChannelDescription_template::si22ind()
{
set_specific();
return single_value->field_si22ind;
}

const BOOLEAN_template& ControlChannelDescription_template::si22ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si22ind of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_si22ind;
}

CBQ3_template& ControlChannelDescription_template::cbq3()
{
set_specific();
return single_value->field_cbq3;
}

const CBQ3_template& ControlChannelDescription_template::cbq3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cbq3 of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_cbq3;
}

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

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

INTEGER_template& ControlChannelDescription_template::bs__pa__mfrms()
{
set_specific();
return single_value->field_bs__pa__mfrms;
}

const INTEGER_template& ControlChannelDescription_template::bs__pa__mfrms() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bs_pa_mfrms of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_bs__pa__mfrms;
}

INTEGER_template& ControlChannelDescription_template::t3212()
{
set_specific();
return single_value->field_t3212;
}

const INTEGER_template& ControlChannelDescription_template::t3212() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3212 of a non-specific template of type @GSM_SystemInformation.ControlChannelDescription.");
return single_value->field_t3212;
}

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

void ControlChannelDescription_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ msc_r99 := ");
single_value->field_msc__r99.log();
TTCN_Logger::log_event_str(", att := ");
single_value->field_att.log();
TTCN_Logger::log_event_str(", bs_ag_blks_res := ");
single_value->field_bs__ag__blks__res.log();
TTCN_Logger::log_event_str(", ccch_conf := ");
single_value->field_ccch__conf.log();
TTCN_Logger::log_event_str(", si22ind := ");
single_value->field_si22ind.log();
TTCN_Logger::log_event_str(", cbq3 := ");
single_value->field_cbq3.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", bs_pa_mfrms := ");
single_value->field_bs__pa__mfrms.log();
TTCN_Logger::log_event_str(", t3212 := ");
single_value->field_t3212.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 ControlChannelDescription_template::log_match(const ControlChannelDescription& 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_msc__r99.match(match_value.msc__r99(), legacy)){
TTCN_Logger::log_logmatch_info(".msc_r99");
single_value->field_msc__r99.log_match(match_value.msc__r99(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_att.match(match_value.att(), legacy)){
TTCN_Logger::log_logmatch_info(".att");
single_value->field_att.log_match(match_value.att(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bs__ag__blks__res.match(match_value.bs__ag__blks__res(), legacy)){
TTCN_Logger::log_logmatch_info(".bs_ag_blks_res");
single_value->field_bs__ag__blks__res.log_match(match_value.bs__ag__blks__res(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ccch__conf.match(match_value.ccch__conf(), legacy)){
TTCN_Logger::log_logmatch_info(".ccch_conf");
single_value->field_ccch__conf.log_match(match_value.ccch__conf(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si22ind.match(match_value.si22ind(), legacy)){
TTCN_Logger::log_logmatch_info(".si22ind");
single_value->field_si22ind.log_match(match_value.si22ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cbq3.match(match_value.cbq3(), legacy)){
TTCN_Logger::log_logmatch_info(".cbq3");
single_value->field_cbq3.log_match(match_value.cbq3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spare.match(match_value.spare(), legacy)){
TTCN_Logger::log_logmatch_info(".spare");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bs__pa__mfrms.match(match_value.bs__pa__mfrms(), legacy)){
TTCN_Logger::log_logmatch_info(".bs_pa_mfrms");
single_value->field_bs__pa__mfrms.log_match(match_value.bs__pa__mfrms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_t3212.match(match_value.t3212(), legacy)){
TTCN_Logger::log_logmatch_info(".t3212");
single_value->field_t3212.log_match(match_value.t3212(), 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("{ msc_r99 := ");
single_value->field_msc__r99.log_match(match_value.msc__r99(), legacy);
TTCN_Logger::log_event_str(", att := ");
single_value->field_att.log_match(match_value.att(), legacy);
TTCN_Logger::log_event_str(", bs_ag_blks_res := ");
single_value->field_bs__ag__blks__res.log_match(match_value.bs__ag__blks__res(), legacy);
TTCN_Logger::log_event_str(", ccch_conf := ");
single_value->field_ccch__conf.log_match(match_value.ccch__conf(), legacy);
TTCN_Logger::log_event_str(", si22ind := ");
single_value->field_si22ind.log_match(match_value.si22ind(), legacy);
TTCN_Logger::log_event_str(", cbq3 := ");
single_value->field_cbq3.log_match(match_value.cbq3(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", bs_pa_mfrms := ");
single_value->field_bs__pa__mfrms.log_match(match_value.bs__pa__mfrms(), legacy);
TTCN_Logger::log_event_str(", t3212 := ");
single_value->field_t3212.log_match(match_value.t3212(), 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 ControlChannelDescription_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (msc__r99().is_bound()) msc__r99().set_implicit_omit();
if (att().is_bound()) att().set_implicit_omit();
if (bs__ag__blks__res().is_bound()) bs__ag__blks__res().set_implicit_omit();
if (ccch__conf().is_bound()) ccch__conf().set_implicit_omit();
if (si22ind().is_bound()) si22ind().set_implicit_omit();
if (cbq3().is_bound()) cbq3().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (bs__pa__mfrms().is_bound()) bs__pa__mfrms().set_implicit_omit();
if (t3212().is_bound()) t3212().set_implicit_omit();
}

void ControlChannelDescription_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_msc__r99.encode_text(text_buf);
single_value->field_att.encode_text(text_buf);
single_value->field_bs__ag__blks__res.encode_text(text_buf);
single_value->field_ccch__conf.encode_text(text_buf);
single_value->field_si22ind.encode_text(text_buf);
single_value->field_cbq3.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_bs__pa__mfrms.encode_text(text_buf);
single_value->field_t3212.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 @GSM_SystemInformation.ControlChannelDescription.");
}
}

void ControlChannelDescription_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_msc__r99.decode_text(text_buf);
single_value->field_att.decode_text(text_buf);
single_value->field_bs__ag__blks__res.decode_text(text_buf);
single_value->field_ccch__conf.decode_text(text_buf);
single_value->field_si22ind.decode_text(text_buf);
single_value->field_cbq3.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_bs__pa__mfrms.decode_text(text_buf);
single_value->field_t3212.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 ControlChannelDescription_template[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 @GSM_SystemInformation.ControlChannelDescription.");
}
}

void ControlChannelDescription_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: {
    ControlChannelDescription_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @GSM_SystemInformation.ControlChannelDescription has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) msc__r99().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) att().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) bs__ag__blks__res().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ccch__conf().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) si22ind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) cbq3().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) bs__pa__mfrms().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) t3212().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msc_r99")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msc__r99().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "att")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          att().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_ag_blks_res")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__ag__blks__res().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ccch_conf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ccch__conf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si22ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si22ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cbq3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cbq3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spare")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spare().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_pa_mfrms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__pa__mfrms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3212")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3212().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.ControlChannelDescription: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ControlChannelDescription_template* precondition = new ControlChannelDescription_template;
    precondition->set_param(*param.get_elem(0));
    ControlChannelDescription_template* implied_template = new ControlChannelDescription_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ControlChannelDescription_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@GSM_SystemInformation.ControlChannelDescription");
  }
  is_ifpresent = param.get_ifpresent();
}

void ControlChannelDescription_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_msc__r99.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_att.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_bs__ag__blks__res.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_ccch__conf.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_si22ind.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_cbq3.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_bs__pa__mfrms.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
single_value->field_t3212.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.ControlChannelDescription");
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 : "@GSM_SystemInformation.ControlChannelDescription");
}

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

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

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

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

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

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

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

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

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

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

boolean RachCtrlPar__MR::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
return enum_value == other_value;
}

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

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

boolean RachCtrlPar__MR::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
return enum_value < other_value;
}

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

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

boolean RachCtrlPar__MR::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
return enum_value > other_value;
}

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

const char *RachCtrlPar__MR::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RACH__MAX__RETRANS__1: return "RACH_MAX_RETRANS_1";
case RACH__MAX__RETRANS__2: return "RACH_MAX_RETRANS_2";
case RACH__MAX__RETRANS__4: return "RACH_MAX_RETRANS_4";
case RACH__MAX__RETRANS__7: return "RACH_MAX_RETRANS_7";
default:
return "<unknown>";
}
}

RachCtrlPar__MR::enum_type RachCtrlPar__MR::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "RACH_MAX_RETRANS_1")) return RACH__MAX__RETRANS__1;
if (!strcmp(str_par, "RACH_MAX_RETRANS_2")) return RACH__MAX__RETRANS__2;
if (!strcmp(str_par, "RACH_MAX_RETRANS_4")) return RACH__MAX__RETRANS__4;
if (!strcmp(str_par, "RACH_MAX_RETRANS_7")) return RACH__MAX__RETRANS__7;
}
return UNKNOWN_VALUE;
}

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

int RachCtrlPar__MR::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int RachCtrlPar__MR::enum2int(const RachCtrlPar__MR& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

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

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

void RachCtrlPar__MR::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void RachCtrlPar__MR::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@GSM_SystemInformation.RachCtrlPar_MR");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @GSM_SystemInformation.RachCtrlPar_MR.");
  }
}

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

void RachCtrlPar__MR::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @GSM_SystemInformation.RachCtrlPar_MR.", enum_value);
}

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

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

int RachCtrlPar__MR::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int RachCtrlPar__MR::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void RachCtrlPar__MR_template::copy_template(const RachCtrlPar__MR_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RachCtrlPar__MR_template[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 RachCtrlPar__MR_template(*other_value.implication_.precondition);
implication_.implied_template = new RachCtrlPar__MR_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
}
}

RachCtrlPar__MR_template::RachCtrlPar__MR_template()
{
}

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

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

RachCtrlPar__MR_template::RachCtrlPar__MR_template(RachCtrlPar__MR::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

RachCtrlPar__MR_template::RachCtrlPar__MR_template(const RachCtrlPar__MR& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == RachCtrlPar__MR::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
single_value = other_value.enum_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

RachCtrlPar__MR_template& RachCtrlPar__MR_template::operator=(const OPTIONAL<RachCtrlPar__MR>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RachCtrlPar__MR::enum_type)(const RachCtrlPar__MR&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
}
return *this;
}

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

boolean RachCtrlPar__MR_template::match(RachCtrlPar__MR::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
}
return FALSE;
}

boolean RachCtrlPar__MR_template::match(const RachCtrlPar__MR& other_value, boolean) const
{
if (other_value.enum_value == RachCtrlPar__MR::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR with an unbound value.");
return match(other_value.enum_value);
}

RachCtrlPar__MR::enum_type RachCtrlPar__MR_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
return single_value;
}

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

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

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

void RachCtrlPar__MR_template::log_match(const RachCtrlPar__MR& 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 RachCtrlPar__MR_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
}
}

void RachCtrlPar__MR_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (RachCtrlPar__MR::enum_type)text_buf.pull_int().get_val();
if (!RachCtrlPar__MR::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RachCtrlPar__MR_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @GSM_SystemInformation.RachCtrlPar_MR.");
}
}

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

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

void RachCtrlPar__MR_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RachCtrlPar__MR_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    RachCtrlPar__MR::enum_type enum_val = RachCtrlPar__MR::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!RachCtrlPar__MR::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @GSM_SystemInformation.RachCtrlPar_MR.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    RachCtrlPar__MR_template* precondition = new RachCtrlPar__MR_template;
    precondition->set_param(*m_p->get_elem(0));
    RachCtrlPar__MR_template* implied_template = new RachCtrlPar__MR_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RachCtrlPar__MR_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@GSM_SystemInformation.RachCtrlPar_MR");
  }
  is_ifpresent = param.get_ifpresent();
}

void RachCtrlPar__MR_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@GSM_SystemInformation.RachCtrlPar_MR");
}

RachControlParameters::RachControlParameters()
{
}

RachControlParameters::RachControlParameters(const RachCtrlPar__MR& par_max__retrans,
    const BITSTRING& par_tx__integer,
    const BOOLEAN& par_cell__barr__access,
    const BOOLEAN& par_re__not__allowed,
    const BITSTRING& par_acc)
  :   field_max__retrans(par_max__retrans),
  field_tx__integer(par_tx__integer),
  field_cell__barr__access(par_cell__barr__access),
  field_re__not__allowed(par_re__not__allowed),
  field_acc(par_acc)
{
}

RachControlParameters::RachControlParameters(const RachControlParameters& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.RachControlParameters.");
if (other_value.max__retrans().is_bound()) field_max__retrans = other_value.max__retrans();
else field_max__retrans.clean_up();
if (other_value.tx__integer().is_bound()) field_tx__integer = other_value.tx__integer();
else field_tx__integer.clean_up();
if (other_value.cell__barr__access().is_bound()) field_cell__barr__access = other_value.cell__barr__access();
else field_cell__barr__access.clean_up();
if (other_value.re__not__allowed().is_bound()) field_re__not__allowed = other_value.re__not__allowed();
else field_re__not__allowed.clean_up();
if (other_value.acc().is_bound()) field_acc = other_value.acc();
else field_acc.clean_up();
}

void RachControlParameters::clean_up()
{
field_max__retrans.clean_up();
field_tx__integer.clean_up();
field_cell__barr__access.clean_up();
field_re__not__allowed.clean_up();
field_acc.clean_up();
}

const TTCN_Typedescriptor_t* RachControlParameters::get_descriptor() const { return &RachControlParameters_descr_; }
RachControlParameters& RachControlParameters::operator=(const RachControlParameters& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.RachControlParameters.");
  if (other_value.max__retrans().is_bound()) field_max__retrans = other_value.max__retrans();
  else field_max__retrans.clean_up();
  if (other_value.tx__integer().is_bound()) field_tx__integer = other_value.tx__integer();
  else field_tx__integer.clean_up();
  if (other_value.cell__barr__access().is_bound()) field_cell__barr__access = other_value.cell__barr__access();
  else field_cell__barr__access.clean_up();
  if (other_value.re__not__allowed().is_bound()) field_re__not__allowed = other_value.re__not__allowed();
  else field_re__not__allowed.clean_up();
  if (other_value.acc().is_bound()) field_acc = other_value.acc();
  else field_acc.clean_up();
}
return *this;
}

boolean RachControlParameters::operator==(const RachControlParameters& other_value) const
{
return field_max__retrans==other_value.field_max__retrans
  && field_tx__integer==other_value.field_tx__integer
  && field_cell__barr__access==other_value.field_cell__barr__access
  && field_re__not__allowed==other_value.field_re__not__allowed
  && field_acc==other_value.field_acc;
}

boolean RachControlParameters::is_bound() const
{
return (field_max__retrans.is_bound())
  || (field_tx__integer.is_bound())
  || (field_cell__barr__access.is_bound())
  || (field_re__not__allowed.is_bound())
  || (field_acc.is_bound());
}
boolean RachControlParameters::is_value() const
{
return field_max__retrans.is_value()
  && field_tx__integer.is_value()
  && field_cell__barr__access.is_value()
  && field_re__not__allowed.is_value()
  && field_acc.is_value();
}
void RachControlParameters::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ max_retrans := ");
field_max__retrans.log();
TTCN_Logger::log_event_str(", tx_integer := ");
field_tx__integer.log();
TTCN_Logger::log_event_str(", cell_barr_access := ");
field_cell__barr__access.log();
TTCN_Logger::log_event_str(", re_not_allowed := ");
field_re__not__allowed.log();
TTCN_Logger::log_event_str(", acc := ");
field_acc.log();
TTCN_Logger::log_event_str(" }");
}

void RachControlParameters::set_implicit_omit()
{
if (max__retrans().is_bound()) max__retrans().set_implicit_omit();
if (tx__integer().is_bound()) tx__integer().set_implicit_omit();
if (cell__barr__access().is_bound()) cell__barr__access().set_implicit_omit();
if (re__not__allowed().is_bound()) re__not__allowed().set_implicit_omit();
if (acc().is_bound()) acc().set_implicit_omit();
}

void RachControlParameters::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 @GSM_SystemInformation.RachControlParameters 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) max__retrans().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__integer().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cell__barr__access().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) re__not__allowed().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) acc().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(), "max_retrans")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          max__retrans().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tx_integer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__integer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_barr_access")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__barr__access().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "re_not_allowed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          re__not__allowed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.RachControlParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@GSM_SystemInformation.RachControlParameters");
  }
}

void RachControlParameters::encode_text(Text_Buf& text_buf) const
{
field_max__retrans.encode_text(text_buf);
field_tx__integer.encode_text(text_buf);
field_cell__barr__access.encode_text(text_buf);
field_re__not__allowed.encode_text(text_buf);
field_acc.encode_text(text_buf);
}

void RachControlParameters::decode_text(Text_Buf& text_buf)
{
field_max__retrans.decode_text(text_buf);
field_tx__integer.decode_text(text_buf);
field_cell__barr__access.decode_text(text_buf);
field_re__not__allowed.decode_text(text_buf);
field_acc.decode_text(text_buf);
}

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

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

int RachControlParameters::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, RachControlParameters_max__retrans_descr_.raw->forceomit);
  decoded_field_length = field_max__retrans.RAW_decode(RachControlParameters_max__retrans_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, RachControlParameters_tx__integer_descr_.raw->forceomit);
  decoded_field_length = field_tx__integer.RAW_decode(RachControlParameters_tx__integer_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, RachControlParameters_cell__barr__access_descr_.raw->forceomit);
  decoded_field_length = field_cell__barr__access.RAW_decode(RachControlParameters_cell__barr__access_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, RachControlParameters_re__not__allowed_descr_.raw->forceomit);
  decoded_field_length = field_re__not__allowed.RAW_decode(RachControlParameters_re__not__allowed_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, RachControlParameters_acc_descr_.raw->forceomit);
  decoded_field_length = field_acc.RAW_decode(RachControlParameters_acc_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 RachControlParameters::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, RachControlParameters_max__retrans_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RachControlParameters_tx__integer_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RachControlParameters_cell__barr__access_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RachControlParameters_re__not__allowed_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RachControlParameters_acc_descr_.raw);
  encoded_length += field_max__retrans.RAW_encode(RachControlParameters_max__retrans_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_tx__integer.RAW_encode(RachControlParameters_tx__integer_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cell__barr__access.RAW_encode(RachControlParameters_cell__barr__access_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_re__not__allowed.RAW_encode(RachControlParameters_re__not__allowed_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_acc.RAW_encode(RachControlParameters_acc_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct RachControlParameters_template::single_value_struct {
RachCtrlPar__MR_template field_max__retrans;
BITSTRING_template field_tx__integer;
BOOLEAN_template field_cell__barr__access;
BOOLEAN_template field_re__not__allowed;
BITSTRING_template field_acc;
};

void RachControlParameters_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_max__retrans = ANY_VALUE;
single_value->field_tx__integer = ANY_VALUE;
single_value->field_cell__barr__access = ANY_VALUE;
single_value->field_re__not__allowed = ANY_VALUE;
single_value->field_acc = ANY_VALUE;
}
}
}

void RachControlParameters_template::copy_value(const RachControlParameters& other_value)
{
single_value = new single_value_struct;
if (other_value.max__retrans().is_bound()) {
  single_value->field_max__retrans = other_value.max__retrans();
} else {
  single_value->field_max__retrans.clean_up();
}
if (other_value.tx__integer().is_bound()) {
  single_value->field_tx__integer = other_value.tx__integer();
} else {
  single_value->field_tx__integer.clean_up();
}
if (other_value.cell__barr__access().is_bound()) {
  single_value->field_cell__barr__access = other_value.cell__barr__access();
} else {
  single_value->field_cell__barr__access.clean_up();
}
if (other_value.re__not__allowed().is_bound()) {
  single_value->field_re__not__allowed = other_value.re__not__allowed();
} else {
  single_value->field_re__not__allowed.clean_up();
}
if (other_value.acc().is_bound()) {
  single_value->field_acc = other_value.acc();
} else {
  single_value->field_acc.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RachControlParameters_template::copy_template(const RachControlParameters_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.max__retrans().get_selection()) {
single_value->field_max__retrans = other_value.max__retrans();
} else {
single_value->field_max__retrans.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tx__integer().get_selection()) {
single_value->field_tx__integer = other_value.tx__integer();
} else {
single_value->field_tx__integer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__barr__access().get_selection()) {
single_value->field_cell__barr__access = other_value.cell__barr__access();
} else {
single_value->field_cell__barr__access.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.re__not__allowed().get_selection()) {
single_value->field_re__not__allowed = other_value.re__not__allowed();
} else {
single_value->field_re__not__allowed.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.acc().get_selection()) {
single_value->field_acc = other_value.acc();
} else {
single_value->field_acc.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 RachControlParameters_template[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 RachControlParameters_template(*other_value.implication_.precondition);
implication_.implied_template = new RachControlParameters_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 @GSM_SystemInformation.RachControlParameters.");
break;
}
set_selection(other_value);
}

RachControlParameters_template::RachControlParameters_template()
{
}

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

RachControlParameters_template::RachControlParameters_template(const RachControlParameters& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RachControlParameters_template::match(const RachControlParameters& 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.max__retrans().is_bound()) return FALSE;
if(!single_value->field_max__retrans.match(other_value.max__retrans(), legacy))return FALSE;
if(!other_value.tx__integer().is_bound()) return FALSE;
if(!single_value->field_tx__integer.match(other_value.tx__integer(), legacy))return FALSE;
if(!other_value.cell__barr__access().is_bound()) return FALSE;
if(!single_value->field_cell__barr__access.match(other_value.cell__barr__access(), legacy))return FALSE;
if(!other_value.re__not__allowed().is_bound()) return FALSE;
if(!single_value->field_re__not__allowed.match(other_value.re__not__allowed(), legacy))return FALSE;
if(!other_value.acc().is_bound()) return FALSE;
if(!single_value->field_acc.match(other_value.acc(), 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 @GSM_SystemInformation.RachControlParameters.");
}
return FALSE;
}

boolean RachControlParameters_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_max__retrans.is_bound()
 || single_value->field_tx__integer.is_bound()
 || single_value->field_cell__barr__access.is_bound()
 || single_value->field_re__not__allowed.is_bound()
 || single_value->field_acc.is_bound();
}

boolean RachControlParameters_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_max__retrans.is_value()
 && single_value->field_tx__integer.is_value()
 && single_value->field_cell__barr__access.is_value()
 && single_value->field_re__not__allowed.is_value()
 && single_value->field_acc.is_value();
}

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

RachControlParameters RachControlParameters_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 @GSM_SystemInformation.RachControlParameters.");
RachControlParameters ret_val;
if (single_value->field_max__retrans.is_bound()) {
ret_val.max__retrans() = single_value->field_max__retrans.valueof();
}
if (single_value->field_tx__integer.is_bound()) {
ret_val.tx__integer() = single_value->field_tx__integer.valueof();
}
if (single_value->field_cell__barr__access.is_bound()) {
ret_val.cell__barr__access() = single_value->field_cell__barr__access.valueof();
}
if (single_value->field_re__not__allowed.is_bound()) {
ret_val.re__not__allowed() = single_value->field_re__not__allowed.valueof();
}
if (single_value->field_acc.is_bound()) {
ret_val.acc() = single_value->field_acc.valueof();
}
return ret_val;
}

void RachControlParameters_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 @GSM_SystemInformation.RachControlParameters.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RachControlParameters_template[list_length];
}

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

RachCtrlPar__MR_template& RachControlParameters_template::max__retrans()
{
set_specific();
return single_value->field_max__retrans;
}

const RachCtrlPar__MR_template& RachControlParameters_template::max__retrans() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field max_retrans of a non-specific template of type @GSM_SystemInformation.RachControlParameters.");
return single_value->field_max__retrans;
}

BITSTRING_template& RachControlParameters_template::tx__integer()
{
set_specific();
return single_value->field_tx__integer;
}

const BITSTRING_template& RachControlParameters_template::tx__integer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tx_integer of a non-specific template of type @GSM_SystemInformation.RachControlParameters.");
return single_value->field_tx__integer;
}

BOOLEAN_template& RachControlParameters_template::cell__barr__access()
{
set_specific();
return single_value->field_cell__barr__access;
}

const BOOLEAN_template& RachControlParameters_template::cell__barr__access() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_barr_access of a non-specific template of type @GSM_SystemInformation.RachControlParameters.");
return single_value->field_cell__barr__access;
}

BOOLEAN_template& RachControlParameters_template::re__not__allowed()
{
set_specific();
return single_value->field_re__not__allowed;
}

const BOOLEAN_template& RachControlParameters_template::re__not__allowed() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field re_not_allowed of a non-specific template of type @GSM_SystemInformation.RachControlParameters.");
return single_value->field_re__not__allowed;
}

BITSTRING_template& RachControlParameters_template::acc()
{
set_specific();
return single_value->field_acc;
}

const BITSTRING_template& RachControlParameters_template::acc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acc of a non-specific template of type @GSM_SystemInformation.RachControlParameters.");
return single_value->field_acc;
}

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

void RachControlParameters_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ max_retrans := ");
single_value->field_max__retrans.log();
TTCN_Logger::log_event_str(", tx_integer := ");
single_value->field_tx__integer.log();
TTCN_Logger::log_event_str(", cell_barr_access := ");
single_value->field_cell__barr__access.log();
TTCN_Logger::log_event_str(", re_not_allowed := ");
single_value->field_re__not__allowed.log();
TTCN_Logger::log_event_str(", acc := ");
single_value->field_acc.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 RachControlParameters_template::log_match(const RachControlParameters& 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_max__retrans.match(match_value.max__retrans(), legacy)){
TTCN_Logger::log_logmatch_info(".max_retrans");
single_value->field_max__retrans.log_match(match_value.max__retrans(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tx__integer.match(match_value.tx__integer(), legacy)){
TTCN_Logger::log_logmatch_info(".tx_integer");
single_value->field_tx__integer.log_match(match_value.tx__integer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__barr__access.match(match_value.cell__barr__access(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_barr_access");
single_value->field_cell__barr__access.log_match(match_value.cell__barr__access(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_re__not__allowed.match(match_value.re__not__allowed(), legacy)){
TTCN_Logger::log_logmatch_info(".re_not_allowed");
single_value->field_re__not__allowed.log_match(match_value.re__not__allowed(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_acc.match(match_value.acc(), legacy)){
TTCN_Logger::log_logmatch_info(".acc");
single_value->field_acc.log_match(match_value.acc(), 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("{ max_retrans := ");
single_value->field_max__retrans.log_match(match_value.max__retrans(), legacy);
TTCN_Logger::log_event_str(", tx_integer := ");
single_value->field_tx__integer.log_match(match_value.tx__integer(), legacy);
TTCN_Logger::log_event_str(", cell_barr_access := ");
single_value->field_cell__barr__access.log_match(match_value.cell__barr__access(), legacy);
TTCN_Logger::log_event_str(", re_not_allowed := ");
single_value->field_re__not__allowed.log_match(match_value.re__not__allowed(), legacy);
TTCN_Logger::log_event_str(", acc := ");
single_value->field_acc.log_match(match_value.acc(), 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 RachControlParameters_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (max__retrans().is_bound()) max__retrans().set_implicit_omit();
if (tx__integer().is_bound()) tx__integer().set_implicit_omit();
if (cell__barr__access().is_bound()) cell__barr__access().set_implicit_omit();
if (re__not__allowed().is_bound()) re__not__allowed().set_implicit_omit();
if (acc().is_bound()) acc().set_implicit_omit();
}

void RachControlParameters_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_max__retrans.encode_text(text_buf);
single_value->field_tx__integer.encode_text(text_buf);
single_value->field_cell__barr__access.encode_text(text_buf);
single_value->field_re__not__allowed.encode_text(text_buf);
single_value->field_acc.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 @GSM_SystemInformation.RachControlParameters.");
}
}

void RachControlParameters_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_max__retrans.decode_text(text_buf);
single_value->field_tx__integer.decode_text(text_buf);
single_value->field_cell__barr__access.decode_text(text_buf);
single_value->field_re__not__allowed.decode_text(text_buf);
single_value->field_acc.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 RachControlParameters_template[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 @GSM_SystemInformation.RachControlParameters.");
}
}

void RachControlParameters_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: {
    RachControlParameters_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 @GSM_SystemInformation.RachControlParameters 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) max__retrans().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__integer().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cell__barr__access().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) re__not__allowed().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) acc().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(), "max_retrans")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          max__retrans().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tx_integer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__integer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_barr_access")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__barr__access().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "re_not_allowed")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          re__not__allowed().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.RachControlParameters: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RachControlParameters_template* precondition = new RachControlParameters_template;
    precondition->set_param(*param.get_elem(0));
    RachControlParameters_template* implied_template = new RachControlParameters_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RachControlParameters_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@GSM_SystemInformation.RachControlParameters");
  }
  is_ifpresent = param.get_ifpresent();
}

void RachControlParameters_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_max__retrans.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.RachControlParameters");
single_value->field_tx__integer.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.RachControlParameters");
single_value->field_cell__barr__access.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.RachControlParameters");
single_value->field_re__not__allowed.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.RachControlParameters");
single_value->field_acc.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.RachControlParameters");
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 : "@GSM_SystemInformation.RachControlParameters");
}

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

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

SystemInformationType1::SystemInformationType1()
{
}

SystemInformationType1::SystemInformationType1(const OCTETSTRING& par_cell__chan__desc,
    const RachControlParameters& par_rach__control,
    const OCTETSTRING& par_rest__octets)
  :   field_cell__chan__desc(par_cell__chan__desc),
  field_rach__control(par_rach__control),
  field_rest__octets(par_rest__octets)
{
}

SystemInformationType1::SystemInformationType1(const SystemInformationType1& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType1.");
if (other_value.cell__chan__desc().is_bound()) field_cell__chan__desc = other_value.cell__chan__desc();
else field_cell__chan__desc.clean_up();
if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
else field_rach__control.clean_up();
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType1::clean_up()
{
field_cell__chan__desc.clean_up();
field_rach__control.clean_up();
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType1::get_descriptor() const { return &SystemInformationType1_descr_; }
SystemInformationType1& SystemInformationType1::operator=(const SystemInformationType1& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType1.");
  if (other_value.cell__chan__desc().is_bound()) field_cell__chan__desc = other_value.cell__chan__desc();
  else field_cell__chan__desc.clean_up();
  if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
  else field_rach__control.clean_up();
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType1::operator==(const SystemInformationType1& other_value) const
{
return field_cell__chan__desc==other_value.field_cell__chan__desc
  && field_rach__control==other_value.field_rach__control
  && field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType1::is_bound() const
{
return (field_cell__chan__desc.is_bound())
  || (field_rach__control.is_bound())
  || (field_rest__octets.is_bound());
}
boolean SystemInformationType1::is_value() const
{
return field_cell__chan__desc.is_value()
  && field_rach__control.is_value()
  && field_rest__octets.is_value();
}
void SystemInformationType1::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cell_chan_desc := ");
field_cell__chan__desc.log();
TTCN_Logger::log_event_str(", rach_control := ");
field_rach__control.log();
TTCN_Logger::log_event_str(", rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType1::set_implicit_omit()
{
if (cell__chan__desc().is_bound()) cell__chan__desc().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType1::encode_text(Text_Buf& text_buf) const
{
field_cell__chan__desc.encode_text(text_buf);
field_rach__control.encode_text(text_buf);
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType1::decode_text(Text_Buf& text_buf)
{
field_cell__chan__desc.decode_text(text_buf);
field_rach__control.decode_text(text_buf);
field_rest__octets.decode_text(text_buf);
}

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

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

int SystemInformationType1::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, SystemInformationType1_cell__chan__desc_descr_.raw->forceomit);
  decoded_field_length = field_cell__chan__desc.RAW_decode(SystemInformationType1_cell__chan__desc_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, SystemInformationType1_rach__control_descr_.raw->forceomit);
  decoded_field_length = field_rach__control.RAW_decode(SystemInformationType1_rach__control_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, SystemInformationType1_rest__octets_descr_.raw->forceomit);
  decoded_field_length = field_rest__octets.RAW_decode(SystemInformationType1_rest__octets_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 SystemInformationType1::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, SystemInformationType1_cell__chan__desc_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SystemInformationType1_rach__control_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SystemInformationType1_rest__octets_descr_.raw);
  encoded_length += field_cell__chan__desc.RAW_encode(SystemInformationType1_cell__chan__desc_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rach__control.RAW_encode(SystemInformationType1_rach__control_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rest__octets.RAW_encode(SystemInformationType1_rest__octets_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct SystemInformationType1_template::single_value_struct {
OCTETSTRING_template field_cell__chan__desc;
RachControlParameters_template field_rach__control;
OCTETSTRING_template field_rest__octets;
};

void SystemInformationType1_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_cell__chan__desc = ANY_VALUE;
single_value->field_rach__control = ANY_VALUE;
single_value->field_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType1_template::copy_value(const SystemInformationType1& other_value)
{
single_value = new single_value_struct;
if (other_value.cell__chan__desc().is_bound()) {
  single_value->field_cell__chan__desc = other_value.cell__chan__desc();
} else {
  single_value->field_cell__chan__desc.clean_up();
}
if (other_value.rach__control().is_bound()) {
  single_value->field_rach__control = other_value.rach__control();
} else {
  single_value->field_rach__control.clean_up();
}
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType1_template::copy_template(const SystemInformationType1_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cell__chan__desc().get_selection()) {
single_value->field_cell__chan__desc = other_value.cell__chan__desc();
} else {
single_value->field_cell__chan__desc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rach__control().get_selection()) {
single_value->field_rach__control = other_value.rach__control();
} else {
single_value->field_rach__control.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType1_template[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 SystemInformationType1_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType1_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 @GSM_SystemInformation.SystemInformationType1.");
break;
}
set_selection(other_value);
}

SystemInformationType1_template::SystemInformationType1_template()
{
}

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

SystemInformationType1_template::SystemInformationType1_template(const SystemInformationType1& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean SystemInformationType1_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cell__chan__desc.is_bound()
 || single_value->field_rach__control.is_bound()
 || single_value->field_rest__octets.is_bound();
}

boolean SystemInformationType1_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cell__chan__desc.is_value()
 && single_value->field_rach__control.is_value()
 && single_value->field_rest__octets.is_value();
}

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

SystemInformationType1 SystemInformationType1_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 @GSM_SystemInformation.SystemInformationType1.");
SystemInformationType1 ret_val;
if (single_value->field_cell__chan__desc.is_bound()) {
ret_val.cell__chan__desc() = single_value->field_cell__chan__desc.valueof();
}
if (single_value->field_rach__control.is_bound()) {
ret_val.rach__control() = single_value->field_rach__control.valueof();
}
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType1_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 @GSM_SystemInformation.SystemInformationType1.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType1_template[list_length];
}

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

OCTETSTRING_template& SystemInformationType1_template::cell__chan__desc()
{
set_specific();
return single_value->field_cell__chan__desc;
}

const OCTETSTRING_template& SystemInformationType1_template::cell__chan__desc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_chan_desc of a non-specific template of type @GSM_SystemInformation.SystemInformationType1.");
return single_value->field_cell__chan__desc;
}

RachControlParameters_template& SystemInformationType1_template::rach__control()
{
set_specific();
return single_value->field_rach__control;
}

const RachControlParameters_template& SystemInformationType1_template::rach__control() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rach_control of a non-specific template of type @GSM_SystemInformation.SystemInformationType1.");
return single_value->field_rach__control;
}

OCTETSTRING_template& SystemInformationType1_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const OCTETSTRING_template& SystemInformationType1_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType1.");
return single_value->field_rest__octets;
}

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

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

void SystemInformationType1_template::log_match(const SystemInformationType1& 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_cell__chan__desc.match(match_value.cell__chan__desc(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_chan_desc");
single_value->field_cell__chan__desc.log_match(match_value.cell__chan__desc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rach__control.match(match_value.rach__control(), legacy)){
TTCN_Logger::log_logmatch_info(".rach_control");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ cell_chan_desc := ");
single_value->field_cell__chan__desc.log_match(match_value.cell__chan__desc(), legacy);
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType1_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cell__chan__desc().is_bound()) cell__chan__desc().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType1_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_cell__chan__desc.decode_text(text_buf);
single_value->field_rach__control.decode_text(text_buf);
single_value->field_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType1_template[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 @GSM_SystemInformation.SystemInformationType1.");
}
}

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

void SystemInformationType1_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_cell__chan__desc.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType1");
single_value->field_rach__control.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType1");
single_value->field_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType1");
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 : "@GSM_SystemInformation.SystemInformationType1");
}

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

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

SystemInformationType2::SystemInformationType2()
{
}

SystemInformationType2::SystemInformationType2(const OCTETSTRING& par_bcch__freq__list,
    const BITSTRING& par_ncc__permitted,
    const RachControlParameters& par_rach__control)
  :   field_bcch__freq__list(par_bcch__freq__list),
  field_ncc__permitted(par_ncc__permitted),
  field_rach__control(par_rach__control)
{
}

SystemInformationType2::SystemInformationType2(const SystemInformationType2& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType2.");
if (other_value.bcch__freq__list().is_bound()) field_bcch__freq__list = other_value.bcch__freq__list();
else field_bcch__freq__list.clean_up();
if (other_value.ncc__permitted().is_bound()) field_ncc__permitted = other_value.ncc__permitted();
else field_ncc__permitted.clean_up();
if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
else field_rach__control.clean_up();
}

void SystemInformationType2::clean_up()
{
field_bcch__freq__list.clean_up();
field_ncc__permitted.clean_up();
field_rach__control.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType2::get_descriptor() const { return &SystemInformationType2_descr_; }
SystemInformationType2& SystemInformationType2::operator=(const SystemInformationType2& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType2.");
  if (other_value.bcch__freq__list().is_bound()) field_bcch__freq__list = other_value.bcch__freq__list();
  else field_bcch__freq__list.clean_up();
  if (other_value.ncc__permitted().is_bound()) field_ncc__permitted = other_value.ncc__permitted();
  else field_ncc__permitted.clean_up();
  if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
  else field_rach__control.clean_up();
}
return *this;
}

boolean SystemInformationType2::operator==(const SystemInformationType2& other_value) const
{
return field_bcch__freq__list==other_value.field_bcch__freq__list
  && field_ncc__permitted==other_value.field_ncc__permitted
  && field_rach__control==other_value.field_rach__control;
}

boolean SystemInformationType2::is_bound() const
{
return (field_bcch__freq__list.is_bound())
  || (field_ncc__permitted.is_bound())
  || (field_rach__control.is_bound());
}
boolean SystemInformationType2::is_value() const
{
return field_bcch__freq__list.is_value()
  && field_ncc__permitted.is_value()
  && field_rach__control.is_value();
}
void SystemInformationType2::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bcch_freq_list := ");
field_bcch__freq__list.log();
TTCN_Logger::log_event_str(", ncc_permitted := ");
field_ncc__permitted.log();
TTCN_Logger::log_event_str(", rach_control := ");
field_rach__control.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType2::set_implicit_omit()
{
if (bcch__freq__list().is_bound()) bcch__freq__list().set_implicit_omit();
if (ncc__permitted().is_bound()) ncc__permitted().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
}

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

void SystemInformationType2::encode_text(Text_Buf& text_buf) const
{
field_bcch__freq__list.encode_text(text_buf);
field_ncc__permitted.encode_text(text_buf);
field_rach__control.encode_text(text_buf);
}

void SystemInformationType2::decode_text(Text_Buf& text_buf)
{
field_bcch__freq__list.decode_text(text_buf);
field_ncc__permitted.decode_text(text_buf);
field_rach__control.decode_text(text_buf);
}

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

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

int SystemInformationType2::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, SystemInformationType2_bcch__freq__list_descr_.raw->forceomit);
  decoded_field_length = field_bcch__freq__list.RAW_decode(SystemInformationType2_bcch__freq__list_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, SystemInformationType2_ncc__permitted_descr_.raw->forceomit);
  decoded_field_length = field_ncc__permitted.RAW_decode(SystemInformationType2_ncc__permitted_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, SystemInformationType2_rach__control_descr_.raw->forceomit);
  decoded_field_length = field_rach__control.RAW_decode(SystemInformationType2_rach__control_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 SystemInformationType2::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, SystemInformationType2_bcch__freq__list_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SystemInformationType2_ncc__permitted_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SystemInformationType2_rach__control_descr_.raw);
  encoded_length += field_bcch__freq__list.RAW_encode(SystemInformationType2_bcch__freq__list_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_ncc__permitted.RAW_encode(SystemInformationType2_ncc__permitted_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rach__control.RAW_encode(SystemInformationType2_rach__control_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct SystemInformationType2_template::single_value_struct {
OCTETSTRING_template field_bcch__freq__list;
BITSTRING_template field_ncc__permitted;
RachControlParameters_template field_rach__control;
};

void SystemInformationType2_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_bcch__freq__list = ANY_VALUE;
single_value->field_ncc__permitted = ANY_VALUE;
single_value->field_rach__control = ANY_VALUE;
}
}
}

void SystemInformationType2_template::copy_value(const SystemInformationType2& other_value)
{
single_value = new single_value_struct;
if (other_value.bcch__freq__list().is_bound()) {
  single_value->field_bcch__freq__list = other_value.bcch__freq__list();
} else {
  single_value->field_bcch__freq__list.clean_up();
}
if (other_value.ncc__permitted().is_bound()) {
  single_value->field_ncc__permitted = other_value.ncc__permitted();
} else {
  single_value->field_ncc__permitted.clean_up();
}
if (other_value.rach__control().is_bound()) {
  single_value->field_rach__control = other_value.rach__control();
} else {
  single_value->field_rach__control.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType2_template::copy_template(const SystemInformationType2_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bcch__freq__list().get_selection()) {
single_value->field_bcch__freq__list = other_value.bcch__freq__list();
} else {
single_value->field_bcch__freq__list.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ncc__permitted().get_selection()) {
single_value->field_ncc__permitted = other_value.ncc__permitted();
} else {
single_value->field_ncc__permitted.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rach__control().get_selection()) {
single_value->field_rach__control = other_value.rach__control();
} else {
single_value->field_rach__control.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 SystemInformationType2_template[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 SystemInformationType2_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType2_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 @GSM_SystemInformation.SystemInformationType2.");
break;
}
set_selection(other_value);
}

SystemInformationType2_template::SystemInformationType2_template()
{
}

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

SystemInformationType2_template::SystemInformationType2_template(const SystemInformationType2& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformationType2_template::match(const SystemInformationType2& 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.bcch__freq__list().is_bound()) return FALSE;
if(!single_value->field_bcch__freq__list.match(other_value.bcch__freq__list(), legacy))return FALSE;
if(!other_value.ncc__permitted().is_bound()) return FALSE;
if(!single_value->field_ncc__permitted.match(other_value.ncc__permitted(), legacy))return FALSE;
if(!other_value.rach__control().is_bound()) return FALSE;
if(!single_value->field_rach__control.match(other_value.rach__control(), 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 @GSM_SystemInformation.SystemInformationType2.");
}
return FALSE;
}

boolean SystemInformationType2_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bcch__freq__list.is_bound()
 || single_value->field_ncc__permitted.is_bound()
 || single_value->field_rach__control.is_bound();
}

boolean SystemInformationType2_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bcch__freq__list.is_value()
 && single_value->field_ncc__permitted.is_value()
 && single_value->field_rach__control.is_value();
}

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

SystemInformationType2 SystemInformationType2_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 @GSM_SystemInformation.SystemInformationType2.");
SystemInformationType2 ret_val;
if (single_value->field_bcch__freq__list.is_bound()) {
ret_val.bcch__freq__list() = single_value->field_bcch__freq__list.valueof();
}
if (single_value->field_ncc__permitted.is_bound()) {
ret_val.ncc__permitted() = single_value->field_ncc__permitted.valueof();
}
if (single_value->field_rach__control.is_bound()) {
ret_val.rach__control() = single_value->field_rach__control.valueof();
}
return ret_val;
}

void SystemInformationType2_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 @GSM_SystemInformation.SystemInformationType2.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType2_template[list_length];
}

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

OCTETSTRING_template& SystemInformationType2_template::bcch__freq__list()
{
set_specific();
return single_value->field_bcch__freq__list;
}

const OCTETSTRING_template& SystemInformationType2_template::bcch__freq__list() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bcch_freq_list of a non-specific template of type @GSM_SystemInformation.SystemInformationType2.");
return single_value->field_bcch__freq__list;
}

BITSTRING_template& SystemInformationType2_template::ncc__permitted()
{
set_specific();
return single_value->field_ncc__permitted;
}

const BITSTRING_template& SystemInformationType2_template::ncc__permitted() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ncc_permitted of a non-specific template of type @GSM_SystemInformation.SystemInformationType2.");
return single_value->field_ncc__permitted;
}

RachControlParameters_template& SystemInformationType2_template::rach__control()
{
set_specific();
return single_value->field_rach__control;
}

const RachControlParameters_template& SystemInformationType2_template::rach__control() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rach_control of a non-specific template of type @GSM_SystemInformation.SystemInformationType2.");
return single_value->field_rach__control;
}

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

void SystemInformationType2_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bcch_freq_list := ");
single_value->field_bcch__freq__list.log();
TTCN_Logger::log_event_str(", ncc_permitted := ");
single_value->field_ncc__permitted.log();
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.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 SystemInformationType2_template::log_match(const SystemInformationType2& 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_bcch__freq__list.match(match_value.bcch__freq__list(), legacy)){
TTCN_Logger::log_logmatch_info(".bcch_freq_list");
single_value->field_bcch__freq__list.log_match(match_value.bcch__freq__list(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ncc__permitted.match(match_value.ncc__permitted(), legacy)){
TTCN_Logger::log_logmatch_info(".ncc_permitted");
single_value->field_ncc__permitted.log_match(match_value.ncc__permitted(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rach__control.match(match_value.rach__control(), legacy)){
TTCN_Logger::log_logmatch_info(".rach_control");
single_value->field_rach__control.log_match(match_value.rach__control(), 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("{ bcch_freq_list := ");
single_value->field_bcch__freq__list.log_match(match_value.bcch__freq__list(), legacy);
TTCN_Logger::log_event_str(", ncc_permitted := ");
single_value->field_ncc__permitted.log_match(match_value.ncc__permitted(), legacy);
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.log_match(match_value.rach__control(), 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 SystemInformationType2_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bcch__freq__list().is_bound()) bcch__freq__list().set_implicit_omit();
if (ncc__permitted().is_bound()) ncc__permitted().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
}

void SystemInformationType2_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bcch__freq__list.encode_text(text_buf);
single_value->field_ncc__permitted.encode_text(text_buf);
single_value->field_rach__control.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 @GSM_SystemInformation.SystemInformationType2.");
}
}

void SystemInformationType2_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_bcch__freq__list.decode_text(text_buf);
single_value->field_ncc__permitted.decode_text(text_buf);
single_value->field_rach__control.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 SystemInformationType2_template[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 @GSM_SystemInformation.SystemInformationType2.");
}
}

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

void SystemInformationType2_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_bcch__freq__list.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2");
single_value->field_ncc__permitted.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2");
single_value->field_rach__control.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2");
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 : "@GSM_SystemInformation.SystemInformationType2");
}

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

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

SystemInformationType2bis::SystemInformationType2bis()
{
}

SystemInformationType2bis::SystemInformationType2bis(const OCTETSTRING& par_extd__bcch__freq__list,
    const RachControlParameters& par_rach__control,
    const OCTETSTRING& par_rest__octets)
  :   field_extd__bcch__freq__list(par_extd__bcch__freq__list),
  field_rach__control(par_rach__control),
  field_rest__octets(par_rest__octets)
{
}

SystemInformationType2bis::SystemInformationType2bis(const SystemInformationType2bis& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType2bis.");
if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
else field_extd__bcch__freq__list.clean_up();
if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
else field_rach__control.clean_up();
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType2bis::clean_up()
{
field_extd__bcch__freq__list.clean_up();
field_rach__control.clean_up();
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType2bis::get_descriptor() const { return &SystemInformationType2bis_descr_; }
SystemInformationType2bis& SystemInformationType2bis::operator=(const SystemInformationType2bis& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType2bis.");
  if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
  else field_extd__bcch__freq__list.clean_up();
  if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
  else field_rach__control.clean_up();
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType2bis::operator==(const SystemInformationType2bis& other_value) const
{
return field_extd__bcch__freq__list==other_value.field_extd__bcch__freq__list
  && field_rach__control==other_value.field_rach__control
  && field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType2bis::is_bound() const
{
return (field_extd__bcch__freq__list.is_bound())
  || (field_rach__control.is_bound())
  || (field_rest__octets.is_bound());
}
boolean SystemInformationType2bis::is_value() const
{
return field_extd__bcch__freq__list.is_value()
  && field_rach__control.is_value()
  && field_rest__octets.is_value();
}
void SystemInformationType2bis::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ extd_bcch_freq_list := ");
field_extd__bcch__freq__list.log();
TTCN_Logger::log_event_str(", rach_control := ");
field_rach__control.log();
TTCN_Logger::log_event_str(", rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType2bis::set_implicit_omit()
{
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType2bis::encode_text(Text_Buf& text_buf) const
{
field_extd__bcch__freq__list.encode_text(text_buf);
field_rach__control.encode_text(text_buf);
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType2bis::decode_text(Text_Buf& text_buf)
{
field_extd__bcch__freq__list.decode_text(text_buf);
field_rach__control.decode_text(text_buf);
field_rest__octets.decode_text(text_buf);
}

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

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

int SystemInformationType2bis::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, SystemInformationType2bis_extd__bcch__freq__list_descr_.raw->forceomit);
  decoded_field_length = field_extd__bcch__freq__list.RAW_decode(SystemInformationType2bis_extd__bcch__freq__list_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, SystemInformationType2bis_rach__control_descr_.raw->forceomit);
  decoded_field_length = field_rach__control.RAW_decode(SystemInformationType2bis_rach__control_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, SystemInformationType2bis_rest__octets_descr_.raw->forceomit);
  decoded_field_length = field_rest__octets.RAW_decode(SystemInformationType2bis_rest__octets_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 SystemInformationType2bis::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, SystemInformationType2bis_extd__bcch__freq__list_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SystemInformationType2bis_rach__control_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SystemInformationType2bis_rest__octets_descr_.raw);
  encoded_length += field_extd__bcch__freq__list.RAW_encode(SystemInformationType2bis_extd__bcch__freq__list_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_rach__control.RAW_encode(SystemInformationType2bis_rach__control_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rest__octets.RAW_encode(SystemInformationType2bis_rest__octets_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct SystemInformationType2bis_template::single_value_struct {
OCTETSTRING_template field_extd__bcch__freq__list;
RachControlParameters_template field_rach__control;
OCTETSTRING_template field_rest__octets;
};

void SystemInformationType2bis_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_extd__bcch__freq__list = ANY_VALUE;
single_value->field_rach__control = ANY_VALUE;
single_value->field_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType2bis_template::copy_value(const SystemInformationType2bis& other_value)
{
single_value = new single_value_struct;
if (other_value.extd__bcch__freq__list().is_bound()) {
  single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
  single_value->field_extd__bcch__freq__list.clean_up();
}
if (other_value.rach__control().is_bound()) {
  single_value->field_rach__control = other_value.rach__control();
} else {
  single_value->field_rach__control.clean_up();
}
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType2bis_template::copy_template(const SystemInformationType2bis_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.extd__bcch__freq__list().get_selection()) {
single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
single_value->field_extd__bcch__freq__list.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rach__control().get_selection()) {
single_value->field_rach__control = other_value.rach__control();
} else {
single_value->field_rach__control.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType2bis_template[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 SystemInformationType2bis_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType2bis_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 @GSM_SystemInformation.SystemInformationType2bis.");
break;
}
set_selection(other_value);
}

SystemInformationType2bis_template::SystemInformationType2bis_template()
{
}

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

SystemInformationType2bis_template::SystemInformationType2bis_template(const SystemInformationType2bis& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean SystemInformationType2bis_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_extd__bcch__freq__list.is_bound()
 || single_value->field_rach__control.is_bound()
 || single_value->field_rest__octets.is_bound();
}

boolean SystemInformationType2bis_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_extd__bcch__freq__list.is_value()
 && single_value->field_rach__control.is_value()
 && single_value->field_rest__octets.is_value();
}

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

SystemInformationType2bis SystemInformationType2bis_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 @GSM_SystemInformation.SystemInformationType2bis.");
SystemInformationType2bis ret_val;
if (single_value->field_extd__bcch__freq__list.is_bound()) {
ret_val.extd__bcch__freq__list() = single_value->field_extd__bcch__freq__list.valueof();
}
if (single_value->field_rach__control.is_bound()) {
ret_val.rach__control() = single_value->field_rach__control.valueof();
}
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType2bis_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 @GSM_SystemInformation.SystemInformationType2bis.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType2bis_template[list_length];
}

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

OCTETSTRING_template& SystemInformationType2bis_template::extd__bcch__freq__list()
{
set_specific();
return single_value->field_extd__bcch__freq__list;
}

const OCTETSTRING_template& SystemInformationType2bis_template::extd__bcch__freq__list() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extd_bcch_freq_list of a non-specific template of type @GSM_SystemInformation.SystemInformationType2bis.");
return single_value->field_extd__bcch__freq__list;
}

RachControlParameters_template& SystemInformationType2bis_template::rach__control()
{
set_specific();
return single_value->field_rach__control;
}

const RachControlParameters_template& SystemInformationType2bis_template::rach__control() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rach_control of a non-specific template of type @GSM_SystemInformation.SystemInformationType2bis.");
return single_value->field_rach__control;
}

OCTETSTRING_template& SystemInformationType2bis_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const OCTETSTRING_template& SystemInformationType2bis_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType2bis.");
return single_value->field_rest__octets;
}

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

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

void SystemInformationType2bis_template::log_match(const SystemInformationType2bis& 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_extd__bcch__freq__list.match(match_value.extd__bcch__freq__list(), legacy)){
TTCN_Logger::log_logmatch_info(".extd_bcch_freq_list");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rach__control.match(match_value.rach__control(), legacy)){
TTCN_Logger::log_logmatch_info(".rach_control");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ extd_bcch_freq_list := ");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), legacy);
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType2bis_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType2bis_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_extd__bcch__freq__list.decode_text(text_buf);
single_value->field_rach__control.decode_text(text_buf);
single_value->field_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType2bis_template[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 @GSM_SystemInformation.SystemInformationType2bis.");
}
}

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

void SystemInformationType2bis_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_extd__bcch__freq__list.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2bis");
single_value->field_rach__control.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2bis");
single_value->field_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2bis");
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 : "@GSM_SystemInformation.SystemInformationType2bis");
}

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

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

SystemInformationType2ter::SystemInformationType2ter()
{
}

SystemInformationType2ter::SystemInformationType2ter(const OCTETSTRING& par_extd__bcch__freq__list,
    const OCTETSTRING& par_rest__octets)
  :   field_extd__bcch__freq__list(par_extd__bcch__freq__list),
  field_rest__octets(par_rest__octets)
{
}

SystemInformationType2ter::SystemInformationType2ter(const SystemInformationType2ter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType2ter.");
if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
else field_extd__bcch__freq__list.clean_up();
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType2ter::clean_up()
{
field_extd__bcch__freq__list.clean_up();
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType2ter::get_descriptor() const { return &SystemInformationType2ter_descr_; }
SystemInformationType2ter& SystemInformationType2ter::operator=(const SystemInformationType2ter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType2ter.");
  if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
  else field_extd__bcch__freq__list.clean_up();
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType2ter::operator==(const SystemInformationType2ter& other_value) const
{
return field_extd__bcch__freq__list==other_value.field_extd__bcch__freq__list
  && field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType2ter::is_bound() const
{
return (field_extd__bcch__freq__list.is_bound())
  || (field_rest__octets.is_bound());
}
boolean SystemInformationType2ter::is_value() const
{
return field_extd__bcch__freq__list.is_value()
  && field_rest__octets.is_value();
}
void SystemInformationType2ter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ extd_bcch_freq_list := ");
field_extd__bcch__freq__list.log();
TTCN_Logger::log_event_str(", rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType2ter::set_implicit_omit()
{
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType2ter::encode_text(Text_Buf& text_buf) const
{
field_extd__bcch__freq__list.encode_text(text_buf);
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType2ter::decode_text(Text_Buf& text_buf)
{
field_extd__bcch__freq__list.decode_text(text_buf);
field_rest__octets.decode_text(text_buf);
}

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

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

int SystemInformationType2ter::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, SystemInformationType2ter_extd__bcch__freq__list_descr_.raw->forceomit);
  decoded_field_length = field_extd__bcch__freq__list.RAW_decode(SystemInformationType2ter_extd__bcch__freq__list_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, SystemInformationType2ter_rest__octets_descr_.raw->forceomit);
  decoded_field_length = field_rest__octets.RAW_decode(SystemInformationType2ter_rest__octets_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

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

struct SystemInformationType2ter_template::single_value_struct {
OCTETSTRING_template field_extd__bcch__freq__list;
OCTETSTRING_template field_rest__octets;
};

void SystemInformationType2ter_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_extd__bcch__freq__list = ANY_VALUE;
single_value->field_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType2ter_template::copy_value(const SystemInformationType2ter& other_value)
{
single_value = new single_value_struct;
if (other_value.extd__bcch__freq__list().is_bound()) {
  single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
  single_value->field_extd__bcch__freq__list.clean_up();
}
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType2ter_template::copy_template(const SystemInformationType2ter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.extd__bcch__freq__list().get_selection()) {
single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
single_value->field_extd__bcch__freq__list.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType2ter_template[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 SystemInformationType2ter_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType2ter_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 @GSM_SystemInformation.SystemInformationType2ter.");
break;
}
set_selection(other_value);
}

SystemInformationType2ter_template::SystemInformationType2ter_template()
{
}

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

SystemInformationType2ter_template::SystemInformationType2ter_template(const SystemInformationType2ter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

boolean SystemInformationType2ter_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_extd__bcch__freq__list.is_value()
 && single_value->field_rest__octets.is_value();
}

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

SystemInformationType2ter SystemInformationType2ter_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 @GSM_SystemInformation.SystemInformationType2ter.");
SystemInformationType2ter ret_val;
if (single_value->field_extd__bcch__freq__list.is_bound()) {
ret_val.extd__bcch__freq__list() = single_value->field_extd__bcch__freq__list.valueof();
}
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType2ter_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 @GSM_SystemInformation.SystemInformationType2ter.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType2ter_template[list_length];
}

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

OCTETSTRING_template& SystemInformationType2ter_template::extd__bcch__freq__list()
{
set_specific();
return single_value->field_extd__bcch__freq__list;
}

const OCTETSTRING_template& SystemInformationType2ter_template::extd__bcch__freq__list() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extd_bcch_freq_list of a non-specific template of type @GSM_SystemInformation.SystemInformationType2ter.");
return single_value->field_extd__bcch__freq__list;
}

OCTETSTRING_template& SystemInformationType2ter_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const OCTETSTRING_template& SystemInformationType2ter_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType2ter.");
return single_value->field_rest__octets;
}

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

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

void SystemInformationType2ter_template::log_match(const SystemInformationType2ter& 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_extd__bcch__freq__list.match(match_value.extd__bcch__freq__list(), legacy)){
TTCN_Logger::log_logmatch_info(".extd_bcch_freq_list");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ extd_bcch_freq_list := ");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), legacy);
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType2ter_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType2ter_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_extd__bcch__freq__list.decode_text(text_buf);
single_value->field_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType2ter_template[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 @GSM_SystemInformation.SystemInformationType2ter.");
}
}

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

void SystemInformationType2ter_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_extd__bcch__freq__list.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2ter");
single_value->field_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2ter");
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 : "@GSM_SystemInformation.SystemInformationType2ter");
}

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

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

SystemInformationType2quater::SystemInformationType2quater()
{
}

SystemInformationType2quater::SystemInformationType2quater(const GSM__RestOctets::SI2quaterRestOctets& par_rest__octets)
  :   field_rest__octets(par_rest__octets)
{
}

SystemInformationType2quater::SystemInformationType2quater(const SystemInformationType2quater& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType2quater.");
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType2quater::clean_up()
{
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType2quater::get_descriptor() const { return &SystemInformationType2quater_descr_; }
SystemInformationType2quater& SystemInformationType2quater::operator=(const SystemInformationType2quater& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType2quater.");
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType2quater::operator==(const SystemInformationType2quater& other_value) const
{
return field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType2quater::is_bound() const
{
return (field_rest__octets.is_bound());
}
boolean SystemInformationType2quater::is_value() const
{
return field_rest__octets.is_value();
}
void SystemInformationType2quater::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType2quater::set_implicit_omit()
{
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType2quater::encode_text(Text_Buf& text_buf) const
{
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType2quater::decode_text(Text_Buf& text_buf)
{
field_rest__octets.decode_text(text_buf);
}

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

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

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

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

struct SystemInformationType2quater_template::single_value_struct {
GSM__RestOctets::SI2quaterRestOctets_template field_rest__octets;
};

void SystemInformationType2quater_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_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType2quater_template::copy_value(const SystemInformationType2quater& other_value)
{
single_value = new single_value_struct;
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType2quater_template::copy_template(const SystemInformationType2quater_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType2quater_template[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 SystemInformationType2quater_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType2quater_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 @GSM_SystemInformation.SystemInformationType2quater.");
break;
}
set_selection(other_value);
}

SystemInformationType2quater_template::SystemInformationType2quater_template()
{
}

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

SystemInformationType2quater_template::SystemInformationType2quater_template(const SystemInformationType2quater& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

SystemInformationType2quater SystemInformationType2quater_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 @GSM_SystemInformation.SystemInformationType2quater.");
SystemInformationType2quater ret_val;
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType2quater_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 @GSM_SystemInformation.SystemInformationType2quater.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType2quater_template[list_length];
}

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

GSM__RestOctets::SI2quaterRestOctets_template& SystemInformationType2quater_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const GSM__RestOctets::SI2quaterRestOctets_template& SystemInformationType2quater_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType2quater.");
return single_value->field_rest__octets;
}

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

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

void SystemInformationType2quater_template::log_match(const SystemInformationType2quater& 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_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType2quater_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType2quater_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_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType2quater_template[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 @GSM_SystemInformation.SystemInformationType2quater.");
}
}

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

void SystemInformationType2quater_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_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType2quater");
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 : "@GSM_SystemInformation.SystemInformationType2quater");
}

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

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

SystemInformationType3::SystemInformationType3()
{
}

SystemInformationType3::SystemInformationType3(const INTEGER& par_cell__id,
    const GSM__Types::LocationAreaIdentification& par_lai,
    const ControlChannelDescription& par_ctrl__chan__desc,
    const CellOptions& par_cell__options,
    const CellSelectionParameters& par_cell__sel__par,
    const RachControlParameters& par_rach__control,
    const GSM__RestOctets::SI3RestOctets& par_rest__octets)
  :   field_cell__id(par_cell__id),
  field_lai(par_lai),
  field_ctrl__chan__desc(par_ctrl__chan__desc),
  field_cell__options(par_cell__options),
  field_cell__sel__par(par_cell__sel__par),
  field_rach__control(par_rach__control),
  field_rest__octets(par_rest__octets)
{
}

SystemInformationType3::SystemInformationType3(const SystemInformationType3& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType3.");
if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
else field_cell__id.clean_up();
if (other_value.lai().is_bound()) field_lai = other_value.lai();
else field_lai.clean_up();
if (other_value.ctrl__chan__desc().is_bound()) field_ctrl__chan__desc = other_value.ctrl__chan__desc();
else field_ctrl__chan__desc.clean_up();
if (other_value.cell__options().is_bound()) field_cell__options = other_value.cell__options();
else field_cell__options.clean_up();
if (other_value.cell__sel__par().is_bound()) field_cell__sel__par = other_value.cell__sel__par();
else field_cell__sel__par.clean_up();
if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
else field_rach__control.clean_up();
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType3::clean_up()
{
field_cell__id.clean_up();
field_lai.clean_up();
field_ctrl__chan__desc.clean_up();
field_cell__options.clean_up();
field_cell__sel__par.clean_up();
field_rach__control.clean_up();
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType3::get_descriptor() const { return &SystemInformationType3_descr_; }
SystemInformationType3& SystemInformationType3::operator=(const SystemInformationType3& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType3.");
  if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
  else field_cell__id.clean_up();
  if (other_value.lai().is_bound()) field_lai = other_value.lai();
  else field_lai.clean_up();
  if (other_value.ctrl__chan__desc().is_bound()) field_ctrl__chan__desc = other_value.ctrl__chan__desc();
  else field_ctrl__chan__desc.clean_up();
  if (other_value.cell__options().is_bound()) field_cell__options = other_value.cell__options();
  else field_cell__options.clean_up();
  if (other_value.cell__sel__par().is_bound()) field_cell__sel__par = other_value.cell__sel__par();
  else field_cell__sel__par.clean_up();
  if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
  else field_rach__control.clean_up();
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType3::operator==(const SystemInformationType3& other_value) const
{
return field_cell__id==other_value.field_cell__id
  && field_lai==other_value.field_lai
  && field_ctrl__chan__desc==other_value.field_ctrl__chan__desc
  && field_cell__options==other_value.field_cell__options
  && field_cell__sel__par==other_value.field_cell__sel__par
  && field_rach__control==other_value.field_rach__control
  && field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType3::is_bound() const
{
return (field_cell__id.is_bound())
  || (field_lai.is_bound())
  || (field_ctrl__chan__desc.is_bound())
  || (field_cell__options.is_bound())
  || (field_cell__sel__par.is_bound())
  || (field_rach__control.is_bound())
  || (field_rest__octets.is_bound());
}
boolean SystemInformationType3::is_value() const
{
return field_cell__id.is_value()
  && field_lai.is_value()
  && field_ctrl__chan__desc.is_value()
  && field_cell__options.is_value()
  && field_cell__sel__par.is_value()
  && field_rach__control.is_value()
  && field_rest__octets.is_value();
}
void SystemInformationType3::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cell_id := ");
field_cell__id.log();
TTCN_Logger::log_event_str(", lai := ");
field_lai.log();
TTCN_Logger::log_event_str(", ctrl_chan_desc := ");
field_ctrl__chan__desc.log();
TTCN_Logger::log_event_str(", cell_options := ");
field_cell__options.log();
TTCN_Logger::log_event_str(", cell_sel_par := ");
field_cell__sel__par.log();
TTCN_Logger::log_event_str(", rach_control := ");
field_rach__control.log();
TTCN_Logger::log_event_str(", rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType3::set_implicit_omit()
{
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (lai().is_bound()) lai().set_implicit_omit();
if (ctrl__chan__desc().is_bound()) ctrl__chan__desc().set_implicit_omit();
if (cell__options().is_bound()) cell__options().set_implicit_omit();
if (cell__sel__par().is_bound()) cell__sel__par().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

void SystemInformationType3::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @GSM_SystemInformation.SystemInformationType3 has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cell__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lai().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ctrl__chan__desc().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__options().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cell__sel__par().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rach__control().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rest__octets().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lai")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lai().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ctrl_chan_desc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ctrl__chan__desc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_options")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__options().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_sel_par")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__sel__par().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rach_control")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rach__control().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rest_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rest__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.SystemInformationType3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@GSM_SystemInformation.SystemInformationType3");
  }
}

void SystemInformationType3::encode_text(Text_Buf& text_buf) const
{
field_cell__id.encode_text(text_buf);
field_lai.encode_text(text_buf);
field_ctrl__chan__desc.encode_text(text_buf);
field_cell__options.encode_text(text_buf);
field_cell__sel__par.encode_text(text_buf);
field_rach__control.encode_text(text_buf);
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType3::decode_text(Text_Buf& text_buf)
{
field_cell__id.decode_text(text_buf);
field_lai.decode_text(text_buf);
field_ctrl__chan__desc.decode_text(text_buf);
field_cell__options.decode_text(text_buf);
field_cell__sel__par.decode_text(text_buf);
field_rach__control.decode_text(text_buf);
field_rest__octets.decode_text(text_buf);
}

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

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

int SystemInformationType3::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, SystemInformationType3_cell__id_descr_.raw->forceomit);
  decoded_field_length = field_cell__id.RAW_decode(SystemInformationType3_cell__id_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, SystemInformationType3_lai_descr_.raw->forceomit);
  decoded_field_length = field_lai.RAW_decode(SystemInformationType3_lai_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, SystemInformationType3_ctrl__chan__desc_descr_.raw->forceomit);
  decoded_field_length = field_ctrl__chan__desc.RAW_decode(SystemInformationType3_ctrl__chan__desc_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, SystemInformationType3_cell__options_descr_.raw->forceomit);
  decoded_field_length = field_cell__options.RAW_decode(SystemInformationType3_cell__options_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, SystemInformationType3_cell__sel__par_descr_.raw->forceomit);
  decoded_field_length = field_cell__sel__par.RAW_decode(SystemInformationType3_cell__sel__par_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_5_force_omit(5, force_omit, SystemInformationType3_rach__control_descr_.raw->forceomit);
  decoded_field_length = field_rach__control.RAW_decode(SystemInformationType3_rach__control_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_6_force_omit(6, force_omit, SystemInformationType3_rest__octets_descr_.raw->forceomit);
  decoded_field_length = field_rest__octets.RAW_decode(SystemInformationType3_rest__octets_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SystemInformationType3::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 7;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(7);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SystemInformationType3_cell__id_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SystemInformationType3_lai_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SystemInformationType3_ctrl__chan__desc_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SystemInformationType3_cell__options_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SystemInformationType3_cell__sel__par_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SystemInformationType3_rach__control_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, SystemInformationType3_rest__octets_descr_.raw);
  encoded_length += field_cell__id.RAW_encode(SystemInformationType3_cell__id_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_lai.RAW_encode(SystemInformationType3_lai_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_ctrl__chan__desc.RAW_encode(SystemInformationType3_ctrl__chan__desc_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_cell__options.RAW_encode(SystemInformationType3_cell__options_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_cell__sel__par.RAW_encode(SystemInformationType3_cell__sel__par_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_rach__control.RAW_encode(SystemInformationType3_rach__control_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_rest__octets.RAW_encode(SystemInformationType3_rest__octets_descr_, *myleaf.body.node.nodes[6]);
  return myleaf.length = encoded_length;
}

struct SystemInformationType3_template::single_value_struct {
INTEGER_template field_cell__id;
GSM__Types::LocationAreaIdentification_template field_lai;
ControlChannelDescription_template field_ctrl__chan__desc;
CellOptions_template field_cell__options;
CellSelectionParameters_template field_cell__sel__par;
RachControlParameters_template field_rach__control;
GSM__RestOctets::SI3RestOctets_template field_rest__octets;
};

void SystemInformationType3_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_cell__id = ANY_VALUE;
single_value->field_lai = ANY_VALUE;
single_value->field_ctrl__chan__desc = ANY_VALUE;
single_value->field_cell__options = ANY_VALUE;
single_value->field_cell__sel__par = ANY_VALUE;
single_value->field_rach__control = ANY_VALUE;
single_value->field_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType3_template::copy_value(const SystemInformationType3& other_value)
{
single_value = new single_value_struct;
if (other_value.cell__id().is_bound()) {
  single_value->field_cell__id = other_value.cell__id();
} else {
  single_value->field_cell__id.clean_up();
}
if (other_value.lai().is_bound()) {
  single_value->field_lai = other_value.lai();
} else {
  single_value->field_lai.clean_up();
}
if (other_value.ctrl__chan__desc().is_bound()) {
  single_value->field_ctrl__chan__desc = other_value.ctrl__chan__desc();
} else {
  single_value->field_ctrl__chan__desc.clean_up();
}
if (other_value.cell__options().is_bound()) {
  single_value->field_cell__options = other_value.cell__options();
} else {
  single_value->field_cell__options.clean_up();
}
if (other_value.cell__sel__par().is_bound()) {
  single_value->field_cell__sel__par = other_value.cell__sel__par();
} else {
  single_value->field_cell__sel__par.clean_up();
}
if (other_value.rach__control().is_bound()) {
  single_value->field_rach__control = other_value.rach__control();
} else {
  single_value->field_rach__control.clean_up();
}
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType3_template::copy_template(const SystemInformationType3_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cell__id().get_selection()) {
single_value->field_cell__id = other_value.cell__id();
} else {
single_value->field_cell__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lai().get_selection()) {
single_value->field_lai = other_value.lai();
} else {
single_value->field_lai.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ctrl__chan__desc().get_selection()) {
single_value->field_ctrl__chan__desc = other_value.ctrl__chan__desc();
} else {
single_value->field_ctrl__chan__desc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__options().get_selection()) {
single_value->field_cell__options = other_value.cell__options();
} else {
single_value->field_cell__options.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__sel__par().get_selection()) {
single_value->field_cell__sel__par = other_value.cell__sel__par();
} else {
single_value->field_cell__sel__par.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rach__control().get_selection()) {
single_value->field_rach__control = other_value.rach__control();
} else {
single_value->field_rach__control.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType3_template[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 SystemInformationType3_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType3_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 @GSM_SystemInformation.SystemInformationType3.");
break;
}
set_selection(other_value);
}

SystemInformationType3_template::SystemInformationType3_template()
{
}

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

SystemInformationType3_template::SystemInformationType3_template(const SystemInformationType3& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformationType3_template::match(const SystemInformationType3& 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.cell__id().is_bound()) return FALSE;
if(!single_value->field_cell__id.match(other_value.cell__id(), legacy))return FALSE;
if(!other_value.lai().is_bound()) return FALSE;
if(!single_value->field_lai.match(other_value.lai(), legacy))return FALSE;
if(!other_value.ctrl__chan__desc().is_bound()) return FALSE;
if(!single_value->field_ctrl__chan__desc.match(other_value.ctrl__chan__desc(), legacy))return FALSE;
if(!other_value.cell__options().is_bound()) return FALSE;
if(!single_value->field_cell__options.match(other_value.cell__options(), legacy))return FALSE;
if(!other_value.cell__sel__par().is_bound()) return FALSE;
if(!single_value->field_cell__sel__par.match(other_value.cell__sel__par(), legacy))return FALSE;
if(!other_value.rach__control().is_bound()) return FALSE;
if(!single_value->field_rach__control.match(other_value.rach__control(), legacy))return FALSE;
if(!other_value.rest__octets().is_bound()) return FALSE;
if(!single_value->field_rest__octets.match(other_value.rest__octets(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @GSM_SystemInformation.SystemInformationType3.");
}
return FALSE;
}

boolean SystemInformationType3_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cell__id.is_bound()
 || single_value->field_lai.is_bound()
 || single_value->field_ctrl__chan__desc.is_bound()
 || single_value->field_cell__options.is_bound()
 || single_value->field_cell__sel__par.is_bound()
 || single_value->field_rach__control.is_bound()
 || single_value->field_rest__octets.is_bound();
}

boolean SystemInformationType3_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cell__id.is_value()
 && single_value->field_lai.is_value()
 && single_value->field_ctrl__chan__desc.is_value()
 && single_value->field_cell__options.is_value()
 && single_value->field_cell__sel__par.is_value()
 && single_value->field_rach__control.is_value()
 && single_value->field_rest__octets.is_value();
}

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

SystemInformationType3 SystemInformationType3_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 @GSM_SystemInformation.SystemInformationType3.");
SystemInformationType3 ret_val;
if (single_value->field_cell__id.is_bound()) {
ret_val.cell__id() = single_value->field_cell__id.valueof();
}
if (single_value->field_lai.is_bound()) {
ret_val.lai() = single_value->field_lai.valueof();
}
if (single_value->field_ctrl__chan__desc.is_bound()) {
ret_val.ctrl__chan__desc() = single_value->field_ctrl__chan__desc.valueof();
}
if (single_value->field_cell__options.is_bound()) {
ret_val.cell__options() = single_value->field_cell__options.valueof();
}
if (single_value->field_cell__sel__par.is_bound()) {
ret_val.cell__sel__par() = single_value->field_cell__sel__par.valueof();
}
if (single_value->field_rach__control.is_bound()) {
ret_val.rach__control() = single_value->field_rach__control.valueof();
}
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType3_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 @GSM_SystemInformation.SystemInformationType3.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType3_template[list_length];
}

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

INTEGER_template& SystemInformationType3_template::cell__id()
{
set_specific();
return single_value->field_cell__id;
}

const INTEGER_template& SystemInformationType3_template::cell__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_id of a non-specific template of type @GSM_SystemInformation.SystemInformationType3.");
return single_value->field_cell__id;
}

GSM__Types::LocationAreaIdentification_template& SystemInformationType3_template::lai()
{
set_specific();
return single_value->field_lai;
}

const GSM__Types::LocationAreaIdentification_template& SystemInformationType3_template::lai() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lai of a non-specific template of type @GSM_SystemInformation.SystemInformationType3.");
return single_value->field_lai;
}

ControlChannelDescription_template& SystemInformationType3_template::ctrl__chan__desc()
{
set_specific();
return single_value->field_ctrl__chan__desc;
}

const ControlChannelDescription_template& SystemInformationType3_template::ctrl__chan__desc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ctrl_chan_desc of a non-specific template of type @GSM_SystemInformation.SystemInformationType3.");
return single_value->field_ctrl__chan__desc;
}

CellOptions_template& SystemInformationType3_template::cell__options()
{
set_specific();
return single_value->field_cell__options;
}

const CellOptions_template& SystemInformationType3_template::cell__options() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_options of a non-specific template of type @GSM_SystemInformation.SystemInformationType3.");
return single_value->field_cell__options;
}

CellSelectionParameters_template& SystemInformationType3_template::cell__sel__par()
{
set_specific();
return single_value->field_cell__sel__par;
}

const CellSelectionParameters_template& SystemInformationType3_template::cell__sel__par() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_sel_par of a non-specific template of type @GSM_SystemInformation.SystemInformationType3.");
return single_value->field_cell__sel__par;
}

RachControlParameters_template& SystemInformationType3_template::rach__control()
{
set_specific();
return single_value->field_rach__control;
}

const RachControlParameters_template& SystemInformationType3_template::rach__control() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rach_control of a non-specific template of type @GSM_SystemInformation.SystemInformationType3.");
return single_value->field_rach__control;
}

GSM__RestOctets::SI3RestOctets_template& SystemInformationType3_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const GSM__RestOctets::SI3RestOctets_template& SystemInformationType3_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType3.");
return single_value->field_rest__octets;
}

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

void SystemInformationType3_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cell_id := ");
single_value->field_cell__id.log();
TTCN_Logger::log_event_str(", lai := ");
single_value->field_lai.log();
TTCN_Logger::log_event_str(", ctrl_chan_desc := ");
single_value->field_ctrl__chan__desc.log();
TTCN_Logger::log_event_str(", cell_options := ");
single_value->field_cell__options.log();
TTCN_Logger::log_event_str(", cell_sel_par := ");
single_value->field_cell__sel__par.log();
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.log();
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SystemInformationType3_template::log_match(const SystemInformationType3& 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_cell__id.match(match_value.cell__id(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_id");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lai.match(match_value.lai(), legacy)){
TTCN_Logger::log_logmatch_info(".lai");
single_value->field_lai.log_match(match_value.lai(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ctrl__chan__desc.match(match_value.ctrl__chan__desc(), legacy)){
TTCN_Logger::log_logmatch_info(".ctrl_chan_desc");
single_value->field_ctrl__chan__desc.log_match(match_value.ctrl__chan__desc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__options.match(match_value.cell__options(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_options");
single_value->field_cell__options.log_match(match_value.cell__options(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__sel__par.match(match_value.cell__sel__par(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_sel_par");
single_value->field_cell__sel__par.log_match(match_value.cell__sel__par(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rach__control.match(match_value.rach__control(), legacy)){
TTCN_Logger::log_logmatch_info(".rach_control");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ cell_id := ");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::log_event_str(", lai := ");
single_value->field_lai.log_match(match_value.lai(), legacy);
TTCN_Logger::log_event_str(", ctrl_chan_desc := ");
single_value->field_ctrl__chan__desc.log_match(match_value.ctrl__chan__desc(), legacy);
TTCN_Logger::log_event_str(", cell_options := ");
single_value->field_cell__options.log_match(match_value.cell__options(), legacy);
TTCN_Logger::log_event_str(", cell_sel_par := ");
single_value->field_cell__sel__par.log_match(match_value.cell__sel__par(), legacy);
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType3_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (lai().is_bound()) lai().set_implicit_omit();
if (ctrl__chan__desc().is_bound()) ctrl__chan__desc().set_implicit_omit();
if (cell__options().is_bound()) cell__options().set_implicit_omit();
if (cell__sel__par().is_bound()) cell__sel__par().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

void SystemInformationType3_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cell__id.encode_text(text_buf);
single_value->field_lai.encode_text(text_buf);
single_value->field_ctrl__chan__desc.encode_text(text_buf);
single_value->field_cell__options.encode_text(text_buf);
single_value->field_cell__sel__par.encode_text(text_buf);
single_value->field_rach__control.encode_text(text_buf);
single_value->field_rest__octets.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @GSM_SystemInformation.SystemInformationType3.");
}
}

void SystemInformationType3_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_cell__id.decode_text(text_buf);
single_value->field_lai.decode_text(text_buf);
single_value->field_ctrl__chan__desc.decode_text(text_buf);
single_value->field_cell__options.decode_text(text_buf);
single_value->field_cell__sel__par.decode_text(text_buf);
single_value->field_rach__control.decode_text(text_buf);
single_value->field_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType3_template[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 @GSM_SystemInformation.SystemInformationType3.");
}
}

void SystemInformationType3_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: {
    SystemInformationType3_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @GSM_SystemInformation.SystemInformationType3 has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cell__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lai().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ctrl__chan__desc().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cell__options().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cell__sel__par().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rach__control().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rest__octets().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lai")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lai().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ctrl_chan_desc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ctrl__chan__desc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_options")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__options().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_sel_par")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__sel__par().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rach_control")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rach__control().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rest_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rest__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.SystemInformationType3: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SystemInformationType3_template* precondition = new SystemInformationType3_template;
    precondition->set_param(*param.get_elem(0));
    SystemInformationType3_template* implied_template = new SystemInformationType3_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SystemInformationType3_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@GSM_SystemInformation.SystemInformationType3");
  }
  is_ifpresent = param.get_ifpresent();
}

void SystemInformationType3_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_cell__id.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType3");
single_value->field_lai.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType3");
single_value->field_ctrl__chan__desc.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType3");
single_value->field_cell__options.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType3");
single_value->field_cell__sel__par.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType3");
single_value->field_rach__control.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType3");
single_value->field_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType3");
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 : "@GSM_SystemInformation.SystemInformationType3");
}

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

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

SystemInformationType4::SystemInformationType4()
{
}

SystemInformationType4::SystemInformationType4(const GSM__Types::LocationAreaIdentification& par_lai,
    const CellSelectionParameters& par_cell__sel__par,
    const RachControlParameters& par_rach__control,
    const OPTIONAL< GSM__RR__Types::ChannelDescriptionTV >& par_cbch__chan__desc,
    const OPTIONAL< GSM__RR__Types::MobileAllocationTLV >& par_cbch__mobile__alloc,
    const GSM__RestOctets::SI4RestOctets& par_rest__octets)
  :   field_lai(par_lai),
  field_cell__sel__par(par_cell__sel__par),
  field_rach__control(par_rach__control),
  field_cbch__chan__desc(par_cbch__chan__desc),
  field_cbch__mobile__alloc(par_cbch__mobile__alloc),
  field_rest__octets(par_rest__octets)
{
}

SystemInformationType4::SystemInformationType4(const SystemInformationType4& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType4.");
if (other_value.lai().is_bound()) field_lai = other_value.lai();
else field_lai.clean_up();
if (other_value.cell__sel__par().is_bound()) field_cell__sel__par = other_value.cell__sel__par();
else field_cell__sel__par.clean_up();
if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
else field_rach__control.clean_up();
if (other_value.cbch__chan__desc().is_bound()) field_cbch__chan__desc = other_value.cbch__chan__desc();
else field_cbch__chan__desc.clean_up();
if (other_value.cbch__mobile__alloc().is_bound()) field_cbch__mobile__alloc = other_value.cbch__mobile__alloc();
else field_cbch__mobile__alloc.clean_up();
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType4::clean_up()
{
field_lai.clean_up();
field_cell__sel__par.clean_up();
field_rach__control.clean_up();
field_cbch__chan__desc.clean_up();
field_cbch__mobile__alloc.clean_up();
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType4::get_descriptor() const { return &SystemInformationType4_descr_; }
SystemInformationType4& SystemInformationType4::operator=(const SystemInformationType4& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType4.");
  if (other_value.lai().is_bound()) field_lai = other_value.lai();
  else field_lai.clean_up();
  if (other_value.cell__sel__par().is_bound()) field_cell__sel__par = other_value.cell__sel__par();
  else field_cell__sel__par.clean_up();
  if (other_value.rach__control().is_bound()) field_rach__control = other_value.rach__control();
  else field_rach__control.clean_up();
  if (other_value.cbch__chan__desc().is_bound()) field_cbch__chan__desc = other_value.cbch__chan__desc();
  else field_cbch__chan__desc.clean_up();
  if (other_value.cbch__mobile__alloc().is_bound()) field_cbch__mobile__alloc = other_value.cbch__mobile__alloc();
  else field_cbch__mobile__alloc.clean_up();
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType4::operator==(const SystemInformationType4& other_value) const
{
return field_lai==other_value.field_lai
  && field_cell__sel__par==other_value.field_cell__sel__par
  && field_rach__control==other_value.field_rach__control
  && field_cbch__chan__desc==other_value.field_cbch__chan__desc
  && field_cbch__mobile__alloc==other_value.field_cbch__mobile__alloc
  && field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType4::is_bound() const
{
return (field_lai.is_bound())
  || (field_cell__sel__par.is_bound())
  || (field_rach__control.is_bound())
  || (OPTIONAL_OMIT == field_cbch__chan__desc.get_selection() || field_cbch__chan__desc.is_bound())
  || (OPTIONAL_OMIT == field_cbch__mobile__alloc.get_selection() || field_cbch__mobile__alloc.is_bound())
  || (field_rest__octets.is_bound());
}
boolean SystemInformationType4::is_value() const
{
return field_lai.is_value()
  && field_cell__sel__par.is_value()
  && field_rach__control.is_value()
  && (OPTIONAL_OMIT == field_cbch__chan__desc.get_selection() || field_cbch__chan__desc.is_value())
  && (OPTIONAL_OMIT == field_cbch__mobile__alloc.get_selection() || field_cbch__mobile__alloc.is_value())
  && field_rest__octets.is_value();
}
int SystemInformationType4::size_of() const
{
  int ret_val = 4;
  if (field_cbch__chan__desc.ispresent()) ret_val++;
  if (field_cbch__mobile__alloc.ispresent()) ret_val++;
  return ret_val;
}

void SystemInformationType4::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ lai := ");
field_lai.log();
TTCN_Logger::log_event_str(", cell_sel_par := ");
field_cell__sel__par.log();
TTCN_Logger::log_event_str(", rach_control := ");
field_rach__control.log();
TTCN_Logger::log_event_str(", cbch_chan_desc := ");
field_cbch__chan__desc.log();
TTCN_Logger::log_event_str(", cbch_mobile_alloc := ");
field_cbch__mobile__alloc.log();
TTCN_Logger::log_event_str(", rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType4::set_implicit_omit()
{
if (lai().is_bound()) lai().set_implicit_omit();
if (cell__sel__par().is_bound()) cell__sel__par().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (!cbch__chan__desc().is_bound()) cbch__chan__desc() = OMIT_VALUE;
else cbch__chan__desc().set_implicit_omit();
if (!cbch__mobile__alloc().is_bound()) cbch__mobile__alloc() = OMIT_VALUE;
else cbch__mobile__alloc().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

void SystemInformationType4::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record value of type @GSM_SystemInformation.SystemInformationType4 has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lai().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cell__sel__par().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rach__control().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cbch__chan__desc().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cbch__mobile__alloc().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rest__octets().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lai")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lai().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_sel_par")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__sel__par().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rach_control")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rach__control().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cbch_chan_desc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cbch__chan__desc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cbch_mobile_alloc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cbch__mobile__alloc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rest_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rest__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.SystemInformationType4: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@GSM_SystemInformation.SystemInformationType4");
  }
}

void SystemInformationType4::encode_text(Text_Buf& text_buf) const
{
field_lai.encode_text(text_buf);
field_cell__sel__par.encode_text(text_buf);
field_rach__control.encode_text(text_buf);
field_cbch__chan__desc.encode_text(text_buf);
field_cbch__mobile__alloc.encode_text(text_buf);
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType4::decode_text(Text_Buf& text_buf)
{
field_lai.decode_text(text_buf);
field_cell__sel__par.decode_text(text_buf);
field_rach__control.decode_text(text_buf);
field_cbch__chan__desc.decode_text(text_buf);
field_cbch__mobile__alloc.decode_text(text_buf);
field_rest__octets.decode_text(text_buf);
}

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

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

int SystemInformationType4::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, SystemInformationType4_lai_descr_.raw->forceomit);
  decoded_field_length = field_lai.RAW_decode(SystemInformationType4_lai_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, SystemInformationType4_cell__sel__par_descr_.raw->forceomit);
  decoded_field_length = field_cell__sel__par.RAW_decode(SystemInformationType4_cell__sel__par_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, SystemInformationType4_rach__control_descr_.raw->forceomit);
  decoded_field_length = field_rach__control.RAW_decode(SystemInformationType4_rach__control_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_cbch__chan__desc = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, SystemInformationType4_cbch__chan__desc_descr_.raw->forceomit);
  decoded_field_length = field_cbch__chan__desc().RAW_decode(SystemInformationType4_cbch__chan__desc_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_cbch__chan__desc = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cbch__chan__desc.ispresent() || field_cbch__chan__desc().iei() !=  os_0){
  field_cbch__chan__desc=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cbch__chan__desc=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_cbch__mobile__alloc = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, SystemInformationType4_cbch__mobile__alloc_descr_.raw->forceomit);
  decoded_field_length = field_cbch__mobile__alloc().RAW_decode(SystemInformationType4_cbch__mobile__alloc_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_cbch__mobile__alloc = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_cbch__mobile__alloc.ispresent() || field_cbch__mobile__alloc().iei() !=  os_1){
  field_cbch__mobile__alloc=OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  }
  else {
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  }
  }
  }
  }
  else field_cbch__mobile__alloc=OMIT_VALUE;
  RAW_Force_Omit field_5_force_omit(5, force_omit, SystemInformationType4_rest__octets_descr_.raw->forceomit);
  decoded_field_length = field_rest__octets.RAW_decode(SystemInformationType4_rest__octets_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SystemInformationType4::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 6;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(6);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SystemInformationType4_lai_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SystemInformationType4_cell__sel__par_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SystemInformationType4_rach__control_descr_.raw);
  if (field_cbch__chan__desc.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SystemInformationType4_cbch__chan__desc_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_cbch__mobile__alloc.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SystemInformationType4_cbch__mobile__alloc_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, SystemInformationType4_rest__octets_descr_.raw);
  encoded_length += field_lai.RAW_encode(SystemInformationType4_lai_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cell__sel__par.RAW_encode(SystemInformationType4_cell__sel__par_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rach__control.RAW_encode(SystemInformationType4_rach__control_descr_, *myleaf.body.node.nodes[2]);
  if (field_cbch__chan__desc.ispresent()) {
  encoded_length += field_cbch__chan__desc().RAW_encode(SystemInformationType4_cbch__chan__desc_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_cbch__mobile__alloc.ispresent()) {
  encoded_length += field_cbch__mobile__alloc().RAW_encode(SystemInformationType4_cbch__mobile__alloc_descr_, *myleaf.body.node.nodes[4]);
  }
  encoded_length += field_rest__octets.RAW_encode(SystemInformationType4_rest__octets_descr_, *myleaf.body.node.nodes[5]);
  if (field_cbch__chan__desc.ispresent() && (!field_cbch__chan__desc.ispresent() || field_cbch__chan__desc().iei() !=  os_0)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_0.RAW_encode(GSM__RR__Types::ChannelDescriptionTV_iei_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  if (field_cbch__mobile__alloc.ispresent() && (!field_cbch__mobile__alloc.ispresent() || field_cbch__mobile__alloc().iei() !=  os_1)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={4,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_1.RAW_encode(GSM__RR__Types::MobileAllocationTLV_iei_descr_,*temp_leaf);
  } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  }
  free_tree_pos(pr_pos0.pos);
  }
  }
  return myleaf.length = encoded_length;
}

struct SystemInformationType4_template::single_value_struct {
GSM__Types::LocationAreaIdentification_template field_lai;
CellSelectionParameters_template field_cell__sel__par;
RachControlParameters_template field_rach__control;
GSM__RR__Types::ChannelDescriptionTV_template field_cbch__chan__desc;
GSM__RR__Types::MobileAllocationTLV_template field_cbch__mobile__alloc;
GSM__RestOctets::SI4RestOctets_template field_rest__octets;
};

void SystemInformationType4_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_lai = ANY_VALUE;
single_value->field_cell__sel__par = ANY_VALUE;
single_value->field_rach__control = ANY_VALUE;
single_value->field_cbch__chan__desc = ANY_OR_OMIT;
single_value->field_cbch__mobile__alloc = ANY_OR_OMIT;
single_value->field_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType4_template::copy_value(const SystemInformationType4& other_value)
{
single_value = new single_value_struct;
if (other_value.lai().is_bound()) {
  single_value->field_lai = other_value.lai();
} else {
  single_value->field_lai.clean_up();
}
if (other_value.cell__sel__par().is_bound()) {
  single_value->field_cell__sel__par = other_value.cell__sel__par();
} else {
  single_value->field_cell__sel__par.clean_up();
}
if (other_value.rach__control().is_bound()) {
  single_value->field_rach__control = other_value.rach__control();
} else {
  single_value->field_rach__control.clean_up();
}
if (other_value.cbch__chan__desc().is_bound()) {
  if (other_value.cbch__chan__desc().ispresent()) single_value->field_cbch__chan__desc = other_value.cbch__chan__desc()();
  else single_value->field_cbch__chan__desc = OMIT_VALUE;
} else {
  single_value->field_cbch__chan__desc.clean_up();
}
if (other_value.cbch__mobile__alloc().is_bound()) {
  if (other_value.cbch__mobile__alloc().ispresent()) single_value->field_cbch__mobile__alloc = other_value.cbch__mobile__alloc()();
  else single_value->field_cbch__mobile__alloc = OMIT_VALUE;
} else {
  single_value->field_cbch__mobile__alloc.clean_up();
}
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType4_template::copy_template(const SystemInformationType4_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.lai().get_selection()) {
single_value->field_lai = other_value.lai();
} else {
single_value->field_lai.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__sel__par().get_selection()) {
single_value->field_cell__sel__par = other_value.cell__sel__par();
} else {
single_value->field_cell__sel__par.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rach__control().get_selection()) {
single_value->field_rach__control = other_value.rach__control();
} else {
single_value->field_rach__control.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cbch__chan__desc().get_selection()) {
single_value->field_cbch__chan__desc = other_value.cbch__chan__desc();
} else {
single_value->field_cbch__chan__desc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cbch__mobile__alloc().get_selection()) {
single_value->field_cbch__mobile__alloc = other_value.cbch__mobile__alloc();
} else {
single_value->field_cbch__mobile__alloc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType4_template[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 SystemInformationType4_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType4_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 @GSM_SystemInformation.SystemInformationType4.");
break;
}
set_selection(other_value);
}

SystemInformationType4_template::SystemInformationType4_template()
{
}

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

SystemInformationType4_template::SystemInformationType4_template(const SystemInformationType4& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformationType4_template::match(const SystemInformationType4& 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.lai().is_bound()) return FALSE;
if(!single_value->field_lai.match(other_value.lai(), legacy))return FALSE;
if(!other_value.cell__sel__par().is_bound()) return FALSE;
if(!single_value->field_cell__sel__par.match(other_value.cell__sel__par(), legacy))return FALSE;
if(!other_value.rach__control().is_bound()) return FALSE;
if(!single_value->field_rach__control.match(other_value.rach__control(), legacy))return FALSE;
if(!other_value.cbch__chan__desc().is_bound()) return FALSE;
if((other_value.cbch__chan__desc().ispresent() ? !single_value->field_cbch__chan__desc.match((const GSM__RR__Types::ChannelDescriptionTV&)other_value.cbch__chan__desc(), legacy) : !single_value->field_cbch__chan__desc.match_omit(legacy)))return FALSE;
if(!other_value.cbch__mobile__alloc().is_bound()) return FALSE;
if((other_value.cbch__mobile__alloc().ispresent() ? !single_value->field_cbch__mobile__alloc.match((const GSM__RR__Types::MobileAllocationTLV&)other_value.cbch__mobile__alloc(), legacy) : !single_value->field_cbch__mobile__alloc.match_omit(legacy)))return FALSE;
if(!other_value.rest__octets().is_bound()) return FALSE;
if(!single_value->field_rest__octets.match(other_value.rest__octets(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @GSM_SystemInformation.SystemInformationType4.");
}
return FALSE;
}

boolean SystemInformationType4_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_lai.is_bound()
 || single_value->field_cell__sel__par.is_bound()
 || single_value->field_rach__control.is_bound()
 || (single_value->field_cbch__chan__desc.is_omit() || single_value->field_cbch__chan__desc.is_bound())
 || (single_value->field_cbch__mobile__alloc.is_omit() || single_value->field_cbch__mobile__alloc.is_bound())
 || single_value->field_rest__octets.is_bound();
}

boolean SystemInformationType4_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_lai.is_value()
 && single_value->field_cell__sel__par.is_value()
 && single_value->field_rach__control.is_value()
 && (single_value->field_cbch__chan__desc.is_omit() || single_value->field_cbch__chan__desc.is_value())
 && (single_value->field_cbch__mobile__alloc.is_omit() || single_value->field_cbch__mobile__alloc.is_value())
 && single_value->field_rest__octets.is_value();
}

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

SystemInformationType4 SystemInformationType4_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 @GSM_SystemInformation.SystemInformationType4.");
SystemInformationType4 ret_val;
if (single_value->field_lai.is_bound()) {
ret_val.lai() = single_value->field_lai.valueof();
}
if (single_value->field_cell__sel__par.is_bound()) {
ret_val.cell__sel__par() = single_value->field_cell__sel__par.valueof();
}
if (single_value->field_rach__control.is_bound()) {
ret_val.rach__control() = single_value->field_rach__control.valueof();
}
if (single_value->field_cbch__chan__desc.is_omit()) ret_val.cbch__chan__desc() = OMIT_VALUE;
else if (single_value->field_cbch__chan__desc.is_bound()) {
ret_val.cbch__chan__desc() = single_value->field_cbch__chan__desc.valueof();
}
if (single_value->field_cbch__mobile__alloc.is_omit()) ret_val.cbch__mobile__alloc() = OMIT_VALUE;
else if (single_value->field_cbch__mobile__alloc.is_bound()) {
ret_val.cbch__mobile__alloc() = single_value->field_cbch__mobile__alloc.valueof();
}
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType4_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 @GSM_SystemInformation.SystemInformationType4.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType4_template[list_length];
}

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

GSM__Types::LocationAreaIdentification_template& SystemInformationType4_template::lai()
{
set_specific();
return single_value->field_lai;
}

const GSM__Types::LocationAreaIdentification_template& SystemInformationType4_template::lai() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lai of a non-specific template of type @GSM_SystemInformation.SystemInformationType4.");
return single_value->field_lai;
}

CellSelectionParameters_template& SystemInformationType4_template::cell__sel__par()
{
set_specific();
return single_value->field_cell__sel__par;
}

const CellSelectionParameters_template& SystemInformationType4_template::cell__sel__par() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_sel_par of a non-specific template of type @GSM_SystemInformation.SystemInformationType4.");
return single_value->field_cell__sel__par;
}

RachControlParameters_template& SystemInformationType4_template::rach__control()
{
set_specific();
return single_value->field_rach__control;
}

const RachControlParameters_template& SystemInformationType4_template::rach__control() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rach_control of a non-specific template of type @GSM_SystemInformation.SystemInformationType4.");
return single_value->field_rach__control;
}

GSM__RR__Types::ChannelDescriptionTV_template& SystemInformationType4_template::cbch__chan__desc()
{
set_specific();
return single_value->field_cbch__chan__desc;
}

const GSM__RR__Types::ChannelDescriptionTV_template& SystemInformationType4_template::cbch__chan__desc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cbch_chan_desc of a non-specific template of type @GSM_SystemInformation.SystemInformationType4.");
return single_value->field_cbch__chan__desc;
}

GSM__RR__Types::MobileAllocationTLV_template& SystemInformationType4_template::cbch__mobile__alloc()
{
set_specific();
return single_value->field_cbch__mobile__alloc;
}

const GSM__RR__Types::MobileAllocationTLV_template& SystemInformationType4_template::cbch__mobile__alloc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cbch_mobile_alloc of a non-specific template of type @GSM_SystemInformation.SystemInformationType4.");
return single_value->field_cbch__mobile__alloc;
}

GSM__RestOctets::SI4RestOctets_template& SystemInformationType4_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const GSM__RestOctets::SI4RestOctets_template& SystemInformationType4_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType4.");
return single_value->field_rest__octets;
}

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

void SystemInformationType4_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ lai := ");
single_value->field_lai.log();
TTCN_Logger::log_event_str(", cell_sel_par := ");
single_value->field_cell__sel__par.log();
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.log();
TTCN_Logger::log_event_str(", cbch_chan_desc := ");
single_value->field_cbch__chan__desc.log();
TTCN_Logger::log_event_str(", cbch_mobile_alloc := ");
single_value->field_cbch__mobile__alloc.log();
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SystemInformationType4_template::log_match(const SystemInformationType4& 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_lai.match(match_value.lai(), legacy)){
TTCN_Logger::log_logmatch_info(".lai");
single_value->field_lai.log_match(match_value.lai(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__sel__par.match(match_value.cell__sel__par(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_sel_par");
single_value->field_cell__sel__par.log_match(match_value.cell__sel__par(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rach__control.match(match_value.rach__control(), legacy)){
TTCN_Logger::log_logmatch_info(".rach_control");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cbch__chan__desc().ispresent()){
if(!single_value->field_cbch__chan__desc.match(match_value.cbch__chan__desc(), legacy)){
TTCN_Logger::log_logmatch_info(".cbch_chan_desc");
single_value->field_cbch__chan__desc.log_match(match_value.cbch__chan__desc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cbch__chan__desc.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cbch_chan_desc := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cbch__chan__desc.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cbch__mobile__alloc().ispresent()){
if(!single_value->field_cbch__mobile__alloc.match(match_value.cbch__mobile__alloc(), legacy)){
TTCN_Logger::log_logmatch_info(".cbch_mobile_alloc");
single_value->field_cbch__mobile__alloc.log_match(match_value.cbch__mobile__alloc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cbch__mobile__alloc.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cbch_mobile_alloc := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cbch__mobile__alloc.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ lai := ");
single_value->field_lai.log_match(match_value.lai(), legacy);
TTCN_Logger::log_event_str(", cell_sel_par := ");
single_value->field_cell__sel__par.log_match(match_value.cell__sel__par(), legacy);
TTCN_Logger::log_event_str(", rach_control := ");
single_value->field_rach__control.log_match(match_value.rach__control(), legacy);
TTCN_Logger::log_event_str(", cbch_chan_desc := ");
if (match_value.cbch__chan__desc().ispresent()) {
single_value->field_cbch__chan__desc.log_match(match_value.cbch__chan__desc(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cbch__chan__desc.log();
if (single_value->field_cbch__chan__desc.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cbch_mobile_alloc := ");
if (match_value.cbch__mobile__alloc().ispresent()) {
single_value->field_cbch__mobile__alloc.log_match(match_value.cbch__mobile__alloc(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cbch__mobile__alloc.log();
if (single_value->field_cbch__mobile__alloc.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType4_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (lai().is_bound()) lai().set_implicit_omit();
if (cell__sel__par().is_bound()) cell__sel__par().set_implicit_omit();
if (rach__control().is_bound()) rach__control().set_implicit_omit();
if (!cbch__chan__desc().is_bound()) cbch__chan__desc() = OMIT_VALUE;
else cbch__chan__desc().set_implicit_omit();
if (!cbch__mobile__alloc().is_bound()) cbch__mobile__alloc() = OMIT_VALUE;
else cbch__mobile__alloc().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

void SystemInformationType4_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_lai.encode_text(text_buf);
single_value->field_cell__sel__par.encode_text(text_buf);
single_value->field_rach__control.encode_text(text_buf);
single_value->field_cbch__chan__desc.encode_text(text_buf);
single_value->field_cbch__mobile__alloc.encode_text(text_buf);
single_value->field_rest__octets.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @GSM_SystemInformation.SystemInformationType4.");
}
}

void SystemInformationType4_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_lai.decode_text(text_buf);
single_value->field_cell__sel__par.decode_text(text_buf);
single_value->field_rach__control.decode_text(text_buf);
single_value->field_cbch__chan__desc.decode_text(text_buf);
single_value->field_cbch__mobile__alloc.decode_text(text_buf);
single_value->field_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType4_template[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 @GSM_SystemInformation.SystemInformationType4.");
}
}

void SystemInformationType4_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: {
    SystemInformationType4_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @GSM_SystemInformation.SystemInformationType4 has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) lai().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cell__sel__par().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) rach__control().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cbch__chan__desc().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cbch__mobile__alloc().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rest__octets().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lai")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lai().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_sel_par")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__sel__par().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rach_control")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rach__control().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cbch_chan_desc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cbch__chan__desc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cbch_mobile_alloc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cbch__mobile__alloc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rest_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rest__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.SystemInformationType4: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SystemInformationType4_template* precondition = new SystemInformationType4_template;
    precondition->set_param(*param.get_elem(0));
    SystemInformationType4_template* implied_template = new SystemInformationType4_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SystemInformationType4_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@GSM_SystemInformation.SystemInformationType4");
  }
  is_ifpresent = param.get_ifpresent();
}

void SystemInformationType4_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_lai.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType4");
single_value->field_cell__sel__par.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType4");
single_value->field_rach__control.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType4");
single_value->field_cbch__chan__desc.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType4");
single_value->field_cbch__mobile__alloc.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType4");
single_value->field_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType4");
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 : "@GSM_SystemInformation.SystemInformationType4");
}

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

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

SystemInformationType5::SystemInformationType5()
{
}

SystemInformationType5::SystemInformationType5(const OCTETSTRING& par_bcch__freq__list)
  :   field_bcch__freq__list(par_bcch__freq__list)
{
}

SystemInformationType5::SystemInformationType5(const SystemInformationType5& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType5.");
if (other_value.bcch__freq__list().is_bound()) field_bcch__freq__list = other_value.bcch__freq__list();
else field_bcch__freq__list.clean_up();
}

void SystemInformationType5::clean_up()
{
field_bcch__freq__list.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType5::get_descriptor() const { return &SystemInformationType5_descr_; }
SystemInformationType5& SystemInformationType5::operator=(const SystemInformationType5& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType5.");
  if (other_value.bcch__freq__list().is_bound()) field_bcch__freq__list = other_value.bcch__freq__list();
  else field_bcch__freq__list.clean_up();
}
return *this;
}

boolean SystemInformationType5::operator==(const SystemInformationType5& other_value) const
{
return field_bcch__freq__list==other_value.field_bcch__freq__list;
}

boolean SystemInformationType5::is_bound() const
{
return (field_bcch__freq__list.is_bound());
}
boolean SystemInformationType5::is_value() const
{
return field_bcch__freq__list.is_value();
}
void SystemInformationType5::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bcch_freq_list := ");
field_bcch__freq__list.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType5::set_implicit_omit()
{
if (bcch__freq__list().is_bound()) bcch__freq__list().set_implicit_omit();
}

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

void SystemInformationType5::encode_text(Text_Buf& text_buf) const
{
field_bcch__freq__list.encode_text(text_buf);
}

void SystemInformationType5::decode_text(Text_Buf& text_buf)
{
field_bcch__freq__list.decode_text(text_buf);
}

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

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

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

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

struct SystemInformationType5_template::single_value_struct {
OCTETSTRING_template field_bcch__freq__list;
};

void SystemInformationType5_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_bcch__freq__list = ANY_VALUE;
}
}
}

void SystemInformationType5_template::copy_value(const SystemInformationType5& other_value)
{
single_value = new single_value_struct;
if (other_value.bcch__freq__list().is_bound()) {
  single_value->field_bcch__freq__list = other_value.bcch__freq__list();
} else {
  single_value->field_bcch__freq__list.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType5_template::copy_template(const SystemInformationType5_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bcch__freq__list().get_selection()) {
single_value->field_bcch__freq__list = other_value.bcch__freq__list();
} else {
single_value->field_bcch__freq__list.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType5_template[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 SystemInformationType5_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType5_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 @GSM_SystemInformation.SystemInformationType5.");
break;
}
set_selection(other_value);
}

SystemInformationType5_template::SystemInformationType5_template()
{
}

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

SystemInformationType5_template::SystemInformationType5_template(const SystemInformationType5& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformationType5_template::match(const SystemInformationType5& 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.bcch__freq__list().is_bound()) return FALSE;
if(!single_value->field_bcch__freq__list.match(other_value.bcch__freq__list(), 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 @GSM_SystemInformation.SystemInformationType5.");
}
return FALSE;
}

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

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

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

SystemInformationType5 SystemInformationType5_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 @GSM_SystemInformation.SystemInformationType5.");
SystemInformationType5 ret_val;
if (single_value->field_bcch__freq__list.is_bound()) {
ret_val.bcch__freq__list() = single_value->field_bcch__freq__list.valueof();
}
return ret_val;
}

void SystemInformationType5_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 @GSM_SystemInformation.SystemInformationType5.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType5_template[list_length];
}

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

OCTETSTRING_template& SystemInformationType5_template::bcch__freq__list()
{
set_specific();
return single_value->field_bcch__freq__list;
}

const OCTETSTRING_template& SystemInformationType5_template::bcch__freq__list() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bcch_freq_list of a non-specific template of type @GSM_SystemInformation.SystemInformationType5.");
return single_value->field_bcch__freq__list;
}

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

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

void SystemInformationType5_template::log_match(const SystemInformationType5& 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_bcch__freq__list.match(match_value.bcch__freq__list(), legacy)){
TTCN_Logger::log_logmatch_info(".bcch_freq_list");
single_value->field_bcch__freq__list.log_match(match_value.bcch__freq__list(), 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("{ bcch_freq_list := ");
single_value->field_bcch__freq__list.log_match(match_value.bcch__freq__list(), 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 SystemInformationType5_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bcch__freq__list().is_bound()) bcch__freq__list().set_implicit_omit();
}

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

void SystemInformationType5_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_bcch__freq__list.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType5_template[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 @GSM_SystemInformation.SystemInformationType5.");
}
}

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

void SystemInformationType5_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_bcch__freq__list.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType5");
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 : "@GSM_SystemInformation.SystemInformationType5");
}

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

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

SystemInformationType5bis::SystemInformationType5bis()
{
}

SystemInformationType5bis::SystemInformationType5bis(const OCTETSTRING& par_extd__bcch__freq__list)
  :   field_extd__bcch__freq__list(par_extd__bcch__freq__list)
{
}

SystemInformationType5bis::SystemInformationType5bis(const SystemInformationType5bis& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType5bis.");
if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
else field_extd__bcch__freq__list.clean_up();
}

void SystemInformationType5bis::clean_up()
{
field_extd__bcch__freq__list.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType5bis::get_descriptor() const { return &SystemInformationType5bis_descr_; }
SystemInformationType5bis& SystemInformationType5bis::operator=(const SystemInformationType5bis& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType5bis.");
  if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
  else field_extd__bcch__freq__list.clean_up();
}
return *this;
}

boolean SystemInformationType5bis::operator==(const SystemInformationType5bis& other_value) const
{
return field_extd__bcch__freq__list==other_value.field_extd__bcch__freq__list;
}

boolean SystemInformationType5bis::is_bound() const
{
return (field_extd__bcch__freq__list.is_bound());
}
boolean SystemInformationType5bis::is_value() const
{
return field_extd__bcch__freq__list.is_value();
}
void SystemInformationType5bis::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ extd_bcch_freq_list := ");
field_extd__bcch__freq__list.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType5bis::set_implicit_omit()
{
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
}

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

void SystemInformationType5bis::encode_text(Text_Buf& text_buf) const
{
field_extd__bcch__freq__list.encode_text(text_buf);
}

void SystemInformationType5bis::decode_text(Text_Buf& text_buf)
{
field_extd__bcch__freq__list.decode_text(text_buf);
}

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

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

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

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

struct SystemInformationType5bis_template::single_value_struct {
OCTETSTRING_template field_extd__bcch__freq__list;
};

void SystemInformationType5bis_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_extd__bcch__freq__list = ANY_VALUE;
}
}
}

void SystemInformationType5bis_template::copy_value(const SystemInformationType5bis& other_value)
{
single_value = new single_value_struct;
if (other_value.extd__bcch__freq__list().is_bound()) {
  single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
  single_value->field_extd__bcch__freq__list.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType5bis_template::copy_template(const SystemInformationType5bis_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.extd__bcch__freq__list().get_selection()) {
single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
single_value->field_extd__bcch__freq__list.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType5bis_template[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 SystemInformationType5bis_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType5bis_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 @GSM_SystemInformation.SystemInformationType5bis.");
break;
}
set_selection(other_value);
}

SystemInformationType5bis_template::SystemInformationType5bis_template()
{
}

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

SystemInformationType5bis_template::SystemInformationType5bis_template(const SystemInformationType5bis& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformationType5bis_template::match(const SystemInformationType5bis& 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.extd__bcch__freq__list().is_bound()) return FALSE;
if(!single_value->field_extd__bcch__freq__list.match(other_value.extd__bcch__freq__list(), 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 @GSM_SystemInformation.SystemInformationType5bis.");
}
return FALSE;
}

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

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

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

SystemInformationType5bis SystemInformationType5bis_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 @GSM_SystemInformation.SystemInformationType5bis.");
SystemInformationType5bis ret_val;
if (single_value->field_extd__bcch__freq__list.is_bound()) {
ret_val.extd__bcch__freq__list() = single_value->field_extd__bcch__freq__list.valueof();
}
return ret_val;
}

void SystemInformationType5bis_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 @GSM_SystemInformation.SystemInformationType5bis.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType5bis_template[list_length];
}

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

OCTETSTRING_template& SystemInformationType5bis_template::extd__bcch__freq__list()
{
set_specific();
return single_value->field_extd__bcch__freq__list;
}

const OCTETSTRING_template& SystemInformationType5bis_template::extd__bcch__freq__list() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extd_bcch_freq_list of a non-specific template of type @GSM_SystemInformation.SystemInformationType5bis.");
return single_value->field_extd__bcch__freq__list;
}

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

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

void SystemInformationType5bis_template::log_match(const SystemInformationType5bis& 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_extd__bcch__freq__list.match(match_value.extd__bcch__freq__list(), legacy)){
TTCN_Logger::log_logmatch_info(".extd_bcch_freq_list");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), 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("{ extd_bcch_freq_list := ");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), 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 SystemInformationType5bis_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
}

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

void SystemInformationType5bis_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_extd__bcch__freq__list.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType5bis_template[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 @GSM_SystemInformation.SystemInformationType5bis.");
}
}

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

void SystemInformationType5bis_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_extd__bcch__freq__list.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType5bis");
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 : "@GSM_SystemInformation.SystemInformationType5bis");
}

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

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

SystemInformationType5ter::SystemInformationType5ter()
{
}

SystemInformationType5ter::SystemInformationType5ter(const OCTETSTRING& par_extd__bcch__freq__list)
  :   field_extd__bcch__freq__list(par_extd__bcch__freq__list)
{
}

SystemInformationType5ter::SystemInformationType5ter(const SystemInformationType5ter& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType5ter.");
if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
else field_extd__bcch__freq__list.clean_up();
}

void SystemInformationType5ter::clean_up()
{
field_extd__bcch__freq__list.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType5ter::get_descriptor() const { return &SystemInformationType5ter_descr_; }
SystemInformationType5ter& SystemInformationType5ter::operator=(const SystemInformationType5ter& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType5ter.");
  if (other_value.extd__bcch__freq__list().is_bound()) field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
  else field_extd__bcch__freq__list.clean_up();
}
return *this;
}

boolean SystemInformationType5ter::operator==(const SystemInformationType5ter& other_value) const
{
return field_extd__bcch__freq__list==other_value.field_extd__bcch__freq__list;
}

boolean SystemInformationType5ter::is_bound() const
{
return (field_extd__bcch__freq__list.is_bound());
}
boolean SystemInformationType5ter::is_value() const
{
return field_extd__bcch__freq__list.is_value();
}
void SystemInformationType5ter::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ extd_bcch_freq_list := ");
field_extd__bcch__freq__list.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType5ter::set_implicit_omit()
{
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
}

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

void SystemInformationType5ter::encode_text(Text_Buf& text_buf) const
{
field_extd__bcch__freq__list.encode_text(text_buf);
}

void SystemInformationType5ter::decode_text(Text_Buf& text_buf)
{
field_extd__bcch__freq__list.decode_text(text_buf);
}

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

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

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

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

struct SystemInformationType5ter_template::single_value_struct {
OCTETSTRING_template field_extd__bcch__freq__list;
};

void SystemInformationType5ter_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_extd__bcch__freq__list = ANY_VALUE;
}
}
}

void SystemInformationType5ter_template::copy_value(const SystemInformationType5ter& other_value)
{
single_value = new single_value_struct;
if (other_value.extd__bcch__freq__list().is_bound()) {
  single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
  single_value->field_extd__bcch__freq__list.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType5ter_template::copy_template(const SystemInformationType5ter_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.extd__bcch__freq__list().get_selection()) {
single_value->field_extd__bcch__freq__list = other_value.extd__bcch__freq__list();
} else {
single_value->field_extd__bcch__freq__list.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType5ter_template[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 SystemInformationType5ter_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType5ter_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 @GSM_SystemInformation.SystemInformationType5ter.");
break;
}
set_selection(other_value);
}

SystemInformationType5ter_template::SystemInformationType5ter_template()
{
}

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

SystemInformationType5ter_template::SystemInformationType5ter_template(const SystemInformationType5ter& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformationType5ter_template::match(const SystemInformationType5ter& 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.extd__bcch__freq__list().is_bound()) return FALSE;
if(!single_value->field_extd__bcch__freq__list.match(other_value.extd__bcch__freq__list(), 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 @GSM_SystemInformation.SystemInformationType5ter.");
}
return FALSE;
}

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

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

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

SystemInformationType5ter SystemInformationType5ter_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 @GSM_SystemInformation.SystemInformationType5ter.");
SystemInformationType5ter ret_val;
if (single_value->field_extd__bcch__freq__list.is_bound()) {
ret_val.extd__bcch__freq__list() = single_value->field_extd__bcch__freq__list.valueof();
}
return ret_val;
}

void SystemInformationType5ter_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 @GSM_SystemInformation.SystemInformationType5ter.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType5ter_template[list_length];
}

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

OCTETSTRING_template& SystemInformationType5ter_template::extd__bcch__freq__list()
{
set_specific();
return single_value->field_extd__bcch__freq__list;
}

const OCTETSTRING_template& SystemInformationType5ter_template::extd__bcch__freq__list() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extd_bcch_freq_list of a non-specific template of type @GSM_SystemInformation.SystemInformationType5ter.");
return single_value->field_extd__bcch__freq__list;
}

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

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

void SystemInformationType5ter_template::log_match(const SystemInformationType5ter& 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_extd__bcch__freq__list.match(match_value.extd__bcch__freq__list(), legacy)){
TTCN_Logger::log_logmatch_info(".extd_bcch_freq_list");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), 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("{ extd_bcch_freq_list := ");
single_value->field_extd__bcch__freq__list.log_match(match_value.extd__bcch__freq__list(), 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 SystemInformationType5ter_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (extd__bcch__freq__list().is_bound()) extd__bcch__freq__list().set_implicit_omit();
}

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

void SystemInformationType5ter_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_extd__bcch__freq__list.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType5ter_template[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 @GSM_SystemInformation.SystemInformationType5ter.");
}
}

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

void SystemInformationType5ter_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_extd__bcch__freq__list.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType5ter");
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 : "@GSM_SystemInformation.SystemInformationType5ter");
}

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

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

SystemInformationType6::SystemInformationType6()
{
}

SystemInformationType6::SystemInformationType6(const INTEGER& par_cell__id,
    const GSM__Types::LocationAreaIdentification& par_lai,
    const CellOptionsSacch& par_cell__options,
    const BITSTRING& par_ncc__permitted,
    const GSM__RestOctets::SI6RestOctets& par_rest__octets)
  :   field_cell__id(par_cell__id),
  field_lai(par_lai),
  field_cell__options(par_cell__options),
  field_ncc__permitted(par_ncc__permitted),
  field_rest__octets(par_rest__octets)
{
}

SystemInformationType6::SystemInformationType6(const SystemInformationType6& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType6.");
if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
else field_cell__id.clean_up();
if (other_value.lai().is_bound()) field_lai = other_value.lai();
else field_lai.clean_up();
if (other_value.cell__options().is_bound()) field_cell__options = other_value.cell__options();
else field_cell__options.clean_up();
if (other_value.ncc__permitted().is_bound()) field_ncc__permitted = other_value.ncc__permitted();
else field_ncc__permitted.clean_up();
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType6::clean_up()
{
field_cell__id.clean_up();
field_lai.clean_up();
field_cell__options.clean_up();
field_ncc__permitted.clean_up();
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType6::get_descriptor() const { return &SystemInformationType6_descr_; }
SystemInformationType6& SystemInformationType6::operator=(const SystemInformationType6& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType6.");
  if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
  else field_cell__id.clean_up();
  if (other_value.lai().is_bound()) field_lai = other_value.lai();
  else field_lai.clean_up();
  if (other_value.cell__options().is_bound()) field_cell__options = other_value.cell__options();
  else field_cell__options.clean_up();
  if (other_value.ncc__permitted().is_bound()) field_ncc__permitted = other_value.ncc__permitted();
  else field_ncc__permitted.clean_up();
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType6::operator==(const SystemInformationType6& other_value) const
{
return field_cell__id==other_value.field_cell__id
  && field_lai==other_value.field_lai
  && field_cell__options==other_value.field_cell__options
  && field_ncc__permitted==other_value.field_ncc__permitted
  && field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType6::is_bound() const
{
return (field_cell__id.is_bound())
  || (field_lai.is_bound())
  || (field_cell__options.is_bound())
  || (field_ncc__permitted.is_bound())
  || (field_rest__octets.is_bound());
}
boolean SystemInformationType6::is_value() const
{
return field_cell__id.is_value()
  && field_lai.is_value()
  && field_cell__options.is_value()
  && field_ncc__permitted.is_value()
  && field_rest__octets.is_value();
}
void SystemInformationType6::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cell_id := ");
field_cell__id.log();
TTCN_Logger::log_event_str(", lai := ");
field_lai.log();
TTCN_Logger::log_event_str(", cell_options := ");
field_cell__options.log();
TTCN_Logger::log_event_str(", ncc_permitted := ");
field_ncc__permitted.log();
TTCN_Logger::log_event_str(", rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType6::set_implicit_omit()
{
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (lai().is_bound()) lai().set_implicit_omit();
if (cell__options().is_bound()) cell__options().set_implicit_omit();
if (ncc__permitted().is_bound()) ncc__permitted().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

void SystemInformationType6::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 @GSM_SystemInformation.SystemInformationType6 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) cell__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lai().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cell__options().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ncc__permitted().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rest__octets().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(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lai")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lai().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_options")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__options().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ncc_permitted")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ncc__permitted().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rest_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rest__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.SystemInformationType6: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@GSM_SystemInformation.SystemInformationType6");
  }
}

void SystemInformationType6::encode_text(Text_Buf& text_buf) const
{
field_cell__id.encode_text(text_buf);
field_lai.encode_text(text_buf);
field_cell__options.encode_text(text_buf);
field_ncc__permitted.encode_text(text_buf);
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType6::decode_text(Text_Buf& text_buf)
{
field_cell__id.decode_text(text_buf);
field_lai.decode_text(text_buf);
field_cell__options.decode_text(text_buf);
field_ncc__permitted.decode_text(text_buf);
field_rest__octets.decode_text(text_buf);
}

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

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

int SystemInformationType6::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, SystemInformationType6_cell__id_descr_.raw->forceomit);
  decoded_field_length = field_cell__id.RAW_decode(SystemInformationType6_cell__id_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, SystemInformationType6_lai_descr_.raw->forceomit);
  decoded_field_length = field_lai.RAW_decode(SystemInformationType6_lai_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, SystemInformationType6_cell__options_descr_.raw->forceomit);
  decoded_field_length = field_cell__options.RAW_decode(SystemInformationType6_cell__options_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, SystemInformationType6_ncc__permitted_descr_.raw->forceomit);
  decoded_field_length = field_ncc__permitted.RAW_decode(SystemInformationType6_ncc__permitted_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, SystemInformationType6_rest__octets_descr_.raw->forceomit);
  decoded_field_length = field_rest__octets.RAW_decode(SystemInformationType6_rest__octets_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 SystemInformationType6::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, SystemInformationType6_cell__id_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SystemInformationType6_lai_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, SystemInformationType6_cell__options_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, SystemInformationType6_ncc__permitted_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, SystemInformationType6_rest__octets_descr_.raw);
  encoded_length += field_cell__id.RAW_encode(SystemInformationType6_cell__id_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_lai.RAW_encode(SystemInformationType6_lai_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cell__options.RAW_encode(SystemInformationType6_cell__options_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_ncc__permitted.RAW_encode(SystemInformationType6_ncc__permitted_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_rest__octets.RAW_encode(SystemInformationType6_rest__octets_descr_, *myleaf.body.node.nodes[4]);
  return myleaf.length = encoded_length;
}

struct SystemInformationType6_template::single_value_struct {
INTEGER_template field_cell__id;
GSM__Types::LocationAreaIdentification_template field_lai;
CellOptionsSacch_template field_cell__options;
BITSTRING_template field_ncc__permitted;
GSM__RestOctets::SI6RestOctets_template field_rest__octets;
};

void SystemInformationType6_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_cell__id = ANY_VALUE;
single_value->field_lai = ANY_VALUE;
single_value->field_cell__options = ANY_VALUE;
single_value->field_ncc__permitted = ANY_VALUE;
single_value->field_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType6_template::copy_value(const SystemInformationType6& other_value)
{
single_value = new single_value_struct;
if (other_value.cell__id().is_bound()) {
  single_value->field_cell__id = other_value.cell__id();
} else {
  single_value->field_cell__id.clean_up();
}
if (other_value.lai().is_bound()) {
  single_value->field_lai = other_value.lai();
} else {
  single_value->field_lai.clean_up();
}
if (other_value.cell__options().is_bound()) {
  single_value->field_cell__options = other_value.cell__options();
} else {
  single_value->field_cell__options.clean_up();
}
if (other_value.ncc__permitted().is_bound()) {
  single_value->field_ncc__permitted = other_value.ncc__permitted();
} else {
  single_value->field_ncc__permitted.clean_up();
}
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType6_template::copy_template(const SystemInformationType6_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cell__id().get_selection()) {
single_value->field_cell__id = other_value.cell__id();
} else {
single_value->field_cell__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.lai().get_selection()) {
single_value->field_lai = other_value.lai();
} else {
single_value->field_lai.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__options().get_selection()) {
single_value->field_cell__options = other_value.cell__options();
} else {
single_value->field_cell__options.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ncc__permitted().get_selection()) {
single_value->field_ncc__permitted = other_value.ncc__permitted();
} else {
single_value->field_ncc__permitted.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType6_template[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 SystemInformationType6_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType6_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 @GSM_SystemInformation.SystemInformationType6.");
break;
}
set_selection(other_value);
}

SystemInformationType6_template::SystemInformationType6_template()
{
}

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

SystemInformationType6_template::SystemInformationType6_template(const SystemInformationType6& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformationType6_template::match(const SystemInformationType6& 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.cell__id().is_bound()) return FALSE;
if(!single_value->field_cell__id.match(other_value.cell__id(), legacy))return FALSE;
if(!other_value.lai().is_bound()) return FALSE;
if(!single_value->field_lai.match(other_value.lai(), legacy))return FALSE;
if(!other_value.cell__options().is_bound()) return FALSE;
if(!single_value->field_cell__options.match(other_value.cell__options(), legacy))return FALSE;
if(!other_value.ncc__permitted().is_bound()) return FALSE;
if(!single_value->field_ncc__permitted.match(other_value.ncc__permitted(), legacy))return FALSE;
if(!other_value.rest__octets().is_bound()) return FALSE;
if(!single_value->field_rest__octets.match(other_value.rest__octets(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @GSM_SystemInformation.SystemInformationType6.");
}
return FALSE;
}

boolean SystemInformationType6_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cell__id.is_bound()
 || single_value->field_lai.is_bound()
 || single_value->field_cell__options.is_bound()
 || single_value->field_ncc__permitted.is_bound()
 || single_value->field_rest__octets.is_bound();
}

boolean SystemInformationType6_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cell__id.is_value()
 && single_value->field_lai.is_value()
 && single_value->field_cell__options.is_value()
 && single_value->field_ncc__permitted.is_value()
 && single_value->field_rest__octets.is_value();
}

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

SystemInformationType6 SystemInformationType6_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 @GSM_SystemInformation.SystemInformationType6.");
SystemInformationType6 ret_val;
if (single_value->field_cell__id.is_bound()) {
ret_val.cell__id() = single_value->field_cell__id.valueof();
}
if (single_value->field_lai.is_bound()) {
ret_val.lai() = single_value->field_lai.valueof();
}
if (single_value->field_cell__options.is_bound()) {
ret_val.cell__options() = single_value->field_cell__options.valueof();
}
if (single_value->field_ncc__permitted.is_bound()) {
ret_val.ncc__permitted() = single_value->field_ncc__permitted.valueof();
}
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType6_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 @GSM_SystemInformation.SystemInformationType6.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType6_template[list_length];
}

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

INTEGER_template& SystemInformationType6_template::cell__id()
{
set_specific();
return single_value->field_cell__id;
}

const INTEGER_template& SystemInformationType6_template::cell__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_id of a non-specific template of type @GSM_SystemInformation.SystemInformationType6.");
return single_value->field_cell__id;
}

GSM__Types::LocationAreaIdentification_template& SystemInformationType6_template::lai()
{
set_specific();
return single_value->field_lai;
}

const GSM__Types::LocationAreaIdentification_template& SystemInformationType6_template::lai() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lai of a non-specific template of type @GSM_SystemInformation.SystemInformationType6.");
return single_value->field_lai;
}

CellOptionsSacch_template& SystemInformationType6_template::cell__options()
{
set_specific();
return single_value->field_cell__options;
}

const CellOptionsSacch_template& SystemInformationType6_template::cell__options() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_options of a non-specific template of type @GSM_SystemInformation.SystemInformationType6.");
return single_value->field_cell__options;
}

BITSTRING_template& SystemInformationType6_template::ncc__permitted()
{
set_specific();
return single_value->field_ncc__permitted;
}

const BITSTRING_template& SystemInformationType6_template::ncc__permitted() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ncc_permitted of a non-specific template of type @GSM_SystemInformation.SystemInformationType6.");
return single_value->field_ncc__permitted;
}

GSM__RestOctets::SI6RestOctets_template& SystemInformationType6_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const GSM__RestOctets::SI6RestOctets_template& SystemInformationType6_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType6.");
return single_value->field_rest__octets;
}

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

void SystemInformationType6_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cell_id := ");
single_value->field_cell__id.log();
TTCN_Logger::log_event_str(", lai := ");
single_value->field_lai.log();
TTCN_Logger::log_event_str(", cell_options := ");
single_value->field_cell__options.log();
TTCN_Logger::log_event_str(", ncc_permitted := ");
single_value->field_ncc__permitted.log();
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SystemInformationType6_template::log_match(const SystemInformationType6& 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_cell__id.match(match_value.cell__id(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_id");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_lai.match(match_value.lai(), legacy)){
TTCN_Logger::log_logmatch_info(".lai");
single_value->field_lai.log_match(match_value.lai(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__options.match(match_value.cell__options(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_options");
single_value->field_cell__options.log_match(match_value.cell__options(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ncc__permitted.match(match_value.ncc__permitted(), legacy)){
TTCN_Logger::log_logmatch_info(".ncc_permitted");
single_value->field_ncc__permitted.log_match(match_value.ncc__permitted(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ cell_id := ");
single_value->field_cell__id.log_match(match_value.cell__id(), legacy);
TTCN_Logger::log_event_str(", lai := ");
single_value->field_lai.log_match(match_value.lai(), legacy);
TTCN_Logger::log_event_str(", cell_options := ");
single_value->field_cell__options.log_match(match_value.cell__options(), legacy);
TTCN_Logger::log_event_str(", ncc_permitted := ");
single_value->field_ncc__permitted.log_match(match_value.ncc__permitted(), legacy);
TTCN_Logger::log_event_str(", rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType6_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cell__id().is_bound()) cell__id().set_implicit_omit();
if (lai().is_bound()) lai().set_implicit_omit();
if (cell__options().is_bound()) cell__options().set_implicit_omit();
if (ncc__permitted().is_bound()) ncc__permitted().set_implicit_omit();
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType6_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_cell__id.decode_text(text_buf);
single_value->field_lai.decode_text(text_buf);
single_value->field_cell__options.decode_text(text_buf);
single_value->field_ncc__permitted.decode_text(text_buf);
single_value->field_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType6_template[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 @GSM_SystemInformation.SystemInformationType6.");
}
}

void SystemInformationType6_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: {
    SystemInformationType6_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 @GSM_SystemInformation.SystemInformationType6 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) cell__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lai().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cell__options().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ncc__permitted().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) rest__octets().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(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "lai")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          lai().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_options")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__options().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ncc_permitted")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ncc__permitted().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rest_octets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rest__octets().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @GSM_SystemInformation.SystemInformationType6: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SystemInformationType6_template* precondition = new SystemInformationType6_template;
    precondition->set_param(*param.get_elem(0));
    SystemInformationType6_template* implied_template = new SystemInformationType6_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SystemInformationType6_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@GSM_SystemInformation.SystemInformationType6");
  }
  is_ifpresent = param.get_ifpresent();
}

void SystemInformationType6_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_cell__id.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType6");
single_value->field_lai.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType6");
single_value->field_cell__options.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType6");
single_value->field_ncc__permitted.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType6");
single_value->field_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType6");
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 : "@GSM_SystemInformation.SystemInformationType6");
}

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

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

SystemInformationType13::SystemInformationType13()
{
}

SystemInformationType13::SystemInformationType13(const GSM__RestOctets::SI13RestOctets& par_rest__octets)
  :   field_rest__octets(par_rest__octets)
{
}

SystemInformationType13::SystemInformationType13(const SystemInformationType13& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformationType13.");
if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
else field_rest__octets.clean_up();
}

void SystemInformationType13::clean_up()
{
field_rest__octets.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationType13::get_descriptor() const { return &SystemInformationType13_descr_; }
SystemInformationType13& SystemInformationType13::operator=(const SystemInformationType13& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformationType13.");
  if (other_value.rest__octets().is_bound()) field_rest__octets = other_value.rest__octets();
  else field_rest__octets.clean_up();
}
return *this;
}

boolean SystemInformationType13::operator==(const SystemInformationType13& other_value) const
{
return field_rest__octets==other_value.field_rest__octets;
}

boolean SystemInformationType13::is_bound() const
{
return (field_rest__octets.is_bound());
}
boolean SystemInformationType13::is_value() const
{
return field_rest__octets.is_value();
}
void SystemInformationType13::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rest_octets := ");
field_rest__octets.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationType13::set_implicit_omit()
{
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType13::encode_text(Text_Buf& text_buf) const
{
field_rest__octets.encode_text(text_buf);
}

void SystemInformationType13::decode_text(Text_Buf& text_buf)
{
field_rest__octets.decode_text(text_buf);
}

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

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

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

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

struct SystemInformationType13_template::single_value_struct {
GSM__RestOctets::SI13RestOctets_template field_rest__octets;
};

void SystemInformationType13_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_rest__octets = ANY_VALUE;
}
}
}

void SystemInformationType13_template::copy_value(const SystemInformationType13& other_value)
{
single_value = new single_value_struct;
if (other_value.rest__octets().is_bound()) {
  single_value->field_rest__octets = other_value.rest__octets();
} else {
  single_value->field_rest__octets.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationType13_template::copy_template(const SystemInformationType13_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rest__octets().get_selection()) {
single_value->field_rest__octets = other_value.rest__octets();
} else {
single_value->field_rest__octets.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationType13_template[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 SystemInformationType13_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationType13_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 @GSM_SystemInformation.SystemInformationType13.");
break;
}
set_selection(other_value);
}

SystemInformationType13_template::SystemInformationType13_template()
{
}

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

SystemInformationType13_template::SystemInformationType13_template(const SystemInformationType13& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

SystemInformationType13 SystemInformationType13_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 @GSM_SystemInformation.SystemInformationType13.");
SystemInformationType13 ret_val;
if (single_value->field_rest__octets.is_bound()) {
ret_val.rest__octets() = single_value->field_rest__octets.valueof();
}
return ret_val;
}

void SystemInformationType13_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 @GSM_SystemInformation.SystemInformationType13.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationType13_template[list_length];
}

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

GSM__RestOctets::SI13RestOctets_template& SystemInformationType13_template::rest__octets()
{
set_specific();
return single_value->field_rest__octets;
}

const GSM__RestOctets::SI13RestOctets_template& SystemInformationType13_template::rest__octets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rest_octets of a non-specific template of type @GSM_SystemInformation.SystemInformationType13.");
return single_value->field_rest__octets;
}

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

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

void SystemInformationType13_template::log_match(const SystemInformationType13& 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_rest__octets.match(match_value.rest__octets(), legacy)){
TTCN_Logger::log_logmatch_info(".rest_octets");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ rest_octets := ");
single_value->field_rest__octets.log_match(match_value.rest__octets(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationType13_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rest__octets().is_bound()) rest__octets().set_implicit_omit();
}

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

void SystemInformationType13_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_rest__octets.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationType13_template[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 @GSM_SystemInformation.SystemInformationType13.");
}
}

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

void SystemInformationType13_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_rest__octets.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationType13");
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 : "@GSM_SystemInformation.SystemInformationType13");
}

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

boolean SystemInformationType13_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 SystemInformationUnion::copy_value(const SystemInformationUnion& other_value)
{
switch (other_value.union_selection) {
case ALT_si1:
field_si1 = new SystemInformationType1(*other_value.field_si1);
break;
case ALT_si2:
field_si2 = new SystemInformationType2(*other_value.field_si2);
break;
case ALT_si2bis:
field_si2bis = new SystemInformationType2bis(*other_value.field_si2bis);
break;
case ALT_si2ter:
field_si2ter = new SystemInformationType2ter(*other_value.field_si2ter);
break;
case ALT_si2quater:
field_si2quater = new SystemInformationType2quater(*other_value.field_si2quater);
break;
case ALT_si3:
field_si3 = new SystemInformationType3(*other_value.field_si3);
break;
case ALT_si4:
field_si4 = new SystemInformationType4(*other_value.field_si4);
break;
case ALT_si5:
field_si5 = new SystemInformationType5(*other_value.field_si5);
break;
case ALT_si5bis:
field_si5bis = new SystemInformationType5bis(*other_value.field_si5bis);
break;
case ALT_si5ter:
field_si5ter = new SystemInformationType5ter(*other_value.field_si5ter);
break;
case ALT_si6:
field_si6 = new SystemInformationType6(*other_value.field_si6);
break;
case ALT_si13:
field_si13 = new SystemInformationType13(*other_value.field_si13);
break;
case ALT_other:
field_other = new OCTETSTRING(*other_value.field_other);
break;
default:
TTCN_error("Assignment of an unbound union value of type @GSM_SystemInformation.SystemInformationUnion.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean SystemInformationUnion::operator==(const SystemInformationUnion& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @GSM_SystemInformation.SystemInformationUnion.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @GSM_SystemInformation.SystemInformationUnion.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_si1:
return *field_si1 == *other_value.field_si1;
case ALT_si2:
return *field_si2 == *other_value.field_si2;
case ALT_si2bis:
return *field_si2bis == *other_value.field_si2bis;
case ALT_si2ter:
return *field_si2ter == *other_value.field_si2ter;
case ALT_si2quater:
return *field_si2quater == *other_value.field_si2quater;
case ALT_si3:
return *field_si3 == *other_value.field_si3;
case ALT_si4:
return *field_si4 == *other_value.field_si4;
case ALT_si5:
return *field_si5 == *other_value.field_si5;
case ALT_si5bis:
return *field_si5bis == *other_value.field_si5bis;
case ALT_si5ter:
return *field_si5ter == *other_value.field_si5ter;
case ALT_si6:
return *field_si6 == *other_value.field_si6;
case ALT_si13:
return *field_si13 == *other_value.field_si13;
case ALT_other:
return *field_other == *other_value.field_other;
default:
return FALSE;
}
}

SystemInformationType1& SystemInformationUnion::si1()
{
if (union_selection != ALT_si1) {
clean_up();
field_si1 = new SystemInformationType1;
union_selection = ALT_si1;
}
return *field_si1;
}

const SystemInformationType1& SystemInformationUnion::si1() const
{
if (union_selection != ALT_si1) TTCN_error("Using non-selected field si1 in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si1;
}

SystemInformationType2& SystemInformationUnion::si2()
{
if (union_selection != ALT_si2) {
clean_up();
field_si2 = new SystemInformationType2;
union_selection = ALT_si2;
}
return *field_si2;
}

const SystemInformationType2& SystemInformationUnion::si2() const
{
if (union_selection != ALT_si2) TTCN_error("Using non-selected field si2 in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si2;
}

SystemInformationType2bis& SystemInformationUnion::si2bis()
{
if (union_selection != ALT_si2bis) {
clean_up();
field_si2bis = new SystemInformationType2bis;
union_selection = ALT_si2bis;
}
return *field_si2bis;
}

const SystemInformationType2bis& SystemInformationUnion::si2bis() const
{
if (union_selection != ALT_si2bis) TTCN_error("Using non-selected field si2bis in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si2bis;
}

SystemInformationType2ter& SystemInformationUnion::si2ter()
{
if (union_selection != ALT_si2ter) {
clean_up();
field_si2ter = new SystemInformationType2ter;
union_selection = ALT_si2ter;
}
return *field_si2ter;
}

const SystemInformationType2ter& SystemInformationUnion::si2ter() const
{
if (union_selection != ALT_si2ter) TTCN_error("Using non-selected field si2ter in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si2ter;
}

SystemInformationType2quater& SystemInformationUnion::si2quater()
{
if (union_selection != ALT_si2quater) {
clean_up();
field_si2quater = new SystemInformationType2quater;
union_selection = ALT_si2quater;
}
return *field_si2quater;
}

const SystemInformationType2quater& SystemInformationUnion::si2quater() const
{
if (union_selection != ALT_si2quater) TTCN_error("Using non-selected field si2quater in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si2quater;
}

SystemInformationType3& SystemInformationUnion::si3()
{
if (union_selection != ALT_si3) {
clean_up();
field_si3 = new SystemInformationType3;
union_selection = ALT_si3;
}
return *field_si3;
}

const SystemInformationType3& SystemInformationUnion::si3() const
{
if (union_selection != ALT_si3) TTCN_error("Using non-selected field si3 in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si3;
}

SystemInformationType4& SystemInformationUnion::si4()
{
if (union_selection != ALT_si4) {
clean_up();
field_si4 = new SystemInformationType4;
union_selection = ALT_si4;
}
return *field_si4;
}

const SystemInformationType4& SystemInformationUnion::si4() const
{
if (union_selection != ALT_si4) TTCN_error("Using non-selected field si4 in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si4;
}

SystemInformationType5& SystemInformationUnion::si5()
{
if (union_selection != ALT_si5) {
clean_up();
field_si5 = new SystemInformationType5;
union_selection = ALT_si5;
}
return *field_si5;
}

const SystemInformationType5& SystemInformationUnion::si5() const
{
if (union_selection != ALT_si5) TTCN_error("Using non-selected field si5 in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si5;
}

SystemInformationType5bis& SystemInformationUnion::si5bis()
{
if (union_selection != ALT_si5bis) {
clean_up();
field_si5bis = new SystemInformationType5bis;
union_selection = ALT_si5bis;
}
return *field_si5bis;
}

const SystemInformationType5bis& SystemInformationUnion::si5bis() const
{
if (union_selection != ALT_si5bis) TTCN_error("Using non-selected field si5bis in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si5bis;
}

SystemInformationType5ter& SystemInformationUnion::si5ter()
{
if (union_selection != ALT_si5ter) {
clean_up();
field_si5ter = new SystemInformationType5ter;
union_selection = ALT_si5ter;
}
return *field_si5ter;
}

const SystemInformationType5ter& SystemInformationUnion::si5ter() const
{
if (union_selection != ALT_si5ter) TTCN_error("Using non-selected field si5ter in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si5ter;
}

SystemInformationType6& SystemInformationUnion::si6()
{
if (union_selection != ALT_si6) {
clean_up();
field_si6 = new SystemInformationType6;
union_selection = ALT_si6;
}
return *field_si6;
}

const SystemInformationType6& SystemInformationUnion::si6() const
{
if (union_selection != ALT_si6) TTCN_error("Using non-selected field si6 in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si6;
}

SystemInformationType13& SystemInformationUnion::si13()
{
if (union_selection != ALT_si13) {
clean_up();
field_si13 = new SystemInformationType13;
union_selection = ALT_si13;
}
return *field_si13;
}

const SystemInformationType13& SystemInformationUnion::si13() const
{
if (union_selection != ALT_si13) TTCN_error("Using non-selected field si13 in a value of union type @GSM_SystemInformation.SystemInformationUnion.");
return *field_si13;
}

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

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

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

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

boolean SystemInformationUnion::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_si1: return field_si1->is_value();
case ALT_si2: return field_si2->is_value();
case ALT_si2bis: return field_si2bis->is_value();
case ALT_si2ter: return field_si2ter->is_value();
case ALT_si2quater: return field_si2quater->is_value();
case ALT_si3: return field_si3->is_value();
case ALT_si4: return field_si4->is_value();
case ALT_si5: return field_si5->is_value();
case ALT_si5bis: return field_si5bis->is_value();
case ALT_si5ter: return field_si5ter->is_value();
case ALT_si6: return field_si6->is_value();
case ALT_si13: return field_si13->is_value();
case ALT_other: return field_other->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void SystemInformationUnion::clean_up()
{
switch (union_selection) {
case ALT_si1:
  delete field_si1;
  break;
case ALT_si2:
  delete field_si2;
  break;
case ALT_si2bis:
  delete field_si2bis;
  break;
case ALT_si2ter:
  delete field_si2ter;
  break;
case ALT_si2quater:
  delete field_si2quater;
  break;
case ALT_si3:
  delete field_si3;
  break;
case ALT_si4:
  delete field_si4;
  break;
case ALT_si5:
  delete field_si5;
  break;
case ALT_si5bis:
  delete field_si5bis;
  break;
case ALT_si5ter:
  delete field_si5ter;
  break;
case ALT_si6:
  delete field_si6;
  break;
case ALT_si13:
  delete field_si13;
  break;
case ALT_other:
  delete field_other;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void SystemInformationUnion::log() const
{
switch (union_selection) {
case ALT_si1:
TTCN_Logger::log_event_str("{ si1 := ");
field_si1->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si2:
TTCN_Logger::log_event_str("{ si2 := ");
field_si2->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si2bis:
TTCN_Logger::log_event_str("{ si2bis := ");
field_si2bis->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si2ter:
TTCN_Logger::log_event_str("{ si2ter := ");
field_si2ter->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si2quater:
TTCN_Logger::log_event_str("{ si2quater := ");
field_si2quater->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si4:
TTCN_Logger::log_event_str("{ si4 := ");
field_si4->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si5:
TTCN_Logger::log_event_str("{ si5 := ");
field_si5->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si5bis:
TTCN_Logger::log_event_str("{ si5bis := ");
field_si5bis->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si5ter:
TTCN_Logger::log_event_str("{ si5ter := ");
field_si5ter->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si6:
TTCN_Logger::log_event_str("{ si6 := ");
field_si6->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_si13:
TTCN_Logger::log_event_str("{ si13 := ");
field_si13->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_other:
TTCN_Logger::log_event_str("{ other := ");
field_other->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void SystemInformationUnion::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, "si1")) {
    si1().set_param(*mp_last);
    if (!si1().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si2")) {
    si2().set_param(*mp_last);
    if (!si2().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si2bis")) {
    si2bis().set_param(*mp_last);
    if (!si2bis().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si2ter")) {
    si2ter().set_param(*mp_last);
    if (!si2ter().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si2quater")) {
    si2quater().set_param(*mp_last);
    if (!si2quater().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si3")) {
    si3().set_param(*mp_last);
    if (!si3().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si4")) {
    si4().set_param(*mp_last);
    if (!si4().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si5")) {
    si5().set_param(*mp_last);
    if (!si5().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si5bis")) {
    si5bis().set_param(*mp_last);
    if (!si5bis().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si5ter")) {
    si5ter().set_param(*mp_last);
    if (!si5ter().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si6")) {
    si6().set_param(*mp_last);
    if (!si6().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "si13")) {
    si13().set_param(*mp_last);
    if (!si13().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "other")) {
    other().set_param(*mp_last);
    if (!other().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @GSM_SystemInformation.SystemInformationUnion.", last_name);
}

void SystemInformationUnion::set_implicit_omit()
{
switch (union_selection) {
case ALT_si1:
field_si1->set_implicit_omit(); break;
case ALT_si2:
field_si2->set_implicit_omit(); break;
case ALT_si2bis:
field_si2bis->set_implicit_omit(); break;
case ALT_si2ter:
field_si2ter->set_implicit_omit(); break;
case ALT_si2quater:
field_si2quater->set_implicit_omit(); break;
case ALT_si3:
field_si3->set_implicit_omit(); break;
case ALT_si4:
field_si4->set_implicit_omit(); break;
case ALT_si5:
field_si5->set_implicit_omit(); break;
case ALT_si5bis:
field_si5bis->set_implicit_omit(); break;
case ALT_si5ter:
field_si5ter->set_implicit_omit(); break;
case ALT_si6:
field_si6->set_implicit_omit(); break;
case ALT_si13:
field_si13->set_implicit_omit(); break;
case ALT_other:
field_other->set_implicit_omit(); break;
default: break;
}
}

void SystemInformationUnion::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_si1:
field_si1->encode_text(text_buf);
break;
case ALT_si2:
field_si2->encode_text(text_buf);
break;
case ALT_si2bis:
field_si2bis->encode_text(text_buf);
break;
case ALT_si2ter:
field_si2ter->encode_text(text_buf);
break;
case ALT_si2quater:
field_si2quater->encode_text(text_buf);
break;
case ALT_si3:
field_si3->encode_text(text_buf);
break;
case ALT_si4:
field_si4->encode_text(text_buf);
break;
case ALT_si5:
field_si5->encode_text(text_buf);
break;
case ALT_si5bis:
field_si5bis->encode_text(text_buf);
break;
case ALT_si5ter:
field_si5ter->encode_text(text_buf);
break;
case ALT_si6:
field_si6->encode_text(text_buf);
break;
case ALT_si13:
field_si13->encode_text(text_buf);
break;
case ALT_other:
field_other->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @GSM_SystemInformation.SystemInformationUnion.");
}
}

void SystemInformationUnion::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_si1:
si1().decode_text(text_buf);
break;
case ALT_si2:
si2().decode_text(text_buf);
break;
case ALT_si2bis:
si2bis().decode_text(text_buf);
break;
case ALT_si2ter:
si2ter().decode_text(text_buf);
break;
case ALT_si2quater:
si2quater().decode_text(text_buf);
break;
case ALT_si3:
si3().decode_text(text_buf);
break;
case ALT_si4:
si4().decode_text(text_buf);
break;
case ALT_si5:
si5().decode_text(text_buf);
break;
case ALT_si5bis:
si5bis().decode_text(text_buf);
break;
case ALT_si5ter:
si5ter().decode_text(text_buf);
break;
case ALT_si6:
si6().decode_text(text_buf);
break;
case ALT_si13:
si13().decode_text(text_buf);
break;
case ALT_other:
other().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @GSM_SystemInformation.SystemInformationUnion.");
}
}

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

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

int SystemInformationUnion::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, SystemInformationUnion_si1_descr_.raw->forceomit);
      decoded_length = si1().RAW_decode(SystemInformationUnion_si1_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, SystemInformationUnion_si2_descr_.raw->forceomit);
      decoded_length = si2().RAW_decode(SystemInformationUnion_si2_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, SystemInformationUnion_si2bis_descr_.raw->forceomit);
      decoded_length = si2bis().RAW_decode(SystemInformationUnion_si2bis_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, SystemInformationUnion_si2ter_descr_.raw->forceomit);
      decoded_length = si2ter().RAW_decode(SystemInformationUnion_si2ter_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, SystemInformationUnion_si2quater_descr_.raw->forceomit);
      decoded_length = si2quater().RAW_decode(SystemInformationUnion_si2quater_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, SystemInformationUnion_si3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(SystemInformationUnion_si3_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, SystemInformationUnion_si4_descr_.raw->forceomit);
      decoded_length = si4().RAW_decode(SystemInformationUnion_si4_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 7: {
      RAW_Force_Omit field_force_omit(7, force_omit, SystemInformationUnion_si5_descr_.raw->forceomit);
      decoded_length = si5().RAW_decode(SystemInformationUnion_si5_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 8: {
      RAW_Force_Omit field_force_omit(8, force_omit, SystemInformationUnion_si5bis_descr_.raw->forceomit);
      decoded_length = si5bis().RAW_decode(SystemInformationUnion_si5bis_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 9: {
      RAW_Force_Omit field_force_omit(9, force_omit, SystemInformationUnion_si5ter_descr_.raw->forceomit);
      decoded_length = si5ter().RAW_decode(SystemInformationUnion_si5ter_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 10: {
      RAW_Force_Omit field_force_omit(10, force_omit, SystemInformationUnion_si6_descr_.raw->forceomit);
      decoded_length = si6().RAW_decode(SystemInformationUnion_si6_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 11: {
      RAW_Force_Omit field_force_omit(11, force_omit, SystemInformationUnion_si13_descr_.raw->forceomit);
      decoded_length = si13().RAW_decode(SystemInformationUnion_si13_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    case 12: {
      RAW_Force_Omit field_force_omit(12, force_omit, SystemInformationUnion_other_descr_.raw->forceomit);
      decoded_length = other().RAW_decode(SystemInformationUnion_other_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit);
      break; }
    default: break;
    }
    return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
  } else {
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_0_force_omit(0, force_omit, SystemInformationUnion_si1_descr_.raw->forceomit);
      decoded_length = si1().RAW_decode(SystemInformationUnion_si1_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, SystemInformationUnion_si2_descr_.raw->forceomit);
      decoded_length = si2().RAW_decode(SystemInformationUnion_si2_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, SystemInformationUnion_si2bis_descr_.raw->forceomit);
      decoded_length = si2bis().RAW_decode(SystemInformationUnion_si2bis_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, SystemInformationUnion_si2ter_descr_.raw->forceomit);
      decoded_length = si2ter().RAW_decode(SystemInformationUnion_si2ter_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, SystemInformationUnion_si2quater_descr_.raw->forceomit);
      decoded_length = si2quater().RAW_decode(SystemInformationUnion_si2quater_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, SystemInformationUnion_si3_descr_.raw->forceomit);
      decoded_length = si3().RAW_decode(SystemInformationUnion_si3_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, SystemInformationUnion_si4_descr_.raw->forceomit);
      decoded_length = si4().RAW_decode(SystemInformationUnion_si4_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;
       }
      p_buf.set_pos_bit(starting_pos);
      RAW_Force_Omit field_7_force_omit(7, force_omit, SystemInformationUnion_si5_descr_.raw->forceomit);
      decoded_length = si5().RAW_decode(SystemInformationUnion_si5_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_7_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_8_force_omit(8, force_omit, SystemInformationUnion_si5bis_descr_.raw->forceomit);
      decoded_length = si5bis().RAW_decode(SystemInformationUnion_si5bis_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_8_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_9_force_omit(9, force_omit, SystemInformationUnion_si5ter_descr_.raw->forceomit);
      decoded_length = si5ter().RAW_decode(SystemInformationUnion_si5ter_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_9_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_10_force_omit(10, force_omit, SystemInformationUnion_si6_descr_.raw->forceomit);
      decoded_length = si6().RAW_decode(SystemInformationUnion_si6_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_10_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_11_force_omit(11, force_omit, SystemInformationUnion_si13_descr_.raw->forceomit);
      decoded_length = si13().RAW_decode(SystemInformationUnion_si13_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_11_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_12_force_omit(12, force_omit, SystemInformationUnion_other_descr_.raw->forceomit);
      decoded_length = other().RAW_decode(SystemInformationUnion_other_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_12_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int SystemInformationUnion::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 13;  myleaf.body.node.nodes = init_nodes_of_enc_tree(13);
  memset(myleaf.body.node.nodes, 0, 13 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_si1:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, SystemInformationUnion_si1_descr_.raw);
    encoded_length = field_si1->RAW_encode(SystemInformationUnion_si1_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &SystemInformationUnion_si1_descr_;
    break;
  case ALT_si2:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, SystemInformationUnion_si2_descr_.raw);
    encoded_length = field_si2->RAW_encode(SystemInformationUnion_si2_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &SystemInformationUnion_si2_descr_;
    break;
  case ALT_si2bis:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, SystemInformationUnion_si2bis_descr_.raw);
    encoded_length = field_si2bis->RAW_encode(SystemInformationUnion_si2bis_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &SystemInformationUnion_si2bis_descr_;
    break;
  case ALT_si2ter:
    myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 3, SystemInformationUnion_si2ter_descr_.raw);
    encoded_length = field_si2ter->RAW_encode(SystemInformationUnion_si2ter_descr_, *myleaf.body.node.nodes[3]);
    myleaf.body.node.nodes[3]->coding_descr = &SystemInformationUnion_si2ter_descr_;
    break;
  case ALT_si2quater:
    myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 4, SystemInformationUnion_si2quater_descr_.raw);
    encoded_length = field_si2quater->RAW_encode(SystemInformationUnion_si2quater_descr_, *myleaf.body.node.nodes[4]);
    myleaf.body.node.nodes[4]->coding_descr = &SystemInformationUnion_si2quater_descr_;
    break;
  case ALT_si3:
    myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 5, SystemInformationUnion_si3_descr_.raw);
    encoded_length = field_si3->RAW_encode(SystemInformationUnion_si3_descr_, *myleaf.body.node.nodes[5]);
    myleaf.body.node.nodes[5]->coding_descr = &SystemInformationUnion_si3_descr_;
    break;
  case ALT_si4:
    myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 6, SystemInformationUnion_si4_descr_.raw);
    encoded_length = field_si4->RAW_encode(SystemInformationUnion_si4_descr_, *myleaf.body.node.nodes[6]);
    myleaf.body.node.nodes[6]->coding_descr = &SystemInformationUnion_si4_descr_;
    break;
  case ALT_si5:
    myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 7, SystemInformationUnion_si5_descr_.raw);
    encoded_length = field_si5->RAW_encode(SystemInformationUnion_si5_descr_, *myleaf.body.node.nodes[7]);
    myleaf.body.node.nodes[7]->coding_descr = &SystemInformationUnion_si5_descr_;
    break;
  case ALT_si5bis:
    myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 8, SystemInformationUnion_si5bis_descr_.raw);
    encoded_length = field_si5bis->RAW_encode(SystemInformationUnion_si5bis_descr_, *myleaf.body.node.nodes[8]);
    myleaf.body.node.nodes[8]->coding_descr = &SystemInformationUnion_si5bis_descr_;
    break;
  case ALT_si5ter:
    myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 9, SystemInformationUnion_si5ter_descr_.raw);
    encoded_length = field_si5ter->RAW_encode(SystemInformationUnion_si5ter_descr_, *myleaf.body.node.nodes[9]);
    myleaf.body.node.nodes[9]->coding_descr = &SystemInformationUnion_si5ter_descr_;
    break;
  case ALT_si6:
    myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 10, SystemInformationUnion_si6_descr_.raw);
    encoded_length = field_si6->RAW_encode(SystemInformationUnion_si6_descr_, *myleaf.body.node.nodes[10]);
    myleaf.body.node.nodes[10]->coding_descr = &SystemInformationUnion_si6_descr_;
    break;
  case ALT_si13:
    myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 11, SystemInformationUnion_si13_descr_.raw);
    encoded_length = field_si13->RAW_encode(SystemInformationUnion_si13_descr_, *myleaf.body.node.nodes[11]);
    myleaf.body.node.nodes[11]->coding_descr = &SystemInformationUnion_si13_descr_;
    break;
  case ALT_other:
    myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 12, SystemInformationUnion_other_descr_.raw);
    encoded_length = field_other->RAW_encode(SystemInformationUnion_other_descr_, *myleaf.body.node.nodes[12]);
    myleaf.body.node.nodes[12]->coding_descr = &SystemInformationUnion_other_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void SystemInformationUnion_template::copy_value(const SystemInformationUnion& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case SystemInformationUnion::ALT_si1:
single_value.field_si1 = new SystemInformationType1_template(other_value.si1());
break;
case SystemInformationUnion::ALT_si2:
single_value.field_si2 = new SystemInformationType2_template(other_value.si2());
break;
case SystemInformationUnion::ALT_si2bis:
single_value.field_si2bis = new SystemInformationType2bis_template(other_value.si2bis());
break;
case SystemInformationUnion::ALT_si2ter:
single_value.field_si2ter = new SystemInformationType2ter_template(other_value.si2ter());
break;
case SystemInformationUnion::ALT_si2quater:
single_value.field_si2quater = new SystemInformationType2quater_template(other_value.si2quater());
break;
case SystemInformationUnion::ALT_si3:
single_value.field_si3 = new SystemInformationType3_template(other_value.si3());
break;
case SystemInformationUnion::ALT_si4:
single_value.field_si4 = new SystemInformationType4_template(other_value.si4());
break;
case SystemInformationUnion::ALT_si5:
single_value.field_si5 = new SystemInformationType5_template(other_value.si5());
break;
case SystemInformationUnion::ALT_si5bis:
single_value.field_si5bis = new SystemInformationType5bis_template(other_value.si5bis());
break;
case SystemInformationUnion::ALT_si5ter:
single_value.field_si5ter = new SystemInformationType5ter_template(other_value.si5ter());
break;
case SystemInformationUnion::ALT_si6:
single_value.field_si6 = new SystemInformationType6_template(other_value.si6());
break;
case SystemInformationUnion::ALT_si13:
single_value.field_si13 = new SystemInformationType13_template(other_value.si13());
break;
case SystemInformationUnion::ALT_other:
single_value.field_other = new OCTETSTRING_template(other_value.other());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @GSM_SystemInformation.SystemInformationUnion.");
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationUnion_template::copy_template(const SystemInformationUnion_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 SystemInformationUnion::ALT_si1:
single_value.field_si1 = new SystemInformationType1_template(*other_value.single_value.field_si1);
break;
case SystemInformationUnion::ALT_si2:
single_value.field_si2 = new SystemInformationType2_template(*other_value.single_value.field_si2);
break;
case SystemInformationUnion::ALT_si2bis:
single_value.field_si2bis = new SystemInformationType2bis_template(*other_value.single_value.field_si2bis);
break;
case SystemInformationUnion::ALT_si2ter:
single_value.field_si2ter = new SystemInformationType2ter_template(*other_value.single_value.field_si2ter);
break;
case SystemInformationUnion::ALT_si2quater:
single_value.field_si2quater = new SystemInformationType2quater_template(*other_value.single_value.field_si2quater);
break;
case SystemInformationUnion::ALT_si3:
single_value.field_si3 = new SystemInformationType3_template(*other_value.single_value.field_si3);
break;
case SystemInformationUnion::ALT_si4:
single_value.field_si4 = new SystemInformationType4_template(*other_value.single_value.field_si4);
break;
case SystemInformationUnion::ALT_si5:
single_value.field_si5 = new SystemInformationType5_template(*other_value.single_value.field_si5);
break;
case SystemInformationUnion::ALT_si5bis:
single_value.field_si5bis = new SystemInformationType5bis_template(*other_value.single_value.field_si5bis);
break;
case SystemInformationUnion::ALT_si5ter:
single_value.field_si5ter = new SystemInformationType5ter_template(*other_value.single_value.field_si5ter);
break;
case SystemInformationUnion::ALT_si6:
single_value.field_si6 = new SystemInformationType6_template(*other_value.single_value.field_si6);
break;
case SystemInformationUnion::ALT_si13:
single_value.field_si13 = new SystemInformationType13_template(*other_value.single_value.field_si13);
break;
case SystemInformationUnion::ALT_other:
single_value.field_other = new OCTETSTRING_template(*other_value.single_value.field_other);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @GSM_SystemInformation.SystemInformationUnion.");
}
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 SystemInformationUnion_template[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 SystemInformationUnion_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationUnion_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 @GSM_SystemInformation.SystemInformationUnion.");
}
set_selection(other_value);
}

SystemInformationUnion_template::SystemInformationUnion_template()
{
}

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

SystemInformationUnion_template::SystemInformationUnion_template(const SystemInformationUnion& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void SystemInformationUnion_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SystemInformationUnion::ALT_si1:
delete single_value.field_si1;
break;
case SystemInformationUnion::ALT_si2:
delete single_value.field_si2;
break;
case SystemInformationUnion::ALT_si2bis:
delete single_value.field_si2bis;
break;
case SystemInformationUnion::ALT_si2ter:
delete single_value.field_si2ter;
break;
case SystemInformationUnion::ALT_si2quater:
delete single_value.field_si2quater;
break;
case SystemInformationUnion::ALT_si3:
delete single_value.field_si3;
break;
case SystemInformationUnion::ALT_si4:
delete single_value.field_si4;
break;
case SystemInformationUnion::ALT_si5:
delete single_value.field_si5;
break;
case SystemInformationUnion::ALT_si5bis:
delete single_value.field_si5bis;
break;
case SystemInformationUnion::ALT_si5ter:
delete single_value.field_si5ter;
break;
case SystemInformationUnion::ALT_si6:
delete single_value.field_si6;
break;
case SystemInformationUnion::ALT_si13:
delete single_value.field_si13;
break;
case SystemInformationUnion::ALT_other:
delete single_value.field_other;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

boolean SystemInformationUnion_template::match(const SystemInformationUnion& 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:
{
SystemInformationUnion::union_selection_type value_selection = other_value.get_selection();
if (value_selection == SystemInformationUnion::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case SystemInformationUnion::ALT_si1:
return single_value.field_si1->match(other_value.si1(), legacy);
case SystemInformationUnion::ALT_si2:
return single_value.field_si2->match(other_value.si2(), legacy);
case SystemInformationUnion::ALT_si2bis:
return single_value.field_si2bis->match(other_value.si2bis(), legacy);
case SystemInformationUnion::ALT_si2ter:
return single_value.field_si2ter->match(other_value.si2ter(), legacy);
case SystemInformationUnion::ALT_si2quater:
return single_value.field_si2quater->match(other_value.si2quater(), legacy);
case SystemInformationUnion::ALT_si3:
return single_value.field_si3->match(other_value.si3(), legacy);
case SystemInformationUnion::ALT_si4:
return single_value.field_si4->match(other_value.si4(), legacy);
case SystemInformationUnion::ALT_si5:
return single_value.field_si5->match(other_value.si5(), legacy);
case SystemInformationUnion::ALT_si5bis:
return single_value.field_si5bis->match(other_value.si5bis(), legacy);
case SystemInformationUnion::ALT_si5ter:
return single_value.field_si5ter->match(other_value.si5ter(), legacy);
case SystemInformationUnion::ALT_si6:
return single_value.field_si6->match(other_value.si6(), legacy);
case SystemInformationUnion::ALT_si13:
return single_value.field_si13->match(other_value.si13(), legacy);
case SystemInformationUnion::ALT_other:
return single_value.field_other->match(other_value.other(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @GSM_SystemInformation.SystemInformationUnion.");
}
}
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 @GSM_SystemInformation.SystemInformationUnion.");
}
return FALSE;
}

boolean SystemInformationUnion_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case SystemInformationUnion::ALT_si1:
return single_value.field_si1->is_value();
case SystemInformationUnion::ALT_si2:
return single_value.field_si2->is_value();
case SystemInformationUnion::ALT_si2bis:
return single_value.field_si2bis->is_value();
case SystemInformationUnion::ALT_si2ter:
return single_value.field_si2ter->is_value();
case SystemInformationUnion::ALT_si2quater:
return single_value.field_si2quater->is_value();
case SystemInformationUnion::ALT_si3:
return single_value.field_si3->is_value();
case SystemInformationUnion::ALT_si4:
return single_value.field_si4->is_value();
case SystemInformationUnion::ALT_si5:
return single_value.field_si5->is_value();
case SystemInformationUnion::ALT_si5bis:
return single_value.field_si5bis->is_value();
case SystemInformationUnion::ALT_si5ter:
return single_value.field_si5ter->is_value();
case SystemInformationUnion::ALT_si6:
return single_value.field_si6->is_value();
case SystemInformationUnion::ALT_si13:
return single_value.field_si13->is_value();
case SystemInformationUnion::ALT_other:
return single_value.field_other->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @GSM_SystemInformation.SystemInformationUnion.");
}
}

SystemInformationUnion SystemInformationUnion_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 @GSM_SystemInformation.SystemInformationUnion.");
SystemInformationUnion ret_val;
switch (single_value.union_selection) {
case SystemInformationUnion::ALT_si1:
ret_val.si1() = single_value.field_si1->valueof();
break;
case SystemInformationUnion::ALT_si2:
ret_val.si2() = single_value.field_si2->valueof();
break;
case SystemInformationUnion::ALT_si2bis:
ret_val.si2bis() = single_value.field_si2bis->valueof();
break;
case SystemInformationUnion::ALT_si2ter:
ret_val.si2ter() = single_value.field_si2ter->valueof();
break;
case SystemInformationUnion::ALT_si2quater:
ret_val.si2quater() = single_value.field_si2quater->valueof();
break;
case SystemInformationUnion::ALT_si3:
ret_val.si3() = single_value.field_si3->valueof();
break;
case SystemInformationUnion::ALT_si4:
ret_val.si4() = single_value.field_si4->valueof();
break;
case SystemInformationUnion::ALT_si5:
ret_val.si5() = single_value.field_si5->valueof();
break;
case SystemInformationUnion::ALT_si5bis:
ret_val.si5bis() = single_value.field_si5bis->valueof();
break;
case SystemInformationUnion::ALT_si5ter:
ret_val.si5ter() = single_value.field_si5ter->valueof();
break;
case SystemInformationUnion::ALT_si6:
ret_val.si6() = single_value.field_si6->valueof();
break;
case SystemInformationUnion::ALT_si13:
ret_val.si13() = single_value.field_si13->valueof();
break;
case SystemInformationUnion::ALT_other:
ret_val.other() = single_value.field_other->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @GSM_SystemInformation.SystemInformationUnion.");
}
return ret_val;
}

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

SystemInformationType1_template& SystemInformationUnion_template::si1()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si1) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si1 = new SystemInformationType1_template(ANY_VALUE);
else single_value.field_si1 = new SystemInformationType1_template;
single_value.union_selection = SystemInformationUnion::ALT_si1;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si1;
}

const SystemInformationType1_template& SystemInformationUnion_template::si1() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si1 in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si1) TTCN_error("Accessing non-selected field si1 in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si1;
}

SystemInformationType2_template& SystemInformationUnion_template::si2()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si2) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si2 = new SystemInformationType2_template(ANY_VALUE);
else single_value.field_si2 = new SystemInformationType2_template;
single_value.union_selection = SystemInformationUnion::ALT_si2;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si2;
}

const SystemInformationType2_template& SystemInformationUnion_template::si2() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si2 in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si2) TTCN_error("Accessing non-selected field si2 in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si2;
}

SystemInformationType2bis_template& SystemInformationUnion_template::si2bis()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si2bis) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si2bis = new SystemInformationType2bis_template(ANY_VALUE);
else single_value.field_si2bis = new SystemInformationType2bis_template;
single_value.union_selection = SystemInformationUnion::ALT_si2bis;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si2bis;
}

const SystemInformationType2bis_template& SystemInformationUnion_template::si2bis() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si2bis in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si2bis) TTCN_error("Accessing non-selected field si2bis in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si2bis;
}

SystemInformationType2ter_template& SystemInformationUnion_template::si2ter()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si2ter) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si2ter = new SystemInformationType2ter_template(ANY_VALUE);
else single_value.field_si2ter = new SystemInformationType2ter_template;
single_value.union_selection = SystemInformationUnion::ALT_si2ter;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si2ter;
}

const SystemInformationType2ter_template& SystemInformationUnion_template::si2ter() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si2ter in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si2ter) TTCN_error("Accessing non-selected field si2ter in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si2ter;
}

SystemInformationType2quater_template& SystemInformationUnion_template::si2quater()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si2quater) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si2quater = new SystemInformationType2quater_template(ANY_VALUE);
else single_value.field_si2quater = new SystemInformationType2quater_template;
single_value.union_selection = SystemInformationUnion::ALT_si2quater;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si2quater;
}

const SystemInformationType2quater_template& SystemInformationUnion_template::si2quater() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si2quater in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si2quater) TTCN_error("Accessing non-selected field si2quater in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si2quater;
}

SystemInformationType3_template& SystemInformationUnion_template::si3()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si3) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si3 = new SystemInformationType3_template(ANY_VALUE);
else single_value.field_si3 = new SystemInformationType3_template;
single_value.union_selection = SystemInformationUnion::ALT_si3;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si3;
}

const SystemInformationType3_template& SystemInformationUnion_template::si3() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si3 in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si3) TTCN_error("Accessing non-selected field si3 in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si3;
}

SystemInformationType4_template& SystemInformationUnion_template::si4()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si4) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si4 = new SystemInformationType4_template(ANY_VALUE);
else single_value.field_si4 = new SystemInformationType4_template;
single_value.union_selection = SystemInformationUnion::ALT_si4;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si4;
}

const SystemInformationType4_template& SystemInformationUnion_template::si4() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si4 in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si4) TTCN_error("Accessing non-selected field si4 in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si4;
}

SystemInformationType5_template& SystemInformationUnion_template::si5()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si5) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si5 = new SystemInformationType5_template(ANY_VALUE);
else single_value.field_si5 = new SystemInformationType5_template;
single_value.union_selection = SystemInformationUnion::ALT_si5;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si5;
}

const SystemInformationType5_template& SystemInformationUnion_template::si5() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si5 in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si5) TTCN_error("Accessing non-selected field si5 in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si5;
}

SystemInformationType5bis_template& SystemInformationUnion_template::si5bis()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si5bis) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si5bis = new SystemInformationType5bis_template(ANY_VALUE);
else single_value.field_si5bis = new SystemInformationType5bis_template;
single_value.union_selection = SystemInformationUnion::ALT_si5bis;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si5bis;
}

const SystemInformationType5bis_template& SystemInformationUnion_template::si5bis() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si5bis in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si5bis) TTCN_error("Accessing non-selected field si5bis in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si5bis;
}

SystemInformationType5ter_template& SystemInformationUnion_template::si5ter()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si5ter) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si5ter = new SystemInformationType5ter_template(ANY_VALUE);
else single_value.field_si5ter = new SystemInformationType5ter_template;
single_value.union_selection = SystemInformationUnion::ALT_si5ter;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si5ter;
}

const SystemInformationType5ter_template& SystemInformationUnion_template::si5ter() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si5ter in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si5ter) TTCN_error("Accessing non-selected field si5ter in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si5ter;
}

SystemInformationType6_template& SystemInformationUnion_template::si6()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si6) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si6 = new SystemInformationType6_template(ANY_VALUE);
else single_value.field_si6 = new SystemInformationType6_template;
single_value.union_selection = SystemInformationUnion::ALT_si6;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si6;
}

const SystemInformationType6_template& SystemInformationUnion_template::si6() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si6 in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si6) TTCN_error("Accessing non-selected field si6 in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si6;
}

SystemInformationType13_template& SystemInformationUnion_template::si13()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SystemInformationUnion::ALT_si13) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_si13 = new SystemInformationType13_template(ANY_VALUE);
else single_value.field_si13 = new SystemInformationType13_template;
single_value.union_selection = SystemInformationUnion::ALT_si13;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_si13;
}

const SystemInformationType13_template& SystemInformationUnion_template::si13() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field si13 in a non-specific template of union type @GSM_SystemInformation.SystemInformationUnion.");
if (single_value.union_selection != SystemInformationUnion::ALT_si13) TTCN_error("Accessing non-selected field si13 in a template of union type @GSM_SystemInformation.SystemInformationUnion.");
return *single_value.field_si13;
}

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

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

boolean SystemInformationUnion_template::ischosen(SystemInformationUnion::union_selection_type checked_selection) const
{
if (checked_selection == SystemInformationUnion::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @GSM_SystemInformation.SystemInformationUnion.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == SystemInformationUnion::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @GSM_SystemInformation.SystemInformationUnion.");
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 @GSM_SystemInformation.SystemInformationUnion 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 SystemInformationUnion_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SystemInformationUnion::ALT_si1:
TTCN_Logger::log_event_str("{ si1 := ");
single_value.field_si1->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si2:
TTCN_Logger::log_event_str("{ si2 := ");
single_value.field_si2->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si2bis:
TTCN_Logger::log_event_str("{ si2bis := ");
single_value.field_si2bis->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si2ter:
TTCN_Logger::log_event_str("{ si2ter := ");
single_value.field_si2ter->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si2quater:
TTCN_Logger::log_event_str("{ si2quater := ");
single_value.field_si2quater->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si3:
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si4:
TTCN_Logger::log_event_str("{ si4 := ");
single_value.field_si4->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si5:
TTCN_Logger::log_event_str("{ si5 := ");
single_value.field_si5->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si5bis:
TTCN_Logger::log_event_str("{ si5bis := ");
single_value.field_si5bis->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si5ter:
TTCN_Logger::log_event_str("{ si5ter := ");
single_value.field_si5ter->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si6:
TTCN_Logger::log_event_str("{ si6 := ");
single_value.field_si6->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_si13:
TTCN_Logger::log_event_str("{ si13 := ");
single_value.field_si13->log();
TTCN_Logger::log_event_str(" }");
break;
case SystemInformationUnion::ALT_other:
TTCN_Logger::log_event_str("{ other := ");
single_value.field_other->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SystemInformationUnion_template::log_match(const SystemInformationUnion& 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 SystemInformationUnion::ALT_si1:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si1");
single_value.field_si1->log_match(match_value.si1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si1 := ");
single_value.field_si1->log_match(match_value.si1(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si2:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si2");
single_value.field_si2->log_match(match_value.si2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si2 := ");
single_value.field_si2->log_match(match_value.si2(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si2bis:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si2bis");
single_value.field_si2bis->log_match(match_value.si2bis(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si2bis := ");
single_value.field_si2bis->log_match(match_value.si2bis(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si2ter:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si2ter");
single_value.field_si2ter->log_match(match_value.si2ter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si2ter := ");
single_value.field_si2ter->log_match(match_value.si2ter(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si2quater:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si2quater");
single_value.field_si2quater->log_match(match_value.si2quater(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si2quater := ");
single_value.field_si2quater->log_match(match_value.si2quater(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si3:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si3");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si3 := ");
single_value.field_si3->log_match(match_value.si3(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si4:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si4");
single_value.field_si4->log_match(match_value.si4(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si4 := ");
single_value.field_si4->log_match(match_value.si4(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si5:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si5");
single_value.field_si5->log_match(match_value.si5(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si5 := ");
single_value.field_si5->log_match(match_value.si5(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si5bis:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si5bis");
single_value.field_si5bis->log_match(match_value.si5bis(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si5bis := ");
single_value.field_si5bis->log_match(match_value.si5bis(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si5ter:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si5ter");
single_value.field_si5ter->log_match(match_value.si5ter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si5ter := ");
single_value.field_si5ter->log_match(match_value.si5ter(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si6:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si6");
single_value.field_si6->log_match(match_value.si6(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si6 := ");
single_value.field_si6->log_match(match_value.si6(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_si13:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".si13");
single_value.field_si13->log_match(match_value.si13(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ si13 := ");
single_value.field_si13->log_match(match_value.si13(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SystemInformationUnion::ALT_other:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".other");
single_value.field_other->log_match(match_value.other(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ other := ");
single_value.field_other->log_match(match_value.other(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationUnion_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case SystemInformationUnion::ALT_si1:
single_value.field_si1->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si2:
single_value.field_si2->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si2bis:
single_value.field_si2bis->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si2ter:
single_value.field_si2ter->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si2quater:
single_value.field_si2quater->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si3:
single_value.field_si3->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si4:
single_value.field_si4->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si5:
single_value.field_si5->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si5bis:
single_value.field_si5bis->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si5ter:
single_value.field_si5ter->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si6:
single_value.field_si6->set_implicit_omit(); break;
case SystemInformationUnion::ALT_si13:
single_value.field_si13->set_implicit_omit(); break;
case SystemInformationUnion::ALT_other:
single_value.field_other->set_implicit_omit(); break;
default: break;
}
}

void SystemInformationUnion_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 SystemInformationUnion::ALT_si1:
single_value.field_si1->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2:
single_value.field_si2->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2bis:
single_value.field_si2bis->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2ter:
single_value.field_si2ter->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2quater:
single_value.field_si2quater->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si3:
single_value.field_si3->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si4:
single_value.field_si4->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si5:
single_value.field_si5->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si5bis:
single_value.field_si5bis->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si5ter:
single_value.field_si5ter->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si6:
single_value.field_si6->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_si13:
single_value.field_si13->encode_text(text_buf);
break;
case SystemInformationUnion::ALT_other:
single_value.field_other->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @GSM_SystemInformation.SystemInformationUnion.");
}
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 @GSM_SystemInformation.SystemInformationUnion.");
}
}

void SystemInformationUnion_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = SystemInformationUnion::UNBOUND_VALUE;
SystemInformationUnion::union_selection_type new_selection = (SystemInformationUnion::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case SystemInformationUnion::ALT_si1:
single_value.field_si1 = new SystemInformationType1_template;
single_value.field_si1->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2:
single_value.field_si2 = new SystemInformationType2_template;
single_value.field_si2->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2bis:
single_value.field_si2bis = new SystemInformationType2bis_template;
single_value.field_si2bis->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2ter:
single_value.field_si2ter = new SystemInformationType2ter_template;
single_value.field_si2ter->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si2quater:
single_value.field_si2quater = new SystemInformationType2quater_template;
single_value.field_si2quater->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si3:
single_value.field_si3 = new SystemInformationType3_template;
single_value.field_si3->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si4:
single_value.field_si4 = new SystemInformationType4_template;
single_value.field_si4->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si5:
single_value.field_si5 = new SystemInformationType5_template;
single_value.field_si5->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si5bis:
single_value.field_si5bis = new SystemInformationType5bis_template;
single_value.field_si5bis->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si5ter:
single_value.field_si5ter = new SystemInformationType5ter_template;
single_value.field_si5ter->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si6:
single_value.field_si6 = new SystemInformationType6_template;
single_value.field_si6->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_si13:
single_value.field_si13 = new SystemInformationType13_template;
single_value.field_si13->decode_text(text_buf);
break;
case SystemInformationUnion::ALT_other:
single_value.field_other = new OCTETSTRING_template;
single_value.field_other->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @GSM_SystemInformation.SystemInformationUnion.");
}
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 SystemInformationUnion_template[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 @GSM_SystemInformation.SystemInformationUnion.");
}
}

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

boolean SystemInformationUnion_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 SystemInformationUnion_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 `@GSM_SystemInformation.SystemInformationUnion'");
    }
    if (strcmp("si1", param_field) == 0) {
      si1().set_param(param);
      return;
    } else if (strcmp("si2", param_field) == 0) {
      si2().set_param(param);
      return;
    } else if (strcmp("si2bis", param_field) == 0) {
      si2bis().set_param(param);
      return;
    } else if (strcmp("si2ter", param_field) == 0) {
      si2ter().set_param(param);
      return;
    } else if (strcmp("si2quater", param_field) == 0) {
      si2quater().set_param(param);
      return;
    } else if (strcmp("si3", param_field) == 0) {
      si3().set_param(param);
      return;
    } else if (strcmp("si4", param_field) == 0) {
      si4().set_param(param);
      return;
    } else if (strcmp("si5", param_field) == 0) {
      si5().set_param(param);
      return;
    } else if (strcmp("si5bis", param_field) == 0) {
      si5bis().set_param(param);
      return;
    } else if (strcmp("si5ter", param_field) == 0) {
      si5ter().set_param(param);
      return;
    } else if (strcmp("si6", param_field) == 0) {
      si6().set_param(param);
      return;
    } else if (strcmp("si13", param_field) == 0) {
      si13().set_param(param);
      return;
    } else if (strcmp("other", param_field) == 0) {
      other().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@GSM_SystemInformation.SystemInformationUnion'", 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: {
    SystemInformationUnion_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", "@GSM_SystemInformation.SystemInformationUnion");
    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, "si1")) {
      si1().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si2")) {
      si2().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si2bis")) {
      si2bis().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si2ter")) {
      si2ter().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si2quater")) {
      si2quater().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si3")) {
      si3().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si4")) {
      si4().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si5")) {
      si5().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si5bis")) {
      si5bis().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si5ter")) {
      si5ter().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si6")) {
      si6().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "si13")) {
      si13().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "other")) {
      other().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @GSM_SystemInformation.SystemInformationUnion.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    SystemInformationUnion_template* precondition = new SystemInformationUnion_template;
    precondition->set_param(*m_p->get_elem(0));
    SystemInformationUnion_template* implied_template = new SystemInformationUnion_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = SystemInformationUnion_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@GSM_SystemInformation.SystemInformationUnion");
  }
  is_ifpresent = param.get_ifpresent();
}

void SystemInformationUnion_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 SystemInformationUnion::ALT_si1:
single_value.field_si1->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si2:
single_value.field_si2->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si2bis:
single_value.field_si2bis->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si2ter:
single_value.field_si2ter->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si2quater:
single_value.field_si2quater->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si3:
single_value.field_si3->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si4:
single_value.field_si4->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si5:
single_value.field_si5->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si5bis:
single_value.field_si5bis->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si5ter:
single_value.field_si5ter->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si6:
single_value.field_si6->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_si13:
single_value.field_si13->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
case SystemInformationUnion::ALT_other:
single_value.field_other->check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformationUnion");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @GSM_SystemInformation.SystemInformationUnion.");
}
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 : "@GSM_SystemInformation.SystemInformationUnion");
}

SystemInformation::SystemInformation()
{
}

SystemInformation::SystemInformation(const GSM__RR__Types::RrHeader& par_header,
    const SystemInformationUnion& par_payload)
  :   field_header(par_header),
  field_payload(par_payload)
{
}

SystemInformation::SystemInformation(const SystemInformation& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @GSM_SystemInformation.SystemInformation.");
if (other_value.header().is_bound()) field_header = other_value.header();
else field_header.clean_up();
if (other_value.payload().is_bound()) field_payload = other_value.payload();
else field_payload.clean_up();
}

void SystemInformation::clean_up()
{
field_header.clean_up();
field_payload.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformation::get_descriptor() const { return &SystemInformation_descr_; }
SystemInformation& SystemInformation::operator=(const SystemInformation& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @GSM_SystemInformation.SystemInformation.");
  if (other_value.header().is_bound()) field_header = other_value.header();
  else field_header.clean_up();
  if (other_value.payload().is_bound()) field_payload = other_value.payload();
  else field_payload.clean_up();
}
return *this;
}

boolean SystemInformation::operator==(const SystemInformation& other_value) const
{
return field_header==other_value.field_header
  && field_payload==other_value.field_payload;
}

boolean SystemInformation::is_bound() const
{
return (field_header.is_bound())
  || (field_payload.is_bound());
}
boolean SystemInformation::is_value() const
{
return field_header.is_value()
  && field_payload.is_value();
}
void SystemInformation::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ header := ");
field_header.log();
TTCN_Logger::log_event_str(", payload := ");
field_payload.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformation::set_implicit_omit()
{
if (header().is_bound()) header().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
}

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

void SystemInformation::encode_text(Text_Buf& text_buf) const
{
field_header.encode_text(text_buf);
field_payload.encode_text(text_buf);
}

void SystemInformation::decode_text(Text_Buf& text_buf)
{
field_header.decode_text(text_buf);
field_payload.decode_text(text_buf);
}

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

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

int SystemInformation::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  RAW_Force_Omit field_0_force_omit(0, force_omit, SystemInformation_header_descr_.raw->forceomit);
  decoded_field_length = field_header.RAW_decode(SystemInformation_header_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__1) selected_field = 0;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2) selected_field = 1;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2bis) selected_field = 2;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2ter) selected_field = 3;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2quater) selected_field = 4;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__3) selected_field = 5;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__4) selected_field = 6;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5) selected_field = 7;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5bis) selected_field = 8;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5ter) selected_field = 9;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__6) selected_field = 10;
  else if (field_header.message__type() == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__13) selected_field = 11;
  else selected_field = 12;
  RAW_Force_Omit field_1_force_omit(1, force_omit, SystemInformation_payload_descr_.raw->forceomit);
  decoded_field_length = field_payload.RAW_decode(SystemInformation_payload_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int SystemInformation::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 2;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(2);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, SystemInformation_header_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, SystemInformation_payload_descr_.raw);
  encoded_length += field_header.RAW_encode(SystemInformation_header_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_payload.RAW_encode(SystemInformation_payload_descr_, *myleaf.body.node.nodes[1]);
  switch (field_payload.get_selection()) {
  case SystemInformationUnion::ALT_si1:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__1) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__1);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si2:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si2bis:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2bis) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2bis);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si2ter:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2ter) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2ter);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si2quater:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2quater) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__2quater);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si3:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__3) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__3);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si4:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__4) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__4);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si5:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si5bis:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5bis) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5bis);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si5ter:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5ter) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5ter);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si6:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__6) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__6);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  case SystemInformationUnion::ALT_si13:
  if (field_header.message__type() != GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__13) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 2;
  int new_pos[] = { 0, 3 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 2, new_pos);
  GSM__RR__Types::RrMessageType new_val(GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__13);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(GSM__RR__Types::RrHeader_message__type_descr_,*temp_leaf);
  else
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value.");
  free_tree_pos(pr_pos.pos);
  }
  break;
  default:;
  }
  return myleaf.length = encoded_length;
}

struct SystemInformation_template::single_value_struct {
GSM__RR__Types::RrHeader_template field_header;
SystemInformationUnion_template field_payload;
};

void SystemInformation_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_header = ANY_VALUE;
single_value->field_payload = ANY_VALUE;
}
}
}

void SystemInformation_template::copy_value(const SystemInformation& other_value)
{
single_value = new single_value_struct;
if (other_value.header().is_bound()) {
  single_value->field_header = other_value.header();
} else {
  single_value->field_header.clean_up();
}
if (other_value.payload().is_bound()) {
  single_value->field_payload = other_value.payload();
} else {
  single_value->field_payload.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformation_template::copy_template(const SystemInformation_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.header().get_selection()) {
single_value->field_header = other_value.header();
} else {
single_value->field_header.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.payload().get_selection()) {
single_value->field_payload = other_value.payload();
} else {
single_value->field_payload.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 SystemInformation_template[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 SystemInformation_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformation_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 @GSM_SystemInformation.SystemInformation.");
break;
}
set_selection(other_value);
}

SystemInformation_template::SystemInformation_template()
{
}

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

SystemInformation_template::SystemInformation_template(const SystemInformation& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean SystemInformation_template::match(const SystemInformation& 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.header().is_bound()) return FALSE;
if(!single_value->field_header.match(other_value.header(), legacy))return FALSE;
if(!other_value.payload().is_bound()) return FALSE;
if(!single_value->field_payload.match(other_value.payload(), 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 @GSM_SystemInformation.SystemInformation.");
}
return FALSE;
}

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

boolean SystemInformation_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_header.is_value()
 && single_value->field_payload.is_value();
}

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

SystemInformation SystemInformation_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 @GSM_SystemInformation.SystemInformation.");
SystemInformation ret_val;
if (single_value->field_header.is_bound()) {
ret_val.header() = single_value->field_header.valueof();
}
if (single_value->field_payload.is_bound()) {
ret_val.payload() = single_value->field_payload.valueof();
}
return ret_val;
}

void SystemInformation_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 @GSM_SystemInformation.SystemInformation.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformation_template[list_length];
}

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

GSM__RR__Types::RrHeader_template& SystemInformation_template::header()
{
set_specific();
return single_value->field_header;
}

const GSM__RR__Types::RrHeader_template& SystemInformation_template::header() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field header of a non-specific template of type @GSM_SystemInformation.SystemInformation.");
return single_value->field_header;
}

SystemInformationUnion_template& SystemInformation_template::payload()
{
set_specific();
return single_value->field_payload;
}

const SystemInformationUnion_template& SystemInformation_template::payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field payload of a non-specific template of type @GSM_SystemInformation.SystemInformation.");
return single_value->field_payload;
}

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

void SystemInformation_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ header := ");
single_value->field_header.log();
TTCN_Logger::log_event_str(", payload := ");
single_value->field_payload.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 SystemInformation_template::log_match(const SystemInformation& 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_header.match(match_value.header(), legacy)){
TTCN_Logger::log_logmatch_info(".header");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_payload.match(match_value.payload(), legacy)){
TTCN_Logger::log_logmatch_info(".payload");
single_value->field_payload.log_match(match_value.payload(), 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("{ header := ");
single_value->field_header.log_match(match_value.header(), legacy);
TTCN_Logger::log_event_str(", payload := ");
single_value->field_payload.log_match(match_value.payload(), 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 SystemInformation_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (header().is_bound()) header().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
}

void SystemInformation_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_header.encode_text(text_buf);
single_value->field_payload.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 @GSM_SystemInformation.SystemInformation.");
}
}

void SystemInformation_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_header.decode_text(text_buf);
single_value->field_payload.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 SystemInformation_template[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 @GSM_SystemInformation.SystemInformation.");
}
}

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

void SystemInformation_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_header.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformation");
single_value->field_payload.check_restriction(t_res, t_name ? t_name : "@GSM_SystemInformation.SystemInformation");
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 : "@GSM_SystemInformation.SystemInformation");
}

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

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


/* Bodies of functions, altsteps and testcases */

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

INTEGER ArfcnOrMaio_arfcn_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(ArfcnOrMaio_arfcn_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 ArfcnOrMaio_maio__hsn_encoder(const GSM__RR__Types::MaioHsn& 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 `@GSM_RR_Types.MaioHsn' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ArfcnOrMaio_maio__hsn_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ArfcnOrMaio_maio__hsn_decoder(OCTETSTRING& input_stream, GSM__RR__Types::MaioHsn& 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 `@GSM_RR_Types.MaioHsn' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ArfcnOrMaio_maio__hsn_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 ArfcnOrMaio_encoder(const ArfcnOrMaio& 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 `@GSM_SystemInformation.ArfcnOrMaio' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ArfcnOrMaio_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ArfcnOrMaio_decoder(OCTETSTRING& input_stream, ArfcnOrMaio& 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 `@GSM_SystemInformation.ArfcnOrMaio' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ArfcnOrMaio_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 SysinfoCellIdentity_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(SysinfoCellIdentity_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SysinfoCellIdentity_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(SysinfoCellIdentity_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 CellChannelDescription_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(CellChannelDescription_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellChannelDescription_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(CellChannelDescription_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 CellOptions__DTX_encoder(const CellOptions__DTX& 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 `@GSM_SystemInformation.CellOptions_DTX' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellOptions__DTX_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptions__DTX_decoder(OCTETSTRING& input_stream, CellOptions__DTX& 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 `@GSM_SystemInformation.CellOptions_DTX' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellOptions__DTX_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 CellOptions_dn__ind_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellOptions_dn__ind_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptions_dn__ind_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellOptions_dn__ind_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 CellOptions_pwrc_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellOptions_pwrc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptions_pwrc_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellOptions_pwrc_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 CellOptions_dtx_encoder(const CellOptions__DTX& 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 `@GSM_SystemInformation.CellOptions_DTX' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellOptions_dtx_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptions_dtx_decoder(OCTETSTRING& input_stream, CellOptions__DTX& 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 `@GSM_SystemInformation.CellOptions_DTX' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellOptions_dtx_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 CellOptions_radio__link__tout__div4_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(CellOptions_radio__link__tout__div4_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptions_radio__link__tout__div4_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(CellOptions_radio__link__tout__div4_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 CellOptions_encoder(const CellOptions& 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 `@GSM_SystemInformation.CellOptions' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellOptions_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptions_decoder(OCTETSTRING& input_stream, CellOptions& 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 `@GSM_SystemInformation.CellOptions' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellOptions_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 CellOptionsSacch_dtx__ext_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(CellOptionsSacch_dtx__ext_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptionsSacch_dtx__ext_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(CellOptionsSacch_dtx__ext_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 CellOptionsSacch_pwrc_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellOptionsSacch_pwrc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptionsSacch_pwrc_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellOptionsSacch_pwrc_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 CellOptionsSacch_dtx_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(CellOptionsSacch_dtx_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptionsSacch_dtx_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(CellOptionsSacch_dtx_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 CellOptionsSacch_radio__link__timeout_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(CellOptionsSacch_radio__link__timeout_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptionsSacch_radio__link__timeout_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(CellOptionsSacch_radio__link__timeout_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 CellOptionsSacch_encoder(const CellOptionsSacch& 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 `@GSM_SystemInformation.CellOptionsSacch' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellOptionsSacch_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellOptionsSacch_decoder(OCTETSTRING& input_stream, CellOptionsSacch& 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 `@GSM_SystemInformation.CellOptionsSacch' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellOptionsSacch_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 CellSelectionParameters_cell__resel__hyst__2dB_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(CellSelectionParameters_cell__resel__hyst__2dB_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellSelectionParameters_cell__resel__hyst__2dB_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(CellSelectionParameters_cell__resel__hyst__2dB_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 CellSelectionParameters_ms__txpwr__max__cch_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(CellSelectionParameters_ms__txpwr__max__cch_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellSelectionParameters_ms__txpwr__max__cch_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(CellSelectionParameters_ms__txpwr__max__cch_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 CellSelectionParameters_acs_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(CellSelectionParameters_acs_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellSelectionParameters_acs_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(CellSelectionParameters_acs_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 CellSelectionParameters_neci_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellSelectionParameters_neci_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellSelectionParameters_neci_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellSelectionParameters_neci_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 CellSelectionParameters_rxlev__access__min_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(CellSelectionParameters_rxlev__access__min_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellSelectionParameters_rxlev__access__min_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(CellSelectionParameters_rxlev__access__min_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 CellSelectionParameters_encoder(const CellSelectionParameters& 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 `@GSM_SystemInformation.CellSelectionParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CellSelectionParameters_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CellSelectionParameters_decoder(OCTETSTRING& input_stream, CellSelectionParameters& 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 `@GSM_SystemInformation.CellSelectionParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CellSelectionParameters_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 CtrlChanDesc__CC_encoder(const CtrlChanDesc__CC& 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 `@GSM_SystemInformation.CtrlChanDesc_CC' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CtrlChanDesc__CC_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CtrlChanDesc__CC_decoder(OCTETSTRING& input_stream, CtrlChanDesc__CC& 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 `@GSM_SystemInformation.CtrlChanDesc_CC' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CtrlChanDesc__CC_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 CBQ3_encoder(const CBQ3& 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 `@GSM_SystemInformation.CBQ3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(CBQ3_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER CBQ3_decoder(OCTETSTRING& input_stream, CBQ3& 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 `@GSM_SystemInformation.CBQ3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(CBQ3_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 ControlChannelDescription_msc__r99_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ControlChannelDescription_msc__r99_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_msc__r99_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ControlChannelDescription_msc__r99_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 ControlChannelDescription_att_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ControlChannelDescription_att_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_att_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ControlChannelDescription_att_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 ControlChannelDescription_bs__ag__blks__res_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(ControlChannelDescription_bs__ag__blks__res_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_bs__ag__blks__res_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(ControlChannelDescription_bs__ag__blks__res_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 ControlChannelDescription_ccch__conf_encoder(const CtrlChanDesc__CC& 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 `@GSM_SystemInformation.CtrlChanDesc_CC' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ControlChannelDescription_ccch__conf_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_ccch__conf_decoder(OCTETSTRING& input_stream, CtrlChanDesc__CC& 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 `@GSM_SystemInformation.CtrlChanDesc_CC' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ControlChannelDescription_ccch__conf_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 ControlChannelDescription_si22ind_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ControlChannelDescription_si22ind_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_si22ind_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ControlChannelDescription_si22ind_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 ControlChannelDescription_cbq3_encoder(const CBQ3& 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 `@GSM_SystemInformation.CBQ3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ControlChannelDescription_cbq3_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_cbq3_decoder(OCTETSTRING& input_stream, CBQ3& 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 `@GSM_SystemInformation.CBQ3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ControlChannelDescription_cbq3_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 ControlChannelDescription_spare_encoder(const BITSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ControlChannelDescription_spare_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

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

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

INTEGER ControlChannelDescription_bs__pa__mfrms_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(ControlChannelDescription_bs__pa__mfrms_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 ControlChannelDescription_t3212_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(ControlChannelDescription_t3212_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_t3212_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(ControlChannelDescription_t3212_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 ControlChannelDescription_encoder(const ControlChannelDescription& 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 `@GSM_SystemInformation.ControlChannelDescription' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(ControlChannelDescription_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER ControlChannelDescription_decoder(OCTETSTRING& input_stream, ControlChannelDescription& 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 `@GSM_SystemInformation.ControlChannelDescription' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(ControlChannelDescription_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 NeighbourCellDescription_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(NeighbourCellDescription_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NeighbourCellDescription_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(NeighbourCellDescription_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 NeighbourCellDescription2_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(NeighbourCellDescription2_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NeighbourCellDescription2_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(NeighbourCellDescription2_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 AccessControlClass_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(AccessControlClass_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER AccessControlClass_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(AccessControlClass_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 RachCtrlPar__MR_encoder(const RachCtrlPar__MR& 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 `@GSM_SystemInformation.RachCtrlPar_MR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RachCtrlPar__MR_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RachCtrlPar__MR_decoder(OCTETSTRING& input_stream, RachCtrlPar__MR& 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 `@GSM_SystemInformation.RachCtrlPar_MR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RachCtrlPar__MR_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 RachControlParameters_max__retrans_encoder(const RachCtrlPar__MR& 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 `@GSM_SystemInformation.RachCtrlPar_MR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RachControlParameters_max__retrans_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RachControlParameters_max__retrans_decoder(OCTETSTRING& input_stream, RachCtrlPar__MR& 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 `@GSM_SystemInformation.RachCtrlPar_MR' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RachControlParameters_max__retrans_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 RachControlParameters_tx__integer_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(RachControlParameters_tx__integer_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RachControlParameters_tx__integer_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(RachControlParameters_tx__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 RachControlParameters_cell__barr__access_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RachControlParameters_cell__barr__access_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RachControlParameters_cell__barr__access_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RachControlParameters_cell__barr__access_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 RachControlParameters_re__not__allowed_encoder(const BOOLEAN& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RachControlParameters_re__not__allowed_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RachControlParameters_re__not__allowed_decoder(OCTETSTRING& input_stream, BOOLEAN& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `boolean' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RachControlParameters_re__not__allowed_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 RachControlParameters_acc_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(RachControlParameters_acc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RachControlParameters_acc_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(RachControlParameters_acc_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 RachControlParameters_encoder(const RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(RachControlParameters_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER RachControlParameters_decoder(OCTETSTRING& input_stream, RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(RachControlParameters_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 SystemInformationType1_cell__chan__desc_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(SystemInformationType1_cell__chan__desc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType1_cell__chan__desc_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(SystemInformationType1_cell__chan__desc_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 SystemInformationType1_rach__control_encoder(const RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType1_rach__control_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType1_rach__control_decoder(OCTETSTRING& input_stream, RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType1_rach__control_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 SystemInformationType1_rest__octets_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(SystemInformationType1_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType1_rest__octets_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(SystemInformationType1_rest__octets_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 SystemInformationType1_encoder(const SystemInformationType1& 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 `@GSM_SystemInformation.SystemInformationType1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType1_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType1_decoder(OCTETSTRING& input_stream, SystemInformationType1& 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 `@GSM_SystemInformation.SystemInformationType1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType1_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 SystemInformationType2_bcch__freq__list_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(SystemInformationType2_bcch__freq__list_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2_bcch__freq__list_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(SystemInformationType2_bcch__freq__list_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 SystemInformationType2_ncc__permitted_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(SystemInformationType2_ncc__permitted_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2_ncc__permitted_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(SystemInformationType2_ncc__permitted_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 SystemInformationType2_rach__control_encoder(const RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType2_rach__control_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2_rach__control_decoder(OCTETSTRING& input_stream, RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType2_rach__control_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 SystemInformationType2_encoder(const SystemInformationType2& 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 `@GSM_SystemInformation.SystemInformationType2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType2_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2_decoder(OCTETSTRING& input_stream, SystemInformationType2& 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 `@GSM_SystemInformation.SystemInformationType2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType2_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 SystemInformationType2bis_extd__bcch__freq__list_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(SystemInformationType2bis_extd__bcch__freq__list_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2bis_extd__bcch__freq__list_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(SystemInformationType2bis_extd__bcch__freq__list_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 SystemInformationType2bis_rach__control_encoder(const RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType2bis_rach__control_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2bis_rach__control_decoder(OCTETSTRING& input_stream, RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType2bis_rach__control_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 SystemInformationType2bis_rest__octets_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(SystemInformationType2bis_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2bis_rest__octets_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(SystemInformationType2bis_rest__octets_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 SystemInformationType2bis_encoder(const SystemInformationType2bis& 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 `@GSM_SystemInformation.SystemInformationType2bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType2bis_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2bis_decoder(OCTETSTRING& input_stream, SystemInformationType2bis& 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 `@GSM_SystemInformation.SystemInformationType2bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType2bis_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 SystemInformationType2ter_extd__bcch__freq__list_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(SystemInformationType2ter_extd__bcch__freq__list_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2ter_extd__bcch__freq__list_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(SystemInformationType2ter_extd__bcch__freq__list_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 SystemInformationType2ter_rest__octets_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(SystemInformationType2ter_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2ter_rest__octets_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(SystemInformationType2ter_rest__octets_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 SystemInformationType2ter_encoder(const SystemInformationType2ter& 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 `@GSM_SystemInformation.SystemInformationType2ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType2ter_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2ter_decoder(OCTETSTRING& input_stream, SystemInformationType2ter& 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 `@GSM_SystemInformation.SystemInformationType2ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType2ter_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 SystemInformationType2quater_rest__octets_encoder(const GSM__RestOctets::SI2quaterRestOctets& 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 `@GSM_RestOctets.SI2quaterRestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType2quater_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2quater_rest__octets_decoder(OCTETSTRING& input_stream, GSM__RestOctets::SI2quaterRestOctets& 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 `@GSM_RestOctets.SI2quaterRestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType2quater_rest__octets_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 SystemInformationType2quater_encoder(const SystemInformationType2quater& 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 `@GSM_SystemInformation.SystemInformationType2quater' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType2quater_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType2quater_decoder(OCTETSTRING& input_stream, SystemInformationType2quater& 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 `@GSM_SystemInformation.SystemInformationType2quater' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType2quater_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 SystemInformationType3_cell__id_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(SystemInformationType3_cell__id_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_cell__id_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(SystemInformationType3_cell__id_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 SystemInformationType3_lai_encoder(const GSM__Types::LocationAreaIdentification& 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 `@GSM_Types.LocationAreaIdentification' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType3_lai_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_lai_decoder(OCTETSTRING& input_stream, GSM__Types::LocationAreaIdentification& 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 `@GSM_Types.LocationAreaIdentification' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType3_lai_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 SystemInformationType3_ctrl__chan__desc_encoder(const ControlChannelDescription& 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 `@GSM_SystemInformation.ControlChannelDescription' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType3_ctrl__chan__desc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_ctrl__chan__desc_decoder(OCTETSTRING& input_stream, ControlChannelDescription& 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 `@GSM_SystemInformation.ControlChannelDescription' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType3_ctrl__chan__desc_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 SystemInformationType3_cell__options_encoder(const CellOptions& 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 `@GSM_SystemInformation.CellOptions' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType3_cell__options_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_cell__options_decoder(OCTETSTRING& input_stream, CellOptions& 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 `@GSM_SystemInformation.CellOptions' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType3_cell__options_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 SystemInformationType3_cell__sel__par_encoder(const CellSelectionParameters& 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 `@GSM_SystemInformation.CellSelectionParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType3_cell__sel__par_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_cell__sel__par_decoder(OCTETSTRING& input_stream, CellSelectionParameters& 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 `@GSM_SystemInformation.CellSelectionParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType3_cell__sel__par_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 SystemInformationType3_rach__control_encoder(const RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType3_rach__control_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_rach__control_decoder(OCTETSTRING& input_stream, RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType3_rach__control_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 SystemInformationType3_rest__octets_encoder(const GSM__RestOctets::SI3RestOctets& 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 `@GSM_RestOctets.SI3RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType3_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_rest__octets_decoder(OCTETSTRING& input_stream, GSM__RestOctets::SI3RestOctets& 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 `@GSM_RestOctets.SI3RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType3_rest__octets_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 SystemInformationType3_encoder(const SystemInformationType3& 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 `@GSM_SystemInformation.SystemInformationType3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType3_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType3_decoder(OCTETSTRING& input_stream, SystemInformationType3& 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 `@GSM_SystemInformation.SystemInformationType3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType3_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 SystemInformationType4_lai_encoder(const GSM__Types::LocationAreaIdentification& 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 `@GSM_Types.LocationAreaIdentification' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType4_lai_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType4_lai_decoder(OCTETSTRING& input_stream, GSM__Types::LocationAreaIdentification& 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 `@GSM_Types.LocationAreaIdentification' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType4_lai_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 SystemInformationType4_cell__sel__par_encoder(const CellSelectionParameters& 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 `@GSM_SystemInformation.CellSelectionParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType4_cell__sel__par_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType4_cell__sel__par_decoder(OCTETSTRING& input_stream, CellSelectionParameters& 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 `@GSM_SystemInformation.CellSelectionParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType4_cell__sel__par_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 SystemInformationType4_rach__control_encoder(const RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType4_rach__control_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType4_rach__control_decoder(OCTETSTRING& input_stream, RachControlParameters& 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 `@GSM_SystemInformation.RachControlParameters' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType4_rach__control_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 SystemInformationType4_rest__octets_encoder(const GSM__RestOctets::SI4RestOctets& 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 `@GSM_RestOctets.SI4RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType4_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType4_rest__octets_decoder(OCTETSTRING& input_stream, GSM__RestOctets::SI4RestOctets& 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 `@GSM_RestOctets.SI4RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType4_rest__octets_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 SystemInformationType4_cbch__chan__desc_encoder(const GSM__RR__Types::ChannelDescriptionTV& 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 `@GSM_RR_Types.ChannelDescriptionTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType4_cbch__chan__desc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType4_cbch__chan__desc_decoder(OCTETSTRING& input_stream, GSM__RR__Types::ChannelDescriptionTV& 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 `@GSM_RR_Types.ChannelDescriptionTV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType4_cbch__chan__desc_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 SystemInformationType4_cbch__mobile__alloc_encoder(const GSM__RR__Types::MobileAllocationTLV& 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 `@GSM_RR_Types.MobileAllocationTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType4_cbch__mobile__alloc_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType4_cbch__mobile__alloc_decoder(OCTETSTRING& input_stream, GSM__RR__Types::MobileAllocationTLV& 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 `@GSM_RR_Types.MobileAllocationTLV' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType4_cbch__mobile__alloc_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 SystemInformationType4_encoder(const SystemInformationType4& 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 `@GSM_SystemInformation.SystemInformationType4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType4_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType4_decoder(OCTETSTRING& input_stream, SystemInformationType4& 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 `@GSM_SystemInformation.SystemInformationType4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType4_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 SystemInformationType5_bcch__freq__list_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(SystemInformationType5_bcch__freq__list_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType5_bcch__freq__list_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(SystemInformationType5_bcch__freq__list_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 SystemInformationType5_encoder(const SystemInformationType5& 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 `@GSM_SystemInformation.SystemInformationType5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType5_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType5_decoder(OCTETSTRING& input_stream, SystemInformationType5& 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 `@GSM_SystemInformation.SystemInformationType5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType5_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 SystemInformationType5bis_extd__bcch__freq__list_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(SystemInformationType5bis_extd__bcch__freq__list_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType5bis_extd__bcch__freq__list_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(SystemInformationType5bis_extd__bcch__freq__list_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 SystemInformationType5bis_encoder(const SystemInformationType5bis& 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 `@GSM_SystemInformation.SystemInformationType5bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType5bis_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType5bis_decoder(OCTETSTRING& input_stream, SystemInformationType5bis& 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 `@GSM_SystemInformation.SystemInformationType5bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType5bis_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 SystemInformationType5ter_extd__bcch__freq__list_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(SystemInformationType5ter_extd__bcch__freq__list_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType5ter_extd__bcch__freq__list_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(SystemInformationType5ter_extd__bcch__freq__list_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 SystemInformationType5ter_encoder(const SystemInformationType5ter& 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 `@GSM_SystemInformation.SystemInformationType5ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType5ter_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType5ter_decoder(OCTETSTRING& input_stream, SystemInformationType5ter& 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 `@GSM_SystemInformation.SystemInformationType5ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType5ter_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 SystemInformationType6_cell__id_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(SystemInformationType6_cell__id_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType6_cell__id_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(SystemInformationType6_cell__id_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 SystemInformationType6_lai_encoder(const GSM__Types::LocationAreaIdentification& 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 `@GSM_Types.LocationAreaIdentification' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType6_lai_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType6_lai_decoder(OCTETSTRING& input_stream, GSM__Types::LocationAreaIdentification& 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 `@GSM_Types.LocationAreaIdentification' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType6_lai_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 SystemInformationType6_cell__options_encoder(const CellOptionsSacch& 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 `@GSM_SystemInformation.CellOptionsSacch' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType6_cell__options_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType6_cell__options_decoder(OCTETSTRING& input_stream, CellOptionsSacch& 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 `@GSM_SystemInformation.CellOptionsSacch' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType6_cell__options_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 SystemInformationType6_ncc__permitted_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(SystemInformationType6_ncc__permitted_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType6_ncc__permitted_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(SystemInformationType6_ncc__permitted_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 SystemInformationType6_rest__octets_encoder(const GSM__RestOctets::SI6RestOctets& 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 `@GSM_RestOctets.SI6RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType6_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType6_rest__octets_decoder(OCTETSTRING& input_stream, GSM__RestOctets::SI6RestOctets& 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 `@GSM_RestOctets.SI6RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType6_rest__octets_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 SystemInformationType6_encoder(const SystemInformationType6& 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 `@GSM_SystemInformation.SystemInformationType6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType6_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType6_decoder(OCTETSTRING& input_stream, SystemInformationType6& 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 `@GSM_SystemInformation.SystemInformationType6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType6_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 SystemInformationType13_rest__octets_encoder(const GSM__RestOctets::SI13RestOctets& 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 `@GSM_RestOctets.SI13RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType13_rest__octets_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType13_rest__octets_decoder(OCTETSTRING& input_stream, GSM__RestOctets::SI13RestOctets& 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 `@GSM_RestOctets.SI13RestOctets' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType13_rest__octets_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 SystemInformationType13_encoder(const SystemInformationType13& 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 `@GSM_SystemInformation.SystemInformationType13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationType13_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationType13_decoder(OCTETSTRING& input_stream, SystemInformationType13& 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 `@GSM_SystemInformation.SystemInformationType13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationType13_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 SystemInformationUnion_si1_encoder(const SystemInformationType1& 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 `@GSM_SystemInformation.SystemInformationType1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si1_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si1_decoder(OCTETSTRING& input_stream, SystemInformationType1& 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 `@GSM_SystemInformation.SystemInformationType1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si1_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 SystemInformationUnion_si2_encoder(const SystemInformationType2& 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 `@GSM_SystemInformation.SystemInformationType2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si2_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si2_decoder(OCTETSTRING& input_stream, SystemInformationType2& 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 `@GSM_SystemInformation.SystemInformationType2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si2_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 SystemInformationUnion_si2bis_encoder(const SystemInformationType2bis& 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 `@GSM_SystemInformation.SystemInformationType2bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si2bis_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si2bis_decoder(OCTETSTRING& input_stream, SystemInformationType2bis& 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 `@GSM_SystemInformation.SystemInformationType2bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si2bis_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 SystemInformationUnion_si2ter_encoder(const SystemInformationType2ter& 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 `@GSM_SystemInformation.SystemInformationType2ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si2ter_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si2ter_decoder(OCTETSTRING& input_stream, SystemInformationType2ter& 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 `@GSM_SystemInformation.SystemInformationType2ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si2ter_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 SystemInformationUnion_si2quater_encoder(const SystemInformationType2quater& 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 `@GSM_SystemInformation.SystemInformationType2quater' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si2quater_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si2quater_decoder(OCTETSTRING& input_stream, SystemInformationType2quater& 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 `@GSM_SystemInformation.SystemInformationType2quater' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si2quater_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 SystemInformationUnion_si3_encoder(const SystemInformationType3& 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 `@GSM_SystemInformation.SystemInformationType3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si3_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si3_decoder(OCTETSTRING& input_stream, SystemInformationType3& 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 `@GSM_SystemInformation.SystemInformationType3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si3_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 SystemInformationUnion_si4_encoder(const SystemInformationType4& 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 `@GSM_SystemInformation.SystemInformationType4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si4_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si4_decoder(OCTETSTRING& input_stream, SystemInformationType4& 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 `@GSM_SystemInformation.SystemInformationType4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si4_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 SystemInformationUnion_si5_encoder(const SystemInformationType5& 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 `@GSM_SystemInformation.SystemInformationType5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si5_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si5_decoder(OCTETSTRING& input_stream, SystemInformationType5& 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 `@GSM_SystemInformation.SystemInformationType5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si5_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 SystemInformationUnion_si5bis_encoder(const SystemInformationType5bis& 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 `@GSM_SystemInformation.SystemInformationType5bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si5bis_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si5bis_decoder(OCTETSTRING& input_stream, SystemInformationType5bis& 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 `@GSM_SystemInformation.SystemInformationType5bis' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si5bis_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 SystemInformationUnion_si5ter_encoder(const SystemInformationType5ter& 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 `@GSM_SystemInformation.SystemInformationType5ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si5ter_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si5ter_decoder(OCTETSTRING& input_stream, SystemInformationType5ter& 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 `@GSM_SystemInformation.SystemInformationType5ter' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si5ter_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 SystemInformationUnion_si6_encoder(const SystemInformationType6& 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 `@GSM_SystemInformation.SystemInformationType6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si6_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si6_decoder(OCTETSTRING& input_stream, SystemInformationType6& 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 `@GSM_SystemInformation.SystemInformationType6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si6_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 SystemInformationUnion_si13_encoder(const SystemInformationType13& 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 `@GSM_SystemInformation.SystemInformationType13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_si13_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformationUnion_si13_decoder(OCTETSTRING& input_stream, SystemInformationType13& 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 `@GSM_SystemInformation.SystemInformationType13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_si13_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 SystemInformationUnion_other_encoder(const OCTETSTRING& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformationUnion_other_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

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

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

INTEGER SystemInformationUnion_decoder(OCTETSTRING& input_stream, SystemInformationUnion& 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 `@GSM_SystemInformation.SystemInformationUnion' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformationUnion_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 SystemInformation_header_encoder(const GSM__RR__Types::RrHeader& 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 `@GSM_RR_Types.RrHeader' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformation_header_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformation_header_decoder(OCTETSTRING& input_stream, GSM__RR__Types::RrHeader& 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 `@GSM_RR_Types.RrHeader' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformation_header_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 SystemInformation_payload_encoder(const SystemInformationUnion& 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 `@GSM_SystemInformation.SystemInformationUnion' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(SystemInformation_payload_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER SystemInformation_payload_decoder(OCTETSTRING& input_stream, SystemInformationUnion& 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 `@GSM_SystemInformation.SystemInformationUnion' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformation_payload_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

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

INTEGER SystemInformation_decoder(OCTETSTRING& input_stream, SystemInformation& 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 `@GSM_SystemInformation.SystemInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(SystemInformation_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

OCTETSTRING enc__SystemInformationNoPad(const SystemInformation& si)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("enc_SystemInformationNoPad(): Encoding @GSM_SystemInformation.SystemInformation: ");
si.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
TTCN_Buffer ttcn_buffer;
si.encode(SystemInformation_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_SystemInformationNoPad(): Stream after encoding: ");
ret_val.log();
TTCN_Logger::end_event();
}
return ret_val;
}

SystemInformation dec__SystemInformation(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_SystemInformation(): 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);
SystemInformation ret_val;
ret_val.decode(SystemInformation_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_SystemInformation(): Decoded @GSM_SystemInformation.SystemInformation: ");
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_SystemInformation(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
}
return ret_val;
}

OCTETSTRING enc__SystemInformation(const SystemInformation& si)
{
TTCN_Location current_location("GSM_SystemInformation.ttcn", 244, TTCN_Location::LOCATION_FUNCTION, "enc_SystemInformation");
current_location.update_lineno(246);
/* GSM_SystemInformation.ttcn, line 246 */
OCTETSTRING si__enc(enc__SystemInformationNoPad(si));
{
const GSM__RR__Types::RrMessageType &tmp_1 = const_cast< const SystemInformation&>(si).header().message__type();
current_location.update_lineno(250);
/* GSM_SystemInformation.ttcn, line 250 */
if(tmp_1 == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5) goto tmp_0_0;
current_location.update_lineno(251);
/* GSM_SystemInformation.ttcn, line 251 */
if(tmp_1 == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5bis) goto tmp_0_0;
current_location.update_lineno(252);
/* GSM_SystemInformation.ttcn, line 252 */
if(tmp_1 == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__5ter) goto tmp_0_0;
current_location.update_lineno(256);
/* GSM_SystemInformation.ttcn, line 256 */
if(tmp_1 == GSM__RR__Types::RrMessageType::SYSTEM__INFORMATION__TYPE__6) goto tmp_0_1;
goto tmp_0_2;
tmp_0_0:
{
current_location.update_lineno(254);
/* GSM_SystemInformation.ttcn, line 254 */
return si__enc;
}
tmp_0_1:
{
current_location.update_lineno(258);
/* GSM_SystemInformation.ttcn, line 258 */
return Osmocom__Types::f__pad__oct(si__enc, 19, os_2);
}
tmp_0_2:
{
current_location.update_lineno(262);
/* GSM_SystemInformation.ttcn, line 262 */
return Osmocom__Types::f__pad__oct(si__enc, 23, os_2);
}
}
}

INTEGER dec__SystemInformationSafeBT(const OCTETSTRING& stream, SystemInformation& si)
{
if (TTCN_Logger::log_this_event(TTCN_Logger::DEBUG_ENCDEC)) {
TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);
TTCN_Logger::log_event_str("dec_SystemInformationSafeBT(): Stream before decoding: ");
stream.log();
TTCN_Logger::end_event();
}
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_WARNING);
TTCN_EncDec::clear_error();
TTCN_Buffer ttcn_buffer(stream);
si.decode(SystemInformation_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_SystemInformationSafeBT(): Decoded @GSM_SystemInformation.SystemInformation: ");
si.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_SystemInformationSafeBT(): Data remained at the end of the stream after successful decoding: %s", (const char*) remaining_stream);
}
return 0;
} else {
return 1;
}
}

INTEGER dec__SystemInformationSafe(const OCTETSTRING& stream, SystemInformation& si)
{
TTCN_Location current_location("GSM_SystemInformation.ttcn", 274, TTCN_Location::LOCATION_FUNCTION, "dec_SystemInformationSafe");
current_location.update_lineno(277);
/* GSM_SystemInformation.ttcn, line 277 */
{
boolean tmp_4;
{
SystemInformation tmp_2;
INTEGER tmp_3 = dec__SystemInformationSafeBT(stream, tmp_2);
if (tmp_2.is_bound()) si = tmp_2;
tmp_4 = (tmp_3 != 0);
}
if (tmp_4) {
current_location.update_lineno(278);
/* GSM_SystemInformation.ttcn, line 278 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Failed to decode (RR) System Information: ");
stream.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(279);
/* GSM_SystemInformation.ttcn, line 279 */
return 1;
}
}
current_location.update_lineno(283);
/* GSM_SystemInformation.ttcn, line 283 */
if ((const_cast< const SystemInformation&>(si).header().rr__protocol__discriminator() != 6)) {
current_location.update_lineno(284);
/* GSM_SystemInformation.ttcn, line 284 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Protocol discriminator is not RR (!= '0110'B): ");
const_cast< const SystemInformation&>(si).header().rr__protocol__discriminator().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(286);
/* GSM_SystemInformation.ttcn, line 286 */
return 1;
}
current_location.update_lineno(289);
/* GSM_SystemInformation.ttcn, line 289 */
return 0;
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("GSM_SystemInformation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "GSM_SystemInformation");
GSM__RR__Types::module_object.pre_init_module();
module_object.add_function("enc_SystemInformationNoPad", (genericfunc_t)&enc__SystemInformationNoPad, NULL);
module_object.add_function("dec_SystemInformation", (genericfunc_t)&dec__SystemInformation, NULL);
module_object.add_function("enc_SystemInformation", (genericfunc_t)&enc__SystemInformation, NULL);
module_object.add_function("dec_SystemInformationSafeBT", (genericfunc_t)&dec__SystemInformationSafeBT, NULL);
module_object.add_function("dec_SystemInformationSafe", (genericfunc_t)&dec__SystemInformationSafe, NULL);
}

void post_init_module()
{
TTCN_Location current_location("GSM_SystemInformation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "GSM_SystemInformation");
GSM__RR__Types::module_object.post_init_module();
current_location.update_lineno(87);
/* GSM_SystemInformation.ttcn, line 87 */
template_t__ControlChannelDescription.msc__r99() = ANY_VALUE;
template_t__ControlChannelDescription.att() = ANY_VALUE;
template_t__ControlChannelDescription.bs__ag__blks__res() = ANY_VALUE;
template_t__ControlChannelDescription.ccch__conf() = ANY_VALUE;
template_t__ControlChannelDescription.si22ind() = ANY_VALUE;
template_t__ControlChannelDescription.cbq3() = ANY_VALUE;
template_t__ControlChannelDescription.spare() = bs_0;
template_t__ControlChannelDescription.bs__pa__mfrms() = ANY_VALUE;
template_t__ControlChannelDescription.t3212() = ANY_VALUE;
current_location.update_lineno(154);
/* GSM_SystemInformation.ttcn, line 154 */
template_t__SI3.cell__id() = ANY_VALUE;
template_t__SI3.lai() = ANY_VALUE;
template_t__SI3.ctrl__chan__desc() = t__ControlChannelDescription;
template_t__SI3.cell__options() = ANY_VALUE;
template_t__SI3.cell__sel__par() = ANY_VALUE;
template_t__SI3.rach__control() = ANY_VALUE;
template_t__SI3.rest__octets() = ANY_VALUE;
}


} /* end of namespace */
