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

namespace RSL__Types {

/* Literal string constants */

const unsigned char bs_3_bits[] = { 0 },
bs_4_bits[] = { 0 },
bs_5_bits[] = { 0 },
bs_2_bits[] = { 0 },
bs_1_bits[] = { 0 },
bs_6_bits[] = { 32 };
extern const BITSTRING bs_0(0, NULL),
bs_3(1, bs_3_bits),
bs_4(2, bs_4_bits),
bs_5(3, bs_5_bits),
bs_2(5, bs_2_bits),
bs_1(6, bs_1_bits),
bs_6(8, bs_6_bits);
const unsigned char os_0_octets[] = { 100 },
os_1_octets[] = { 114 };
extern const OCTETSTRING os_2(0, NULL),
os_0(1, os_0_octets),
os_1(1, os_1_octets);
extern const CHARSTRING cs_0('?'),
cs_1(4, "omit");
const unsigned char module_checksum[] = { 0x0f, 0x71, 0x68, 0x24, 0x6b, 0x16, 0xef, 0x3a, 0x13, 0x45, 0x88, 0xc3, 0x88, 0xb1, 0xac, 0x9c };

/* Global variable definitions */

const TTCN_RAWdescriptor_t RSL__MessageGroup_raw_ = {7,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 RSL__MessageGroup
const TTCN_Typedescriptor_t RSL__MessageGroup_descr_ = { "@RSL_Types.RSL_MessageGroup", NULL, &RSL__MessageGroup_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__MessageGroup_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__MessageDiscriminator_msg__group_raw_ = {7,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 RSL__MessageDiscriminator_msg__group
const TTCN_Typedescriptor_t RSL__MessageDiscriminator_msg__group_descr_ = { "@RSL_Types.RSL_MessageDiscriminator.msg_group", NULL, &RSL__MessageDiscriminator_msg__group_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__MessageDiscriminator_msg__group_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__MessageDiscriminator_transparent_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       RSL__MessageDiscriminator_transparent_xer_ = { {"transparent>\n", "transparent>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__MessageDiscriminator_transparent_oer_ext_arr_[0] = {};
const int RSL__MessageDiscriminator_transparent_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__MessageDiscriminator_transparent_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__MessageDiscriminator_transparent_oer_ext_arr_, 0, RSL__MessageDiscriminator_transparent_oer_p_};
const TTCN_Typedescriptor_t RSL__MessageDiscriminator_transparent_descr_ = { "@RSL_Types.RSL_MessageDiscriminator.transparent", &BOOLEAN_ber_, &RSL__MessageDiscriminator_transparent_raw_, &BOOLEAN_text_, &RSL__MessageDiscriminator_transparent_xer_, &BOOLEAN_json_, &RSL__MessageDiscriminator_transparent_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__MessageDiscriminator_transparent_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__MessageDiscriminator_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 RSL__MessageDiscriminator
const TTCN_Typedescriptor_t RSL__MessageDiscriminator_descr_ = { "@RSL_Types.RSL_MessageDiscriminator", NULL, &RSL__MessageDiscriminator_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__MessageDiscriminator_default_coding("RAW");
BOOLEAN const_ts__RSL__MsgDisc_t_defval;
const BOOLEAN& ts__RSL__MsgDisc_t_defval = const_ts__RSL__MsgDisc_t_defval;
BOOLEAN const_tr__RSL__MsgDisc_t_defval;
const BOOLEAN& tr__RSL__MsgDisc_t_defval = const_tr__RSL__MsgDisc_t_defval;
const TTCN_RAWdescriptor_t RSL__MessageType_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__MessageType
const TTCN_Typedescriptor_t RSL__MessageType_descr_ = { "@RSL_Types.RSL_MessageType", NULL, &RSL__MessageType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__MessageType_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Type_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__Type
const TTCN_Typedescriptor_t RSL__IE__Type_descr_ = { "@RSL_Types.RSL_IE_Type", NULL, &RSL__IE__Type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Type_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__LV_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__LV_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__LV_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__LV_len_descr_ = { "@RSL_Types.RSL_LV.len", &INTEGER_ber_, &RSL__LV_len_raw_, &INTEGER_text_, &RSL__LV_len_xer_, &INTEGER_json_, &RSL__LV_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__LV_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__LV_payload_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       RSL__LV_payload_xer_ = { {"payload>\n", "payload>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__LV_payload_oer_ext_arr_[0] = {};
const int RSL__LV_payload_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__LV_payload_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__LV_payload_oer_ext_arr_, 0, RSL__LV_payload_oer_p_};
const TTCN_Typedescriptor_t RSL__LV_payload_descr_ = { "@RSL_Types.RSL_LV.payload", &OCTETSTRING_ber_, &RSL__LV_payload_raw_, &OCTETSTRING_text_, &RSL__LV_payload_xer_, &OCTETSTRING_json_, &RSL__LV_payload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__LV_payload_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__LV_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 RSL__LV
const TTCN_Typedescriptor_t RSL__LV_descr_ = { "@RSL_Types.RSL_LV", NULL, &RSL__LV_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__LV_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__L16V_len_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       RSL__L16V_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__L16V_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__L16V_len_descr_ = { "@RSL_Types.RSL_L16V.len", &INTEGER_ber_, &RSL__L16V_len_raw_, &INTEGER_text_, &RSL__L16V_len_xer_, &INTEGER_json_, &RSL__L16V_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__L16V_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__L16V_payload_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       RSL__L16V_payload_xer_ = { {"payload>\n", "payload>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__L16V_payload_oer_ext_arr_[0] = {};
const int RSL__L16V_payload_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__L16V_payload_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__L16V_payload_oer_ext_arr_, 0, RSL__L16V_payload_oer_p_};
const TTCN_Typedescriptor_t RSL__L16V_payload_descr_ = { "@RSL_Types.RSL_L16V.payload", &OCTETSTRING_ber_, &RSL__L16V_payload_raw_, &OCTETSTRING_text_, &RSL__L16V_payload_xer_, &OCTETSTRING_json_, &RSL__L16V_payload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__L16V_payload_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__L16V_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 RSL__L16V
const TTCN_Typedescriptor_t RSL__L16V_descr_ = { "@RSL_Types.RSL_L16V", NULL, &RSL__L16V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__L16V_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__V_val_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       RSL__IE__V_val_xer_ = { {"val>\n", "val>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__V_val_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__V_val_descr_ = { "@RSL_Types.RSL_IE_V.val", &INTEGER_ber_, &RSL__IE__V_val_raw_, &INTEGER_text_, &RSL__IE__V_val_xer_, &INTEGER_json_, &RSL__IE__V_val_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__V_val_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__V_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 RSL__IE__V
const TTCN_Typedescriptor_t RSL__IE__V_descr_ = { "@RSL_Types.RSL_IE_V", NULL, &RSL__IE__V_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__V_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ActivationType_reactivation_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       RSL__IE__ActivationType_reactivation_xer_ = { {"reactivation>\n", "reactivation>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__ActivationType_reactivation_oer_ext_arr_[0] = {};
const int RSL__IE__ActivationType_reactivation_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__ActivationType_reactivation_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__ActivationType_reactivation_oer_ext_arr_, 0, RSL__IE__ActivationType_reactivation_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__ActivationType_reactivation_descr_ = { "@RSL_Types.RSL_IE_ActivationType.reactivation", &BOOLEAN_ber_, &RSL__IE__ActivationType_reactivation_raw_, &BOOLEAN_text_, &RSL__IE__ActivationType_reactivation_xer_, &BOOLEAN_json_, &RSL__IE__ActivationType_reactivation_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ActivationType_reactivation_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ActivationType_reserved_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       RSL__IE__ActivationType_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__ActivationType_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__ActivationType_reserved_descr_ = { "@RSL_Types.RSL_IE_ActivationType.reserved", &INTEGER_ber_, &RSL__IE__ActivationType_reserved_raw_, &INTEGER_text_, &RSL__IE__ActivationType_reserved_xer_, &INTEGER_json_, &RSL__IE__ActivationType_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ActivationType_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ActivationAbits_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 RSL__ActivationAbits
const TTCN_Typedescriptor_t RSL__ActivationAbits_descr_ = { "@RSL_Types.RSL_ActivationAbits", NULL, &RSL__ActivationAbits_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ActivationAbits_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ActivationType_a__bits_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 RSL__IE__ActivationType_a__bits
const TTCN_Typedescriptor_t RSL__IE__ActivationType_a__bits_descr_ = { "@RSL_Types.RSL_IE_ActivationType.a_bits", NULL, &RSL__IE__ActivationType_a__bits_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ActivationType_a__bits_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ActivationType_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 RSL__IE__ActivationType
const TTCN_Typedescriptor_t RSL__IE__ActivationType_descr_ = { "@RSL_Types.RSL_IE_ActivationType", NULL, &RSL__IE__ActivationType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ActivationType_default_coding("RAW");
RSL__IE__ActivationType const_c__RSL__IE__ActType__IA;
const RSL__IE__ActivationType& c__RSL__IE__ActType__IA = const_c__RSL__IE__ActType__IA;
RSL__IE__ActivationType const_c__RSL__IE__ActType__ASS;
const RSL__IE__ActivationType& c__RSL__IE__ActType__ASS = const_c__RSL__IE__ActType__ASS;
RSL__IE__ActivationType const_c__RSL__IE__ActType__HO__ASYNC;
const RSL__IE__ActivationType& c__RSL__IE__ActType__HO__ASYNC = const_c__RSL__IE__ActType__HO__ASYNC;
RSL__IE__ActivationType const_c__RSL__IE__ActType__HO__SYNC;
const RSL__IE__ActivationType& c__RSL__IE__ActType__HO__SYNC = const_c__RSL__IE__ActType__HO__SYNC;
RSL__IE__ActivationType const_c__RSL__IE__ActType__PDCH;
const RSL__IE__ActivationType& c__RSL__IE__ActType__PDCH = const_c__RSL__IE__ActType__PDCH;
const TTCN_RAWdescriptor_t RSL__IE__ChannelIdent_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__ChannelIdent_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__ChannelIdent_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__ChannelIdent_len_descr_ = { "@RSL_Types.RSL_IE_ChannelIdent.len", &INTEGER_ber_, &RSL__IE__ChannelIdent_len_raw_, &INTEGER_text_, &RSL__IE__ChannelIdent_len_xer_, &INTEGER_json_, &RSL__IE__ChannelIdent_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelIdent_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelIdent_ch__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 RSL__IE__ChannelIdent_ch__desc
const TTCN_Typedescriptor_t RSL__IE__ChannelIdent_ch__desc_descr_ = { "@RSL_Types.RSL_IE_ChannelIdent.ch_desc", NULL, &RSL__IE__ChannelIdent_ch__desc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelIdent_ch__desc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelIdent_ma_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 RSL__IE__ChannelIdent_ma
const TTCN_Typedescriptor_t RSL__IE__ChannelIdent_ma_descr_ = { "@RSL_Types.RSL_IE_ChannelIdent.ma", NULL, &RSL__IE__ChannelIdent_ma_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelIdent_ma_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelIdent_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 RSL__IE__ChannelIdent
const TTCN_Typedescriptor_t RSL__IE__ChannelIdent_descr_ = { "@RSL_Types.RSL_IE_ChannelIdent", NULL, &RSL__IE__ChannelIdent_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelIdent_default_coding("RAW");
GSM__RR__Types::ChannelDescription_template template_tr__RSL__ChannelIdent_ch__desc_defval;
const GSM__RR__Types::ChannelDescription_template& tr__RSL__ChannelIdent_ch__desc_defval = template_tr__RSL__ChannelIdent_ch__desc_defval;
GSM__RR__Types::MobileAllocationLV_template template_tr__RSL__ChannelIdent_ma_defval;
const GSM__RR__Types::MobileAllocationLV_template& tr__RSL__ChannelIdent_ma_defval = template_tr__RSL__ChannelIdent_ma_defval;
const TTCN_RAWdescriptor_t RSL__SpeechDataInd_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__SpeechDataInd
const TTCN_Typedescriptor_t RSL__SpeechDataInd_descr_ = { "@RSL_Types.RSL_SpeechDataInd", NULL, &RSL__SpeechDataInd_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SpeechDataInd_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanRateType_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ChanRateType
const TTCN_Typedescriptor_t RSL__ChanRateType_descr_ = { "@RSL_Types.RSL_ChanRateType", NULL, &RSL__ChanRateType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanRateType_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanModeOct6Signalling_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ChanModeOct6Signalling
const TTCN_Typedescriptor_t RSL__ChanModeOct6Signalling_descr_ = { "@RSL_Types.RSL_ChanModeOct6Signalling", NULL, &RSL__ChanModeOct6Signalling_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanModeOct6Signalling_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanModeOct6SpeechAlgo_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ChanModeOct6SpeechAlgo
const TTCN_Typedescriptor_t RSL__ChanModeOct6SpeechAlgo_descr_ = { "@RSL_Types.RSL_ChanModeOct6SpeechAlgo", NULL, &RSL__ChanModeOct6SpeechAlgo_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanModeOct6SpeechAlgo_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanModeOct6DataRate_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ChanModeOct6DataRate
const TTCN_Typedescriptor_t RSL__ChanModeOct6DataRate_descr_ = { "@RSL_Types.RSL_ChanModeOct6DataRate", NULL, &RSL__ChanModeOct6DataRate_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanModeOct6DataRate_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanModeOct6_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 RSL__ChanModeOct6
const TTCN_Typedescriptor_t RSL__ChanModeOct6_descr_ = { "@RSL_Types.RSL_ChanModeOct6", NULL, &RSL__ChanModeOct6_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__ChanModeOct6_sign_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ChanModeOct6_sign
const TTCN_Typedescriptor_t RSL__ChanModeOct6_sign_descr_ = { "@RSL_Types.RSL_ChanModeOct6.sign", NULL, &RSL__ChanModeOct6_sign_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanModeOct6_sign_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanModeOct6_speech_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ChanModeOct6_speech
const TTCN_Typedescriptor_t RSL__ChanModeOct6_speech_descr_ = { "@RSL_Types.RSL_ChanModeOct6.speech", NULL, &RSL__ChanModeOct6_speech_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanModeOct6_speech_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanModeOct6_data_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ChanModeOct6_data
const TTCN_Typedescriptor_t RSL__ChanModeOct6_data_descr_ = { "@RSL_Types.RSL_ChanModeOct6.data", NULL, &RSL__ChanModeOct6_data_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanModeOct6_data_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__ChanModeOct6_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__ChannelMode_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__ChannelMode_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_len_descr_ = { "@RSL_Types.RSL_IE_ChannelMode.len", &INTEGER_ber_, &RSL__IE__ChannelMode_len_raw_, &INTEGER_text_, &RSL__IE__ChannelMode_len_xer_, &INTEGER_json_, &RSL__IE__ChannelMode_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_reserved_raw_ = {6,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,6,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__ChannelMode_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__ChannelMode_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_reserved_descr_ = { "@RSL_Types.RSL_IE_ChannelMode.reserved", &BITSTRING_ber_, &RSL__IE__ChannelMode_reserved_raw_, NULL, &RSL__IE__ChannelMode_reserved_xer_, &BITSTRING_json_, &RSL__IE__ChannelMode_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_dtx__d_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       RSL__IE__ChannelMode_dtx__d_xer_ = { {"dtx_d>\n", "dtx_d>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__ChannelMode_dtx__d_oer_ext_arr_[0] = {};
const int RSL__IE__ChannelMode_dtx__d_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__ChannelMode_dtx__d_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__ChannelMode_dtx__d_oer_ext_arr_, 0, RSL__IE__ChannelMode_dtx__d_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_dtx__d_descr_ = { "@RSL_Types.RSL_IE_ChannelMode.dtx_d", &BOOLEAN_ber_, &RSL__IE__ChannelMode_dtx__d_raw_, &BOOLEAN_text_, &RSL__IE__ChannelMode_dtx__d_xer_, &BOOLEAN_json_, &RSL__IE__ChannelMode_dtx__d_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_dtx__d_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_dtx__u_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       RSL__IE__ChannelMode_dtx__u_xer_ = { {"dtx_u>\n", "dtx_u>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__ChannelMode_dtx__u_oer_ext_arr_[0] = {};
const int RSL__IE__ChannelMode_dtx__u_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__ChannelMode_dtx__u_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__ChannelMode_dtx__u_oer_ext_arr_, 0, RSL__IE__ChannelMode_dtx__u_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_dtx__u_descr_ = { "@RSL_Types.RSL_IE_ChannelMode.dtx_u", &BOOLEAN_ber_, &RSL__IE__ChannelMode_dtx__u_raw_, &BOOLEAN_text_, &RSL__IE__ChannelMode_dtx__u_xer_, &BOOLEAN_json_, &RSL__IE__ChannelMode_dtx__u_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_dtx__u_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_spd__ind_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__ChannelMode_spd__ind
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_spd__ind_descr_ = { "@RSL_Types.RSL_IE_ChannelMode.spd_ind", NULL, &RSL__IE__ChannelMode_spd__ind_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_spd__ind_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_ch__rate__type_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__ChannelMode_ch__rate__type
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_ch__rate__type_descr_ = { "@RSL_Types.RSL_IE_ChannelMode.ch_rate_type", NULL, &RSL__IE__ChannelMode_ch__rate__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_ch__rate__type_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_u_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 RSL__IE__ChannelMode_u
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_u_descr_ = { "@RSL_Types.RSL_IE_ChannelMode.u", NULL, &RSL__IE__ChannelMode_u_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_u_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChannelMode_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 RSL__IE__ChannelMode
const TTCN_Typedescriptor_t RSL__IE__ChannelMode_descr_ = { "@RSL_Types.RSL_IE_ChannelMode", NULL, &RSL__IE__ChannelMode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChannelMode_default_coding("RAW");
RSL__ChanRateType_template template_ts__RSL__ChanMode__SIGN_t_defval;
const RSL__ChanRateType_template& ts__RSL__ChanMode__SIGN_t_defval = template_ts__RSL__ChanMode__SIGN_t_defval;
BOOLEAN_template template_ts__RSL__ChanMode__SIGN_dtxd_defval;
const BOOLEAN_template& ts__RSL__ChanMode__SIGN_dtxd_defval = template_ts__RSL__ChanMode__SIGN_dtxd_defval;
BOOLEAN_template template_ts__RSL__ChanMode__SIGN_dtxu_defval;
const BOOLEAN_template& ts__RSL__ChanMode__SIGN_dtxu_defval = template_ts__RSL__ChanMode__SIGN_dtxu_defval;
RSL__ChanRateType_template template_tr__RSL__ChanMode__SIGN_t_defval;
const RSL__ChanRateType_template& tr__RSL__ChanMode__SIGN_t_defval = template_tr__RSL__ChanMode__SIGN_t_defval;
BOOLEAN_template template_tr__RSL__ChanMode__SIGN_dtxd_defval;
const BOOLEAN_template& tr__RSL__ChanMode__SIGN_dtxd_defval = template_tr__RSL__ChanMode__SIGN_dtxd_defval;
BOOLEAN_template template_tr__RSL__ChanMode__SIGN_dtxu_defval;
const BOOLEAN_template& tr__RSL__ChanMode__SIGN_dtxu_defval = template_tr__RSL__ChanMode__SIGN_dtxu_defval;
BOOLEAN_template template_ts__RSL__ChanMode__DATA_dtxd_defval;
const BOOLEAN_template& ts__RSL__ChanMode__DATA_dtxd_defval = template_ts__RSL__ChanMode__DATA_dtxd_defval;
BOOLEAN_template template_ts__RSL__ChanMode__DATA_dtxu_defval;
const BOOLEAN_template& ts__RSL__ChanMode__DATA_dtxu_defval = template_ts__RSL__ChanMode__DATA_dtxu_defval;
RSL__ChanRateType_template template_tr__RSL__ChanMode__DATA_t_defval;
const RSL__ChanRateType_template& tr__RSL__ChanMode__DATA_t_defval = template_tr__RSL__ChanMode__DATA_t_defval;
RSL__ChanModeOct6DataRate_template template_tr__RSL__ChanMode__DATA_r_defval;
const RSL__ChanModeOct6DataRate_template& tr__RSL__ChanMode__DATA_r_defval = template_tr__RSL__ChanMode__DATA_r_defval;
BOOLEAN_template template_tr__RSL__ChanMode__DATA_dtxd_defval;
const BOOLEAN_template& tr__RSL__ChanMode__DATA_dtxd_defval = template_tr__RSL__ChanMode__DATA_dtxd_defval;
BOOLEAN_template template_tr__RSL__ChanMode__DATA_dtxu_defval;
const BOOLEAN_template& tr__RSL__ChanMode__DATA_dtxu_defval = template_tr__RSL__ChanMode__DATA_dtxu_defval;
BOOLEAN const_ts__RSL__ChanMode_dtx__downlink_defval;
const BOOLEAN& ts__RSL__ChanMode_dtx__downlink_defval = const_ts__RSL__ChanMode_dtx__downlink_defval;
const TTCN_RAWdescriptor_t RSL__IE__BS__Power_reserved_raw_ = {2,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       RSL__IE__BS__Power_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__BS__Power_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__BS__Power_reserved_descr_ = { "@RSL_Types.RSL_IE_BS_Power.reserved", &INTEGER_ber_, &RSL__IE__BS__Power_reserved_raw_, &INTEGER_text_, &RSL__IE__BS__Power_reserved_xer_, &INTEGER_json_, &RSL__IE__BS__Power_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__BS__Power_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__BS__Power_epc_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       RSL__IE__BS__Power_epc_xer_ = { {"epc>\n", "epc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__BS__Power_epc_oer_ext_arr_[0] = {};
const int RSL__IE__BS__Power_epc_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__BS__Power_epc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__BS__Power_epc_oer_ext_arr_, 0, RSL__IE__BS__Power_epc_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__BS__Power_epc_descr_ = { "@RSL_Types.RSL_IE_BS_Power.epc", &BOOLEAN_ber_, &RSL__IE__BS__Power_epc_raw_, &BOOLEAN_text_, &RSL__IE__BS__Power_epc_xer_, &BOOLEAN_json_, &RSL__IE__BS__Power_epc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__BS__Power_epc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__BS__Power_fpc_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       RSL__IE__BS__Power_fpc_xer_ = { {"fpc>\n", "fpc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__BS__Power_fpc_oer_ext_arr_[0] = {};
const int RSL__IE__BS__Power_fpc_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__BS__Power_fpc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__BS__Power_fpc_oer_ext_arr_, 0, RSL__IE__BS__Power_fpc_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__BS__Power_fpc_descr_ = { "@RSL_Types.RSL_IE_BS_Power.fpc", &BOOLEAN_ber_, &RSL__IE__BS__Power_fpc_raw_, &BOOLEAN_text_, &RSL__IE__BS__Power_fpc_xer_, &BOOLEAN_json_, &RSL__IE__BS__Power_fpc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__BS__Power_fpc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__BS__Power_power__level_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       RSL__IE__BS__Power_power__level_xer_ = { {"power_level>\n", "power_level>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__BS__Power_power__level_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__BS__Power_power__level_descr_ = { "@RSL_Types.RSL_IE_BS_Power.power_level", &INTEGER_ber_, &RSL__IE__BS__Power_power__level_raw_, &INTEGER_text_, &RSL__IE__BS__Power_power__level_xer_, &INTEGER_json_, &RSL__IE__BS__Power_power__level_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__BS__Power_power__level_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__BS__Power_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 RSL__IE__BS__Power
const TTCN_Typedescriptor_t RSL__IE__BS__Power_descr_ = { "@RSL_Types.RSL_IE_BS_Power", NULL, &RSL__IE__BS__Power_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__BS__Power_default_coding("RAW");
BOOLEAN const_ts__RSL__IE__BS__Power_epc_defval;
const BOOLEAN& ts__RSL__IE__BS__Power_epc_defval = const_ts__RSL__IE__BS__Power_epc_defval;
BOOLEAN const_ts__RSL__IE__BS__Power_fpc_defval;
const BOOLEAN& ts__RSL__IE__BS__Power_fpc_defval = const_ts__RSL__IE__BS__Power_fpc_defval;
BOOLEAN_template template_tr__RSL__IE__BS__Power_epc_defval;
const BOOLEAN_template& tr__RSL__IE__BS__Power_epc_defval = template_tr__RSL__IE__BS__Power_epc_defval;
BOOLEAN_template template_tr__RSL__IE__BS__Power_fpc_defval;
const BOOLEAN_template& tr__RSL__IE__BS__Power_fpc_defval = template_tr__RSL__IE__BS__Power_fpc_defval;
const TTCN_RAWdescriptor_t RSL__AlgId_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__AlgId
const TTCN_Typedescriptor_t RSL__AlgId_descr_ = { "@RSL_Types.RSL_AlgId", NULL, &RSL__AlgId_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__AlgId_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__EncryptionInfo_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__EncryptionInfo_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__EncryptionInfo_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__EncryptionInfo_len_descr_ = { "@RSL_Types.RSL_IE_EncryptionInfo.len", &INTEGER_ber_, &RSL__IE__EncryptionInfo_len_raw_, &INTEGER_text_, &RSL__IE__EncryptionInfo_len_xer_, &INTEGER_json_, &RSL__IE__EncryptionInfo_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__EncryptionInfo_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__EncryptionInfo_alg__id_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__EncryptionInfo_alg__id
const TTCN_Typedescriptor_t RSL__IE__EncryptionInfo_alg__id_descr_ = { "@RSL_Types.RSL_IE_EncryptionInfo.alg_id", NULL, &RSL__IE__EncryptionInfo_alg__id_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__EncryptionInfo_alg__id_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__EncryptionInfo_key_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       RSL__IE__EncryptionInfo_key_xer_ = { {"key>\n", "key>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__EncryptionInfo_key_oer_ext_arr_[0] = {};
const int RSL__IE__EncryptionInfo_key_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__EncryptionInfo_key_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__EncryptionInfo_key_oer_ext_arr_, 0, RSL__IE__EncryptionInfo_key_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__EncryptionInfo_key_descr_ = { "@RSL_Types.RSL_IE_EncryptionInfo.key", &OCTETSTRING_ber_, &RSL__IE__EncryptionInfo_key_raw_, &OCTETSTRING_text_, &RSL__IE__EncryptionInfo_key_xer_, &OCTETSTRING_json_, &RSL__IE__EncryptionInfo_key_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__EncryptionInfo_key_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__EncryptionInfo_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 RSL__IE__EncryptionInfo
const TTCN_Typedescriptor_t RSL__IE__EncryptionInfo_descr_ = { "@RSL_Types.RSL_IE_EncryptionInfo", NULL, &RSL__IE__EncryptionInfo_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__EncryptionInfo_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__FrameNumber_t1__p_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       RSL__IE__FrameNumber_t1__p_xer_ = { {"t1_p>\n", "t1_p>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__FrameNumber_t1__p_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__FrameNumber_t1__p_descr_ = { "@RSL_Types.RSL_IE_FrameNumber.t1_p", &INTEGER_ber_, &RSL__IE__FrameNumber_t1__p_raw_, &INTEGER_text_, &RSL__IE__FrameNumber_t1__p_xer_, &INTEGER_json_, &RSL__IE__FrameNumber_t1__p_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__FrameNumber_t1__p_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__FrameNumber_t3_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       RSL__IE__FrameNumber_t3_xer_ = { {"t3>\n", "t3>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__FrameNumber_t3_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__FrameNumber_t3_descr_ = { "@RSL_Types.RSL_IE_FrameNumber.t3", &INTEGER_ber_, &RSL__IE__FrameNumber_t3_raw_, &INTEGER_text_, &RSL__IE__FrameNumber_t3_xer_, &INTEGER_json_, &RSL__IE__FrameNumber_t3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__FrameNumber_t3_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__FrameNumber_t2_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       RSL__IE__FrameNumber_t2_xer_ = { {"t2>\n", "t2>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__FrameNumber_t2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__FrameNumber_t2_descr_ = { "@RSL_Types.RSL_IE_FrameNumber.t2", &INTEGER_ber_, &RSL__IE__FrameNumber_t2_raw_, &INTEGER_text_, &RSL__IE__FrameNumber_t2_xer_, &INTEGER_json_, &RSL__IE__FrameNumber_t2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__FrameNumber_t2_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__FrameNumber_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 RSL__IE__FrameNumber
const TTCN_Typedescriptor_t RSL__IE__FrameNumber_descr_ = { "@RSL_Types.RSL_IE_FrameNumber", NULL, &RSL__IE__FrameNumber_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__FrameNumber_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__StartingTime_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 RSL__IE__StartingTime
const TTCN_Typedescriptor_t RSL__IE__StartingTime_descr_ = { "@RSL_Types.RSL_IE_StartingTime", NULL, &RSL__IE__StartingTime_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__StartingTime_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__L1Info_ms__power__lvl_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       RSL__IE__L1Info_ms__power__lvl_xer_ = { {"ms_power_lvl>\n", "ms_power_lvl>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__L1Info_ms__power__lvl_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__L1Info_ms__power__lvl_descr_ = { "@RSL_Types.RSL_IE_L1Info.ms_power_lvl", &INTEGER_ber_, &RSL__IE__L1Info_ms__power__lvl_raw_, &INTEGER_text_, &RSL__IE__L1Info_ms__power__lvl_xer_, &INTEGER_json_, &RSL__IE__L1Info_ms__power__lvl_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__L1Info_ms__power__lvl_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__L1Info_fpc_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       RSL__IE__L1Info_fpc_xer_ = { {"fpc>\n", "fpc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__L1Info_fpc_oer_ext_arr_[0] = {};
const int RSL__IE__L1Info_fpc_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__L1Info_fpc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__L1Info_fpc_oer_ext_arr_, 0, RSL__IE__L1Info_fpc_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__L1Info_fpc_descr_ = { "@RSL_Types.RSL_IE_L1Info.fpc", &BOOLEAN_ber_, &RSL__IE__L1Info_fpc_raw_, &BOOLEAN_text_, &RSL__IE__L1Info_fpc_xer_, &BOOLEAN_json_, &RSL__IE__L1Info_fpc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__L1Info_fpc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__L1Info_reserved_raw_ = {2,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       RSL__IE__L1Info_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__L1Info_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__L1Info_reserved_descr_ = { "@RSL_Types.RSL_IE_L1Info.reserved", &INTEGER_ber_, &RSL__IE__L1Info_reserved_raw_, &INTEGER_text_, &RSL__IE__L1Info_reserved_xer_, &INTEGER_json_, &RSL__IE__L1Info_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__L1Info_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__L1Info_actual__ta_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       RSL__IE__L1Info_actual__ta_xer_ = { {"actual_ta>\n", "actual_ta>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__L1Info_actual__ta_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__L1Info_actual__ta_descr_ = { "@RSL_Types.RSL_IE_L1Info.actual_ta", &INTEGER_ber_, &RSL__IE__L1Info_actual__ta_raw_, &INTEGER_text_, &RSL__IE__L1Info_actual__ta_xer_, &INTEGER_json_, &RSL__IE__L1Info_actual__ta_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__L1Info_actual__ta_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__L1Info_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 RSL__IE__L1Info
const TTCN_Typedescriptor_t RSL__IE__L1Info_descr_ = { "@RSL_Types.RSL_IE_L1Info", NULL, &RSL__IE__L1Info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__L1Info_default_coding("RAW");
RSL__IE__L1Info_template template_ts__RSL__IE__L1Info;
const RSL__IE__L1Info_template& ts__RSL__IE__L1Info = template_ts__RSL__IE__L1Info;
const TTCN_RAWdescriptor_t RSL__IE__MS__Power_reserved_raw_ = {2,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       RSL__IE__MS__Power_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MS__Power_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MS__Power_reserved_descr_ = { "@RSL_Types.RSL_IE_MS_Power.reserved", &INTEGER_ber_, &RSL__IE__MS__Power_reserved_raw_, &INTEGER_text_, &RSL__IE__MS__Power_reserved_xer_, &INTEGER_json_, &RSL__IE__MS__Power_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MS__Power_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MS__Power_fpc__epc_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       RSL__IE__MS__Power_fpc__epc_xer_ = { {"fpc_epc>\n", "fpc_epc>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MS__Power_fpc__epc_oer_ext_arr_[0] = {};
const int RSL__IE__MS__Power_fpc__epc_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MS__Power_fpc__epc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MS__Power_fpc__epc_oer_ext_arr_, 0, RSL__IE__MS__Power_fpc__epc_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MS__Power_fpc__epc_descr_ = { "@RSL_Types.RSL_IE_MS_Power.fpc_epc", &BOOLEAN_ber_, &RSL__IE__MS__Power_fpc__epc_raw_, &BOOLEAN_text_, &RSL__IE__MS__Power_fpc__epc_xer_, &BOOLEAN_json_, &RSL__IE__MS__Power_fpc__epc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MS__Power_fpc__epc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MS__Power_power__level_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       RSL__IE__MS__Power_power__level_xer_ = { {"power_level>\n", "power_level>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MS__Power_power__level_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MS__Power_power__level_descr_ = { "@RSL_Types.RSL_IE_MS_Power.power_level", &INTEGER_ber_, &RSL__IE__MS__Power_power__level_raw_, &INTEGER_text_, &RSL__IE__MS__Power_power__level_xer_, &INTEGER_json_, &RSL__IE__MS__Power_power__level_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MS__Power_power__level_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MS__Power_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 RSL__IE__MS__Power
const TTCN_Typedescriptor_t RSL__IE__MS__Power_descr_ = { "@RSL_Types.RSL_IE_MS_Power", NULL, &RSL__IE__MS__Power_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MS__Power_default_coding("RAW");
INTEGER_template template_tr__RSL__IE__MS__Power_power__level_defval;
const INTEGER_template& tr__RSL__IE__MS__Power_power__level_defval = template_tr__RSL__IE__MS__Power_power__level_defval;
BOOLEAN_template template_tr__RSL__IE__MS__Power_fpc__epc_defval;
const BOOLEAN_template& tr__RSL__IE__MS__Power_fpc__epc_defval = template_tr__RSL__IE__MS__Power_fpc__epc_defval;
BOOLEAN const_ts__RSL__IE__MS__Power_fpc__epc_defval;
const BOOLEAN& ts__RSL__IE__MS__Power_fpc__epc_defval = const_ts__RSL__IE__MS__Power_fpc__epc_defval;
const TTCN_RAWdescriptor_t RSL__IE__RachLoad_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__RachLoad_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__RachLoad_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__RachLoad_len_descr_ = { "@RSL_Types.RSL_IE_RachLoad.len", &INTEGER_ber_, &RSL__IE__RachLoad_len_raw_, &INTEGER_text_, &RSL__IE__RachLoad_len_xer_, &INTEGER_json_, &RSL__IE__RachLoad_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RachLoad_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__RachLoad_slot__count_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       RSL__IE__RachLoad_slot__count_xer_ = { {"slot_count>\n", "slot_count>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__RachLoad_slot__count_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__RachLoad_slot__count_descr_ = { "@RSL_Types.RSL_IE_RachLoad.slot_count", &INTEGER_ber_, &RSL__IE__RachLoad_slot__count_raw_, &INTEGER_text_, &RSL__IE__RachLoad_slot__count_xer_, &INTEGER_json_, &RSL__IE__RachLoad_slot__count_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RachLoad_slot__count_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__RachLoad_busy__count_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       RSL__IE__RachLoad_busy__count_xer_ = { {"busy_count>\n", "busy_count>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__RachLoad_busy__count_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__RachLoad_busy__count_descr_ = { "@RSL_Types.RSL_IE_RachLoad.busy_count", &INTEGER_ber_, &RSL__IE__RachLoad_busy__count_raw_, &INTEGER_text_, &RSL__IE__RachLoad_busy__count_xer_, &INTEGER_json_, &RSL__IE__RachLoad_busy__count_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RachLoad_busy__count_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__RachLoad_access__count_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       RSL__IE__RachLoad_access__count_xer_ = { {"access_count>\n", "access_count>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__RachLoad_access__count_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__RachLoad_access__count_descr_ = { "@RSL_Types.RSL_IE_RachLoad.access_count", &INTEGER_ber_, &RSL__IE__RachLoad_access__count_raw_, &INTEGER_text_, &RSL__IE__RachLoad_access__count_xer_, &INTEGER_json_, &RSL__IE__RachLoad_access__count_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RachLoad_access__count_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__RachLoad_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 RSL__IE__RachLoad
const TTCN_Typedescriptor_t RSL__IE__RachLoad_descr_ = { "@RSL_Types.RSL_IE_RachLoad", NULL, &RSL__IE__RachLoad_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RachLoad_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__RequestRef_ra_raw_ = {8,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__RequestRef_ra_xer_ = { {"ra>\n", "ra>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__RequestRef_ra_oer_ext_arr_[0] = {};
const int RSL__IE__RequestRef_ra_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__RequestRef_ra_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RSL__IE__RequestRef_ra_oer_ext_arr_, 0, RSL__IE__RequestRef_ra_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__RequestRef_ra_descr_ = { "@RSL_Types.RSL_IE_RequestRef.ra", &OCTETSTRING_ber_, &RSL__IE__RequestRef_ra_raw_, &OCTETSTRING_text_, &RSL__IE__RequestRef_ra_xer_, &OCTETSTRING_json_, &RSL__IE__RequestRef_ra_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RequestRef_ra_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__RequestRef_frame__nr_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 RSL__IE__RequestRef_frame__nr
const TTCN_Typedescriptor_t RSL__IE__RequestRef_frame__nr_descr_ = { "@RSL_Types.RSL_IE_RequestRef.frame_nr", NULL, &RSL__IE__RequestRef_frame__nr_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RequestRef_frame__nr_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__RequestRef_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 RSL__IE__RequestRef
const TTCN_Typedescriptor_t RSL__IE__RequestRef_descr_ = { "@RSL_Types.RSL_IE_RequestRef", NULL, &RSL__IE__RequestRef_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__RequestRef_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ResourceInfo_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__ResourceInfo_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__ResourceInfo_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__ResourceInfo_len_descr_ = { "@RSL_Types.RSL_IE_ResourceInfo.len", &INTEGER_ber_, &RSL__IE__ResourceInfo_len_raw_, &INTEGER_text_, &RSL__IE__ResourceInfo_len_xer_, &INTEGER_json_, &RSL__IE__ResourceInfo_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ResourceInfo_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ResourceInfo_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 RSL__ResourceInfo
const TTCN_Typedescriptor_t RSL__ResourceInfo_descr_ = { "@RSL_Types.RSL_ResourceInfo", NULL, &RSL__ResourceInfo_raw_, NULL, NULL, NULL, NULL, NULL, &RSL__ResourceInfo_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__ResourceInfoItem_chan__nr_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ResourceInfoItem_chan__nr
const TTCN_Typedescriptor_t RSL__ResourceInfoItem_chan__nr_descr_ = { "@RSL_Types.RSL_ResourceInfoItem.chan_nr", NULL, &RSL__ResourceInfoItem_chan__nr_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ResourceInfoItem_chan__nr_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ResourceInfoItem_interf__band_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       RSL__ResourceInfoItem_interf__band_xer_ = { {"interf_band>\n", "interf_band>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__ResourceInfoItem_interf__band_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__ResourceInfoItem_interf__band_descr_ = { "@RSL_Types.RSL_ResourceInfoItem.interf_band", &INTEGER_ber_, &RSL__ResourceInfoItem_interf__band_raw_, &INTEGER_text_, &RSL__ResourceInfoItem_interf__band_xer_, &INTEGER_json_, &RSL__ResourceInfoItem_interf__band_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ResourceInfoItem_interf__band_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ResourceInfoItem_rfu_raw_ = {5,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,5,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__ResourceInfoItem_rfu_xer_ = { {"rfu>\n", "rfu>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__ResourceInfoItem_rfu_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__ResourceInfoItem_rfu_descr_ = { "@RSL_Types.RSL_ResourceInfoItem.rfu", &BITSTRING_ber_, &RSL__ResourceInfoItem_rfu_raw_, NULL, &RSL__ResourceInfoItem_rfu_xer_, &BITSTRING_json_, &RSL__ResourceInfoItem_rfu_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ResourceInfoItem_rfu_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ResourceInfoItem_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 RSL__ResourceInfoItem
const TTCN_Typedescriptor_t RSL__ResourceInfoItem_descr_ = { "@RSL_Types.RSL_ResourceInfoItem", NULL, &RSL__ResourceInfoItem_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ResourceInfoItem_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ResourceInfo_0_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__ResourceInfo_0
const TTCN_Typedescriptor_t RSL__ResourceInfo_0_descr_ = { "@RSL_Types.RSL_ResourceInfo.<oftype>", NULL, &RSL__ResourceInfo_0_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ResourceInfo_0_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__ResourceInfo_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ResourceInfo_info_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 RSL__IE__ResourceInfo_info
const TTCN_Typedescriptor_t RSL__IE__ResourceInfo_info_descr_ = { "@RSL_Types.RSL_IE_ResourceInfo.info", NULL, &RSL__IE__ResourceInfo_info_raw_, NULL, NULL, NULL, NULL, NULL, &RSL__ResourceInfo_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ResourceInfo_info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ResourceInfo_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 RSL__IE__ResourceInfo
const TTCN_Typedescriptor_t RSL__IE__ResourceInfo_descr_ = { "@RSL_Types.RSL_IE_ResourceInfo", NULL, &RSL__IE__ResourceInfo_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ResourceInfo_default_coding("RAW");
INTEGER_template template_ts__RSL__ResourceInfoItem_interf__band_defval;
const INTEGER_template& ts__RSL__ResourceInfoItem_interf__band_defval = template_ts__RSL__ResourceInfoItem_interf__band_defval;
GSM__Types::RslChannelNr_template template_tr__RSL__ResourceInfoItem_chan__nr_defval;
const GSM__Types::RslChannelNr_template& tr__RSL__ResourceInfoItem_chan__nr_defval = template_tr__RSL__ResourceInfoItem_chan__nr_defval;
INTEGER_template template_tr__RSL__ResourceInfoItem_interf__band_defval;
const INTEGER_template& tr__RSL__ResourceInfoItem_interf__band_defval = template_tr__RSL__ResourceInfoItem_interf__band_defval;
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_raw_ = {16,SG_SG_BIT,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       RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_xer_ = { {"toa256_mean>\n", "toa256_mean>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_descr_ = { "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.toa256_mean", &INTEGER_ber_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_raw_, &INTEGER_text_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_xer_, &INTEGER_json_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_raw_ = {16,SG_SG_BIT,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       RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_xer_ = { {"toa256_min>\n", "toa256_min>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_descr_ = { "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.toa256_min", &INTEGER_ber_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_raw_, &INTEGER_text_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_xer_, &INTEGER_json_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_raw_ = {16,SG_SG_BIT,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       RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_xer_ = { {"toa256_max>\n", "toa256_max>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_descr_ = { "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.toa256_max", &INTEGER_ber_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_raw_, &INTEGER_text_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_xer_, &INTEGER_json_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_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       RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_xer_ = { {"toa256_std_dev>\n", "toa256_std_dev>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_descr_ = { "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.toa256_std_dev", &INTEGER_ber_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_raw_, &INTEGER_text_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_xer_, &INTEGER_json_, &RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_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 RSL__IE__UplinkMeasSuppMeasInfo
const TTCN_Typedescriptor_t RSL__IE__UplinkMeasSuppMeasInfo_descr_ = { "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo", NULL, &RSL__IE__UplinkMeasSuppMeasInfo_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeasSuppMeasInfo_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__UplinkMeas_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_len_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.len", &INTEGER_ber_, &RSL__IE__UplinkMeas_len_raw_, &INTEGER_text_, &RSL__IE__UplinkMeas_len_xer_, &INTEGER_json_, &RSL__IE__UplinkMeas_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_rfu_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       RSL__IE__UplinkMeas_rfu_xer_ = { {"rfu>\n", "rfu>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_rfu_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_rfu_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.rfu", &BITSTRING_ber_, &RSL__IE__UplinkMeas_rfu_raw_, NULL, &RSL__IE__UplinkMeas_rfu_xer_, &BITSTRING_json_, &RSL__IE__UplinkMeas_rfu_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_rfu_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_dtx__d_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       RSL__IE__UplinkMeas_dtx__d_xer_ = { {"dtx_d>\n", "dtx_d>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__UplinkMeas_dtx__d_oer_ext_arr_[0] = {};
const int RSL__IE__UplinkMeas_dtx__d_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_dtx__d_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__UplinkMeas_dtx__d_oer_ext_arr_, 0, RSL__IE__UplinkMeas_dtx__d_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_dtx__d_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.dtx_d", &BOOLEAN_ber_, &RSL__IE__UplinkMeas_dtx__d_raw_, &BOOLEAN_text_, &RSL__IE__UplinkMeas_dtx__d_xer_, &BOOLEAN_json_, &RSL__IE__UplinkMeas_dtx__d_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_dtx__d_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_rxlev__f__u_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       RSL__IE__UplinkMeas_rxlev__f__u_xer_ = { {"rxlev_f_u>\n", "rxlev_f_u>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_rxlev__f__u_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_rxlev__f__u_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.rxlev_f_u", &INTEGER_ber_, &RSL__IE__UplinkMeas_rxlev__f__u_raw_, &INTEGER_text_, &RSL__IE__UplinkMeas_rxlev__f__u_xer_, &INTEGER_json_, &RSL__IE__UplinkMeas_rxlev__f__u_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_rxlev__f__u_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_reserved1_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       RSL__IE__UplinkMeas_reserved1_xer_ = { {"reserved1>\n", "reserved1>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_reserved1_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_reserved1_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.reserved1", &BITSTRING_ber_, &RSL__IE__UplinkMeas_reserved1_raw_, NULL, &RSL__IE__UplinkMeas_reserved1_xer_, &BITSTRING_json_, &RSL__IE__UplinkMeas_reserved1_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_reserved1_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_rxlev__s__u_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       RSL__IE__UplinkMeas_rxlev__s__u_xer_ = { {"rxlev_s_u>\n", "rxlev_s_u>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_rxlev__s__u_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_rxlev__s__u_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.rxlev_s_u", &INTEGER_ber_, &RSL__IE__UplinkMeas_rxlev__s__u_raw_, &INTEGER_text_, &RSL__IE__UplinkMeas_rxlev__s__u_xer_, &INTEGER_json_, &RSL__IE__UplinkMeas_rxlev__s__u_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_rxlev__s__u_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_reserved2_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       RSL__IE__UplinkMeas_reserved2_xer_ = { {"reserved2>\n", "reserved2>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_reserved2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_reserved2_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.reserved2", &BITSTRING_ber_, &RSL__IE__UplinkMeas_reserved2_raw_, NULL, &RSL__IE__UplinkMeas_reserved2_xer_, &BITSTRING_json_, &RSL__IE__UplinkMeas_reserved2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_reserved2_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_rxq__f__u_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       RSL__IE__UplinkMeas_rxq__f__u_xer_ = { {"rxq_f_u>\n", "rxq_f_u>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_rxq__f__u_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_rxq__f__u_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.rxq_f_u", &INTEGER_ber_, &RSL__IE__UplinkMeas_rxq__f__u_raw_, &INTEGER_text_, &RSL__IE__UplinkMeas_rxq__f__u_xer_, &INTEGER_json_, &RSL__IE__UplinkMeas_rxq__f__u_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_rxq__f__u_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_rxq__s__u_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       RSL__IE__UplinkMeas_rxq__s__u_xer_ = { {"rxq_s_u>\n", "rxq_s_u>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__UplinkMeas_rxq__s__u_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_rxq__s__u_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.rxq_s_u", &INTEGER_ber_, &RSL__IE__UplinkMeas_rxq__s__u_raw_, &INTEGER_text_, &RSL__IE__UplinkMeas_rxq__s__u_xer_, &INTEGER_json_, &RSL__IE__UplinkMeas_rxq__s__u_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_rxq__s__u_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_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 RSL__IE__UplinkMeas
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas", NULL, &RSL__IE__UplinkMeas_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__IE__UplinkMeas_supp__meas__info_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 RSL__IE__UplinkMeas_supp__meas__info
const TTCN_Typedescriptor_t RSL__IE__UplinkMeas_supp__meas__info_descr_ = { "@RSL_Types.RSL_IE_UplinkMeas.supp_meas_info", NULL, &RSL__IE__UplinkMeas_supp__meas__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_supp__meas__info_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__IE__UplinkMeas_default_coding("RAW");
INTEGER const_ts__RSL__IE__UplinkMeas_rxlev_defval;
const INTEGER& ts__RSL__IE__UplinkMeas_rxlev_defval = const_ts__RSL__IE__UplinkMeas_rxlev_defval;
INTEGER const_ts__RSL__IE__UplinkMeas_rxqual_defval;
const INTEGER& ts__RSL__IE__UplinkMeas_rxqual_defval = const_ts__RSL__IE__UplinkMeas_rxqual_defval;
const TTCN_RAWdescriptor_t RSL__Cause_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 RSL__Cause
const TTCN_Typedescriptor_t RSL__Cause_descr_ = { "@RSL_Types.RSL_Cause", NULL, &RSL__Cause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__Cause_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Cause_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__Cause_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Cause_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Cause_len_descr_ = { "@RSL_Types.RSL_IE_Cause.len", &INTEGER_ber_, &RSL__IE__Cause_len_raw_, &INTEGER_text_, &RSL__IE__Cause_len_xer_, &INTEGER_json_, &RSL__IE__Cause_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Cause_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Cause_e_raw_ = {1,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       RSL__IE__Cause_e_xer_ = { {"e>\n", "e>\n"}, {3, 3}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Cause_e_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Cause_e_descr_ = { "@RSL_Types.RSL_IE_Cause.e", &INTEGER_ber_, &RSL__IE__Cause_e_raw_, &INTEGER_text_, &RSL__IE__Cause_e_xer_, &INTEGER_json_, &RSL__IE__Cause_e_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Cause_e_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Cause_cause_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 RSL__IE__Cause_cause
const TTCN_Typedescriptor_t RSL__IE__Cause_cause_descr_ = { "@RSL_Types.RSL_IE_Cause.cause", NULL, &RSL__IE__Cause_cause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Cause_cause_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Cause_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 RSL__IE__Cause
const TTCN_Typedescriptor_t RSL__IE__Cause_descr_ = { "@RSL_Types.RSL_IE_Cause", NULL, &RSL__IE__Cause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__IE__Cause_cause__ext_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       RSL__IE__Cause_cause__ext_xer_ = { {"cause_ext>\n", "cause_ext>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__Cause_cause__ext_oer_ext_arr_[0] = {};
const int RSL__IE__Cause_cause__ext_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__Cause_cause__ext_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__Cause_cause__ext_oer_ext_arr_, 0, RSL__IE__Cause_cause__ext_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__Cause_cause__ext_descr_ = { "@RSL_Types.RSL_IE_Cause.cause_ext", &OCTETSTRING_ber_, &RSL__IE__Cause_cause__ext_raw_, &OCTETSTRING_text_, &RSL__IE__Cause_cause__ext_xer_, &OCTETSTRING_json_, &RSL__IE__Cause_cause__ext_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Cause_cause__ext_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__IE__Cause_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfo_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__SacchInfo_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__SacchInfo_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__SacchInfo_len_descr_ = { "@RSL_Types.RSL_SacchInfo.len", &INTEGER_ber_, &RSL__SacchInfo_len_raw_, &INTEGER_text_, &RSL__SacchInfo_len_xer_, &INTEGER_json_, &RSL__SacchInfo_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfo_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfo_num__msgs_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,-1,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__SacchInfo_num__msgs_xer_ = { {"num_msgs>\n", "num_msgs>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__SacchInfo_num__msgs_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__SacchInfo_num__msgs_descr_ = { "@RSL_Types.RSL_SacchInfo.num_msgs", &INTEGER_ber_, &RSL__SacchInfo_num__msgs_raw_, &INTEGER_text_, &RSL__SacchInfo_num__msgs_xer_, &INTEGER_json_, &RSL__SacchInfo_num__msgs_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfo_num__msgs_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfoElements_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 RSL__SacchInfoElements
const TTCN_Typedescriptor_t RSL__SacchInfoElements_descr_ = { "@RSL_Types.RSL_SacchInfoElements", NULL, &RSL__SacchInfoElements_raw_, NULL, NULL, NULL, NULL, NULL, &RSL__SacchInfoElements_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__IE__SysinfoType_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__SysinfoType
const TTCN_Typedescriptor_t RSL__IE__SysinfoType_descr_ = { "@RSL_Types.RSL_IE_SysinfoType", NULL, &RSL__IE__SysinfoType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__SysinfoType_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfoElement_si__type_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__SacchInfoElement_si__type
const TTCN_Typedescriptor_t RSL__SacchInfoElement_si__type_descr_ = { "@RSL_Types.RSL_SacchInfoElement.si_type", NULL, &RSL__SacchInfoElement_si__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfoElement_si__type_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfoElement_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__SacchInfoElement_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__SacchInfoElement_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__SacchInfoElement_len_descr_ = { "@RSL_Types.RSL_SacchInfoElement.len", &INTEGER_ber_, &RSL__SacchInfoElement_len_raw_, &INTEGER_text_, &RSL__SacchInfoElement_len_xer_, &INTEGER_json_, &RSL__SacchInfoElement_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfoElement_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfoElement_msg_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       RSL__SacchInfoElement_msg_xer_ = { {"msg>\n", "msg>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__SacchInfoElement_msg_oer_ext_arr_[0] = {};
const int RSL__SacchInfoElement_msg_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__SacchInfoElement_msg_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__SacchInfoElement_msg_oer_ext_arr_, 0, RSL__SacchInfoElement_msg_oer_p_};
const TTCN_Typedescriptor_t RSL__SacchInfoElement_msg_descr_ = { "@RSL_Types.RSL_SacchInfoElement.msg", &OCTETSTRING_ber_, &RSL__SacchInfoElement_msg_raw_, &OCTETSTRING_text_, &RSL__SacchInfoElement_msg_xer_, &OCTETSTRING_json_, &RSL__SacchInfoElement_msg_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfoElement_msg_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfoElement_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 RSL__SacchInfoElement
const TTCN_Typedescriptor_t RSL__SacchInfoElement_descr_ = { "@RSL_Types.RSL_SacchInfoElement", NULL, &RSL__SacchInfoElement_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfoElement_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfoElements_0_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__SacchInfoElements_0
const TTCN_Typedescriptor_t RSL__SacchInfoElements_0_descr_ = { "@RSL_Types.RSL_SacchInfoElements.<oftype>", NULL, &RSL__SacchInfoElements_0_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfoElements_0_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__SacchInfoElements_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfo_elems_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 RSL__SacchInfo_elems
const TTCN_Typedescriptor_t RSL__SacchInfo_elems_descr_ = { "@RSL_Types.RSL_SacchInfo.elems", NULL, &RSL__SacchInfo_elems_raw_, NULL, NULL, NULL, NULL, NULL, &RSL__SacchInfoElements_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfo_elems_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__SacchInfo_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 RSL__SacchInfo
const TTCN_Typedescriptor_t RSL__SacchInfo_descr_ = { "@RSL_Types.RSL_SacchInfo", NULL, &RSL__SacchInfo_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__SacchInfo_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MS__Power__Parameters_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__MS__Power__Parameters_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MS__Power__Parameters_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MS__Power__Parameters_len_descr_ = { "@RSL_Types.RSL_IE_MS_Power_Parameters.len", &INTEGER_ber_, &RSL__IE__MS__Power__Parameters_len_raw_, &INTEGER_text_, &RSL__IE__MS__Power__Parameters_len_xer_, &INTEGER_json_, &RSL__IE__MS__Power__Parameters_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MS__Power__Parameters_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MS__Power__Parameters_params_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       RSL__IE__MS__Power__Parameters_params_xer_ = { {"params>\n", "params>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MS__Power__Parameters_params_oer_ext_arr_[0] = {};
const int RSL__IE__MS__Power__Parameters_params_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MS__Power__Parameters_params_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MS__Power__Parameters_params_oer_ext_arr_, 0, RSL__IE__MS__Power__Parameters_params_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MS__Power__Parameters_params_descr_ = { "@RSL_Types.RSL_IE_MS_Power_Parameters.params", &OCTETSTRING_ber_, &RSL__IE__MS__Power__Parameters_params_raw_, &OCTETSTRING_text_, &RSL__IE__MS__Power__Parameters_params_xer_, &OCTETSTRING_json_, &RSL__IE__MS__Power__Parameters_params_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MS__Power__Parameters_params_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MS__Power__Parameters_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 RSL__IE__MS__Power__Parameters
const TTCN_Typedescriptor_t RSL__IE__MS__Power__Parameters_descr_ = { "@RSL_Types.RSL_IE_MS_Power_Parameters", NULL, &RSL__IE__MS__Power__Parameters_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MS__Power__Parameters_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__ChanNeeded_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 RSL__ChanNeeded
const TTCN_Typedescriptor_t RSL__ChanNeeded_descr_ = { "@RSL_Types.RSL_ChanNeeded", NULL, &RSL__ChanNeeded_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__ChanNeeded_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChanNeeded_reserved_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       RSL__IE__ChanNeeded_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__ChanNeeded_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__ChanNeeded_reserved_descr_ = { "@RSL_Types.RSL_IE_ChanNeeded.reserved", &INTEGER_ber_, &RSL__IE__ChanNeeded_reserved_raw_, &INTEGER_text_, &RSL__IE__ChanNeeded_reserved_xer_, &INTEGER_json_, &RSL__IE__ChanNeeded_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChanNeeded_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChanNeeded_chan__needed_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 RSL__IE__ChanNeeded_chan__needed
const TTCN_Typedescriptor_t RSL__IE__ChanNeeded_chan__needed_descr_ = { "@RSL_Types.RSL_IE_ChanNeeded.chan_needed", NULL, &RSL__IE__ChanNeeded_chan__needed_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChanNeeded_chan__needed_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ChanNeeded_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 RSL__IE__ChanNeeded
const TTCN_Typedescriptor_t RSL__IE__ChanNeeded_descr_ = { "@RSL_Types.RSL_IE_ChanNeeded", NULL, &RSL__IE__ChanNeeded_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ChanNeeded_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__CbCommand_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__CbCommand
const TTCN_Typedescriptor_t RSL__CbCommand_descr_ = { "@RSL_Types.RSL_CbCommand", NULL, &RSL__CbCommand_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__CbCommand_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbCommandType_command_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__CbCommandType_command
const TTCN_Typedescriptor_t RSL__IE__CbCommandType_command_descr_ = { "@RSL_Types.RSL_IE_CbCommandType.command", NULL, &RSL__IE__CbCommandType_command_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbCommandType_command_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbCommandType_default__bcast__null_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       RSL__IE__CbCommandType_default__bcast__null_xer_ = { {"default_bcast_null>\n", "default_bcast_null>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__CbCommandType_default__bcast__null_oer_ext_arr_[0] = {};
const int RSL__IE__CbCommandType_default__bcast__null_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__CbCommandType_default__bcast__null_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__CbCommandType_default__bcast__null_oer_ext_arr_, 0, RSL__IE__CbCommandType_default__bcast__null_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__CbCommandType_default__bcast__null_descr_ = { "@RSL_Types.RSL_IE_CbCommandType.default_bcast_null", &BOOLEAN_ber_, &RSL__IE__CbCommandType_default__bcast__null_raw_, &BOOLEAN_text_, &RSL__IE__CbCommandType_default__bcast__null_xer_, &BOOLEAN_json_, &RSL__IE__CbCommandType_default__bcast__null_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbCommandType_default__bcast__null_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbCommandType_spare_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       RSL__IE__CbCommandType_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 RSL__IE__CbCommandType_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__CbCommandType_spare_descr_ = { "@RSL_Types.RSL_IE_CbCommandType.spare", &BITSTRING_ber_, &RSL__IE__CbCommandType_spare_raw_, NULL, &RSL__IE__CbCommandType_spare_xer_, &BITSTRING_json_, &RSL__IE__CbCommandType_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbCommandType_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbCommandType_last__block_raw_ = {2,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       RSL__IE__CbCommandType_last__block_xer_ = { {"last_block>\n", "last_block>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__CbCommandType_last__block_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__CbCommandType_last__block_descr_ = { "@RSL_Types.RSL_IE_CbCommandType.last_block", &INTEGER_ber_, &RSL__IE__CbCommandType_last__block_raw_, &INTEGER_text_, &RSL__IE__CbCommandType_last__block_xer_, &INTEGER_json_, &RSL__IE__CbCommandType_last__block_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbCommandType_last__block_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbCommandType_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 RSL__IE__CbCommandType
const TTCN_Typedescriptor_t RSL__IE__CbCommandType_descr_ = { "@RSL_Types.RSL_IE_CbCommandType", NULL, &RSL__IE__CbCommandType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbCommandType_default_coding("RAW");
RSL__CbCommand const_ts__RSL__IE__CbCmdType_cmd_defval;
const RSL__CbCommand& ts__RSL__IE__CbCmdType_cmd_defval = const_ts__RSL__IE__CbCmdType_cmd_defval;
INTEGER const_ts__RSL__IE__CbCmdType_last__block_defval;
const INTEGER& ts__RSL__IE__CbCmdType_last__block_defval = const_ts__RSL__IE__CbCmdType_last__block_defval;
BOOLEAN const_ts__RSL__IE__CbCmdType_def__bcast__null_defval;
const BOOLEAN& ts__RSL__IE__CbCmdType_def__bcast__null_defval = const_ts__RSL__IE__CbCmdType_def__bcast__null_defval;
const TTCN_RAWdescriptor_t RSL__IE__CbchLoadInfo_overflow_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       RSL__IE__CbchLoadInfo_overflow_xer_ = { {"overflow>\n", "overflow>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__CbchLoadInfo_overflow_oer_ext_arr_[0] = {};
const int RSL__IE__CbchLoadInfo_overflow_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__CbchLoadInfo_overflow_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__CbchLoadInfo_overflow_oer_ext_arr_, 0, RSL__IE__CbchLoadInfo_overflow_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__CbchLoadInfo_overflow_descr_ = { "@RSL_Types.RSL_IE_CbchLoadInfo.overflow", &BOOLEAN_ber_, &RSL__IE__CbchLoadInfo_overflow_raw_, &BOOLEAN_text_, &RSL__IE__CbchLoadInfo_overflow_xer_, &BOOLEAN_json_, &RSL__IE__CbchLoadInfo_overflow_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbchLoadInfo_overflow_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbchLoadInfo_spare_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,3,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__CbchLoadInfo_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 RSL__IE__CbchLoadInfo_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__CbchLoadInfo_spare_descr_ = { "@RSL_Types.RSL_IE_CbchLoadInfo.spare", &BITSTRING_ber_, &RSL__IE__CbchLoadInfo_spare_raw_, NULL, &RSL__IE__CbchLoadInfo_spare_xer_, &BITSTRING_json_, &RSL__IE__CbchLoadInfo_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbchLoadInfo_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbchLoadInfo_slot__count_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       RSL__IE__CbchLoadInfo_slot__count_xer_ = { {"slot_count>\n", "slot_count>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__CbchLoadInfo_slot__count_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__CbchLoadInfo_slot__count_descr_ = { "@RSL_Types.RSL_IE_CbchLoadInfo.slot_count", &INTEGER_ber_, &RSL__IE__CbchLoadInfo_slot__count_raw_, &INTEGER_text_, &RSL__IE__CbchLoadInfo_slot__count_xer_, &INTEGER_json_, &RSL__IE__CbchLoadInfo_slot__count_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbchLoadInfo_slot__count_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CbchLoadInfo_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 RSL__IE__CbchLoadInfo
const TTCN_Typedescriptor_t RSL__IE__CbchLoadInfo_descr_ = { "@RSL_Types.RSL_IE_CbchLoadInfo", NULL, &RSL__IE__CbchLoadInfo_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CbchLoadInfo_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__GroupCallReference_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__GroupCallReference_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__GroupCallReference_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__GroupCallReference_len_descr_ = { "@RSL_Types.RSL_IE_GroupCallReference.len", &INTEGER_ber_, &RSL__IE__GroupCallReference_len_raw_, &INTEGER_text_, &RSL__IE__GroupCallReference_len_xer_, &INTEGER_json_, &RSL__IE__GroupCallReference_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__GroupCallReference_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__GroupCallReference_group__or__bcast__call__ref_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       RSL__IE__GroupCallReference_group__or__bcast__call__ref_xer_ = { {"group_or_bcast_call_ref>\n", "group_or_bcast_call_ref>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__GroupCallReference_group__or__bcast__call__ref_oer_ext_arr_[0] = {};
const int RSL__IE__GroupCallReference_group__or__bcast__call__ref_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__GroupCallReference_group__or__bcast__call__ref_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__GroupCallReference_group__or__bcast__call__ref_oer_ext_arr_, 0, RSL__IE__GroupCallReference_group__or__bcast__call__ref_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__GroupCallReference_group__or__bcast__call__ref_descr_ = { "@RSL_Types.RSL_IE_GroupCallReference.group_or_bcast_call_ref", &OCTETSTRING_ber_, &RSL__IE__GroupCallReference_group__or__bcast__call__ref_raw_, &OCTETSTRING_text_, &RSL__IE__GroupCallReference_group__or__bcast__call__ref_xer_, &OCTETSTRING_json_, &RSL__IE__GroupCallReference_group__or__bcast__call__ref_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__GroupCallReference_group__or__bcast__call__ref_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__GroupCallReference_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 RSL__IE__GroupCallReference
const TTCN_Typedescriptor_t RSL__IE__GroupCallReference_descr_ = { "@RSL_Types.RSL_IE_GroupCallReference", NULL, &RSL__IE__GroupCallReference_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__GroupCallReference_default_coding("RAW");
OCTETSTRING_template template_tr__GroupCallRef_gcr_defval;
const OCTETSTRING_template& tr__GroupCallRef_gcr_defval = template_tr__GroupCallRef_gcr_defval;
const TTCN_RAWdescriptor_t RSL__IE__GroupChannelDescription_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__GroupChannelDescription_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__GroupChannelDescription_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__GroupChannelDescription_len_descr_ = { "@RSL_Types.RSL_IE_GroupChannelDescription.len", &INTEGER_ber_, &RSL__IE__GroupChannelDescription_len_raw_, &INTEGER_text_, &RSL__IE__GroupChannelDescription_len_xer_, &INTEGER_json_, &RSL__IE__GroupChannelDescription_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__GroupChannelDescription_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__GroupChannelDescription_chan__desc_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       RSL__IE__GroupChannelDescription_chan__desc_xer_ = { {"chan_desc>\n", "chan_desc>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__GroupChannelDescription_chan__desc_oer_ext_arr_[0] = {};
const int RSL__IE__GroupChannelDescription_chan__desc_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__GroupChannelDescription_chan__desc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__GroupChannelDescription_chan__desc_oer_ext_arr_, 0, RSL__IE__GroupChannelDescription_chan__desc_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__GroupChannelDescription_chan__desc_descr_ = { "@RSL_Types.RSL_IE_GroupChannelDescription.chan_desc", &OCTETSTRING_ber_, &RSL__IE__GroupChannelDescription_chan__desc_raw_, &OCTETSTRING_text_, &RSL__IE__GroupChannelDescription_chan__desc_xer_, &OCTETSTRING_json_, &RSL__IE__GroupChannelDescription_chan__desc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__GroupChannelDescription_chan__desc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__GroupChannelDescription_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 RSL__IE__GroupChannelDescription
const TTCN_Typedescriptor_t RSL__IE__GroupChannelDescription_descr_ = { "@RSL_Types.RSL_IE_GroupChannelDescription", NULL, &RSL__IE__GroupChannelDescription_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__GroupChannelDescription_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__NchDrxInformation_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__NchDrxInformation_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__NchDrxInformation_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__NchDrxInformation_len_descr_ = { "@RSL_Types.RSL_IE_NchDrxInformation.len", &INTEGER_ber_, &RSL__IE__NchDrxInformation_len_raw_, &INTEGER_text_, &RSL__IE__NchDrxInformation_len_xer_, &INTEGER_json_, &RSL__IE__NchDrxInformation_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__NchDrxInformation_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__NchDrxInformation_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       RSL__IE__NchDrxInformation_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 RSL__IE__NchDrxInformation_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__NchDrxInformation_spare_descr_ = { "@RSL_Types.RSL_IE_NchDrxInformation.spare", &BITSTRING_ber_, &RSL__IE__NchDrxInformation_spare_raw_, NULL, &RSL__IE__NchDrxInformation_spare_xer_, &BITSTRING_json_, &RSL__IE__NchDrxInformation_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__NchDrxInformation_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__NchDrxInformation_nln__status_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       RSL__IE__NchDrxInformation_nln__status_xer_ = { {"nln_status>\n", "nln_status>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__NchDrxInformation_nln__status_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__NchDrxInformation_nln__status_descr_ = { "@RSL_Types.RSL_IE_NchDrxInformation.nln_status", &BITSTRING_ber_, &RSL__IE__NchDrxInformation_nln__status_raw_, NULL, &RSL__IE__NchDrxInformation_nln__status_xer_, &BITSTRING_json_, &RSL__IE__NchDrxInformation_nln__status_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__NchDrxInformation_nln__status_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__NchDrxInformation_emlpp__priority_raw_ = {3,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,3,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__NchDrxInformation_emlpp__priority_xer_ = { {"emlpp_priority>\n", "emlpp_priority>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__NchDrxInformation_emlpp__priority_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__NchDrxInformation_emlpp__priority_descr_ = { "@RSL_Types.RSL_IE_NchDrxInformation.emlpp_priority", &BITSTRING_ber_, &RSL__IE__NchDrxInformation_emlpp__priority_raw_, NULL, &RSL__IE__NchDrxInformation_emlpp__priority_xer_, &BITSTRING_json_, &RSL__IE__NchDrxInformation_emlpp__priority_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__NchDrxInformation_emlpp__priority_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__NchDrxInformation_nln_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       RSL__IE__NchDrxInformation_nln_xer_ = { {"nln>\n", "nln>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__NchDrxInformation_nln_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__NchDrxInformation_nln_descr_ = { "@RSL_Types.RSL_IE_NchDrxInformation.nln", &BITSTRING_ber_, &RSL__IE__NchDrxInformation_nln_raw_, NULL, &RSL__IE__NchDrxInformation_nln_xer_, &BITSTRING_json_, &RSL__IE__NchDrxInformation_nln_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__NchDrxInformation_nln_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__NchDrxInformation_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 RSL__IE__NchDrxInformation
const TTCN_Typedescriptor_t RSL__IE__NchDrxInformation_descr_ = { "@RSL_Types.RSL_IE_NchDrxInformation", NULL, &RSL__IE__NchDrxInformation_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__NchDrxInformation_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__CommandIndicator_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__CommandIndicator
const TTCN_Typedescriptor_t RSL__CommandIndicator_descr_ = { "@RSL_Types.RSL_CommandIndicator", NULL, &RSL__CommandIndicator_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__CommandIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CommandIndicator_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__CommandIndicator_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__CommandIndicator_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__CommandIndicator_len_descr_ = { "@RSL_Types.RSL_IE_CommandIndicator.len", &INTEGER_ber_, &RSL__IE__CommandIndicator_len_raw_, &INTEGER_text_, &RSL__IE__CommandIndicator_len_xer_, &INTEGER_json_, &RSL__IE__CommandIndicator_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CommandIndicator_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CommandIndicator_command__value_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__CommandIndicator_command__value
const TTCN_Typedescriptor_t RSL__IE__CommandIndicator_command__value_descr_ = { "@RSL_Types.RSL_IE_CommandIndicator.command_value", NULL, &RSL__IE__CommandIndicator_command__value_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CommandIndicator_command__value_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__CommandIndicator_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 RSL__IE__CommandIndicator
const TTCN_Typedescriptor_t RSL__IE__CommandIndicator_descr_ = { "@RSL_Types.RSL_IE_CommandIndicator", NULL, &RSL__IE__CommandIndicator_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__CommandIndicator_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Uic_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__Uic_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Uic_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Uic_len_descr_ = { "@RSL_Types.RSL_IE_Uic.len", &INTEGER_ber_, &RSL__IE__Uic_len_raw_, &INTEGER_text_, &RSL__IE__Uic_len_xer_, &INTEGER_json_, &RSL__IE__Uic_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Uic_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Uic_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       RSL__IE__Uic_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 RSL__IE__Uic_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Uic_spare_descr_ = { "@RSL_Types.RSL_IE_Uic.spare", &BITSTRING_ber_, &RSL__IE__Uic_spare_raw_, NULL, &RSL__IE__Uic_spare_xer_, &BITSTRING_json_, &RSL__IE__Uic_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Uic_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Uic_uic_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       RSL__IE__Uic_uic_xer_ = { {"uic>\n", "uic>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Uic_uic_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Uic_uic_descr_ = { "@RSL_Types.RSL_IE_Uic.uic", &INTEGER_ber_, &RSL__IE__Uic_uic_raw_, &INTEGER_text_, &RSL__IE__Uic_uic_xer_, &INTEGER_json_, &RSL__IE__Uic_uic_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Uic_uic_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Uic_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 RSL__IE__Uic
const TTCN_Typedescriptor_t RSL__IE__Uic_descr_ = { "@RSL_Types.RSL_IE_Uic", NULL, &RSL__IE__Uic_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Uic_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__MultirateCfg_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MultirateCfg_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_len_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.len", &INTEGER_ber_, &RSL__IE__MultirateCfg_len_raw_, &INTEGER_text_, &RSL__IE__MultirateCfg_len_xer_, &INTEGER_json_, &RSL__IE__MultirateCfg_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_mr__speech__ver_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       RSL__IE__MultirateCfg_mr__speech__ver_xer_ = { {"mr_speech_ver>\n", "mr_speech_ver>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MultirateCfg_mr__speech__ver_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_mr__speech__ver_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.mr_speech_ver", &INTEGER_ber_, &RSL__IE__MultirateCfg_mr__speech__ver_raw_, &INTEGER_text_, &RSL__IE__MultirateCfg_mr__speech__ver_xer_, &INTEGER_json_, &RSL__IE__MultirateCfg_mr__speech__ver_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_mr__speech__ver_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_nscb_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       RSL__IE__MultirateCfg_nscb_xer_ = { {"nscb>\n", "nscb>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MultirateCfg_nscb_oer_ext_arr_[0] = {};
const int RSL__IE__MultirateCfg_nscb_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MultirateCfg_nscb_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MultirateCfg_nscb_oer_ext_arr_, 0, RSL__IE__MultirateCfg_nscb_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_nscb_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.nscb", &BOOLEAN_ber_, &RSL__IE__MultirateCfg_nscb_raw_, &BOOLEAN_text_, &RSL__IE__MultirateCfg_nscb_xer_, &BOOLEAN_json_, &RSL__IE__MultirateCfg_nscb_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_nscb_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_icmi_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       RSL__IE__MultirateCfg_icmi_xer_ = { {"icmi>\n", "icmi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MultirateCfg_icmi_oer_ext_arr_[0] = {};
const int RSL__IE__MultirateCfg_icmi_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MultirateCfg_icmi_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MultirateCfg_icmi_oer_ext_arr_, 0, RSL__IE__MultirateCfg_icmi_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_icmi_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.icmi", &BOOLEAN_ber_, &RSL__IE__MultirateCfg_icmi_raw_, &BOOLEAN_text_, &RSL__IE__MultirateCfg_icmi_xer_, &BOOLEAN_json_, &RSL__IE__MultirateCfg_icmi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_icmi_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_spare_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       RSL__IE__MultirateCfg_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 RSL__IE__MultirateCfg_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_spare_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.spare", &BITSTRING_ber_, &RSL__IE__MultirateCfg_spare_raw_, NULL, &RSL__IE__MultirateCfg_spare_xer_, &BITSTRING_json_, &RSL__IE__MultirateCfg_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_start__mode_raw_ = {2,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       RSL__IE__MultirateCfg_start__mode_xer_ = { {"start_mode>\n", "start_mode>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MultirateCfg_start__mode_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_start__mode_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.start_mode", &INTEGER_ber_, &RSL__IE__MultirateCfg_start__mode_raw_, &INTEGER_text_, &RSL__IE__MultirateCfg_start__mode_xer_, &INTEGER_json_, &RSL__IE__MultirateCfg_start__mode_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_start__mode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_codec__modes_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       RSL__IE__MultirateCfg_codec__modes_xer_ = { {"codec_modes>\n", "codec_modes>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MultirateCfg_codec__modes_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_codec__modes_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.codec_modes", &BITSTRING_ber_, &RSL__IE__MultirateCfg_codec__modes_raw_, NULL, &RSL__IE__MultirateCfg_codec__modes_xer_, &BITSTRING_json_, &RSL__IE__MultirateCfg_codec__modes_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_codec__modes_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_parameters_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       RSL__IE__MultirateCfg_parameters_xer_ = { {"parameters>\n", "parameters>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MultirateCfg_parameters_oer_ext_arr_[0] = {};
const int RSL__IE__MultirateCfg_parameters_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MultirateCfg_parameters_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MultirateCfg_parameters_oer_ext_arr_, 0, RSL__IE__MultirateCfg_parameters_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_parameters_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg.parameters", &OCTETSTRING_ber_, &RSL__IE__MultirateCfg_parameters_raw_, &OCTETSTRING_text_, &RSL__IE__MultirateCfg_parameters_xer_, &OCTETSTRING_json_, &RSL__IE__MultirateCfg_parameters_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_parameters_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCfg_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 RSL__IE__MultirateCfg
const TTCN_Typedescriptor_t RSL__IE__MultirateCfg_descr_ = { "@RSL_Types.RSL_IE_MultirateCfg", NULL, &RSL__IE__MultirateCfg_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCfg_default_coding("RAW");
BOOLEAN const_ts__RSL__MultirateCfg_icmi_defval;
const BOOLEAN& ts__RSL__MultirateCfg_icmi_defval = const_ts__RSL__MultirateCfg_icmi_defval;
INTEGER const_ts__RSL__MultirateCfg_start__mode_defval;
const INTEGER& ts__RSL__MultirateCfg_start__mode_defval = const_ts__RSL__MultirateCfg_start__mode_defval;
BITSTRING const_ts__RSL__MultirateCfg_codec__modes_defval;
const BITSTRING& ts__RSL__MultirateCfg_codec__modes_defval = const_ts__RSL__MultirateCfg_codec__modes_defval;
OCTETSTRING const_ts__RSL__MultirateCfg_params_defval;
const OCTETSTRING& ts__RSL__MultirateCfg_params_defval = const_ts__RSL__MultirateCfg_params_defval;
const TTCN_RAWdescriptor_t RSL__IE__MultirateCtrl_spare_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       RSL__IE__MultirateCtrl_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 RSL__IE__MultirateCtrl_spare_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MultirateCtrl_spare_descr_ = { "@RSL_Types.RSL_IE_MultirateCtrl.spare", &INTEGER_ber_, &RSL__IE__MultirateCtrl_spare_raw_, &INTEGER_text_, &RSL__IE__MultirateCtrl_spare_xer_, &INTEGER_json_, &RSL__IE__MultirateCtrl_spare_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCtrl_spare_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCtrl_od_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       RSL__IE__MultirateCtrl_od_xer_ = { {"od>\n", "od>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MultirateCtrl_od_oer_ext_arr_[0] = {};
const int RSL__IE__MultirateCtrl_od_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MultirateCtrl_od_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MultirateCtrl_od_oer_ext_arr_, 0, RSL__IE__MultirateCtrl_od_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MultirateCtrl_od_descr_ = { "@RSL_Types.RSL_IE_MultirateCtrl.od", &BOOLEAN_ber_, &RSL__IE__MultirateCtrl_od_raw_, &BOOLEAN_text_, &RSL__IE__MultirateCtrl_od_xer_, &BOOLEAN_json_, &RSL__IE__MultirateCtrl_od_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCtrl_od_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCtrl_pre_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       RSL__IE__MultirateCtrl_pre_xer_ = { {"pre>\n", "pre>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MultirateCtrl_pre_oer_ext_arr_[0] = {};
const int RSL__IE__MultirateCtrl_pre_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MultirateCtrl_pre_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MultirateCtrl_pre_oer_ext_arr_, 0, RSL__IE__MultirateCtrl_pre_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MultirateCtrl_pre_descr_ = { "@RSL_Types.RSL_IE_MultirateCtrl.pre", &BOOLEAN_ber_, &RSL__IE__MultirateCtrl_pre_raw_, &BOOLEAN_text_, &RSL__IE__MultirateCtrl_pre_xer_, &BOOLEAN_json_, &RSL__IE__MultirateCtrl_pre_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCtrl_pre_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCtrl_rae_raw_ = {2,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       RSL__IE__MultirateCtrl_rae_xer_ = { {"rae>\n", "rae>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__MultirateCtrl_rae_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__MultirateCtrl_rae_descr_ = { "@RSL_Types.RSL_IE_MultirateCtrl.rae", &INTEGER_ber_, &RSL__IE__MultirateCtrl_rae_raw_, &INTEGER_text_, &RSL__IE__MultirateCtrl_rae_xer_, &INTEGER_json_, &RSL__IE__MultirateCtrl_rae_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCtrl_rae_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCtrl_tfo_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       RSL__IE__MultirateCtrl_tfo_xer_ = { {"tfo>\n", "tfo>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__MultirateCtrl_tfo_oer_ext_arr_[0] = {};
const int RSL__IE__MultirateCtrl_tfo_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__MultirateCtrl_tfo_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__MultirateCtrl_tfo_oer_ext_arr_, 0, RSL__IE__MultirateCtrl_tfo_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__MultirateCtrl_tfo_descr_ = { "@RSL_Types.RSL_IE_MultirateCtrl.tfo", &BOOLEAN_ber_, &RSL__IE__MultirateCtrl_tfo_raw_, &BOOLEAN_text_, &RSL__IE__MultirateCtrl_tfo_xer_, &BOOLEAN_json_, &RSL__IE__MultirateCtrl_tfo_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCtrl_tfo_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__MultirateCtrl_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 RSL__IE__MultirateCtrl
const TTCN_Typedescriptor_t RSL__IE__MultirateCtrl_descr_ = { "@RSL_Types.RSL_IE_MultirateCtrl", NULL, &RSL__IE__MultirateCtrl_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__MultirateCtrl_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__IPA__ConnectionStats_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_len_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.len", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_len_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_len_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_tx__packets_raw_ = {32,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       RSL__IE__IPA__ConnectionStats_tx__packets_xer_ = { {"tx_packets>\n", "tx_packets>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_tx__packets_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_tx__packets_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.tx_packets", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_tx__packets_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_tx__packets_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_tx__packets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_tx__packets_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_tx__octets_raw_ = {32,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       RSL__IE__IPA__ConnectionStats_tx__octets_xer_ = { {"tx_octets>\n", "tx_octets>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_tx__octets_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_tx__octets_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.tx_octets", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_tx__octets_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_tx__octets_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_tx__octets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_tx__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_rx__packets_raw_ = {32,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       RSL__IE__IPA__ConnectionStats_rx__packets_xer_ = { {"rx_packets>\n", "rx_packets>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_rx__packets_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_rx__packets_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.rx_packets", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_rx__packets_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_rx__packets_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_rx__packets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_rx__packets_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_rx__octets_raw_ = {32,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       RSL__IE__IPA__ConnectionStats_rx__octets_xer_ = { {"rx_octets>\n", "rx_octets>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_rx__octets_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_rx__octets_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.rx_octets", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_rx__octets_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_rx__octets_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_rx__octets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_rx__octets_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_lost__packets_raw_ = {32,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       RSL__IE__IPA__ConnectionStats_lost__packets_xer_ = { {"lost_packets>\n", "lost_packets>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_lost__packets_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_lost__packets_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.lost_packets", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_lost__packets_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_lost__packets_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_lost__packets_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_lost__packets_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_jitter_raw_ = {32,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       RSL__IE__IPA__ConnectionStats_jitter_xer_ = { {"jitter>\n", "jitter>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_jitter_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_jitter_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.jitter", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_jitter_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_jitter_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_jitter_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_jitter_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_avg__delay_raw_ = {32,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       RSL__IE__IPA__ConnectionStats_avg__delay_xer_ = { {"avg_delay>\n", "avg_delay>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__ConnectionStats_avg__delay_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_avg__delay_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats.avg_delay", &INTEGER_ber_, &RSL__IE__IPA__ConnectionStats_avg__delay_raw_, &INTEGER_text_, &RSL__IE__IPA__ConnectionStats_avg__delay_xer_, &INTEGER_json_, &RSL__IE__IPA__ConnectionStats_avg__delay_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_avg__delay_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__ConnectionStats_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 RSL__IE__IPA__ConnectionStats
const TTCN_Typedescriptor_t RSL__IE__IPA__ConnectionStats_descr_ = { "@RSL_Types.RSL_IE_IPA_ConnectionStats", NULL, &RSL__IE__IPA__ConnectionStats_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__ConnectionStats_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IPA__SpeechMode_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 RSL__IPA__SpeechMode
const TTCN_Typedescriptor_t RSL__IPA__SpeechMode_descr_ = { "@RSL_Types.RSL_IPA_SpeechMode", NULL, &RSL__IPA__SpeechMode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IPA__SpeechMode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IPA__Codec_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IPA__Codec
const TTCN_Typedescriptor_t RSL__IPA__Codec_descr_ = { "@RSL_Types.RSL_IPA_Codec", NULL, &RSL__IPA__Codec_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IPA__Codec_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__SpeechMode_reserved_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       RSL__IE__IPA__SpeechMode_reserved_xer_ = { {"reserved>\n", "reserved>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__IPA__SpeechMode_reserved_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__IPA__SpeechMode_reserved_descr_ = { "@RSL_Types.RSL_IE_IPA_SpeechMode.reserved", &BITSTRING_ber_, &RSL__IE__IPA__SpeechMode_reserved_raw_, NULL, &RSL__IE__IPA__SpeechMode_reserved_xer_, &BITSTRING_json_, &RSL__IE__IPA__SpeechMode_reserved_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__SpeechMode_reserved_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__SpeechMode_mode_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 RSL__IE__IPA__SpeechMode_mode
const TTCN_Typedescriptor_t RSL__IE__IPA__SpeechMode_mode_descr_ = { "@RSL_Types.RSL_IE_IPA_SpeechMode.mode", NULL, &RSL__IE__IPA__SpeechMode_mode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__SpeechMode_mode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__SpeechMode_codec_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__IPA__SpeechMode_codec
const TTCN_Typedescriptor_t RSL__IE__IPA__SpeechMode_codec_descr_ = { "@RSL_Types.RSL_IE_IPA_SpeechMode.codec", NULL, &RSL__IE__IPA__SpeechMode_codec_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__SpeechMode_codec_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__SpeechMode_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 RSL__IE__IPA__SpeechMode
const TTCN_Typedescriptor_t RSL__IE__IPA__SpeechMode_descr_ = { "@RSL_Types.RSL_IE_IPA_SpeechMode", NULL, &RSL__IE__IPA__SpeechMode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__SpeechMode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IPA__RTP__CSD__FMT__D_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IPA__RTP__CSD__FMT__D
const TTCN_Typedescriptor_t RSL__IPA__RTP__CSD__FMT__D_descr_ = { "@RSL_Types.RSL_IPA_RTP_CSD_FMT_D", NULL, &RSL__IPA__RTP__CSD__FMT__D_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IPA__RTP__CSD__FMT__D_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IPA__RTP__CSD__FMT__IR_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IPA__RTP__CSD__FMT__IR
const TTCN_Typedescriptor_t RSL__IPA__RTP__CSD__FMT__IR_descr_ = { "@RSL_Types.RSL_IPA_RTP_CSD_FMT_IR", NULL, &RSL__IPA__RTP__CSD__FMT__IR_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IPA__RTP__CSD__FMT__IR_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__RTP__CSD__FMT_ir_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__IPA__RTP__CSD__FMT_ir
const TTCN_Typedescriptor_t RSL__IE__IPA__RTP__CSD__FMT_ir_descr_ = { "@RSL_Types.RSL_IE_IPA_RTP_CSD_FMT.ir", NULL, &RSL__IE__IPA__RTP__CSD__FMT_ir_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__RTP__CSD__FMT_ir_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__RTP__CSD__FMT_d_raw_ = {4,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__IPA__RTP__CSD__FMT_d
const TTCN_Typedescriptor_t RSL__IE__IPA__RTP__CSD__FMT_d_descr_ = { "@RSL_Types.RSL_IE_IPA_RTP_CSD_FMT.d", NULL, &RSL__IE__IPA__RTP__CSD__FMT_d_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__RTP__CSD__FMT_d_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__IPA__RTP__CSD__FMT_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 RSL__IE__IPA__RTP__CSD__FMT
const TTCN_Typedescriptor_t RSL__IE__IPA__RTP__CSD__FMT_descr_ = { "@RSL_Types.RSL_IE_IPA_RTP_CSD_FMT", NULL, &RSL__IE__IPA__RTP__CSD__FMT_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__IPA__RTP__CSD__FMT_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__ReleaseMode_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 RSL__IE__ReleaseMode
const TTCN_Typedescriptor_t RSL__IE__ReleaseMode_descr_ = { "@RSL_Types.RSL_IE_ReleaseMode", NULL, &RSL__IE__ReleaseMode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__ReleaseMode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TrainingSequence_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__OSMO__TrainingSequence_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__TrainingSequence_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__TrainingSequence_len_descr_ = { "@RSL_Types.RSL_IE_OSMO_TrainingSequence.len", &INTEGER_ber_, &RSL__IE__OSMO__TrainingSequence_len_raw_, &INTEGER_text_, &RSL__IE__OSMO__TrainingSequence_len_xer_, &INTEGER_json_, &RSL__IE__OSMO__TrainingSequence_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TrainingSequence_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TrainingSequence_tsc__set_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       RSL__IE__OSMO__TrainingSequence_tsc__set_xer_ = { {"tsc_set>\n", "tsc_set>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__TrainingSequence_tsc__set_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__TrainingSequence_tsc__set_descr_ = { "@RSL_Types.RSL_IE_OSMO_TrainingSequence.tsc_set", &INTEGER_ber_, &RSL__IE__OSMO__TrainingSequence_tsc__set_raw_, &INTEGER_text_, &RSL__IE__OSMO__TrainingSequence_tsc__set_xer_, &INTEGER_json_, &RSL__IE__OSMO__TrainingSequence_tsc__set_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TrainingSequence_tsc__set_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TrainingSequence_tsc_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       RSL__IE__OSMO__TrainingSequence_tsc_xer_ = { {"tsc>\n", "tsc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__TrainingSequence_tsc_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__TrainingSequence_tsc_descr_ = { "@RSL_Types.RSL_IE_OSMO_TrainingSequence.tsc", &INTEGER_ber_, &RSL__IE__OSMO__TrainingSequence_tsc_raw_, &INTEGER_text_, &RSL__IE__OSMO__TrainingSequence_tsc_xer_, &INTEGER_json_, &RSL__IE__OSMO__TrainingSequence_tsc_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TrainingSequence_tsc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TrainingSequence_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 RSL__IE__OSMO__TrainingSequence
const TTCN_Typedescriptor_t RSL__IE__OSMO__TrainingSequence_descr_ = { "@RSL_Types.RSL_IE_OSMO_TrainingSequence", NULL, &RSL__IE__OSMO__TrainingSequence_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TrainingSequence_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__OSMO__RepAcchCap_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__RepAcchCap_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_len_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap.len", &INTEGER_ber_, &RSL__IE__OSMO__RepAcchCap_len_raw_, &INTEGER_text_, &RSL__IE__OSMO__RepAcchCap_len_xer_, &INTEGER_json_, &RSL__IE__OSMO__RepAcchCap_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_rfu_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       RSL__IE__OSMO__RepAcchCap_rfu_xer_ = { {"rfu>\n", "rfu>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__RepAcchCap_rfu_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_rfu_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap.rfu", &BITSTRING_ber_, &RSL__IE__OSMO__RepAcchCap_rfu_raw_, NULL, &RSL__IE__OSMO__RepAcchCap_rfu_xer_, &BITSTRING_json_, &RSL__IE__OSMO__RepAcchCap_rfu_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_rfu_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_rxqual_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       RSL__IE__OSMO__RepAcchCap_rxqual_xer_ = { {"rxqual>\n", "rxqual>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__RepAcchCap_rxqual_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_rxqual_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap.rxqual", &INTEGER_ber_, &RSL__IE__OSMO__RepAcchCap_rxqual_raw_, &INTEGER_text_, &RSL__IE__OSMO__RepAcchCap_rxqual_xer_, &INTEGER_json_, &RSL__IE__OSMO__RepAcchCap_rxqual_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_rxqual_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_ul__sacch_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       RSL__IE__OSMO__RepAcchCap_ul__sacch_xer_ = { {"ul_sacch>\n", "ul_sacch>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__OSMO__RepAcchCap_ul__sacch_oer_ext_arr_[0] = {};
const int RSL__IE__OSMO__RepAcchCap_ul__sacch_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__OSMO__RepAcchCap_ul__sacch_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__OSMO__RepAcchCap_ul__sacch_oer_ext_arr_, 0, RSL__IE__OSMO__RepAcchCap_ul__sacch_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_ul__sacch_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap.ul_sacch", &BOOLEAN_ber_, &RSL__IE__OSMO__RepAcchCap_ul__sacch_raw_, &BOOLEAN_text_, &RSL__IE__OSMO__RepAcchCap_ul__sacch_xer_, &BOOLEAN_json_, &RSL__IE__OSMO__RepAcchCap_ul__sacch_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_ul__sacch_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_dl__sacch_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       RSL__IE__OSMO__RepAcchCap_dl__sacch_xer_ = { {"dl_sacch>\n", "dl_sacch>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__OSMO__RepAcchCap_dl__sacch_oer_ext_arr_[0] = {};
const int RSL__IE__OSMO__RepAcchCap_dl__sacch_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__OSMO__RepAcchCap_dl__sacch_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__OSMO__RepAcchCap_dl__sacch_oer_ext_arr_, 0, RSL__IE__OSMO__RepAcchCap_dl__sacch_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_dl__sacch_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap.dl_sacch", &BOOLEAN_ber_, &RSL__IE__OSMO__RepAcchCap_dl__sacch_raw_, &BOOLEAN_text_, &RSL__IE__OSMO__RepAcchCap_dl__sacch_xer_, &BOOLEAN_json_, &RSL__IE__OSMO__RepAcchCap_dl__sacch_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_dl__sacch_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_dl__facch__all_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       RSL__IE__OSMO__RepAcchCap_dl__facch__all_xer_ = { {"dl_facch_all>\n", "dl_facch_all>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__OSMO__RepAcchCap_dl__facch__all_oer_ext_arr_[0] = {};
const int RSL__IE__OSMO__RepAcchCap_dl__facch__all_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__OSMO__RepAcchCap_dl__facch__all_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__OSMO__RepAcchCap_dl__facch__all_oer_ext_arr_, 0, RSL__IE__OSMO__RepAcchCap_dl__facch__all_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_dl__facch__all_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap.dl_facch_all", &BOOLEAN_ber_, &RSL__IE__OSMO__RepAcchCap_dl__facch__all_raw_, &BOOLEAN_text_, &RSL__IE__OSMO__RepAcchCap_dl__facch__all_xer_, &BOOLEAN_json_, &RSL__IE__OSMO__RepAcchCap_dl__facch__all_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_dl__facch__all_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_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       RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_xer_ = { {"dl_facch_cmd>\n", "dl_facch_cmd>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_oer_ext_arr_[0] = {};
const int RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_oer_ext_arr_, 0, RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap.dl_facch_cmd", &BOOLEAN_ber_, &RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_raw_, &BOOLEAN_text_, &RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_xer_, &BOOLEAN_json_, &RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_dl__facch__cmd_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__RepAcchCap_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 RSL__IE__OSMO__RepAcchCap
const TTCN_Typedescriptor_t RSL__IE__OSMO__RepAcchCap_descr_ = { "@RSL_Types.RSL_IE_OSMO_RepAcchCap", NULL, &RSL__IE__OSMO__RepAcchCap_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__RepAcchCap_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TopAcchCap_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__OSMO__TopAcchCap_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__TopAcchCap_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__TopAcchCap_len_descr_ = { "@RSL_Types.RSL_IE_OSMO_TopAcchCap.len", &INTEGER_ber_, &RSL__IE__OSMO__TopAcchCap_len_raw_, &INTEGER_text_, &RSL__IE__OSMO__TopAcchCap_len_xer_, &INTEGER_json_, &RSL__IE__OSMO__TopAcchCap_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TopAcchCap_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TopAcchCap_sacch__enable_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       RSL__IE__OSMO__TopAcchCap_sacch__enable_xer_ = { {"sacch_enable>\n", "sacch_enable>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__OSMO__TopAcchCap_sacch__enable_oer_ext_arr_[0] = {};
const int RSL__IE__OSMO__TopAcchCap_sacch__enable_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__OSMO__TopAcchCap_sacch__enable_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__OSMO__TopAcchCap_sacch__enable_oer_ext_arr_, 0, RSL__IE__OSMO__TopAcchCap_sacch__enable_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__OSMO__TopAcchCap_sacch__enable_descr_ = { "@RSL_Types.RSL_IE_OSMO_TopAcchCap.sacch_enable", &BOOLEAN_ber_, &RSL__IE__OSMO__TopAcchCap_sacch__enable_raw_, &BOOLEAN_text_, &RSL__IE__OSMO__TopAcchCap_sacch__enable_xer_, &BOOLEAN_json_, &RSL__IE__OSMO__TopAcchCap_sacch__enable_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TopAcchCap_sacch__enable_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TopAcchCap_facch__enable_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       RSL__IE__OSMO__TopAcchCap_facch__enable_xer_ = { {"facch_enable>\n", "facch_enable>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__OSMO__TopAcchCap_facch__enable_oer_ext_arr_[0] = {};
const int RSL__IE__OSMO__TopAcchCap_facch__enable_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__OSMO__TopAcchCap_facch__enable_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RSL__IE__OSMO__TopAcchCap_facch__enable_oer_ext_arr_, 0, RSL__IE__OSMO__TopAcchCap_facch__enable_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__OSMO__TopAcchCap_facch__enable_descr_ = { "@RSL_Types.RSL_IE_OSMO_TopAcchCap.facch_enable", &BOOLEAN_ber_, &RSL__IE__OSMO__TopAcchCap_facch__enable_raw_, &BOOLEAN_text_, &RSL__IE__OSMO__TopAcchCap_facch__enable_xer_, &BOOLEAN_json_, &RSL__IE__OSMO__TopAcchCap_facch__enable_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TopAcchCap_facch__enable_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TopAcchCap_rxqual_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       RSL__IE__OSMO__TopAcchCap_rxqual_xer_ = { {"rxqual>\n", "rxqual>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__TopAcchCap_rxqual_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__TopAcchCap_rxqual_descr_ = { "@RSL_Types.RSL_IE_OSMO_TopAcchCap.rxqual", &INTEGER_ber_, &RSL__IE__OSMO__TopAcchCap_rxqual_raw_, &INTEGER_text_, &RSL__IE__OSMO__TopAcchCap_rxqual_xer_, &INTEGER_json_, &RSL__IE__OSMO__TopAcchCap_rxqual_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TopAcchCap_rxqual_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TopAcchCap_overpower__db_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       RSL__IE__OSMO__TopAcchCap_overpower__db_xer_ = { {"overpower_db>\n", "overpower_db>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__TopAcchCap_overpower__db_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__TopAcchCap_overpower__db_descr_ = { "@RSL_Types.RSL_IE_OSMO_TopAcchCap.overpower_db", &INTEGER_ber_, &RSL__IE__OSMO__TopAcchCap_overpower__db_raw_, &INTEGER_text_, &RSL__IE__OSMO__TopAcchCap_overpower__db_xer_, &INTEGER_json_, &RSL__IE__OSMO__TopAcchCap_overpower__db_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TopAcchCap_overpower__db_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__TopAcchCap_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 RSL__IE__OSMO__TopAcchCap
const TTCN_Typedescriptor_t RSL__IE__OSMO__TopAcchCap_descr_ = { "@RSL_Types.RSL_IE_OSMO_TopAcchCap", NULL, &RSL__IE__OSMO__TopAcchCap_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__TopAcchCap_default_coding("RAW");
INTEGER_template template_ts__RSL__IE__OSMO__TopAcchCap_overpower_defval;
const INTEGER_template& ts__RSL__IE__OSMO__TopAcchCap_overpower_defval = template_ts__RSL__IE__OSMO__TopAcchCap_overpower_defval;
INTEGER_template template_ts__RSL__IE__OSMO__TopAcchCap_rxqual_defval;
const INTEGER_template& ts__RSL__IE__OSMO__TopAcchCap_rxqual_defval = template_ts__RSL__IE__OSMO__TopAcchCap_rxqual_defval;
BOOLEAN const_ts__RSL__IE__OSMO__TopAcchCap_facch__enable_defval;
const BOOLEAN& ts__RSL__IE__OSMO__TopAcchCap_facch__enable_defval = const_ts__RSL__IE__OSMO__TopAcchCap_facch__enable_defval;
BOOLEAN const_ts__RSL__IE__OSMO__TopAcchCap_sacch__enable_defval;
const BOOLEAN& ts__RSL__IE__OSMO__TopAcchCap_sacch__enable_defval = const_ts__RSL__IE__OSMO__TopAcchCap_sacch__enable_defval;
INTEGER_template template_tr__RSL__IE__OSMO__TopAcchCap_overpower_defval;
const INTEGER_template& tr__RSL__IE__OSMO__TopAcchCap_overpower_defval = template_tr__RSL__IE__OSMO__TopAcchCap_overpower_defval;
INTEGER_template template_tr__RSL__IE__OSMO__TopAcchCap_rxqual_defval;
const INTEGER_template& tr__RSL__IE__OSMO__TopAcchCap_rxqual_defval = template_tr__RSL__IE__OSMO__TopAcchCap_rxqual_defval;
BOOLEAN_template template_tr__RSL__IE__OSMO__TopAcchCap_facch__enable_defval;
const BOOLEAN_template& tr__RSL__IE__OSMO__TopAcchCap_facch__enable_defval = template_tr__RSL__IE__OSMO__TopAcchCap_facch__enable_defval;
BOOLEAN_template template_tr__RSL__IE__OSMO__TopAcchCap_sacch__enable_defval;
const BOOLEAN_template& tr__RSL__IE__OSMO__TopAcchCap_sacch__enable_defval = template_tr__RSL__IE__OSMO__TopAcchCap_sacch__enable_defval;
const TTCN_RAWdescriptor_t RSL__IE__OSMO__Osmux__CID_len_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__OSMO__Osmux__CID_len_xer_ = { {"len>\n", "len>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__Osmux__CID_len_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__Osmux__CID_len_descr_ = { "@RSL_Types.RSL_IE_OSMO_Osmux_CID.len", &INTEGER_ber_, &RSL__IE__OSMO__Osmux__CID_len_raw_, &INTEGER_text_, &RSL__IE__OSMO__Osmux__CID_len_xer_, &INTEGER_json_, &RSL__IE__OSMO__Osmux__CID_len_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__Osmux__CID_len_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__Osmux__CID_cid_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       RSL__IE__OSMO__Osmux__CID_cid_xer_ = { {"cid>\n", "cid>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__OSMO__Osmux__CID_cid_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__OSMO__Osmux__CID_cid_descr_ = { "@RSL_Types.RSL_IE_OSMO_Osmux_CID.cid", &INTEGER_ber_, &RSL__IE__OSMO__Osmux__CID_cid_raw_, &INTEGER_text_, &RSL__IE__OSMO__Osmux__CID_cid_xer_, &INTEGER_json_, &RSL__IE__OSMO__Osmux__CID_cid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__Osmux__CID_cid_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__OSMO__Osmux__CID_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 RSL__IE__OSMO__Osmux__CID
const TTCN_Typedescriptor_t RSL__IE__OSMO__Osmux__CID_descr_ = { "@RSL_Types.RSL_IE_OSMO_Osmux_CID", NULL, &RSL__IE__OSMO__Osmux__CID_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__OSMO__Osmux__CID_default_coding("RAW");
INTEGER_template template_tr__RSL__IE__OSMO__Osmux__CID_osmux__cid_defval;
const INTEGER_template& tr__RSL__IE__OSMO__Osmux__CID_osmux__cid_defval = template_tr__RSL__IE__OSMO__Osmux__CID_osmux__cid_defval;
INTEGER_template template_f__tr__RSL__IE__OSMO__Osmux__CID_osmux__cid_defval;
const INTEGER_template& f__tr__RSL__IE__OSMO__Osmux__CID_osmux__cid_defval = template_f__tr__RSL__IE__OSMO__Osmux__CID_osmux__cid_defval;
const TTCN_RAWdescriptor_t RSL__IE__Body_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__Body
const TTCN_Typedescriptor_t RSL__IE__Body_descr_ = { "@RSL_Types.RSL_IE_Body", NULL, &RSL__IE__Body_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__IE__Body_chan__nr_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__Body_chan__nr
const TTCN_Typedescriptor_t RSL__IE__Body_chan__nr_descr_ = { "@RSL_Types.RSL_IE_Body.chan_nr", NULL, &RSL__IE__Body_chan__nr_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_chan__nr_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_link__id_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 RSL__IE__Body_link__id
const TTCN_Typedescriptor_t RSL__IE__Body_link__id_descr_ = { "@RSL_Types.RSL_IE_Body.link_id", NULL, &RSL__IE__Body_link__id_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_link__id_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_l3__info_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 RSL__IE__Body_l3__info
const TTCN_Typedescriptor_t RSL__IE__Body_l3__info_descr_ = { "@RSL_Types.RSL_IE_Body.l3_info", NULL, &RSL__IE__Body_l3__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_l3__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_rlm__cause_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 RSL__IE__Body_rlm__cause
const TTCN_Typedescriptor_t RSL__IE__Body_rlm__cause_descr_ = { "@RSL_Types.RSL_IE_Body.rlm_cause", NULL, &RSL__IE__Body_rlm__cause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_rlm__cause_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_release__mode_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 RSL__IE__Body_release__mode
const TTCN_Typedescriptor_t RSL__IE__Body_release__mode_descr_ = { "@RSL_Types.RSL_IE_Body.release_mode", NULL, &RSL__IE__Body_release__mode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_release__mode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_act__type_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__Body_act__type
const TTCN_Typedescriptor_t RSL__IE__Body_act__type_descr_ = { "@RSL_Types.RSL_IE_Body.act_type", NULL, &RSL__IE__Body_act__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_act__type_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_chan__ident_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 RSL__IE__Body_chan__ident
const TTCN_Typedescriptor_t RSL__IE__Body_chan__ident_descr_ = { "@RSL_Types.RSL_IE_Body.chan_ident", NULL, &RSL__IE__Body_chan__ident_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_chan__ident_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_chan__mode_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 RSL__IE__Body_chan__mode
const TTCN_Typedescriptor_t RSL__IE__Body_chan__mode_descr_ = { "@RSL_Types.RSL_IE_Body.chan_mode", NULL, &RSL__IE__Body_chan__mode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_chan__mode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_handover__ref_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       RSL__IE__Body_handover__ref_xer_ = { {"handover_ref>\n", "handover_ref>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_handover__ref_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_handover__ref_descr_ = { "@RSL_Types.RSL_IE_Body.handover_ref", &INTEGER_ber_, &RSL__IE__Body_handover__ref_raw_, &INTEGER_text_, &RSL__IE__Body_handover__ref_xer_, &INTEGER_json_, &RSL__IE__Body_handover__ref_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_handover__ref_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_bs__power_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 RSL__IE__Body_bs__power
const TTCN_Typedescriptor_t RSL__IE__Body_bs__power_descr_ = { "@RSL_Types.RSL_IE_Body.bs_power", NULL, &RSL__IE__Body_bs__power_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_bs__power_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_bs__power__params_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 RSL__IE__Body_bs__power__params
const TTCN_Typedescriptor_t RSL__IE__Body_bs__power__params_descr_ = { "@RSL_Types.RSL_IE_Body.bs_power_params", NULL, &RSL__IE__Body_bs__power__params_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_bs__power__params_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ms__power_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 RSL__IE__Body_ms__power
const TTCN_Typedescriptor_t RSL__IE__Body_ms__power_descr_ = { "@RSL_Types.RSL_IE_Body.ms_power", NULL, &RSL__IE__Body_ms__power_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ms__power_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ms__power__params_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 RSL__IE__Body_ms__power__params
const TTCN_Typedescriptor_t RSL__IE__Body_ms__power__params_descr_ = { "@RSL_Types.RSL_IE_Body.ms_power_params", NULL, &RSL__IE__Body_ms__power__params_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ms__power__params_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_timing__adv_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       RSL__IE__Body_timing__adv_xer_ = { {"timing_adv>\n", "timing_adv>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_timing__adv_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_timing__adv_descr_ = { "@RSL_Types.RSL_IE_Body.timing_adv", &INTEGER_ber_, &RSL__IE__Body_timing__adv_raw_, &INTEGER_text_, &RSL__IE__Body_timing__adv_xer_, &INTEGER_json_, &RSL__IE__Body_timing__adv_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_timing__adv_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_multirate__cfg_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 RSL__IE__Body_multirate__cfg
const TTCN_Typedescriptor_t RSL__IE__Body_multirate__cfg_descr_ = { "@RSL_Types.RSL_IE_Body.multirate_cfg", NULL, &RSL__IE__Body_multirate__cfg_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_multirate__cfg_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_multirate__ctrl_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 RSL__IE__Body_multirate__ctrl
const TTCN_Typedescriptor_t RSL__IE__Body_multirate__ctrl_descr_ = { "@RSL_Types.RSL_IE_Body.multirate_ctrl", NULL, &RSL__IE__Body_multirate__ctrl_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_multirate__ctrl_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_msg__id_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       RSL__IE__Body_msg__id_xer_ = { {"msg_id>\n", "msg_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_msg__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_msg__id_descr_ = { "@RSL_Types.RSL_IE_Body.msg_id", &INTEGER_ber_, &RSL__IE__Body_msg__id_raw_, &INTEGER_text_, &RSL__IE__Body_msg__id_xer_, &INTEGER_json_, &RSL__IE__Body_msg__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_msg__id_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_frame__nr_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 RSL__IE__Body_frame__nr
const TTCN_Typedescriptor_t RSL__IE__Body_frame__nr_descr_ = { "@RSL_Types.RSL_IE_Body.frame_nr", NULL, &RSL__IE__Body_frame__nr_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_frame__nr_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_cause_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 RSL__IE__Body_cause
const TTCN_Typedescriptor_t RSL__IE__Body_cause_descr_ = { "@RSL_Types.RSL_IE_Body.cause", NULL, &RSL__IE__Body_cause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_cause_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_access__delay_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       RSL__IE__Body_access__delay_xer_ = { {"access_delay>\n", "access_delay>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_access__delay_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_access__delay_descr_ = { "@RSL_Types.RSL_IE_Body.access_delay", &INTEGER_ber_, &RSL__IE__Body_access__delay_raw_, &INTEGER_text_, &RSL__IE__Body_access__delay_xer_, &INTEGER_json_, &RSL__IE__Body_access__delay_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_access__delay_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_rach__load_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 RSL__IE__Body_rach__load
const TTCN_Typedescriptor_t RSL__IE__Body_rach__load_descr_ = { "@RSL_Types.RSL_IE_Body.rach_load", NULL, &RSL__IE__Body_rach__load_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_rach__load_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_meas__res__nr_raw_ = {8,SG_NO,ORDER_MSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__Body_meas__res__nr_xer_ = { {"meas_res_nr>\n", "meas_res_nr>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_meas__res__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_meas__res__nr_descr_ = { "@RSL_Types.RSL_IE_Body.meas_res_nr", &INTEGER_ber_, &RSL__IE__Body_meas__res__nr_raw_, &INTEGER_text_, &RSL__IE__Body_meas__res__nr_xer_, &INTEGER_json_, &RSL__IE__Body_meas__res__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_meas__res__nr_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ms__timing__offset_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       RSL__IE__Body_ms__timing__offset_xer_ = { {"ms_timing_offset>\n", "ms_timing_offset>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_ms__timing__offset_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_ms__timing__offset_descr_ = { "@RSL_Types.RSL_IE_Body.ms_timing_offset", &INTEGER_ber_, &RSL__IE__Body_ms__timing__offset_raw_, &INTEGER_text_, &RSL__IE__Body_ms__timing__offset_xer_, &INTEGER_json_, &RSL__IE__Body_ms__timing__offset_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ms__timing__offset_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_uplink__meas_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 RSL__IE__Body_uplink__meas
const TTCN_Typedescriptor_t RSL__IE__Body_uplink__meas_descr_ = { "@RSL_Types.RSL_IE_Body.uplink_meas", NULL, &RSL__IE__Body_uplink__meas_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_uplink__meas_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_l1__info_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 RSL__IE__Body_l1__info
const TTCN_Typedescriptor_t RSL__IE__Body_l1__info_descr_ = { "@RSL_Types.RSL_IE_Body.l1_info", NULL, &RSL__IE__Body_l1__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_l1__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_sysinfo__type_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__Body_sysinfo__type
const TTCN_Typedescriptor_t RSL__IE__Body_sysinfo__type_descr_ = { "@RSL_Types.RSL_IE_Body.sysinfo_type", NULL, &RSL__IE__Body_sysinfo__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_sysinfo__type_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_paging__load_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       RSL__IE__Body_paging__load_xer_ = { {"paging_load>\n", "paging_load>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_paging__load_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_paging__load_descr_ = { "@RSL_Types.RSL_IE_Body.paging_load", &INTEGER_ber_, &RSL__IE__Body_paging__load_raw_, &INTEGER_text_, &RSL__IE__Body_paging__load_xer_, &INTEGER_json_, &RSL__IE__Body_paging__load_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_paging__load_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_paging__group_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       RSL__IE__Body_paging__group_xer_ = { {"paging_group>\n", "paging_group>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_paging__group_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_paging__group_descr_ = { "@RSL_Types.RSL_IE_Body.paging_group", &INTEGER_ber_, &RSL__IE__Body_paging__group_raw_, &INTEGER_text_, &RSL__IE__Body_paging__group_xer_, &INTEGER_json_, &RSL__IE__Body_paging__group_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_paging__group_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_chan__needed_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 RSL__IE__Body_chan__needed
const TTCN_Typedescriptor_t RSL__IE__Body_chan__needed_descr_ = { "@RSL_Types.RSL_IE_Body.chan_needed", NULL, &RSL__IE__Body_chan__needed_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_chan__needed_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_cb__cmd__type_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__Body_cb__cmd__type
const TTCN_Typedescriptor_t RSL__IE__Body_cb__cmd__type_descr_ = { "@RSL_Types.RSL_IE_Body.cb_cmd_type", NULL, &RSL__IE__Body_cb__cmd__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_cb__cmd__type_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_smscb__message_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 RSL__IE__Body_smscb__message
const TTCN_Typedescriptor_t RSL__IE__Body_smscb__message_descr_ = { "@RSL_Types.RSL_IE_Body.smscb_message", NULL, &RSL__IE__Body_smscb__message_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_smscb__message_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_cbch__load__info_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 RSL__IE__Body_cbch__load__info
const TTCN_Typedescriptor_t RSL__IE__Body_cbch__load__info_descr_ = { "@RSL_Types.RSL_IE_Body.cbch_load_info", NULL, &RSL__IE__Body_cbch__load__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_cbch__load__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_resource__info_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 RSL__IE__Body_resource__info
const TTCN_Typedescriptor_t RSL__IE__Body_resource__info_descr_ = { "@RSL_Types.RSL_IE_Body.resource_info", NULL, &RSL__IE__Body_resource__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_resource__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_sacch__info_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 RSL__IE__Body_sacch__info
const TTCN_Typedescriptor_t RSL__IE__Body_sacch__info_descr_ = { "@RSL_Types.RSL_IE_Body.sacch_info", NULL, &RSL__IE__Body_sacch__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_sacch__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_starting__time_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 RSL__IE__Body_starting__time
const TTCN_Typedescriptor_t RSL__IE__Body_starting__time_descr_ = { "@RSL_Types.RSL_IE_Body.starting_time", NULL, &RSL__IE__Body_starting__time_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_starting__time_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_encr__info_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 RSL__IE__Body_encr__info
const TTCN_Typedescriptor_t RSL__IE__Body_encr__info_descr_ = { "@RSL_Types.RSL_IE_Body.encr_info", NULL, &RSL__IE__Body_encr__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_encr__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_smscb__chan__ind_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       RSL__IE__Body_smscb__chan__ind_xer_ = { {"smscb_chan_ind>\n", "smscb_chan_ind>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_smscb__chan__ind_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_smscb__chan__ind_descr_ = { "@RSL_Types.RSL_IE_Body.smscb_chan_ind", &INTEGER_ber_, &RSL__IE__Body_smscb__chan__ind_raw_, &INTEGER_text_, &RSL__IE__Body_smscb__chan__ind_xer_, &INTEGER_json_, &RSL__IE__Body_smscb__chan__ind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_smscb__chan__ind_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_req__ref_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 RSL__IE__Body_req__ref
const TTCN_Typedescriptor_t RSL__IE__Body_req__ref_descr_ = { "@RSL_Types.RSL_IE_Body.req_ref", NULL, &RSL__IE__Body_req__ref_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_req__ref_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_full__imm__ass__info_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 RSL__IE__Body_full__imm__ass__info
const TTCN_Typedescriptor_t RSL__IE__Body_full__imm__ass__info_descr_ = { "@RSL_Types.RSL_IE_Body.full_imm_ass_info", NULL, &RSL__IE__Body_full__imm__ass__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_full__imm__ass__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ms__identity_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 RSL__IE__Body_ms__identity
const TTCN_Typedescriptor_t RSL__IE__Body_ms__identity_descr_ = { "@RSL_Types.RSL_IE_Body.ms_identity", NULL, &RSL__IE__Body_ms__identity_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ms__identity_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_group__call__ref_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 RSL__IE__Body_group__call__ref
const TTCN_Typedescriptor_t RSL__IE__Body_group__call__ref_descr_ = { "@RSL_Types.RSL_IE_Body.group_call_ref", NULL, &RSL__IE__Body_group__call__ref_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_group__call__ref_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_group__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 RSL__IE__Body_group__chan__desc
const TTCN_Typedescriptor_t RSL__IE__Body_group__chan__desc_descr_ = { "@RSL_Types.RSL_IE_Body.group_chan_desc", NULL, &RSL__IE__Body_group__chan__desc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_group__chan__desc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_nch__drx__info_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 RSL__IE__Body_nch__drx__info
const TTCN_Typedescriptor_t RSL__IE__Body_nch__drx__info_descr_ = { "@RSL_Types.RSL_IE_Body.nch_drx_info", NULL, &RSL__IE__Body_nch__drx__info_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_nch__drx__info_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_cmd__indicator_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 RSL__IE__Body_cmd__indicator
const TTCN_Typedescriptor_t RSL__IE__Body_cmd__indicator_descr_ = { "@RSL_Types.RSL_IE_Body.cmd_indicator", NULL, &RSL__IE__Body_cmd__indicator_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_cmd__indicator_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_uic_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 RSL__IE__Body_uic
const TTCN_Typedescriptor_t RSL__IE__Body_uic_descr_ = { "@RSL_Types.RSL_IE_Body.uic", NULL, &RSL__IE__Body_uic_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_uic_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__conn__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       RSL__IE__Body_ipa__conn__id_xer_ = { {"ipa_conn_id>\n", "ipa_conn_id>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_ipa__conn__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__conn__id_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_conn_id", &INTEGER_ber_, &RSL__IE__Body_ipa__conn__id_raw_, &INTEGER_text_, &RSL__IE__Body_ipa__conn__id_xer_, &INTEGER_json_, &RSL__IE__Body_ipa__conn__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__conn__id_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__local__port_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       RSL__IE__Body_ipa__local__port_xer_ = { {"ipa_local_port>\n", "ipa_local_port>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_ipa__local__port_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__local__port_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_local_port", &INTEGER_ber_, &RSL__IE__Body_ipa__local__port_raw_, &INTEGER_text_, &RSL__IE__Body_ipa__local__port_xer_, &INTEGER_json_, &RSL__IE__Body_ipa__local__port_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__local__port_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__remote__port_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       RSL__IE__Body_ipa__remote__port_xer_ = { {"ipa_remote_port>\n", "ipa_remote_port>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_ipa__remote__port_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__remote__port_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_remote_port", &INTEGER_ber_, &RSL__IE__Body_ipa__remote__port_raw_, &INTEGER_text_, &RSL__IE__Body_ipa__remote__port_xer_, &INTEGER_json_, &RSL__IE__Body_ipa__remote__port_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__remote__port_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__local__ip_raw_ = {32,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,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__Body_ipa__local__ip_xer_ = { {"ipa_local_ip>\n", "ipa_local_ip>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__Body_ipa__local__ip_oer_ext_arr_[0] = {};
const int RSL__IE__Body_ipa__local__ip_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__Body_ipa__local__ip_oer_ = { -1, TRUE, 4, FALSE, 0, 0, RSL__IE__Body_ipa__local__ip_oer_ext_arr_, 0, RSL__IE__Body_ipa__local__ip_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__local__ip_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_local_ip", &OCTETSTRING_ber_, &RSL__IE__Body_ipa__local__ip_raw_, &OCTETSTRING_text_, &RSL__IE__Body_ipa__local__ip_xer_, &OCTETSTRING_json_, &RSL__IE__Body_ipa__local__ip_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__local__ip_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__remote__ip_raw_ = {32,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,4,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
const XERdescriptor_t       RSL__IE__Body_ipa__remote__ip_xer_ = { {"ipa_remote_ip>\n", "ipa_remote_ip>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RSL__IE__Body_ipa__remote__ip_oer_ext_arr_[0] = {};
const int RSL__IE__Body_ipa__remote__ip_oer_p_[0] = {};
const TTCN_OERdescriptor_t RSL__IE__Body_ipa__remote__ip_oer_ = { -1, TRUE, 4, FALSE, 0, 0, RSL__IE__Body_ipa__remote__ip_oer_ext_arr_, 0, RSL__IE__Body_ipa__remote__ip_oer_p_};
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__remote__ip_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_remote_ip", &OCTETSTRING_ber_, &RSL__IE__Body_ipa__remote__ip_raw_, &OCTETSTRING_text_, &RSL__IE__Body_ipa__remote__ip_xer_, &OCTETSTRING_json_, &RSL__IE__Body_ipa__remote__ip_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__remote__ip_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__rtp__pt_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       RSL__IE__Body_ipa__rtp__pt_xer_ = { {"ipa_rtp_pt>\n", "ipa_rtp_pt>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_ipa__rtp__pt_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__rtp__pt_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_rtp_pt", &INTEGER_ber_, &RSL__IE__Body_ipa__rtp__pt_raw_, &INTEGER_text_, &RSL__IE__Body_ipa__rtp__pt_xer_, &INTEGER_json_, &RSL__IE__Body_ipa__rtp__pt_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__rtp__pt_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__rtp__pt2_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       RSL__IE__Body_ipa__rtp__pt2_xer_ = { {"ipa_rtp_pt2>\n", "ipa_rtp_pt2>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RSL__IE__Body_ipa__rtp__pt2_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__rtp__pt2_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_rtp_pt2", &INTEGER_ber_, &RSL__IE__Body_ipa__rtp__pt2_raw_, &INTEGER_text_, &RSL__IE__Body_ipa__rtp__pt2_xer_, &INTEGER_json_, &RSL__IE__Body_ipa__rtp__pt2_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__rtp__pt2_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__stats_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 RSL__IE__Body_ipa__stats
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__stats_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_stats", NULL, &RSL__IE__Body_ipa__stats_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__stats_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__speech__mode_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 RSL__IE__Body_ipa__speech__mode
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__speech__mode_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_speech_mode", NULL, &RSL__IE__Body_ipa__speech__mode_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__speech__mode_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_ipa__rtp__csd__fmt_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 RSL__IE__Body_ipa__rtp__csd__fmt
const TTCN_Typedescriptor_t RSL__IE__Body_ipa__rtp__csd__fmt_descr_ = { "@RSL_Types.RSL_IE_Body.ipa_rtp_csd_fmt", NULL, &RSL__IE__Body_ipa__rtp__csd__fmt_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_ipa__rtp__csd__fmt_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_osmo__training__sequence_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 RSL__IE__Body_osmo__training__sequence
const TTCN_Typedescriptor_t RSL__IE__Body_osmo__training__sequence_descr_ = { "@RSL_Types.RSL_IE_Body.osmo_training_sequence", NULL, &RSL__IE__Body_osmo__training__sequence_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_osmo__training__sequence_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_rep__acch__cap_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 RSL__IE__Body_rep__acch__cap
const TTCN_Typedescriptor_t RSL__IE__Body_rep__acch__cap_descr_ = { "@RSL_Types.RSL_IE_Body.rep_acch_cap", NULL, &RSL__IE__Body_rep__acch__cap_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_rep__acch__cap_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_top__acch__cap_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 RSL__IE__Body_top__acch__cap
const TTCN_Typedescriptor_t RSL__IE__Body_top__acch__cap_descr_ = { "@RSL_Types.RSL_IE_Body.top_acch_cap", NULL, &RSL__IE__Body_top__acch__cap_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_top__acch__cap_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_osmux__cid_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 RSL__IE__Body_osmux__cid
const TTCN_Typedescriptor_t RSL__IE__Body_osmux__cid_descr_ = { "@RSL_Types.RSL_IE_Body.osmux_cid", NULL, &RSL__IE__Body_osmux__cid_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_osmux__cid_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__Body_other_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 RSL__IE__Body_other
const TTCN_Typedescriptor_t RSL__IE__Body_other_descr_ = { "@RSL_Types.RSL_IE_Body.other", NULL, &RSL__IE__Body_other_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__Body_other_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__IE__Body_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE_iei_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE_iei
const TTCN_Typedescriptor_t RSL__IE_iei_descr_ = { "@RSL_Types.RSL_IE.iei", NULL, &RSL__IE_iei_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE_iei_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE_body_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE_body
const TTCN_Typedescriptor_t RSL__IE_body_descr_ = { "@RSL_Types.RSL_IE.body", NULL, &RSL__IE_body_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE_body_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE_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 RSL__IE
const TTCN_Typedescriptor_t RSL__IE_descr_ = { "@RSL_Types.RSL_IE", NULL, &RSL__IE_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__IE__List_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 RSL__IE__List
const TTCN_Typedescriptor_t RSL__IE__List_descr_ = { "@RSL_Types.RSL_IE_List", NULL, &RSL__IE__List_raw_, NULL, NULL, NULL, NULL, NULL, &RSL__IE__List_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__IE__List_0_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__IE__List_0
const TTCN_Typedescriptor_t RSL__IE__List_0_descr_ = { "@RSL_Types.RSL_IE_List.<oftype>", NULL, &RSL__IE__List_0_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__IE__List_0_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__IE__List_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__Message_msg__disc_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 RSL__Message_msg__disc
const TTCN_Typedescriptor_t RSL__Message_msg__disc_descr_ = { "@RSL_Types.RSL_Message.msg_disc", NULL, &RSL__Message_msg__disc_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__Message_msg__disc_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__Message_msg__type_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for RSL__Message_msg__type
const TTCN_Typedescriptor_t RSL__Message_msg__type_descr_ = { "@RSL_Types.RSL_Message.msg_type", NULL, &RSL__Message_msg__type_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__Message_msg__type_default_coding("RAW");
const TTCN_RAWdescriptor_t RSL__Message_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 RSL__Message
const TTCN_Typedescriptor_t RSL__Message_descr_ = { "@RSL_Types.RSL_Message", NULL, &RSL__Message_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t RSL__Message_ies_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 RSL__Message_ies
const TTCN_Typedescriptor_t RSL__Message_ies_descr_ = { "@RSL_Types.RSL_Message.ies", NULL, &RSL__Message_ies_raw_, NULL, NULL, NULL, NULL, NULL, &RSL__IE__List_0_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RSL__Message_ies_default_coding("RAW");
UNIVERSAL_CHARSTRING RSL__Message_default_coding("RAW");
RSL__IE__List_template template_ts__RSL__MsgDiscType_ies_defval;
const RSL__IE__List_template& ts__RSL__MsgDiscType_ies_defval = template_ts__RSL__MsgDiscType_ies_defval;
GSM__Types::RslChannelNr_template template_tr__RSL__DATA__REQ_chan__nr_defval;
const GSM__Types::RslChannelNr_template& tr__RSL__DATA__REQ_chan__nr_defval = template_tr__RSL__DATA__REQ_chan__nr_defval;
GSM__Types::RslLinkId_template template_tr__RSL__DATA__REQ_link__id_defval;
const GSM__Types::RslLinkId_template& tr__RSL__DATA__REQ_link__id_defval = template_tr__RSL__DATA__REQ_link__id_defval;
OCTETSTRING_template template_tr__RSL__DATA__REQ_l3__info_defval;
const OCTETSTRING_template& tr__RSL__DATA__REQ_l3__info_defval = template_tr__RSL__DATA__REQ_l3__info_defval;
OCTETSTRING_template template_tr__RSL__DATA__IND_l3__info_defval;
const OCTETSTRING_template& tr__RSL__DATA__IND_l3__info_defval = template_tr__RSL__DATA__IND_l3__info_defval;
OCTETSTRING_template template_tr__RSL__ERROR__IND_rlm__cause_defval;
const OCTETSTRING_template& tr__RSL__ERROR__IND_rlm__cause_defval = template_tr__RSL__ERROR__IND_rlm__cause_defval;
OCTETSTRING_template template_tr__RSL__EST__IND_l3__info_defval;
const OCTETSTRING_template& tr__RSL__EST__IND_l3__info_defval = template_tr__RSL__EST__IND_l3__info_defval;
RSL__IE__ReleaseMode_template template_ts__RSL__REL__REQ_rel__mode_defval;
const RSL__IE__ReleaseMode_template& ts__RSL__REL__REQ_rel__mode_defval = template_ts__RSL__REL__REQ_rel__mode_defval;
RSL__IE__ReleaseMode_template template_tr__RSL__REL__REQ_rel__mode_defval;
const RSL__IE__ReleaseMode_template& tr__RSL__REL__REQ_rel__mode_defval = template_tr__RSL__REL__REQ_rel__mode_defval;
OCTETSTRING_template template_tr__RSL__UNITDATA__REQ_l3__info_defval;
const OCTETSTRING_template& tr__RSL__UNITDATA__REQ_l3__info_defval = template_tr__RSL__UNITDATA__REQ_l3__info_defval;
OCTETSTRING_template template_tr__RSL__UNITDATA__IND_l3__info_defval;
const OCTETSTRING_template& tr__RSL__UNITDATA__IND_l3__info_defval = template_tr__RSL__UNITDATA__IND_l3__info_defval;
RSL__IE__ActivationType_template template_ts__RSL__CHAN__ACT_at_defval;
const RSL__IE__ActivationType_template& ts__RSL__CHAN__ACT_at_defval = template_ts__RSL__CHAN__ACT_at_defval;
RSL__IE__ActivationType_template template_tr__RSL__CHAN__ACT_at_defval;
const RSL__IE__ActivationType_template& tr__RSL__CHAN__ACT_at_defval = template_tr__RSL__CHAN__ACT_at_defval;
RSL__Cause_template template_tr__RSL__CHAN__ACT__NACK_cause_defval;
const RSL__Cause_template& tr__RSL__CHAN__ACT__NACK_cause_defval = template_tr__RSL__CHAN__ACT__NACK_cause_defval;
RSL__Cause_template template_tr__RSL__CONN__FAIL__IND_cause_defval;
const RSL__Cause_template& tr__RSL__CONN__FAIL__IND_cause_defval = template_tr__RSL__CONN__FAIL__IND_cause_defval;
GSM__Types::RslLinkId_template template_tr__RSL__ENCR__CMD_link__id_defval;
const GSM__Types::RslLinkId_template& tr__RSL__ENCR__CMD_link__id_defval = template_tr__RSL__ENCR__CMD_link__id_defval;
RSL__AlgId_template template_tr__RSL__ENCR__CMD_alg_defval;
const RSL__AlgId_template& tr__RSL__ENCR__CMD_alg_defval = template_tr__RSL__ENCR__CMD_alg_defval;
OCTETSTRING_template template_tr__RSL__ENCR__CMD_key_defval;
const OCTETSTRING_template& tr__RSL__ENCR__CMD_key_defval = template_tr__RSL__ENCR__CMD_key_defval;
OCTETSTRING_template template_tr__RSL__ENCR__CMD_l3__info_defval;
const OCTETSTRING_template& tr__RSL__ENCR__CMD_l3__info_defval = template_tr__RSL__ENCR__CMD_l3__info_defval;
INTEGER_template template_tr__RSL__MEAS__RES_meas__res__nr_defval;
const INTEGER_template& tr__RSL__MEAS__RES_meas__res__nr_defval = template_tr__RSL__MEAS__RES_meas__res__nr_defval;
RSL__IE__UplinkMeas_template template_tr__RSL__MEAS__RES_ul__meas_defval;
const RSL__IE__UplinkMeas_template& tr__RSL__MEAS__RES_ul__meas_defval = template_tr__RSL__MEAS__RES_ul__meas_defval;
RSL__IE__BS__Power_template template_tr__RSL__MEAS__RES_bs__power_defval;
const RSL__IE__BS__Power_template& tr__RSL__MEAS__RES_bs__power_defval = template_tr__RSL__MEAS__RES_bs__power_defval;
INTEGER_template template_tr__RSL__MEAS__RES__EMPTY_meas__res__nr_defval;
const INTEGER_template& tr__RSL__MEAS__RES__EMPTY_meas__res__nr_defval = template_tr__RSL__MEAS__RES__EMPTY_meas__res__nr_defval;
RSL__IE__UplinkMeas_template template_tr__RSL__MEAS__RES__EMPTY_ul__meas_defval;
const RSL__IE__UplinkMeas_template& tr__RSL__MEAS__RES__EMPTY_ul__meas_defval = template_tr__RSL__MEAS__RES__EMPTY_ul__meas_defval;
RSL__IE__BS__Power_template template_tr__RSL__MEAS__RES__EMPTY_bs__power_defval;
const RSL__IE__BS__Power_template& tr__RSL__MEAS__RES__EMPTY_bs__power_defval = template_tr__RSL__MEAS__RES__EMPTY_bs__power_defval;
INTEGER_template template_tr__RSL__MEAS__RES__OSMO_meas__res__nr_defval;
const INTEGER_template& tr__RSL__MEAS__RES__OSMO_meas__res__nr_defval = template_tr__RSL__MEAS__RES__OSMO_meas__res__nr_defval;
RSL__IE__UplinkMeas_template template_tr__RSL__MEAS__RES__OSMO_ul__meas_defval;
const RSL__IE__UplinkMeas_template& tr__RSL__MEAS__RES__OSMO_ul__meas_defval = template_tr__RSL__MEAS__RES__OSMO_ul__meas_defval;
RSL__IE__BS__Power_template template_tr__RSL__MEAS__RES__OSMO_bs__power_defval;
const RSL__IE__BS__Power_template& tr__RSL__MEAS__RES__OSMO_bs__power_defval = template_tr__RSL__MEAS__RES__OSMO_bs__power_defval;
RSL__IE__L1Info_template template_tr__RSL__MEAS__RES__OSMO_l1__info_defval;
const RSL__IE__L1Info_template& tr__RSL__MEAS__RES__OSMO_l1__info_defval = template_tr__RSL__MEAS__RES__OSMO_l1__info_defval;
OCTETSTRING_template template_tr__RSL__MEAS__RES__OSMO_l3__info_defval;
const OCTETSTRING_template& tr__RSL__MEAS__RES__OSMO_l3__info_defval = template_tr__RSL__MEAS__RES__OSMO_l3__info_defval;
INTEGER_template template_tr__RSL__MEAS__RES__OSMO_ms__to_defval;
const INTEGER_template& tr__RSL__MEAS__RES__OSMO_ms__to_defval = template_tr__RSL__MEAS__RES__OSMO_ms__to_defval;
INTEGER_template template_tr__RSL__MODE__MODIFY__REQ__with__OSMO__TSC_tsc__set_defval;
const INTEGER_template& tr__RSL__MODE__MODIFY__REQ__with__OSMO__TSC_tsc__set_defval = template_tr__RSL__MODE__MODIFY__REQ__with__OSMO__TSC_tsc__set_defval;
INTEGER_template template_tr__RSL__MODE__MODIFY__REQ__with__OSMO__TSC_tsc_defval;
const INTEGER_template& tr__RSL__MODE__MODIFY__REQ__with__OSMO__TSC_tsc_defval = template_tr__RSL__MODE__MODIFY__REQ__with__OSMO__TSC_tsc_defval;
RSL__IE__SysinfoType_template template_tr__RSL__SACCH__INF__MOD_si__type_defval;
const RSL__IE__SysinfoType_template& tr__RSL__SACCH__INF__MOD_si__type_defval = template_tr__RSL__SACCH__INF__MOD_si__type_defval;
OCTETSTRING_template template_tr__RSL__SACCH__INF__MOD_l3__info_defval;
const OCTETSTRING_template& tr__RSL__SACCH__INF__MOD_l3__info_defval = template_tr__RSL__SACCH__INF__MOD_l3__info_defval;
INTEGER_template template_tr__RSL__HANDO__DET_acc__delay_defval;
const INTEGER_template& tr__RSL__HANDO__DET_acc__delay_defval = template_tr__RSL__HANDO__DET_acc__delay_defval;
INTEGER_template template_tr__RSL__TALKER__DET_acc__delay_defval;
const INTEGER_template& tr__RSL__TALKER__DET_acc__delay_defval = template_tr__RSL__TALKER__DET_acc__delay_defval;
INTEGER_template template_tr__RSL__LISTENER__DET_acc__delay_defval;
const INTEGER_template& tr__RSL__LISTENER__DET_acc__delay_defval = template_tr__RSL__LISTENER__DET_acc__delay_defval;
RSL__IE__SysinfoType_template template_tr__RSL__NO__BCCH__INFO_si__type_defval;
const RSL__IE__SysinfoType_template& tr__RSL__NO__BCCH__INFO_si__type_defval = template_tr__RSL__NO__BCCH__INFO_si__type_defval;
RSL__IE__SysinfoType_template template_tr__RSL__BCCH__INFO_si__type_defval;
const RSL__IE__SysinfoType_template& tr__RSL__BCCH__INFO_si__type_defval = template_tr__RSL__BCCH__INFO_si__type_defval;
OCTETSTRING_template template_tr__RSL__BCCH__INFO_full__bcch__info_defval;
const OCTETSTRING_template& tr__RSL__BCCH__INFO_full__bcch__info_defval = template_tr__RSL__BCCH__INFO_full__bcch__info_defval;
INTEGER_template template_tr__RSL__RACH__LOAD__IND_slot__ct_defval;
const INTEGER_template& tr__RSL__RACH__LOAD__IND_slot__ct_defval = template_tr__RSL__RACH__LOAD__IND_slot__ct_defval;
INTEGER_template template_tr__RSL__RACH__LOAD__IND_busy__ct_defval;
const INTEGER_template& tr__RSL__RACH__LOAD__IND_busy__ct_defval = template_tr__RSL__RACH__LOAD__IND_busy__ct_defval;
INTEGER_template template_tr__RSL__RACH__LOAD__IND_acc__ct_defval;
const INTEGER_template& tr__RSL__RACH__LOAD__IND_acc__ct_defval = template_tr__RSL__RACH__LOAD__IND_acc__ct_defval;
INTEGER_template template_tr__RSL__PAGING__LOAD__IND_buffer__space_defval;
const INTEGER_template& tr__RSL__PAGING__LOAD__IND_buffer__space_defval = template_tr__RSL__PAGING__LOAD__IND_buffer__space_defval;
GSM__Types::RslChannelNr_template template_ts__RSL__CHAN__RQD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& ts__RSL__CHAN__RQD_chan__nr_defval = template_ts__RSL__CHAN__RQD_chan__nr_defval;
INTEGER const_ts__RSL__CHAN__RQD_acc__del_defval;
const INTEGER& ts__RSL__CHAN__RQD_acc__del_defval = const_ts__RSL__CHAN__RQD_acc__del_defval;
INTEGER_template template_tr__RSL__CHAN__RQD_fn_defval;
const INTEGER_template& tr__RSL__CHAN__RQD_fn_defval = template_tr__RSL__CHAN__RQD_fn_defval;
GSM__Types::RslChannelNr_template template_tr__RSL__CHAN__RQD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& tr__RSL__CHAN__RQD_chan__nr_defval = template_tr__RSL__CHAN__RQD_chan__nr_defval;
INTEGER_template template_tr__RSL__CHAN__RQD_acc__del_defval;
const INTEGER_template& tr__RSL__CHAN__RQD_acc__del_defval = template_tr__RSL__CHAN__RQD_acc__del_defval;
OCTETSTRING_template template_tr__RSL__DELETE__IND_imm__ass_defval;
const OCTETSTRING_template& tr__RSL__DELETE__IND_imm__ass_defval = template_tr__RSL__DELETE__IND_imm__ass_defval;
INTEGER_template template_tr__RSL__PAGING__CMD_tn_defval;
const INTEGER_template& tr__RSL__PAGING__CMD_tn_defval = template_tr__RSL__PAGING__CMD_tn_defval;
INTEGER const_ts__RSL__PAGING__CMD_tn_defval;
const INTEGER& ts__RSL__PAGING__CMD_tn_defval = const_ts__RSL__PAGING__CMD_tn_defval;
INTEGER_template template_tr__RSL__IMM__ASSIGN_tn_defval;
const INTEGER_template& tr__RSL__IMM__ASSIGN_tn_defval = template_tr__RSL__IMM__ASSIGN_tn_defval;
INTEGER const_ts__RSL__IMM__ASSIGN_tn_defval;
const INTEGER& ts__RSL__IMM__ASSIGN_tn_defval = const_ts__RSL__IMM__ASSIGN_tn_defval;
RSL__IE__CbCommandType_template template_tr__RSL__SMSCB__CMD_cb__cmd_defval;
const RSL__IE__CbCommandType_template& tr__RSL__SMSCB__CMD_cb__cmd_defval = template_tr__RSL__SMSCB__CMD_cb__cmd_defval;
OCTETSTRING_template template_tr__RSL__SMSCB__CMD_msg_defval;
const OCTETSTRING_template& tr__RSL__SMSCB__CMD_msg_defval = template_tr__RSL__SMSCB__CMD_msg_defval;
GSM__Types::RslChannelNr_template template_tr__RSL__SMSCB__CMD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& tr__RSL__SMSCB__CMD_chan__nr_defval = template_tr__RSL__SMSCB__CMD_chan__nr_defval;
GSM__Types::RslChannelNr_template template_ts__RSL__SMSCB__CMD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& ts__RSL__SMSCB__CMD_chan__nr_defval = template_ts__RSL__SMSCB__CMD_chan__nr_defval;
BOOLEAN_template template_tr__RSL__CBCH__LOAD__IND__BASIC_overflow_defval;
const BOOLEAN_template& tr__RSL__CBCH__LOAD__IND__BASIC_overflow_defval = template_tr__RSL__CBCH__LOAD__IND__BASIC_overflow_defval;
INTEGER_template template_tr__RSL__CBCH__LOAD__IND__BASIC_slot__count_defval;
const INTEGER_template& tr__RSL__CBCH__LOAD__IND__BASIC_slot__count_defval = template_tr__RSL__CBCH__LOAD__IND__BASIC_slot__count_defval;
GSM__Types::RslChannelNr_template template_tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval;
const GSM__Types::RslChannelNr_template& tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval = template_tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval;
GSM__Types::RslChannelNr_template template_ts__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval;
const GSM__Types::RslChannelNr_template& ts__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval = template_ts__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval;
BOOLEAN_template template_tr__RSL__CBCH__LOAD__IND__EXTD_overflow_defval;
const BOOLEAN_template& tr__RSL__CBCH__LOAD__IND__EXTD_overflow_defval = template_tr__RSL__CBCH__LOAD__IND__EXTD_overflow_defval;
INTEGER_template template_tr__RSL__CBCH__LOAD__IND__EXTD_slot__count_defval;
const INTEGER_template& tr__RSL__CBCH__LOAD__IND__EXTD_slot__count_defval = template_tr__RSL__CBCH__LOAD__IND__EXTD_slot__count_defval;
GSM__Types::RslChannelNr_template template_tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval = template_tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval;
GSM__Types::RslChannelNr_template template_ts__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& ts__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval = template_ts__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval;
RSL__ResourceInfo_template template_tr__RSL__RF__RES__IND_info_defval;
const RSL__ResourceInfo_template& tr__RSL__RF__RES__IND_info_defval = template_tr__RSL__RF__RES__IND_info_defval;
RSL__IE__SysinfoType_template template_tr__RSL__NO__SACCH__FILL_si__type_defval;
const RSL__IE__SysinfoType_template& tr__RSL__NO__SACCH__FILL_si__type_defval = template_tr__RSL__NO__SACCH__FILL_si__type_defval;
RSL__IE__SysinfoType_template template_tr__RSL__SACCH__FILL_si__type_defval;
const RSL__IE__SysinfoType_template& tr__RSL__SACCH__FILL_si__type_defval = template_tr__RSL__SACCH__FILL_si__type_defval;
OCTETSTRING_template template_tr__RSL__SACCH__FILL_l3__info_defval;
const OCTETSTRING_template& tr__RSL__SACCH__FILL_l3__info_defval = template_tr__RSL__SACCH__FILL_l3__info_defval;
RSL__Cause_template template_tr__RSL__ERROR__REPORT_cause_defval;
const RSL__Cause_template& tr__RSL__ERROR__REPORT_cause_defval = template_tr__RSL__ERROR__REPORT_cause_defval;
OCTETSTRING_template template_ts__RSL__IPA__CRCX_remote__ip_defval;
const OCTETSTRING_template& ts__RSL__IPA__CRCX_remote__ip_defval = template_ts__RSL__IPA__CRCX_remote__ip_defval;
INTEGER_template template_ts__RSL__IPA__CRCX_remote__port_defval;
const INTEGER_template& ts__RSL__IPA__CRCX_remote__port_defval = template_ts__RSL__IPA__CRCX_remote__port_defval;
INTEGER_template template_ts__RSL__IPA__CRCX_osmux__cid_defval;
const INTEGER_template& ts__RSL__IPA__CRCX_osmux__cid_defval = template_ts__RSL__IPA__CRCX_osmux__cid_defval;
INTEGER_template template_ts__RSL__IPA__CRCX__ACK_osmux__cid_defval;
const INTEGER_template& ts__RSL__IPA__CRCX__ACK_osmux__cid_defval = template_ts__RSL__IPA__CRCX__ACK_osmux__cid_defval;
INTEGER_template template_tr__RSL__IPA__CRCX__ACK_osmux__cid_defval;
const INTEGER_template& tr__RSL__IPA__CRCX__ACK_osmux__cid_defval = template_tr__RSL__IPA__CRCX__ACK_osmux__cid_defval;
RSL__Cause_template template_tr__RSL__IPA__CRCX__NACK_cause_defval;
const RSL__Cause_template& tr__RSL__IPA__CRCX__NACK_cause_defval = template_tr__RSL__IPA__CRCX__NACK_cause_defval;
INTEGER_template template_ts__RSL__IPA__MDCX_osmux__cid_defval;
const INTEGER_template& ts__RSL__IPA__MDCX_osmux__cid_defval = template_ts__RSL__IPA__MDCX_osmux__cid_defval;
INTEGER_template template_ts__RSL__IPA__MDCX__ACK_osmux__cid_defval;
const INTEGER_template& ts__RSL__IPA__MDCX__ACK_osmux__cid_defval = template_ts__RSL__IPA__MDCX__ACK_osmux__cid_defval;
INTEGER_template template_tr__RSL__IPA__MDCX__ACK_osmux__cid_defval;
const INTEGER_template& tr__RSL__IPA__MDCX__ACK_osmux__cid_defval = template_tr__RSL__IPA__MDCX__ACK_osmux__cid_defval;
INTEGER_template template_tr__RSL__IPA__DLCX_ipa__conn__id_defval;
const INTEGER_template& tr__RSL__IPA__DLCX_ipa__conn__id_defval = template_tr__RSL__IPA__DLCX_ipa__conn__id_defval;
GSM__Types::RslChannelNr_template template_ts__RSL__OSMO__ETWS__CMD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& ts__RSL__OSMO__ETWS__CMD_chan__nr_defval = template_ts__RSL__OSMO__ETWS__CMD_chan__nr_defval;
GSM__Types::RslChannelNr_template template_tr__RSL__OSMO__ETWS__CMD_chan__nr_defval;
const GSM__Types::RslChannelNr_template& tr__RSL__OSMO__ETWS__CMD_chan__nr_defval = template_tr__RSL__OSMO__ETWS__CMD_chan__nr_defval;
OCTETSTRING_template template_tr__RSL__OSMO__ETWS__CMD_msg_defval;
const OCTETSTRING_template& tr__RSL__OSMO__ETWS__CMD_msg_defval = template_tr__RSL__OSMO__ETWS__CMD_msg_defval;
OCTETSTRING_template template_tr__RSL__NOTIF__CMD__START_chan__desc_defval;
const OCTETSTRING_template& tr__RSL__NOTIF__CMD__START_chan__desc_defval = template_tr__RSL__NOTIF__CMD__START_chan__desc_defval;
TTCN_Module module_object("RSL_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

/* Member functions of C++ classes */

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

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

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

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

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

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

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

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

boolean RSL__MessageGroup::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 @RSL_Types.RSL_MessageGroup.");
return enum_value == other_value;
}

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

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

boolean RSL__MessageGroup::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 @RSL_Types.RSL_MessageGroup.");
return enum_value < other_value;
}

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

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

boolean RSL__MessageGroup::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 @RSL_Types.RSL_MessageGroup.");
return enum_value > other_value;
}

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

const char *RSL__MessageGroup::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__MDISC__RESERVED: return "RSL_MDISC_RESERVED";
case RSL__MDISC__RLL: return "RSL_MDISC_RLL";
case RSL__MDISC__DCHAN: return "RSL_MDISC_DCHAN";
case RSL__MDISC__CCHAN: return "RSL_MDISC_CCHAN";
case RSL__MDISC__TRX__MGMT: return "RSL_MDISC_TRX_MGMT";
case RSL__MDISC__LCS: return "RSL_MDISC_LCS";
case RSL__MDISC__IPACCESS: return "RSL_MDISC_IPACCESS";
default:
return "<unknown>";
}
}

RSL__MessageGroup::enum_type RSL__MessageGroup::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, "RSL_MDISC_RESERVED")) return RSL__MDISC__RESERVED;
if (!strcmp(str_par, "RSL_MDISC_RLL")) return RSL__MDISC__RLL;
if (!strcmp(str_par, "RSL_MDISC_DCHAN")) return RSL__MDISC__DCHAN;
if (!strcmp(str_par, "RSL_MDISC_CCHAN")) return RSL__MDISC__CCHAN;
if (!strcmp(str_par, "RSL_MDISC_TRX_MGMT")) return RSL__MDISC__TRX__MGMT;
if (!strcmp(str_par, "RSL_MDISC_LCS")) return RSL__MDISC__LCS;
if (!strcmp(str_par, "RSL_MDISC_IPACCESS")) return RSL__MDISC__IPACCESS;
}
return UNKNOWN_VALUE;
}

boolean RSL__MessageGroup::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 4:
case 6:
case 8:
case 16:
case 63:
return TRUE;
default:
return FALSE;
}
}

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

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

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

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

void RSL__MessageGroup::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 RSL__MessageGroup::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", "@RSL_Types.RSL_MessageGroup");
  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 @RSL_Types.RSL_MessageGroup.");
  }
}

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

void RSL__MessageGroup::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 @RSL_Types.RSL_MessageGroup.", enum_value);
}

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

void RSL__MessageGroup_template::copy_template(const RSL__MessageGroup_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 RSL__MessageGroup_template[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 RSL__MessageGroup_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__MessageGroup_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 @RSL_Types.RSL_MessageGroup.");
}
}

RSL__MessageGroup_template::RSL__MessageGroup_template()
{
}

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

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

RSL__MessageGroup_template::RSL__MessageGroup_template(RSL__MessageGroup::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__MessageGroup_template::match(RSL__MessageGroup::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 @RSL_Types.RSL_MessageGroup.");
}
return FALSE;
}

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

RSL__MessageGroup::enum_type RSL__MessageGroup_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 @RSL_Types.RSL_MessageGroup.");
return single_value;
}

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

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

void RSL__MessageGroup_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__MessageGroup::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 RSL__MessageGroup_template::log_match(const RSL__MessageGroup& 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 RSL__MessageGroup_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 @RSL_Types.RSL_MessageGroup.");
}
}

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

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

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

void RSL__MessageGroup_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 : "@RSL_Types.RSL_MessageGroup");
}

RSL__MessageDiscriminator::RSL__MessageDiscriminator()
{
}

RSL__MessageDiscriminator::RSL__MessageDiscriminator(const RSL__MessageGroup& par_msg__group,
    const BOOLEAN& par_transparent)
  :   field_msg__group(par_msg__group),
  field_transparent(par_transparent)
{
}

RSL__MessageDiscriminator::RSL__MessageDiscriminator(const RSL__MessageDiscriminator& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_MessageDiscriminator.");
if (other_value.msg__group().is_bound()) field_msg__group = other_value.msg__group();
else field_msg__group.clean_up();
if (other_value.transparent().is_bound()) field_transparent = other_value.transparent();
else field_transparent.clean_up();
}

void RSL__MessageDiscriminator::clean_up()
{
field_msg__group.clean_up();
field_transparent.clean_up();
}

const TTCN_Typedescriptor_t* RSL__MessageDiscriminator::get_descriptor() const { return &RSL__MessageDiscriminator_descr_; }
RSL__MessageDiscriminator& RSL__MessageDiscriminator::operator=(const RSL__MessageDiscriminator& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_MessageDiscriminator.");
  if (other_value.msg__group().is_bound()) field_msg__group = other_value.msg__group();
  else field_msg__group.clean_up();
  if (other_value.transparent().is_bound()) field_transparent = other_value.transparent();
  else field_transparent.clean_up();
}
return *this;
}

boolean RSL__MessageDiscriminator::operator==(const RSL__MessageDiscriminator& other_value) const
{
return field_msg__group==other_value.field_msg__group
  && field_transparent==other_value.field_transparent;
}

boolean RSL__MessageDiscriminator::is_bound() const
{
return (field_msg__group.is_bound())
  || (field_transparent.is_bound());
}
boolean RSL__MessageDiscriminator::is_value() const
{
return field_msg__group.is_value()
  && field_transparent.is_value();
}
void RSL__MessageDiscriminator::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ msg_group := ");
field_msg__group.log();
TTCN_Logger::log_event_str(", transparent := ");
field_transparent.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__MessageDiscriminator::set_implicit_omit()
{
if (msg__group().is_bound()) msg__group().set_implicit_omit();
if (transparent().is_bound()) transparent().set_implicit_omit();
}

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

void RSL__MessageDiscriminator::encode_text(Text_Buf& text_buf) const
{
field_msg__group.encode_text(text_buf);
field_transparent.encode_text(text_buf);
}

void RSL__MessageDiscriminator::decode_text(Text_Buf& text_buf)
{
field_msg__group.decode_text(text_buf);
field_transparent.decode_text(text_buf);
}

void RSL__MessageDiscriminator::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 RSL__MessageDiscriminator::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 RSL__MessageDiscriminator::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, RSL__MessageDiscriminator_msg__group_descr_.raw->forceomit);
  decoded_field_length = field_msg__group.RAW_decode(RSL__MessageDiscriminator_msg__group_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, RSL__MessageDiscriminator_transparent_descr_.raw->forceomit);
  decoded_field_length = field_transparent.RAW_decode(RSL__MessageDiscriminator_transparent_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 RSL__MessageDiscriminator::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, RSL__MessageDiscriminator_msg__group_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__MessageDiscriminator_transparent_descr_.raw);
  encoded_length += field_msg__group.RAW_encode(RSL__MessageDiscriminator_msg__group_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_transparent.RAW_encode(RSL__MessageDiscriminator_transparent_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RSL__MessageDiscriminator_template::single_value_struct {
RSL__MessageGroup_template field_msg__group;
BOOLEAN_template field_transparent;
};

void RSL__MessageDiscriminator_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_msg__group = ANY_VALUE;
single_value->field_transparent = ANY_VALUE;
}
}
}

void RSL__MessageDiscriminator_template::copy_value(const RSL__MessageDiscriminator& other_value)
{
single_value = new single_value_struct;
if (other_value.msg__group().is_bound()) {
  single_value->field_msg__group = other_value.msg__group();
} else {
  single_value->field_msg__group.clean_up();
}
if (other_value.transparent().is_bound()) {
  single_value->field_transparent = other_value.transparent();
} else {
  single_value->field_transparent.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__MessageDiscriminator_template::copy_template(const RSL__MessageDiscriminator_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.msg__group().get_selection()) {
single_value->field_msg__group = other_value.msg__group();
} else {
single_value->field_msg__group.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.transparent().get_selection()) {
single_value->field_transparent = other_value.transparent();
} else {
single_value->field_transparent.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 RSL__MessageDiscriminator_template[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 RSL__MessageDiscriminator_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__MessageDiscriminator_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 @RSL_Types.RSL_MessageDiscriminator.");
break;
}
set_selection(other_value);
}

RSL__MessageDiscriminator_template::RSL__MessageDiscriminator_template()
{
}

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

RSL__MessageDiscriminator_template::RSL__MessageDiscriminator_template(const RSL__MessageDiscriminator& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__MessageDiscriminator_template::match(const RSL__MessageDiscriminator& 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.msg__group().is_bound()) return FALSE;
if(!single_value->field_msg__group.match(other_value.msg__group(), legacy))return FALSE;
if(!other_value.transparent().is_bound()) return FALSE;
if(!single_value->field_transparent.match(other_value.transparent(), 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 @RSL_Types.RSL_MessageDiscriminator.");
}
return FALSE;
}

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

boolean RSL__MessageDiscriminator_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_msg__group.is_value()
 && single_value->field_transparent.is_value();
}

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

RSL__MessageDiscriminator RSL__MessageDiscriminator_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 @RSL_Types.RSL_MessageDiscriminator.");
RSL__MessageDiscriminator ret_val;
if (single_value->field_msg__group.is_bound()) {
ret_val.msg__group() = single_value->field_msg__group.valueof();
}
if (single_value->field_transparent.is_bound()) {
ret_val.transparent() = single_value->field_transparent.valueof();
}
return ret_val;
}

void RSL__MessageDiscriminator_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 @RSL_Types.RSL_MessageDiscriminator.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__MessageDiscriminator_template[list_length];
}

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

RSL__MessageGroup_template& RSL__MessageDiscriminator_template::msg__group()
{
set_specific();
return single_value->field_msg__group;
}

const RSL__MessageGroup_template& RSL__MessageDiscriminator_template::msg__group() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msg_group of a non-specific template of type @RSL_Types.RSL_MessageDiscriminator.");
return single_value->field_msg__group;
}

BOOLEAN_template& RSL__MessageDiscriminator_template::transparent()
{
set_specific();
return single_value->field_transparent;
}

const BOOLEAN_template& RSL__MessageDiscriminator_template::transparent() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field transparent of a non-specific template of type @RSL_Types.RSL_MessageDiscriminator.");
return single_value->field_transparent;
}

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

void RSL__MessageDiscriminator_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ msg_group := ");
single_value->field_msg__group.log();
TTCN_Logger::log_event_str(", transparent := ");
single_value->field_transparent.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 RSL__MessageDiscriminator_template::log_match(const RSL__MessageDiscriminator& 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_msg__group.match(match_value.msg__group(), legacy)){
TTCN_Logger::log_logmatch_info(".msg_group");
single_value->field_msg__group.log_match(match_value.msg__group(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_transparent.match(match_value.transparent(), legacy)){
TTCN_Logger::log_logmatch_info(".transparent");
single_value->field_transparent.log_match(match_value.transparent(), 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("{ msg_group := ");
single_value->field_msg__group.log_match(match_value.msg__group(), legacy);
TTCN_Logger::log_event_str(", transparent := ");
single_value->field_transparent.log_match(match_value.transparent(), 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 RSL__MessageDiscriminator_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (msg__group().is_bound()) msg__group().set_implicit_omit();
if (transparent().is_bound()) transparent().set_implicit_omit();
}

void RSL__MessageDiscriminator_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_msg__group.encode_text(text_buf);
single_value->field_transparent.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 @RSL_Types.RSL_MessageDiscriminator.");
}
}

void RSL__MessageDiscriminator_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_msg__group.decode_text(text_buf);
single_value->field_transparent.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 RSL__MessageDiscriminator_template[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 @RSL_Types.RSL_MessageDiscriminator.");
}
}

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

void RSL__MessageDiscriminator_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_msg__group.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_MessageDiscriminator");
single_value->field_transparent.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_MessageDiscriminator");
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 : "@RSL_Types.RSL_MessageDiscriminator");
}

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

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

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

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

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

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

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

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

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

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

boolean RSL__MessageType::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 @RSL_Types.RSL_MessageType.");
return enum_value == other_value;
}

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

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

boolean RSL__MessageType::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 @RSL_Types.RSL_MessageType.");
return enum_value < other_value;
}

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

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

boolean RSL__MessageType::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 @RSL_Types.RSL_MessageType.");
return enum_value > other_value;
}

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

const char *RSL__MessageType::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__MT__DATA__REQ: return "RSL_MT_DATA_REQ";
case RSL__MT__DATA__IND: return "RSL_MT_DATA_IND";
case RSL__MT__ERROR__IND: return "RSL_MT_ERROR_IND";
case RSL__MT__EST__REQ: return "RSL_MT_EST_REQ";
case RSL__MT__EST__CONF: return "RSL_MT_EST_CONF";
case RSL__MT__EST__IND: return "RSL_MT_EST_IND";
case RSL__MT__REL__REQ: return "RSL_MT_REL_REQ";
case RSL__MT__REL__CONF: return "RSL_MT_REL_CONF";
case RSL__MT__REL__IND: return "RSL_MT_REL_IND";
case RSL__MT__UNIT__DATA__REQ: return "RSL_MT_UNIT_DATA_REQ";
case RSL__MT__UNIT__DATA__IND: return "RSL_MT_UNIT_DATA_IND";
case RSL__MT__SUSP__REQ: return "RSL_MT_SUSP_REQ";
case RSL__MT__SUSP__CONF: return "RSL_MT_SUSP_CONF";
case RSL__MT__RES__REQ: return "RSL_MT_RES_REQ";
case RSL__MT__RECON__REQ: return "RSL_MT_RECON_REQ";
case RSL__MT__BCCH__INFO: return "RSL_MT_BCCH_INFO";
case RSL__MT__CCCH__LOAD__IND: return "RSL_MT_CCCH_LOAD_IND";
case RSL__MT__CHAN__RQD: return "RSL_MT_CHAN_RQD";
case RSL__MT__DELETE__IND: return "RSL_MT_DELETE_IND";
case RSL__MT__PAGING__CMD: return "RSL_MT_PAGING_CMD";
case RSL__MT__IMMEDIATE__ASSIGN__CMD: return "RSL_MT_IMMEDIATE_ASSIGN_CMD";
case RSL__MT__SMS__BC__REQ: return "RSL_MT_SMS_BC_REQ";
case RSL__MT__CHAN__CONF: return "RSL_MT_CHAN_CONF";
case RSL__MT__RF__RES__IND: return "RSL_MT_RF_RES_IND";
case RSL__MT__SACCH__FILL: return "RSL_MT_SACCH_FILL";
case RSL__MT__OVERLOAD: return "RSL_MT_OVERLOAD";
case RSL__MT__ERROR__REPORT: return "RSL_MT_ERROR_REPORT";
case RSL__MT__SMS__BC__CMD: return "RSL_MT_SMS_BC_CMD";
case RSL__MT__CBCH__LOAD__IND: return "RSL_MT_CBCH_LOAD_IND";
case RSL__MT__NOT__CMD: return "RSL_MT_NOT_CMD";
case RSL__MT__CHAN__ACTIV: return "RSL_MT_CHAN_ACTIV";
case RSL__MT__CHAN__ACTIV__ACK: return "RSL_MT_CHAN_ACTIV_ACK";
case RSL__MT__CHAN__ACTIV__NACK: return "RSL_MT_CHAN_ACTIV_NACK";
case RSL__MT__CONN__FAIL: return "RSL_MT_CONN_FAIL";
case RSL__MT__DEACTIVATE__SACCH: return "RSL_MT_DEACTIVATE_SACCH";
case RSL__MT__ENCR__CMD: return "RSL_MT_ENCR_CMD";
case RSL__MT__HANDO__DET: return "RSL_MT_HANDO_DET";
case RSL__MT__MEAS__RES: return "RSL_MT_MEAS_RES";
case RSL__MT__MODE__MODIFY__REQ: return "RSL_MT_MODE_MODIFY_REQ";
case RSL__MT__MODE__MODIFY__ACK: return "RSL_MT_MODE_MODIFY_ACK";
case RSL__MT__MODE__MODIFY__NACK: return "RSL_MT_MODE_MODIFY_NACK";
case RSL__MT__PHY__CONTEXT__REQ: return "RSL_MT_PHY_CONTEXT_REQ";
case RSL__MT__PHY__CONTEXT__CONF: return "RSL_MT_PHY_CONTEXT_CONF";
case RSL__MT__RF__CHAN__REL: return "RSL_MT_RF_CHAN_REL";
case RSL__MT__MS__POWER__CONTROL: return "RSL_MT_MS_POWER_CONTROL";
case RSL__MT__BS__POWER__CONTROL: return "RSL_MT_BS_POWER_CONTROL";
case RSL__MT__PREPROC__CONFIG: return "RSL_MT_PREPROC_CONFIG";
case RSL__MT__PREPROC__MEAS__RES: return "RSL_MT_PREPROC_MEAS_RES";
case RSL__MT__RF__CHAN__REL__ACK: return "RSL_MT_RF_CHAN_REL_ACK";
case RSL__MT__SACCH__INFO__MODIFY: return "RSL_MT_SACCH_INFO_MODIFY";
case RSL__MT__TALKER__DET: return "RSL_MT_TALKER_DET";
case RSL__MT__LISTENER__DET: return "RSL_MT_LISTENER_DET";
case RSL__MT__REMOTE__CODEC__CONF__REP: return "RSL_MT_REMOTE_CODEC_CONF_REP";
case RSL__MT__RTD__REP: return "RSL_MT_RTD_REP";
case RSL__MT__PRE__HANDO__NOTIF: return "RSL_MT_PRE_HANDO_NOTIF";
case RSL__MT__MR__CODEC__MOD__REQ: return "RSL_MT_MR_CODEC_MOD_REQ";
case RSL__MT__MR__CODEC__MOD__ACK: return "RSL_MT_MR_CODEC_MOD_ACK";
case RSL__MT__MR__CODEC__MOD__NACK: return "RSL_MT_MR_CODEC_MOD_NACK";
case RSL__MT__MR__CODEC__MOD__PER: return "RSL_MT_MR_CODEC_MOD_PER";
case RSL__MT__TFO__REP: return "RSL_MT_TFO_REP";
case RSL__MT__TFO__MOD__REQ: return "RSL_MT_TFO_MOD_REQ";
case RSL__MT__LOCATION__INFO: return "RSL_MT_LOCATION_INFO";
case RSL__MT__IPAC__DIR__RETR__ENQ: return "RSL_MT_IPAC_DIR_RETR_ENQ";
case RSL__MT__IPAC__PDCH__ACT: return "RSL_MT_IPAC_PDCH_ACT";
case RSL__MT__IPAC__PDCH__ACT__ACK: return "RSL_MT_IPAC_PDCH_ACT_ACK";
case RSL__MT__IPAC__PDCH__ACT__NACK: return "RSL_MT_IPAC_PDCH_ACT_NACK";
case RSL__MT__IPAC__PDCH__DEACT: return "RSL_MT_IPAC_PDCH_DEACT";
case RSL__MT__IPAC__PDCH__DEACT__ACK: return "RSL_MT_IPAC_PDCH_DEACT_ACK";
case RSL__MT__IPAC__PDCH__DEACT__NACK: return "RSL_MT_IPAC_PDCH_DEACT_NACK";
case RSL__MT__IPAC__CONNECT__MUX: return "RSL_MT_IPAC_CONNECT_MUX";
case RSL__MT__IPAC__CONNECT__MUX__ACK: return "RSL_MT_IPAC_CONNECT_MUX_ACK";
case RSL__MT__IPAC__CONNECT__MUX__NACK: return "RSL_MT_IPAC_CONNECT_MUX_NACK";
case RSL__MT__IPAC__BIND__MUX: return "RSL_MT_IPAC_BIND_MUX";
case RSL__MT__IPAC__BIND__MUX__ACK: return "RSL_MT_IPAC_BIND_MUX_ACK";
case RSL__MT__IPAC__BIND__MUX__NACK: return "RSL_MT_IPAC_BIND_MUX_NACK";
case RSL__MT__IPAC__DISC__MUX: return "RSL_MT_IPAC_DISC_MUX";
case RSL__MT__IPAC__DISC__MUX__ACK: return "RSL_MT_IPAC_DISC_MUX_ACK";
case RSL__MT__IPAC__DISC__MUX__NACK: return "RSL_MT_IPAC_DISC_MUX_NACK";
case RSL__MT__IPAC__MEAS__PREPROC__DFT: return "RSL_MT_IPAC_MEAS_PREPROC_DFT";
case RSL__MT__IPAC__HO__CAN__ENQ: return "RSL_MT_IPAC_HO_CAN_ENQ";
case RSL__MT__IPAC__HO__CAN__RES: return "RSL_MT_IPAC_HO_CAN_RES";
case RSL__MT__IPAC__CRCX: return "RSL_MT_IPAC_CRCX";
case RSL__MT__IPAC__CRCX__ACK: return "RSL_MT_IPAC_CRCX_ACK";
case RSL__MT__IPAC__CRCX__NACK: return "RSL_MT_IPAC_CRCX_NACK";
case RSL__MT__IPAC__MDCX: return "RSL_MT_IPAC_MDCX";
case RSL__MT__IPAC__MDCX__ACK: return "RSL_MT_IPAC_MDCX_ACK";
case RSL__MT__IPAC__MDCX__NACK: return "RSL_MT_IPAC_MDCX_NACK";
case RSL__MT__IPAC__DLCX__IND: return "RSL_MT_IPAC_DLCX_IND";
case RSL__MT__IPAC__DLCX: return "RSL_MT_IPAC_DLCX";
case RSL__MT__IPAC__DLCX__ACK: return "RSL_MT_IPAC_DLCX_ACK";
case RSL__MT__IPAC__DLCX__NACK: return "RSL_MT_IPAC_DLCX_NACK";
case RSL__MT__OSMO__ETWS__CMD: return "RSL_MT_OSMO_ETWS_CMD";
default:
return "<unknown>";
}
}

RSL__MessageType::enum_type RSL__MessageType::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, "RSL_MT_DATA_REQ")) return RSL__MT__DATA__REQ;
if (!strcmp(str_par, "RSL_MT_DATA_IND")) return RSL__MT__DATA__IND;
if (!strcmp(str_par, "RSL_MT_ERROR_IND")) return RSL__MT__ERROR__IND;
if (!strcmp(str_par, "RSL_MT_EST_REQ")) return RSL__MT__EST__REQ;
if (!strcmp(str_par, "RSL_MT_EST_CONF")) return RSL__MT__EST__CONF;
if (!strcmp(str_par, "RSL_MT_EST_IND")) return RSL__MT__EST__IND;
if (!strcmp(str_par, "RSL_MT_REL_REQ")) return RSL__MT__REL__REQ;
if (!strcmp(str_par, "RSL_MT_REL_CONF")) return RSL__MT__REL__CONF;
if (!strcmp(str_par, "RSL_MT_REL_IND")) return RSL__MT__REL__IND;
if (!strcmp(str_par, "RSL_MT_UNIT_DATA_REQ")) return RSL__MT__UNIT__DATA__REQ;
if (!strcmp(str_par, "RSL_MT_UNIT_DATA_IND")) return RSL__MT__UNIT__DATA__IND;
if (!strcmp(str_par, "RSL_MT_SUSP_REQ")) return RSL__MT__SUSP__REQ;
if (!strcmp(str_par, "RSL_MT_SUSP_CONF")) return RSL__MT__SUSP__CONF;
if (!strcmp(str_par, "RSL_MT_RES_REQ")) return RSL__MT__RES__REQ;
if (!strcmp(str_par, "RSL_MT_RECON_REQ")) return RSL__MT__RECON__REQ;
if (!strcmp(str_par, "RSL_MT_BCCH_INFO")) return RSL__MT__BCCH__INFO;
if (!strcmp(str_par, "RSL_MT_CCCH_LOAD_IND")) return RSL__MT__CCCH__LOAD__IND;
if (!strcmp(str_par, "RSL_MT_CHAN_RQD")) return RSL__MT__CHAN__RQD;
if (!strcmp(str_par, "RSL_MT_DELETE_IND")) return RSL__MT__DELETE__IND;
if (!strcmp(str_par, "RSL_MT_PAGING_CMD")) return RSL__MT__PAGING__CMD;
if (!strcmp(str_par, "RSL_MT_IMMEDIATE_ASSIGN_CMD")) return RSL__MT__IMMEDIATE__ASSIGN__CMD;
if (!strcmp(str_par, "RSL_MT_SMS_BC_REQ")) return RSL__MT__SMS__BC__REQ;
if (!strcmp(str_par, "RSL_MT_CHAN_CONF")) return RSL__MT__CHAN__CONF;
if (!strcmp(str_par, "RSL_MT_RF_RES_IND")) return RSL__MT__RF__RES__IND;
if (!strcmp(str_par, "RSL_MT_SACCH_FILL")) return RSL__MT__SACCH__FILL;
if (!strcmp(str_par, "RSL_MT_OVERLOAD")) return RSL__MT__OVERLOAD;
if (!strcmp(str_par, "RSL_MT_ERROR_REPORT")) return RSL__MT__ERROR__REPORT;
if (!strcmp(str_par, "RSL_MT_SMS_BC_CMD")) return RSL__MT__SMS__BC__CMD;
if (!strcmp(str_par, "RSL_MT_CBCH_LOAD_IND")) return RSL__MT__CBCH__LOAD__IND;
if (!strcmp(str_par, "RSL_MT_NOT_CMD")) return RSL__MT__NOT__CMD;
if (!strcmp(str_par, "RSL_MT_CHAN_ACTIV")) return RSL__MT__CHAN__ACTIV;
if (!strcmp(str_par, "RSL_MT_CHAN_ACTIV_ACK")) return RSL__MT__CHAN__ACTIV__ACK;
if (!strcmp(str_par, "RSL_MT_CHAN_ACTIV_NACK")) return RSL__MT__CHAN__ACTIV__NACK;
if (!strcmp(str_par, "RSL_MT_CONN_FAIL")) return RSL__MT__CONN__FAIL;
if (!strcmp(str_par, "RSL_MT_DEACTIVATE_SACCH")) return RSL__MT__DEACTIVATE__SACCH;
if (!strcmp(str_par, "RSL_MT_ENCR_CMD")) return RSL__MT__ENCR__CMD;
if (!strcmp(str_par, "RSL_MT_HANDO_DET")) return RSL__MT__HANDO__DET;
if (!strcmp(str_par, "RSL_MT_MEAS_RES")) return RSL__MT__MEAS__RES;
if (!strcmp(str_par, "RSL_MT_MODE_MODIFY_REQ")) return RSL__MT__MODE__MODIFY__REQ;
if (!strcmp(str_par, "RSL_MT_MODE_MODIFY_ACK")) return RSL__MT__MODE__MODIFY__ACK;
if (!strcmp(str_par, "RSL_MT_MODE_MODIFY_NACK")) return RSL__MT__MODE__MODIFY__NACK;
if (!strcmp(str_par, "RSL_MT_PHY_CONTEXT_REQ")) return RSL__MT__PHY__CONTEXT__REQ;
if (!strcmp(str_par, "RSL_MT_PHY_CONTEXT_CONF")) return RSL__MT__PHY__CONTEXT__CONF;
if (!strcmp(str_par, "RSL_MT_RF_CHAN_REL")) return RSL__MT__RF__CHAN__REL;
if (!strcmp(str_par, "RSL_MT_MS_POWER_CONTROL")) return RSL__MT__MS__POWER__CONTROL;
if (!strcmp(str_par, "RSL_MT_BS_POWER_CONTROL")) return RSL__MT__BS__POWER__CONTROL;
if (!strcmp(str_par, "RSL_MT_PREPROC_CONFIG")) return RSL__MT__PREPROC__CONFIG;
if (!strcmp(str_par, "RSL_MT_PREPROC_MEAS_RES")) return RSL__MT__PREPROC__MEAS__RES;
if (!strcmp(str_par, "RSL_MT_RF_CHAN_REL_ACK")) return RSL__MT__RF__CHAN__REL__ACK;
if (!strcmp(str_par, "RSL_MT_SACCH_INFO_MODIFY")) return RSL__MT__SACCH__INFO__MODIFY;
if (!strcmp(str_par, "RSL_MT_TALKER_DET")) return RSL__MT__TALKER__DET;
if (!strcmp(str_par, "RSL_MT_LISTENER_DET")) return RSL__MT__LISTENER__DET;
if (!strcmp(str_par, "RSL_MT_REMOTE_CODEC_CONF_REP")) return RSL__MT__REMOTE__CODEC__CONF__REP;
if (!strcmp(str_par, "RSL_MT_RTD_REP")) return RSL__MT__RTD__REP;
if (!strcmp(str_par, "RSL_MT_PRE_HANDO_NOTIF")) return RSL__MT__PRE__HANDO__NOTIF;
if (!strcmp(str_par, "RSL_MT_MR_CODEC_MOD_REQ")) return RSL__MT__MR__CODEC__MOD__REQ;
if (!strcmp(str_par, "RSL_MT_MR_CODEC_MOD_ACK")) return RSL__MT__MR__CODEC__MOD__ACK;
if (!strcmp(str_par, "RSL_MT_MR_CODEC_MOD_NACK")) return RSL__MT__MR__CODEC__MOD__NACK;
if (!strcmp(str_par, "RSL_MT_MR_CODEC_MOD_PER")) return RSL__MT__MR__CODEC__MOD__PER;
if (!strcmp(str_par, "RSL_MT_TFO_REP")) return RSL__MT__TFO__REP;
if (!strcmp(str_par, "RSL_MT_TFO_MOD_REQ")) return RSL__MT__TFO__MOD__REQ;
if (!strcmp(str_par, "RSL_MT_LOCATION_INFO")) return RSL__MT__LOCATION__INFO;
if (!strcmp(str_par, "RSL_MT_IPAC_DIR_RETR_ENQ")) return RSL__MT__IPAC__DIR__RETR__ENQ;
if (!strcmp(str_par, "RSL_MT_IPAC_PDCH_ACT")) return RSL__MT__IPAC__PDCH__ACT;
if (!strcmp(str_par, "RSL_MT_IPAC_PDCH_ACT_ACK")) return RSL__MT__IPAC__PDCH__ACT__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_PDCH_ACT_NACK")) return RSL__MT__IPAC__PDCH__ACT__NACK;
if (!strcmp(str_par, "RSL_MT_IPAC_PDCH_DEACT")) return RSL__MT__IPAC__PDCH__DEACT;
if (!strcmp(str_par, "RSL_MT_IPAC_PDCH_DEACT_ACK")) return RSL__MT__IPAC__PDCH__DEACT__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_PDCH_DEACT_NACK")) return RSL__MT__IPAC__PDCH__DEACT__NACK;
if (!strcmp(str_par, "RSL_MT_IPAC_CONNECT_MUX")) return RSL__MT__IPAC__CONNECT__MUX;
if (!strcmp(str_par, "RSL_MT_IPAC_CONNECT_MUX_ACK")) return RSL__MT__IPAC__CONNECT__MUX__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_CONNECT_MUX_NACK")) return RSL__MT__IPAC__CONNECT__MUX__NACK;
if (!strcmp(str_par, "RSL_MT_IPAC_BIND_MUX")) return RSL__MT__IPAC__BIND__MUX;
if (!strcmp(str_par, "RSL_MT_IPAC_BIND_MUX_ACK")) return RSL__MT__IPAC__BIND__MUX__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_BIND_MUX_NACK")) return RSL__MT__IPAC__BIND__MUX__NACK;
if (!strcmp(str_par, "RSL_MT_IPAC_DISC_MUX")) return RSL__MT__IPAC__DISC__MUX;
if (!strcmp(str_par, "RSL_MT_IPAC_DISC_MUX_ACK")) return RSL__MT__IPAC__DISC__MUX__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_DISC_MUX_NACK")) return RSL__MT__IPAC__DISC__MUX__NACK;
if (!strcmp(str_par, "RSL_MT_IPAC_MEAS_PREPROC_DFT")) return RSL__MT__IPAC__MEAS__PREPROC__DFT;
if (!strcmp(str_par, "RSL_MT_IPAC_HO_CAN_ENQ")) return RSL__MT__IPAC__HO__CAN__ENQ;
if (!strcmp(str_par, "RSL_MT_IPAC_HO_CAN_RES")) return RSL__MT__IPAC__HO__CAN__RES;
if (!strcmp(str_par, "RSL_MT_IPAC_CRCX")) return RSL__MT__IPAC__CRCX;
if (!strcmp(str_par, "RSL_MT_IPAC_CRCX_ACK")) return RSL__MT__IPAC__CRCX__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_CRCX_NACK")) return RSL__MT__IPAC__CRCX__NACK;
if (!strcmp(str_par, "RSL_MT_IPAC_MDCX")) return RSL__MT__IPAC__MDCX;
if (!strcmp(str_par, "RSL_MT_IPAC_MDCX_ACK")) return RSL__MT__IPAC__MDCX__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_MDCX_NACK")) return RSL__MT__IPAC__MDCX__NACK;
if (!strcmp(str_par, "RSL_MT_IPAC_DLCX_IND")) return RSL__MT__IPAC__DLCX__IND;
if (!strcmp(str_par, "RSL_MT_IPAC_DLCX")) return RSL__MT__IPAC__DLCX;
if (!strcmp(str_par, "RSL_MT_IPAC_DLCX_ACK")) return RSL__MT__IPAC__DLCX__ACK;
if (!strcmp(str_par, "RSL_MT_IPAC_DLCX_NACK")) return RSL__MT__IPAC__DLCX__NACK;
if (!strcmp(str_par, "RSL_MT_OSMO_ETWS_CMD")) return RSL__MT__OSMO__ETWS__CMD;
}
return UNKNOWN_VALUE;
}

boolean RSL__MessageType::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 30:
case 31:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
case 58:
case 59:
case 60:
case 61:
case 62:
case 63:
case 65:
case 64:
case 72:
case 73:
case 74:
case 75:
case 76:
case 77:
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 96:
case 97:
case 98:
case 112:
case 113:
case 114:
case 115:
case 116:
case 117:
case 118:
case 119:
case 120:
case 121:
case 127:
return TRUE;
default:
return FALSE;
}
}

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

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

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

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

void RSL__MessageType::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 RSL__MessageType::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", "@RSL_Types.RSL_MessageType");
  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 @RSL_Types.RSL_MessageType.");
  }
}

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

void RSL__MessageType::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 @RSL_Types.RSL_MessageType.", enum_value);
}

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

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

void RSL__MessageType_template::copy_template(const RSL__MessageType_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 RSL__MessageType_template[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 RSL__MessageType_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__MessageType_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 @RSL_Types.RSL_MessageType.");
}
}

RSL__MessageType_template::RSL__MessageType_template()
{
}

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

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

RSL__MessageType_template::RSL__MessageType_template(RSL__MessageType::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__MessageType_template::match(RSL__MessageType::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 @RSL_Types.RSL_MessageType.");
}
return FALSE;
}

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

RSL__MessageType::enum_type RSL__MessageType_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 @RSL_Types.RSL_MessageType.");
return single_value;
}

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

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

void RSL__MessageType_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__MessageType::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 RSL__MessageType_template::log_match(const RSL__MessageType& 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 RSL__MessageType_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 @RSL_Types.RSL_MessageType.");
}
}

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

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

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

void RSL__MessageType_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 : "@RSL_Types.RSL_MessageType");
}

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

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

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

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

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

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

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

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

boolean RSL__IE__Type::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 @RSL_Types.RSL_IE_Type.");
return enum_value == other_value;
}

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

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

boolean RSL__IE__Type::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 @RSL_Types.RSL_IE_Type.");
return enum_value < other_value;
}

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

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

boolean RSL__IE__Type::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 @RSL_Types.RSL_IE_Type.");
return enum_value > other_value;
}

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

const char *RSL__IE__Type::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__IE__CHAN__NR: return "RSL_IE_CHAN_NR";
case RSL__IE__LINK__IDENT: return "RSL_IE_LINK_IDENT";
case RSL__IE__ACT__TYPE: return "RSL_IE_ACT_TYPE";
case RSL__IE__BS__POWER: return "RSL_IE_BS_POWER";
case RSL__IE__CHAN__IDENT: return "RSL_IE_CHAN_IDENT";
case RSL__IE__CHAN__MODE: return "RSL_IE_CHAN_MODE";
case RSL__IE__ENCR__INFO: return "RSL_IE_ENCR_INFO";
case RSL__IE__FRAME__NUMBER: return "RSL_IE_FRAME_NUMBER";
case RSL__IE__HANDO__REF: return "RSL_IE_HANDO_REF";
case RSL__IE__L1__INFO: return "RSL_IE_L1_INFO";
case RSL__IE__L3__INFO: return "RSL_IE_L3_INFO";
case RSL__IE__MS__IDENTITY: return "RSL_IE_MS_IDENTITY";
case RSL__IE__MS__POWER: return "RSL_IE_MS_POWER";
case RSL__IE__PAGING__GROUP: return "RSL_IE_PAGING_GROUP";
case RSL__IE__PAGING__LOAD: return "RSL_IE_PAGING_LOAD";
case RSL__IE__PYHS__CONTEXT: return "RSL_IE_PYHS_CONTEXT";
case RSL__IE__ACCESS__DELAY: return "RSL_IE_ACCESS_DELAY";
case RSL__IE__RACH__LOAD: return "RSL_IE_RACH_LOAD";
case RSL__IE__REQ__REFERENCE: return "RSL_IE_REQ_REFERENCE";
case RSL__IE__RELEASE__MODE: return "RSL_IE_RELEASE_MODE";
case RSL__IE__RESOURCE__INFO: return "RSL_IE_RESOURCE_INFO";
case RSL__IE__RLM__CAUSE: return "RSL_IE_RLM_CAUSE";
case RSL__IE__STARTNG__TIME: return "RSL_IE_STARTNG_TIME";
case RSL__IE__TIMING__ADVANCE: return "RSL_IE_TIMING_ADVANCE";
case RSL__IE__UPLINK__MEAS: return "RSL_IE_UPLINK_MEAS";
case RSL__IE__CAUSE: return "RSL_IE_CAUSE";
case RSL__IE__MEAS__RES__NR: return "RSL_IE_MEAS_RES_NR";
case RSL__IE__MSG__ID: return "RSL_IE_MSG_ID";
case RSL__IE__SYSINFO__TYPE: return "RSL_IE_SYSINFO_TYPE";
case RSL__IE__MS__POWER__PARAM: return "RSL_IE_MS_POWER_PARAM";
case RSL__IE__BS__POWER__PARAM: return "RSL_IE_BS_POWER_PARAM";
case RSL__IE__PREPROC__PARAM: return "RSL_IE_PREPROC_PARAM";
case RSL__IE__PREPROC__MEAS: return "RSL_IE_PREPROC_MEAS";
case RSL__IE__IMM__ASS__INFO: return "RSL_IE_IMM_ASS_INFO";
case RSL__IE__SMSCB__INFO: return "RSL_IE_SMSCB_INFO";
case RSL__IE__MS__TIMING__OFFSET: return "RSL_IE_MS_TIMING_OFFSET";
case RSL__IE__ERR__MSG: return "RSL_IE_ERR_MSG";
case RSL__IE__FULL__BCCH__INFO: return "RSL_IE_FULL_BCCH_INFO";
case RSL__IE__CHAN__NEEDED: return "RSL_IE_CHAN_NEEDED";
case RSL__IE__CB__CMD__TYPE: return "RSL_IE_CB_CMD_TYPE";
case RSL__IE__SMSCB__MSG: return "RSL_IE_SMSCB_MSG";
case RSL__IE__FULL__IMM__ASS__INFO: return "RSL_IE_FULL_IMM_ASS_INFO";
case RSL__IE__SACCH__INFO: return "RSL_IE_SACCH_INFO";
case RSL__IE__CBCH__LOAD__INFO: return "RSL_IE_CBCH_LOAD_INFO";
case RSL__IE__SMSCB__CHAN__INDICATOR: return "RSL_IE_SMSCB_CHAN_INDICATOR";
case RSL__IE__GROUP__CALL__REF: return "RSL_IE_GROUP_CALL_REF";
case RSL__IE__GROUP__CHAN__DESC: return "RSL_IE_GROUP_CHAN_DESC";
case RSL__IE__NCH__DRX__INFO: return "RSL_IE_NCH_DRX_INFO";
case RSL__IE__CMD__INDICATOR: return "RSL_IE_CMD_INDICATOR";
case RSL__IE__EMLPP__PRIO: return "RSL_IE_EMLPP_PRIO";
case RSL__IE__UIC: return "RSL_IE_UIC";
case RSL__IE__MAIN__CHAN__REF: return "RSL_IE_MAIN_CHAN_REF";
case RSL__IE__MR__CONFIG: return "RSL_IE_MR_CONFIG";
case RSL__IE__MR__CONTROL: return "RSL_IE_MR_CONTROL";
case RSL__IE__SUP__CODEC__TYPES: return "RSL_IE_SUP_CODEC_TYPES";
case RSL__IE__CODEC__CONFIG: return "RSL_IE_CODEC_CONFIG";
case RSL__IE__RTD: return "RSL_IE_RTD";
case RSL__IE__TFO__STATUS: return "RSL_IE_TFO_STATUS";
case RSL__IE__LLP__APDU: return "RSL_IE_LLP_APDU";
case RSL__IE__OSMO__REP__ACCH__CAP: return "RSL_IE_OSMO_REP_ACCH_CAP";
case RSL__IE__OSMO__TRAINING__SEQUENCE: return "RSL_IE_OSMO_TRAINING_SEQUENCE";
case RSL__IE__OSMO__TOP__ACCH__CAP: return "RSL_IE_OSMO_TOP_ACCH_CAP";
case RSL__IE__OSMO__OSMUX__CID: return "RSL_IE_OSMO_OSMUX_CID";
case RSL__IE__IPAC__SRTP__CONFIG: return "RSL_IE_IPAC_SRTP_CONFIG";
case RSL__IE__IPAC__PROXY__UDP: return "RSL_IE_IPAC_PROXY_UDP";
case RSL__IE__IPAC__BSCMPL__TOUT: return "RSL_IE_IPAC_BSCMPL_TOUT";
case RSL__IE__IPAC__REMOTE__IP: return "RSL_IE_IPAC_REMOTE_IP";
case RSL__IE__IPAC__REMOTE__PORT: return "RSL_IE_IPAC_REMOTE_PORT";
case RSL__IE__IPAC__RTP__PAYLOAD: return "RSL_IE_IPAC_RTP_PAYLOAD";
case RSL__IE__IPAC__LOCAL__PORT: return "RSL_IE_IPAC_LOCAL_PORT";
case RSL__IE__IPAC__SPEECH__MODE: return "RSL_IE_IPAC_SPEECH_MODE";
case RSL__IE__IPAC__LOCAL__IP: return "RSL_IE_IPAC_LOCAL_IP";
case RSL__IE__IPAC__CONN__STAT: return "RSL_IE_IPAC_CONN_STAT";
case RSL__IE__IPAC__HO__C__PARMS: return "RSL_IE_IPAC_HO_C_PARMS";
case RSL__IE__IPAC__CONN__ID: return "RSL_IE_IPAC_CONN_ID";
case RSL__IE__IPAC__RTP__CSD__FMT: return "RSL_IE_IPAC_RTP_CSD_FMT";
case RSL__IE__IPAC__RTP__JIT__BUF: return "RSL_IE_IPAC_RTP_JIT_BUF";
case RSL__IE__IPAC__RTP__COMPR: return "RSL_IE_IPAC_RTP_COMPR";
case RSL__IE__IPAC__RTP__PAYLOAD2: return "RSL_IE_IPAC_RTP_PAYLOAD2";
case RSL__IE__IPAC__RTP__MPLEX: return "RSL_IE_IPAC_RTP_MPLEX";
case RSL__IE__IPAC__RTP__MPLEX__ID: return "RSL_IE_IPAC_RTP_MPLEX_ID";
default:
return "<unknown>";
}
}

RSL__IE__Type::enum_type RSL__IE__Type::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, "RSL_IE_CHAN_NR")) return RSL__IE__CHAN__NR;
if (!strcmp(str_par, "RSL_IE_LINK_IDENT")) return RSL__IE__LINK__IDENT;
if (!strcmp(str_par, "RSL_IE_ACT_TYPE")) return RSL__IE__ACT__TYPE;
if (!strcmp(str_par, "RSL_IE_BS_POWER")) return RSL__IE__BS__POWER;
if (!strcmp(str_par, "RSL_IE_CHAN_IDENT")) return RSL__IE__CHAN__IDENT;
if (!strcmp(str_par, "RSL_IE_CHAN_MODE")) return RSL__IE__CHAN__MODE;
if (!strcmp(str_par, "RSL_IE_ENCR_INFO")) return RSL__IE__ENCR__INFO;
if (!strcmp(str_par, "RSL_IE_FRAME_NUMBER")) return RSL__IE__FRAME__NUMBER;
if (!strcmp(str_par, "RSL_IE_HANDO_REF")) return RSL__IE__HANDO__REF;
if (!strcmp(str_par, "RSL_IE_L1_INFO")) return RSL__IE__L1__INFO;
if (!strcmp(str_par, "RSL_IE_L3_INFO")) return RSL__IE__L3__INFO;
if (!strcmp(str_par, "RSL_IE_MS_IDENTITY")) return RSL__IE__MS__IDENTITY;
if (!strcmp(str_par, "RSL_IE_MS_POWER")) return RSL__IE__MS__POWER;
if (!strcmp(str_par, "RSL_IE_PAGING_GROUP")) return RSL__IE__PAGING__GROUP;
if (!strcmp(str_par, "RSL_IE_PAGING_LOAD")) return RSL__IE__PAGING__LOAD;
if (!strcmp(str_par, "RSL_IE_PYHS_CONTEXT")) return RSL__IE__PYHS__CONTEXT;
if (!strcmp(str_par, "RSL_IE_ACCESS_DELAY")) return RSL__IE__ACCESS__DELAY;
if (!strcmp(str_par, "RSL_IE_RACH_LOAD")) return RSL__IE__RACH__LOAD;
if (!strcmp(str_par, "RSL_IE_REQ_REFERENCE")) return RSL__IE__REQ__REFERENCE;
if (!strcmp(str_par, "RSL_IE_RELEASE_MODE")) return RSL__IE__RELEASE__MODE;
if (!strcmp(str_par, "RSL_IE_RESOURCE_INFO")) return RSL__IE__RESOURCE__INFO;
if (!strcmp(str_par, "RSL_IE_RLM_CAUSE")) return RSL__IE__RLM__CAUSE;
if (!strcmp(str_par, "RSL_IE_STARTNG_TIME")) return RSL__IE__STARTNG__TIME;
if (!strcmp(str_par, "RSL_IE_TIMING_ADVANCE")) return RSL__IE__TIMING__ADVANCE;
if (!strcmp(str_par, "RSL_IE_UPLINK_MEAS")) return RSL__IE__UPLINK__MEAS;
if (!strcmp(str_par, "RSL_IE_CAUSE")) return RSL__IE__CAUSE;
if (!strcmp(str_par, "RSL_IE_MEAS_RES_NR")) return RSL__IE__MEAS__RES__NR;
if (!strcmp(str_par, "RSL_IE_MSG_ID")) return RSL__IE__MSG__ID;
if (!strcmp(str_par, "RSL_IE_SYSINFO_TYPE")) return RSL__IE__SYSINFO__TYPE;
if (!strcmp(str_par, "RSL_IE_MS_POWER_PARAM")) return RSL__IE__MS__POWER__PARAM;
if (!strcmp(str_par, "RSL_IE_BS_POWER_PARAM")) return RSL__IE__BS__POWER__PARAM;
if (!strcmp(str_par, "RSL_IE_PREPROC_PARAM")) return RSL__IE__PREPROC__PARAM;
if (!strcmp(str_par, "RSL_IE_PREPROC_MEAS")) return RSL__IE__PREPROC__MEAS;
if (!strcmp(str_par, "RSL_IE_IMM_ASS_INFO")) return RSL__IE__IMM__ASS__INFO;
if (!strcmp(str_par, "RSL_IE_SMSCB_INFO")) return RSL__IE__SMSCB__INFO;
if (!strcmp(str_par, "RSL_IE_MS_TIMING_OFFSET")) return RSL__IE__MS__TIMING__OFFSET;
if (!strcmp(str_par, "RSL_IE_ERR_MSG")) return RSL__IE__ERR__MSG;
if (!strcmp(str_par, "RSL_IE_FULL_BCCH_INFO")) return RSL__IE__FULL__BCCH__INFO;
if (!strcmp(str_par, "RSL_IE_CHAN_NEEDED")) return RSL__IE__CHAN__NEEDED;
if (!strcmp(str_par, "RSL_IE_CB_CMD_TYPE")) return RSL__IE__CB__CMD__TYPE;
if (!strcmp(str_par, "RSL_IE_SMSCB_MSG")) return RSL__IE__SMSCB__MSG;
if (!strcmp(str_par, "RSL_IE_FULL_IMM_ASS_INFO")) return RSL__IE__FULL__IMM__ASS__INFO;
if (!strcmp(str_par, "RSL_IE_SACCH_INFO")) return RSL__IE__SACCH__INFO;
if (!strcmp(str_par, "RSL_IE_CBCH_LOAD_INFO")) return RSL__IE__CBCH__LOAD__INFO;
if (!strcmp(str_par, "RSL_IE_SMSCB_CHAN_INDICATOR")) return RSL__IE__SMSCB__CHAN__INDICATOR;
if (!strcmp(str_par, "RSL_IE_GROUP_CALL_REF")) return RSL__IE__GROUP__CALL__REF;
if (!strcmp(str_par, "RSL_IE_GROUP_CHAN_DESC")) return RSL__IE__GROUP__CHAN__DESC;
if (!strcmp(str_par, "RSL_IE_NCH_DRX_INFO")) return RSL__IE__NCH__DRX__INFO;
if (!strcmp(str_par, "RSL_IE_CMD_INDICATOR")) return RSL__IE__CMD__INDICATOR;
if (!strcmp(str_par, "RSL_IE_EMLPP_PRIO")) return RSL__IE__EMLPP__PRIO;
if (!strcmp(str_par, "RSL_IE_UIC")) return RSL__IE__UIC;
if (!strcmp(str_par, "RSL_IE_MAIN_CHAN_REF")) return RSL__IE__MAIN__CHAN__REF;
if (!strcmp(str_par, "RSL_IE_MR_CONFIG")) return RSL__IE__MR__CONFIG;
if (!strcmp(str_par, "RSL_IE_MR_CONTROL")) return RSL__IE__MR__CONTROL;
if (!strcmp(str_par, "RSL_IE_SUP_CODEC_TYPES")) return RSL__IE__SUP__CODEC__TYPES;
if (!strcmp(str_par, "RSL_IE_CODEC_CONFIG")) return RSL__IE__CODEC__CONFIG;
if (!strcmp(str_par, "RSL_IE_RTD")) return RSL__IE__RTD;
if (!strcmp(str_par, "RSL_IE_TFO_STATUS")) return RSL__IE__TFO__STATUS;
if (!strcmp(str_par, "RSL_IE_LLP_APDU")) return RSL__IE__LLP__APDU;
if (!strcmp(str_par, "RSL_IE_OSMO_REP_ACCH_CAP")) return RSL__IE__OSMO__REP__ACCH__CAP;
if (!strcmp(str_par, "RSL_IE_OSMO_TRAINING_SEQUENCE")) return RSL__IE__OSMO__TRAINING__SEQUENCE;
if (!strcmp(str_par, "RSL_IE_OSMO_TOP_ACCH_CAP")) return RSL__IE__OSMO__TOP__ACCH__CAP;
if (!strcmp(str_par, "RSL_IE_OSMO_OSMUX_CID")) return RSL__IE__OSMO__OSMUX__CID;
if (!strcmp(str_par, "RSL_IE_IPAC_SRTP_CONFIG")) return RSL__IE__IPAC__SRTP__CONFIG;
if (!strcmp(str_par, "RSL_IE_IPAC_PROXY_UDP")) return RSL__IE__IPAC__PROXY__UDP;
if (!strcmp(str_par, "RSL_IE_IPAC_BSCMPL_TOUT")) return RSL__IE__IPAC__BSCMPL__TOUT;
if (!strcmp(str_par, "RSL_IE_IPAC_REMOTE_IP")) return RSL__IE__IPAC__REMOTE__IP;
if (!strcmp(str_par, "RSL_IE_IPAC_REMOTE_PORT")) return RSL__IE__IPAC__REMOTE__PORT;
if (!strcmp(str_par, "RSL_IE_IPAC_RTP_PAYLOAD")) return RSL__IE__IPAC__RTP__PAYLOAD;
if (!strcmp(str_par, "RSL_IE_IPAC_LOCAL_PORT")) return RSL__IE__IPAC__LOCAL__PORT;
if (!strcmp(str_par, "RSL_IE_IPAC_SPEECH_MODE")) return RSL__IE__IPAC__SPEECH__MODE;
if (!strcmp(str_par, "RSL_IE_IPAC_LOCAL_IP")) return RSL__IE__IPAC__LOCAL__IP;
if (!strcmp(str_par, "RSL_IE_IPAC_CONN_STAT")) return RSL__IE__IPAC__CONN__STAT;
if (!strcmp(str_par, "RSL_IE_IPAC_HO_C_PARMS")) return RSL__IE__IPAC__HO__C__PARMS;
if (!strcmp(str_par, "RSL_IE_IPAC_CONN_ID")) return RSL__IE__IPAC__CONN__ID;
if (!strcmp(str_par, "RSL_IE_IPAC_RTP_CSD_FMT")) return RSL__IE__IPAC__RTP__CSD__FMT;
if (!strcmp(str_par, "RSL_IE_IPAC_RTP_JIT_BUF")) return RSL__IE__IPAC__RTP__JIT__BUF;
if (!strcmp(str_par, "RSL_IE_IPAC_RTP_COMPR")) return RSL__IE__IPAC__RTP__COMPR;
if (!strcmp(str_par, "RSL_IE_IPAC_RTP_PAYLOAD2")) return RSL__IE__IPAC__RTP__PAYLOAD2;
if (!strcmp(str_par, "RSL_IE_IPAC_RTP_MPLEX")) return RSL__IE__IPAC__RTP__MPLEX;
if (!strcmp(str_par, "RSL_IE_IPAC_RTP_MPLEX_ID")) return RSL__IE__IPAC__RTP__MPLEX__ID;
}
return UNKNOWN_VALUE;
}

boolean RSL__IE__Type::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
case 58:
case 59:
case 60:
case 96:
case 97:
case 98:
case 99:
case 224:
case 225:
case 226:
case 240:
case 241:
case 242:
case 243:
case 244:
case 245:
case 246:
case 247:
case 248:
case 249:
case 250:
case 251:
case 252:
case 253:
case 254:
return TRUE;
default:
return FALSE;
}
}

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

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

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

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

void RSL__IE__Type::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 RSL__IE__Type::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", "@RSL_Types.RSL_IE_Type");
  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 @RSL_Types.RSL_IE_Type.");
  }
}

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

void RSL__IE__Type::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 @RSL_Types.RSL_IE_Type.", enum_value);
}

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

int RSL__IE__Type::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 8, 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 RSL__IE__Type::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 8);
}

void RSL__IE__Type_template::copy_template(const RSL__IE__Type_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 RSL__IE__Type_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RSL__IE__Type_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__Type_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @RSL_Types.RSL_IE_Type.");
}
}

RSL__IE__Type_template::RSL__IE__Type_template()
{
}

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

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

RSL__IE__Type_template::RSL__IE__Type_template(RSL__IE__Type::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__IE__Type_template::match(RSL__IE__Type::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 @RSL_Types.RSL_IE_Type.");
}
return FALSE;
}

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

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

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

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

void RSL__IE__Type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__IE__Type::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 RSL__IE__Type_template::log_match(const RSL__IE__Type& 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 RSL__IE__Type_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 @RSL_Types.RSL_IE_Type.");
}
}

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

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

boolean RSL__IE__Type_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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 RSL__IE__Type_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: {
    RSL__IE__Type_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: {
    RSL__IE__Type::enum_type enum_val = RSL__IE__Type::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!RSL__IE__Type::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @RSL_Types.RSL_IE_Type.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__Type_template* precondition = new RSL__IE__Type_template;
    precondition->set_param(*m_p->get_elem(0));
    RSL__IE__Type_template* implied_template = new RSL__IE__Type_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RSL__IE__Type_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@RSL_Types.RSL_IE_Type");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__Type_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_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 : "@RSL_Types.RSL_IE_Type");
}

RSL__LV::RSL__LV()
{
}

RSL__LV::RSL__LV(const INTEGER& par_len,
    const OCTETSTRING& par_payload)
  :   field_len(par_len),
  field_payload(par_payload)
{
}

RSL__LV::RSL__LV(const RSL__LV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_LV.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.payload().is_bound()) field_payload = other_value.payload();
else field_payload.clean_up();
}

void RSL__LV::clean_up()
{
field_len.clean_up();
field_payload.clean_up();
}

const TTCN_Typedescriptor_t* RSL__LV::get_descriptor() const { return &RSL__LV_descr_; }
RSL__LV& RSL__LV::operator=(const RSL__LV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_LV.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.payload().is_bound()) field_payload = other_value.payload();
  else field_payload.clean_up();
}
return *this;
}

boolean RSL__LV::operator==(const RSL__LV& other_value) const
{
return field_len==other_value.field_len
  && field_payload==other_value.field_payload;
}

boolean RSL__LV::is_bound() const
{
return (field_len.is_bound())
  || (field_payload.is_bound());
}
boolean RSL__LV::is_value() const
{
return field_len.is_value()
  && field_payload.is_value();
}
void RSL__LV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", payload := ");
field_payload.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__LV::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
}

void RSL__LV::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 @RSL_Types.RSL_LV 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) len().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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 @RSL_Types.RSL_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_LV");
  }
}

void RSL__LV::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_payload.encode_text(text_buf);
}

void RSL__LV::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_payload.decode_text(text_buf);
}

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

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

struct RSL__LV_template::single_value_struct {
INTEGER_template field_len;
OCTETSTRING_template field_payload;
};

void RSL__LV_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_len = ANY_VALUE;
single_value->field_payload = ANY_VALUE;
}
}
}

void RSL__LV_template::copy_value(const RSL__LV& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.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 RSL__LV_template::copy_template(const RSL__LV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.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 RSL__LV_template[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 RSL__LV_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__LV_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 @RSL_Types.RSL_LV.");
break;
}
set_selection(other_value);
}

RSL__LV_template::RSL__LV_template()
{
}

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

RSL__LV_template::RSL__LV_template(const RSL__LV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__LV_template::match(const RSL__LV& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), 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 @RSL_Types.RSL_LV.");
}
return FALSE;
}

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

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

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

RSL__LV RSL__LV_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 @RSL_Types.RSL_LV.");
RSL__LV ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_payload.is_bound()) {
ret_val.payload() = single_value->field_payload.valueof();
}
return ret_val;
}

void RSL__LV_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 @RSL_Types.RSL_LV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__LV_template[list_length];
}

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

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

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

OCTETSTRING_template& RSL__LV_template::payload()
{
set_specific();
return single_value->field_payload;
}

const OCTETSTRING_template& RSL__LV_template::payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field payload of a non-specific template of type @RSL_Types.RSL_LV.");
return single_value->field_payload;
}

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

void RSL__LV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.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 RSL__LV_template::log_match(const RSL__LV& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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("{ len := ");
single_value->field_len.log_match(match_value.len(), 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 RSL__LV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
}

void RSL__LV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.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 @RSL_Types.RSL_LV.");
}
}

void RSL__LV_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_len.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 RSL__LV_template[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 @RSL_Types.RSL_LV.");
}
}

void RSL__LV_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: {
    RSL__LV_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 @RSL_Types.RSL_LV 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) len().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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 @RSL_Types.RSL_LV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__LV_template* precondition = new RSL__LV_template;
    precondition->set_param(*param.get_elem(0));
    RSL__LV_template* implied_template = new RSL__LV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__LV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_LV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__LV_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_LV");
single_value->field_payload.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_LV");
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 : "@RSL_Types.RSL_LV");
}

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

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

RSL__L16V::RSL__L16V()
{
}

RSL__L16V::RSL__L16V(const INTEGER& par_len,
    const OCTETSTRING& par_payload)
  :   field_len(par_len),
  field_payload(par_payload)
{
}

RSL__L16V::RSL__L16V(const RSL__L16V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_L16V.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.payload().is_bound()) field_payload = other_value.payload();
else field_payload.clean_up();
}

void RSL__L16V::clean_up()
{
field_len.clean_up();
field_payload.clean_up();
}

const TTCN_Typedescriptor_t* RSL__L16V::get_descriptor() const { return &RSL__L16V_descr_; }
RSL__L16V& RSL__L16V::operator=(const RSL__L16V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_L16V.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.payload().is_bound()) field_payload = other_value.payload();
  else field_payload.clean_up();
}
return *this;
}

boolean RSL__L16V::operator==(const RSL__L16V& other_value) const
{
return field_len==other_value.field_len
  && field_payload==other_value.field_payload;
}

boolean RSL__L16V::is_bound() const
{
return (field_len.is_bound())
  || (field_payload.is_bound());
}
boolean RSL__L16V::is_value() const
{
return field_len.is_value()
  && field_payload.is_value();
}
void RSL__L16V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", payload := ");
field_payload.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__L16V::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
}

void RSL__L16V::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 @RSL_Types.RSL_L16V 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) len().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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 @RSL_Types.RSL_L16V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_L16V");
  }
}

void RSL__L16V::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_payload.encode_text(text_buf);
}

void RSL__L16V::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_payload.decode_text(text_buf);
}

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

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

struct RSL__L16V_template::single_value_struct {
INTEGER_template field_len;
OCTETSTRING_template field_payload;
};

void RSL__L16V_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_len = ANY_VALUE;
single_value->field_payload = ANY_VALUE;
}
}
}

void RSL__L16V_template::copy_value(const RSL__L16V& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.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 RSL__L16V_template::copy_template(const RSL__L16V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.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 RSL__L16V_template[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 RSL__L16V_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__L16V_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 @RSL_Types.RSL_L16V.");
break;
}
set_selection(other_value);
}

RSL__L16V_template::RSL__L16V_template()
{
}

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

RSL__L16V_template::RSL__L16V_template(const RSL__L16V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__L16V_template::match(const RSL__L16V& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), 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 @RSL_Types.RSL_L16V.");
}
return FALSE;
}

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

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

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

RSL__L16V RSL__L16V_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 @RSL_Types.RSL_L16V.");
RSL__L16V ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_payload.is_bound()) {
ret_val.payload() = single_value->field_payload.valueof();
}
return ret_val;
}

void RSL__L16V_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 @RSL_Types.RSL_L16V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__L16V_template[list_length];
}

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

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

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

OCTETSTRING_template& RSL__L16V_template::payload()
{
set_specific();
return single_value->field_payload;
}

const OCTETSTRING_template& RSL__L16V_template::payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field payload of a non-specific template of type @RSL_Types.RSL_L16V.");
return single_value->field_payload;
}

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

void RSL__L16V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.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 RSL__L16V_template::log_match(const RSL__L16V& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_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("{ len := ");
single_value->field_len.log_match(match_value.len(), 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 RSL__L16V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
}

void RSL__L16V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.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 @RSL_Types.RSL_L16V.");
}
}

void RSL__L16V_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_len.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 RSL__L16V_template[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 @RSL_Types.RSL_L16V.");
}
}

void RSL__L16V_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: {
    RSL__L16V_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 @RSL_Types.RSL_L16V 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) len().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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 @RSL_Types.RSL_L16V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__L16V_template* precondition = new RSL__L16V_template;
    precondition->set_param(*param.get_elem(0));
    RSL__L16V_template* implied_template = new RSL__L16V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__L16V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_L16V");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__L16V_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_L16V");
single_value->field_payload.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_L16V");
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 : "@RSL_Types.RSL_L16V");
}

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

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

RSL__IE__V::RSL__IE__V()
{
}

RSL__IE__V::RSL__IE__V(const INTEGER& par_val)
  :   field_val(par_val)
{
}

RSL__IE__V::RSL__IE__V(const RSL__IE__V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_V.");
if (other_value.val().is_bound()) field_val = other_value.val();
else field_val.clean_up();
}

void RSL__IE__V::clean_up()
{
field_val.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__V::get_descriptor() const { return &RSL__IE__V_descr_; }
RSL__IE__V& RSL__IE__V::operator=(const RSL__IE__V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_V.");
  if (other_value.val().is_bound()) field_val = other_value.val();
  else field_val.clean_up();
}
return *this;
}

boolean RSL__IE__V::operator==(const RSL__IE__V& other_value) const
{
return field_val==other_value.field_val;
}

boolean RSL__IE__V::is_bound() const
{
return (field_val.is_bound());
}
boolean RSL__IE__V::is_value() const
{
return field_val.is_value();
}
void RSL__IE__V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ val := ");
field_val.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__V::set_implicit_omit()
{
if (val().is_bound()) val().set_implicit_omit();
}

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

void RSL__IE__V::encode_text(Text_Buf& text_buf) const
{
field_val.encode_text(text_buf);
}

void RSL__IE__V::decode_text(Text_Buf& text_buf)
{
field_val.decode_text(text_buf);
}

void RSL__IE__V::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 RSL__IE__V::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 RSL__IE__V::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, RSL__IE__V_val_descr_.raw->forceomit);
  decoded_field_length = field_val.RAW_decode(RSL__IE__V_val_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 RSL__IE__V::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, RSL__IE__V_val_descr_.raw);
  encoded_length += field_val.RAW_encode(RSL__IE__V_val_descr_, *myleaf.body.node.nodes[0]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__V_template::single_value_struct {
INTEGER_template field_val;
};

void RSL__IE__V_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_val = ANY_VALUE;
}
}
}

void RSL__IE__V_template::copy_value(const RSL__IE__V& other_value)
{
single_value = new single_value_struct;
if (other_value.val().is_bound()) {
  single_value->field_val = other_value.val();
} else {
  single_value->field_val.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__V_template::copy_template(const RSL__IE__V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.val().get_selection()) {
single_value->field_val = other_value.val();
} else {
single_value->field_val.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 RSL__IE__V_template[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 RSL__IE__V_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__V_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 @RSL_Types.RSL_IE_V.");
break;
}
set_selection(other_value);
}

RSL__IE__V_template::RSL__IE__V_template()
{
}

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

RSL__IE__V_template::RSL__IE__V_template(const RSL__IE__V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__V_template::match(const RSL__IE__V& 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.val().is_bound()) return FALSE;
if(!single_value->field_val.match(other_value.val(), 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 @RSL_Types.RSL_IE_V.");
}
return FALSE;
}

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

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

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

RSL__IE__V RSL__IE__V_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 @RSL_Types.RSL_IE_V.");
RSL__IE__V ret_val;
if (single_value->field_val.is_bound()) {
ret_val.val() = single_value->field_val.valueof();
}
return ret_val;
}

void RSL__IE__V_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 @RSL_Types.RSL_IE_V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__V_template[list_length];
}

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

INTEGER_template& RSL__IE__V_template::val()
{
set_specific();
return single_value->field_val;
}

const INTEGER_template& RSL__IE__V_template::val() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field val of a non-specific template of type @RSL_Types.RSL_IE_V.");
return single_value->field_val;
}

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

void RSL__IE__V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ val := ");
single_value->field_val.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 RSL__IE__V_template::log_match(const RSL__IE__V& 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_val.match(match_value.val(), legacy)){
TTCN_Logger::log_logmatch_info(".val");
single_value->field_val.log_match(match_value.val(), 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("{ val := ");
single_value->field_val.log_match(match_value.val(), 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 RSL__IE__V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (val().is_bound()) val().set_implicit_omit();
}

void RSL__IE__V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_val.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 @RSL_Types.RSL_IE_V.");
}
}

void RSL__IE__V_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_val.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 RSL__IE__V_template[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 @RSL_Types.RSL_IE_V.");
}
}

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

void RSL__IE__V_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_val.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_V");
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 : "@RSL_Types.RSL_IE_V");
}

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

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

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

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

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

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

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

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

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

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

boolean RSL__ActivationAbits::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 @RSL_Types.RSL_ActivationAbits.");
return enum_value == other_value;
}

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

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

boolean RSL__ActivationAbits::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 @RSL_Types.RSL_ActivationAbits.");
return enum_value < other_value;
}

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

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

boolean RSL__ActivationAbits::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 @RSL_Types.RSL_ActivationAbits.");
return enum_value > other_value;
}

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

const char *RSL__ActivationAbits::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case ACT__REL__TO__IMM__ASSIGN: return "ACT_REL_TO_IMM_ASSIGN";
case ACT__REL__TO__NORM__ASSIGN: return "ACT_REL_TO_NORM_ASSIGN";
case ACT__REL__TO__ASYNC__HANDOVER: return "ACT_REL_TO_ASYNC_HANDOVER";
case ACT__REL__TO__SYNC__HANDOVER: return "ACT_REL_TO_SYNC_HANDOVER";
case ACT__REL__TO__ADDL__ASSIGN: return "ACT_REL_TO_ADDL_ASSIGN";
case ACT__REL__TO__MSLOT__CONFIG: return "ACT_REL_TO_MSLOT_CONFIG";
case ACT__REL__TO__OSMO__PDCH: return "ACT_REL_TO_OSMO_PDCH";
default:
return "<unknown>";
}
}

RSL__ActivationAbits::enum_type RSL__ActivationAbits::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, "ACT_REL_TO_IMM_ASSIGN")) return ACT__REL__TO__IMM__ASSIGN;
if (!strcmp(str_par, "ACT_REL_TO_NORM_ASSIGN")) return ACT__REL__TO__NORM__ASSIGN;
if (!strcmp(str_par, "ACT_REL_TO_ASYNC_HANDOVER")) return ACT__REL__TO__ASYNC__HANDOVER;
if (!strcmp(str_par, "ACT_REL_TO_SYNC_HANDOVER")) return ACT__REL__TO__SYNC__HANDOVER;
if (!strcmp(str_par, "ACT_REL_TO_ADDL_ASSIGN")) return ACT__REL__TO__ADDL__ASSIGN;
if (!strcmp(str_par, "ACT_REL_TO_MSLOT_CONFIG")) return ACT__REL__TO__MSLOT__CONFIG;
if (!strcmp(str_par, "ACT_REL_TO_OSMO_PDCH")) return ACT__REL__TO__OSMO__PDCH;
}
return UNKNOWN_VALUE;
}

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

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

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

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

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

void RSL__ActivationAbits::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 RSL__ActivationAbits::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", "@RSL_Types.RSL_ActivationAbits");
  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 @RSL_Types.RSL_ActivationAbits.");
  }
}

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

void RSL__ActivationAbits::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 @RSL_Types.RSL_ActivationAbits.", enum_value);
}

void RSL__ActivationAbits::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 RSL__ActivationAbits::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 RSL__ActivationAbits::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 RSL__ActivationAbits::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 RSL__ActivationAbits_template::copy_template(const RSL__ActivationAbits_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 RSL__ActivationAbits_template[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 RSL__ActivationAbits_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__ActivationAbits_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 @RSL_Types.RSL_ActivationAbits.");
}
}

RSL__ActivationAbits_template::RSL__ActivationAbits_template()
{
}

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

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

RSL__ActivationAbits_template::RSL__ActivationAbits_template(RSL__ActivationAbits::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__ActivationAbits_template::match(RSL__ActivationAbits::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 @RSL_Types.RSL_ActivationAbits.");
}
return FALSE;
}

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

RSL__ActivationAbits::enum_type RSL__ActivationAbits_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 @RSL_Types.RSL_ActivationAbits.");
return single_value;
}

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

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

void RSL__ActivationAbits_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__ActivationAbits::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 RSL__ActivationAbits_template::log_match(const RSL__ActivationAbits& 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 RSL__ActivationAbits_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 @RSL_Types.RSL_ActivationAbits.");
}
}

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

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

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

void RSL__ActivationAbits_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 : "@RSL_Types.RSL_ActivationAbits");
}

RSL__IE__ActivationType::RSL__IE__ActivationType()
{
}

RSL__IE__ActivationType::RSL__IE__ActivationType(const BOOLEAN& par_reactivation,
    const INTEGER& par_reserved,
    const RSL__ActivationAbits& par_a__bits)
  :   field_reactivation(par_reactivation),
  field_reserved(par_reserved),
  field_a__bits(par_a__bits)
{
}

RSL__IE__ActivationType::RSL__IE__ActivationType(const RSL__IE__ActivationType& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_ActivationType.");
if (other_value.reactivation().is_bound()) field_reactivation = other_value.reactivation();
else field_reactivation.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.a__bits().is_bound()) field_a__bits = other_value.a__bits();
else field_a__bits.clean_up();
}

void RSL__IE__ActivationType::clean_up()
{
field_reactivation.clean_up();
field_reserved.clean_up();
field_a__bits.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__ActivationType::get_descriptor() const { return &RSL__IE__ActivationType_descr_; }
RSL__IE__ActivationType& RSL__IE__ActivationType::operator=(const RSL__IE__ActivationType& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_ActivationType.");
  if (other_value.reactivation().is_bound()) field_reactivation = other_value.reactivation();
  else field_reactivation.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.a__bits().is_bound()) field_a__bits = other_value.a__bits();
  else field_a__bits.clean_up();
}
return *this;
}

boolean RSL__IE__ActivationType::operator==(const RSL__IE__ActivationType& other_value) const
{
return field_reactivation==other_value.field_reactivation
  && field_reserved==other_value.field_reserved
  && field_a__bits==other_value.field_a__bits;
}

boolean RSL__IE__ActivationType::is_bound() const
{
return (field_reactivation.is_bound())
  || (field_reserved.is_bound())
  || (field_a__bits.is_bound());
}
boolean RSL__IE__ActivationType::is_value() const
{
return field_reactivation.is_value()
  && field_reserved.is_value()
  && field_a__bits.is_value();
}
void RSL__IE__ActivationType::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ reactivation := ");
field_reactivation.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", a_bits := ");
field_a__bits.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__ActivationType::set_implicit_omit()
{
if (reactivation().is_bound()) reactivation().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (a__bits().is_bound()) a__bits().set_implicit_omit();
}

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

void RSL__IE__ActivationType::encode_text(Text_Buf& text_buf) const
{
field_reactivation.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_a__bits.encode_text(text_buf);
}

void RSL__IE__ActivationType::decode_text(Text_Buf& text_buf)
{
field_reactivation.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_a__bits.decode_text(text_buf);
}

void RSL__IE__ActivationType::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 RSL__IE__ActivationType::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 RSL__IE__ActivationType::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, RSL__IE__ActivationType_reactivation_descr_.raw->forceomit);
  decoded_field_length = field_reactivation.RAW_decode(RSL__IE__ActivationType_reactivation_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, RSL__IE__ActivationType_reserved_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(RSL__IE__ActivationType_reserved_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, RSL__IE__ActivationType_a__bits_descr_.raw->forceomit);
  decoded_field_length = field_a__bits.RAW_decode(RSL__IE__ActivationType_a__bits_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 RSL__IE__ActivationType::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, RSL__IE__ActivationType_reactivation_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__ActivationType_reserved_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__ActivationType_a__bits_descr_.raw);
  encoded_length += field_reactivation.RAW_encode(RSL__IE__ActivationType_reactivation_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_reserved.RAW_encode(RSL__IE__ActivationType_reserved_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_a__bits.RAW_encode(RSL__IE__ActivationType_a__bits_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__ActivationType_template::single_value_struct {
BOOLEAN_template field_reactivation;
INTEGER_template field_reserved;
RSL__ActivationAbits_template field_a__bits;
};

void RSL__IE__ActivationType_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_reactivation = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_a__bits = ANY_VALUE;
}
}
}

void RSL__IE__ActivationType_template::copy_value(const RSL__IE__ActivationType& other_value)
{
single_value = new single_value_struct;
if (other_value.reactivation().is_bound()) {
  single_value->field_reactivation = other_value.reactivation();
} else {
  single_value->field_reactivation.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.a__bits().is_bound()) {
  single_value->field_a__bits = other_value.a__bits();
} else {
  single_value->field_a__bits.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__ActivationType_template::copy_template(const RSL__IE__ActivationType_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.reactivation().get_selection()) {
single_value->field_reactivation = other_value.reactivation();
} else {
single_value->field_reactivation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.a__bits().get_selection()) {
single_value->field_a__bits = other_value.a__bits();
} else {
single_value->field_a__bits.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 RSL__IE__ActivationType_template[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 RSL__IE__ActivationType_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__ActivationType_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 @RSL_Types.RSL_IE_ActivationType.");
break;
}
set_selection(other_value);
}

RSL__IE__ActivationType_template::RSL__IE__ActivationType_template()
{
}

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

RSL__IE__ActivationType_template::RSL__IE__ActivationType_template(const RSL__IE__ActivationType& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__ActivationType_template::match(const RSL__IE__ActivationType& 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.reactivation().is_bound()) return FALSE;
if(!single_value->field_reactivation.match(other_value.reactivation(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.a__bits().is_bound()) return FALSE;
if(!single_value->field_a__bits.match(other_value.a__bits(), 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 @RSL_Types.RSL_IE_ActivationType.");
}
return FALSE;
}

boolean RSL__IE__ActivationType_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_reactivation.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_a__bits.is_bound();
}

boolean RSL__IE__ActivationType_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_reactivation.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_a__bits.is_value();
}

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

RSL__IE__ActivationType RSL__IE__ActivationType_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 @RSL_Types.RSL_IE_ActivationType.");
RSL__IE__ActivationType ret_val;
if (single_value->field_reactivation.is_bound()) {
ret_val.reactivation() = single_value->field_reactivation.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_a__bits.is_bound()) {
ret_val.a__bits() = single_value->field_a__bits.valueof();
}
return ret_val;
}

void RSL__IE__ActivationType_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 @RSL_Types.RSL_IE_ActivationType.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__ActivationType_template[list_length];
}

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

BOOLEAN_template& RSL__IE__ActivationType_template::reactivation()
{
set_specific();
return single_value->field_reactivation;
}

const BOOLEAN_template& RSL__IE__ActivationType_template::reactivation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reactivation of a non-specific template of type @RSL_Types.RSL_IE_ActivationType.");
return single_value->field_reactivation;
}

INTEGER_template& RSL__IE__ActivationType_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const INTEGER_template& RSL__IE__ActivationType_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @RSL_Types.RSL_IE_ActivationType.");
return single_value->field_reserved;
}

RSL__ActivationAbits_template& RSL__IE__ActivationType_template::a__bits()
{
set_specific();
return single_value->field_a__bits;
}

const RSL__ActivationAbits_template& RSL__IE__ActivationType_template::a__bits() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field a_bits of a non-specific template of type @RSL_Types.RSL_IE_ActivationType.");
return single_value->field_a__bits;
}

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

void RSL__IE__ActivationType_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ reactivation := ");
single_value->field_reactivation.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", a_bits := ");
single_value->field_a__bits.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 RSL__IE__ActivationType_template::log_match(const RSL__IE__ActivationType& 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_reactivation.match(match_value.reactivation(), legacy)){
TTCN_Logger::log_logmatch_info(".reactivation");
single_value->field_reactivation.log_match(match_value.reactivation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_a__bits.match(match_value.a__bits(), legacy)){
TTCN_Logger::log_logmatch_info(".a_bits");
single_value->field_a__bits.log_match(match_value.a__bits(), 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("{ reactivation := ");
single_value->field_reactivation.log_match(match_value.reactivation(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", a_bits := ");
single_value->field_a__bits.log_match(match_value.a__bits(), 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 RSL__IE__ActivationType_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (reactivation().is_bound()) reactivation().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (a__bits().is_bound()) a__bits().set_implicit_omit();
}

void RSL__IE__ActivationType_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_reactivation.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_a__bits.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 @RSL_Types.RSL_IE_ActivationType.");
}
}

void RSL__IE__ActivationType_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_reactivation.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_a__bits.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 RSL__IE__ActivationType_template[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 @RSL_Types.RSL_IE_ActivationType.");
}
}

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

void RSL__IE__ActivationType_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_reactivation.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ActivationType");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ActivationType");
single_value->field_a__bits.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ActivationType");
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 : "@RSL_Types.RSL_IE_ActivationType");
}

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

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

RSL__IE__ChannelIdent::RSL__IE__ChannelIdent()
{
}

RSL__IE__ChannelIdent::RSL__IE__ChannelIdent(const INTEGER& par_len,
    const GSM__RR__Types::ChannelDescriptionTV& par_ch__desc,
    const GSM__RR__Types::MobileAllocationTLV& par_ma)
  :   field_len(par_len),
  field_ch__desc(par_ch__desc),
  field_ma(par_ma)
{
}

RSL__IE__ChannelIdent::RSL__IE__ChannelIdent(const RSL__IE__ChannelIdent& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_ChannelIdent.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.ch__desc().is_bound()) field_ch__desc = other_value.ch__desc();
else field_ch__desc.clean_up();
if (other_value.ma().is_bound()) field_ma = other_value.ma();
else field_ma.clean_up();
}

void RSL__IE__ChannelIdent::clean_up()
{
field_len.clean_up();
field_ch__desc.clean_up();
field_ma.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__ChannelIdent::get_descriptor() const { return &RSL__IE__ChannelIdent_descr_; }
RSL__IE__ChannelIdent& RSL__IE__ChannelIdent::operator=(const RSL__IE__ChannelIdent& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_ChannelIdent.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.ch__desc().is_bound()) field_ch__desc = other_value.ch__desc();
  else field_ch__desc.clean_up();
  if (other_value.ma().is_bound()) field_ma = other_value.ma();
  else field_ma.clean_up();
}
return *this;
}

boolean RSL__IE__ChannelIdent::operator==(const RSL__IE__ChannelIdent& other_value) const
{
return field_len==other_value.field_len
  && field_ch__desc==other_value.field_ch__desc
  && field_ma==other_value.field_ma;
}

boolean RSL__IE__ChannelIdent::is_bound() const
{
return (field_len.is_bound())
  || (field_ch__desc.is_bound())
  || (field_ma.is_bound());
}
boolean RSL__IE__ChannelIdent::is_value() const
{
return field_len.is_value()
  && field_ch__desc.is_value()
  && field_ma.is_value();
}
void RSL__IE__ChannelIdent::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", ch_desc := ");
field_ch__desc.log();
TTCN_Logger::log_event_str(", ma := ");
field_ma.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__ChannelIdent::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (ch__desc().is_bound()) ch__desc().set_implicit_omit();
if (ma().is_bound()) ma().set_implicit_omit();
}

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

void RSL__IE__ChannelIdent::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_ch__desc.encode_text(text_buf);
field_ma.encode_text(text_buf);
}

void RSL__IE__ChannelIdent::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_ch__desc.decode_text(text_buf);
field_ma.decode_text(text_buf);
}

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

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

struct RSL__IE__ChannelIdent_template::single_value_struct {
INTEGER_template field_len;
GSM__RR__Types::ChannelDescriptionTV_template field_ch__desc;
GSM__RR__Types::MobileAllocationTLV_template field_ma;
};

void RSL__IE__ChannelIdent_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_len = ANY_VALUE;
single_value->field_ch__desc = ANY_VALUE;
single_value->field_ma = ANY_VALUE;
}
}
}

void RSL__IE__ChannelIdent_template::copy_value(const RSL__IE__ChannelIdent& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.ch__desc().is_bound()) {
  single_value->field_ch__desc = other_value.ch__desc();
} else {
  single_value->field_ch__desc.clean_up();
}
if (other_value.ma().is_bound()) {
  single_value->field_ma = other_value.ma();
} else {
  single_value->field_ma.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__ChannelIdent_template::copy_template(const RSL__IE__ChannelIdent_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ch__desc().get_selection()) {
single_value->field_ch__desc = other_value.ch__desc();
} else {
single_value->field_ch__desc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ma().get_selection()) {
single_value->field_ma = other_value.ma();
} else {
single_value->field_ma.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 RSL__IE__ChannelIdent_template[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 RSL__IE__ChannelIdent_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__ChannelIdent_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 @RSL_Types.RSL_IE_ChannelIdent.");
break;
}
set_selection(other_value);
}

RSL__IE__ChannelIdent_template::RSL__IE__ChannelIdent_template()
{
}

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

RSL__IE__ChannelIdent_template::RSL__IE__ChannelIdent_template(const RSL__IE__ChannelIdent& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__ChannelIdent_template::match(const RSL__IE__ChannelIdent& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.ch__desc().is_bound()) return FALSE;
if(!single_value->field_ch__desc.match(other_value.ch__desc(), legacy))return FALSE;
if(!other_value.ma().is_bound()) return FALSE;
if(!single_value->field_ma.match(other_value.ma(), 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 @RSL_Types.RSL_IE_ChannelIdent.");
}
return FALSE;
}

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

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

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

RSL__IE__ChannelIdent RSL__IE__ChannelIdent_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 @RSL_Types.RSL_IE_ChannelIdent.");
RSL__IE__ChannelIdent ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_ch__desc.is_bound()) {
ret_val.ch__desc() = single_value->field_ch__desc.valueof();
}
if (single_value->field_ma.is_bound()) {
ret_val.ma() = single_value->field_ma.valueof();
}
return ret_val;
}

void RSL__IE__ChannelIdent_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 @RSL_Types.RSL_IE_ChannelIdent.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__ChannelIdent_template[list_length];
}

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

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

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

GSM__RR__Types::ChannelDescriptionTV_template& RSL__IE__ChannelIdent_template::ch__desc()
{
set_specific();
return single_value->field_ch__desc;
}

const GSM__RR__Types::ChannelDescriptionTV_template& RSL__IE__ChannelIdent_template::ch__desc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ch_desc of a non-specific template of type @RSL_Types.RSL_IE_ChannelIdent.");
return single_value->field_ch__desc;
}

GSM__RR__Types::MobileAllocationTLV_template& RSL__IE__ChannelIdent_template::ma()
{
set_specific();
return single_value->field_ma;
}

const GSM__RR__Types::MobileAllocationTLV_template& RSL__IE__ChannelIdent_template::ma() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ma of a non-specific template of type @RSL_Types.RSL_IE_ChannelIdent.");
return single_value->field_ma;
}

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

void RSL__IE__ChannelIdent_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", ch_desc := ");
single_value->field_ch__desc.log();
TTCN_Logger::log_event_str(", ma := ");
single_value->field_ma.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 RSL__IE__ChannelIdent_template::log_match(const RSL__IE__ChannelIdent& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ch__desc.match(match_value.ch__desc(), legacy)){
TTCN_Logger::log_logmatch_info(".ch_desc");
single_value->field_ch__desc.log_match(match_value.ch__desc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ma.match(match_value.ma(), legacy)){
TTCN_Logger::log_logmatch_info(".ma");
single_value->field_ma.log_match(match_value.ma(), 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("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", ch_desc := ");
single_value->field_ch__desc.log_match(match_value.ch__desc(), legacy);
TTCN_Logger::log_event_str(", ma := ");
single_value->field_ma.log_match(match_value.ma(), 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 RSL__IE__ChannelIdent_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (ch__desc().is_bound()) ch__desc().set_implicit_omit();
if (ma().is_bound()) ma().set_implicit_omit();
}

void RSL__IE__ChannelIdent_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.encode_text(text_buf);
single_value->field_ch__desc.encode_text(text_buf);
single_value->field_ma.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 @RSL_Types.RSL_IE_ChannelIdent.");
}
}

void RSL__IE__ChannelIdent_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_len.decode_text(text_buf);
single_value->field_ch__desc.decode_text(text_buf);
single_value->field_ma.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 RSL__IE__ChannelIdent_template[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 @RSL_Types.RSL_IE_ChannelIdent.");
}
}

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

void RSL__IE__ChannelIdent_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelIdent");
single_value->field_ch__desc.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelIdent");
single_value->field_ma.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelIdent");
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 : "@RSL_Types.RSL_IE_ChannelIdent");
}

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

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

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

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

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

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

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

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

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

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

boolean RSL__SpeechDataInd::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 @RSL_Types.RSL_SpeechDataInd.");
return enum_value == other_value;
}

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

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

boolean RSL__SpeechDataInd::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 @RSL_Types.RSL_SpeechDataInd.");
return enum_value < other_value;
}

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

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

boolean RSL__SpeechDataInd::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 @RSL_Types.RSL_SpeechDataInd.");
return enum_value > other_value;
}

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

const char *RSL__SpeechDataInd::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__SPDI__SPEECH: return "RSL_SPDI_SPEECH";
case RSL__SPDI__DATA: return "RSL_SPDI_DATA";
case RSL__SPDI__SIGN: return "RSL_SPDI_SIGN";
default:
return "<unknown>";
}
}

RSL__SpeechDataInd::enum_type RSL__SpeechDataInd::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, "RSL_SPDI_SPEECH")) return RSL__SPDI__SPEECH;
if (!strcmp(str_par, "RSL_SPDI_DATA")) return RSL__SPDI__DATA;
if (!strcmp(str_par, "RSL_SPDI_SIGN")) return RSL__SPDI__SIGN;
}
return UNKNOWN_VALUE;
}

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

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

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

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

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

void RSL__SpeechDataInd::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 RSL__SpeechDataInd::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", "@RSL_Types.RSL_SpeechDataInd");
  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 @RSL_Types.RSL_SpeechDataInd.");
  }
}

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

void RSL__SpeechDataInd::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 @RSL_Types.RSL_SpeechDataInd.", enum_value);
}

void RSL__SpeechDataInd::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 RSL__SpeechDataInd::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 RSL__SpeechDataInd::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 RSL__SpeechDataInd::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 RSL__SpeechDataInd_template::copy_template(const RSL__SpeechDataInd_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 RSL__SpeechDataInd_template[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 RSL__SpeechDataInd_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__SpeechDataInd_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 @RSL_Types.RSL_SpeechDataInd.");
}
}

RSL__SpeechDataInd_template::RSL__SpeechDataInd_template()
{
}

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

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

RSL__SpeechDataInd_template::RSL__SpeechDataInd_template(RSL__SpeechDataInd::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__SpeechDataInd_template::match(RSL__SpeechDataInd::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 @RSL_Types.RSL_SpeechDataInd.");
}
return FALSE;
}

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

RSL__SpeechDataInd::enum_type RSL__SpeechDataInd_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 @RSL_Types.RSL_SpeechDataInd.");
return single_value;
}

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

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

void RSL__SpeechDataInd_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__SpeechDataInd::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 RSL__SpeechDataInd_template::log_match(const RSL__SpeechDataInd& 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 RSL__SpeechDataInd_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 @RSL_Types.RSL_SpeechDataInd.");
}
}

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

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

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

void RSL__SpeechDataInd_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 : "@RSL_Types.RSL_SpeechDataInd");
}

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

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

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

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

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

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

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

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

boolean RSL__ChanRateType::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 @RSL_Types.RSL_ChanRateType.");
return enum_value == other_value;
}

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

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

boolean RSL__ChanRateType::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 @RSL_Types.RSL_ChanRateType.");
return enum_value < other_value;
}

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

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

boolean RSL__ChanRateType::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 @RSL_Types.RSL_ChanRateType.");
return enum_value > other_value;
}

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

const char *RSL__ChanRateType::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__CHRT__SDCCH: return "RSL_CHRT_SDCCH";
case RSL__CHRT__TCH__F: return "RSL_CHRT_TCH_F";
case RSL__CHRT__TCH__H: return "RSL_CHRT_TCH_H";
case RSL__CHRT__TCH__F__BD__MSLOT: return "RSL_CHRT_TCH_F_BD_MSLOT";
case RSL__CHRT__TCH__F__DL__MSLOT: return "RSL_CHRT_TCH_F_DL_MSLOT";
case RSL__CHRT__TCH__F__GROUP: return "RSL_CHRT_TCH_F_GROUP";
case RSL__CHRT__TCH__H__GROUP: return "RSL_CHRT_TCH_H_GROUP";
case RSL__CHRT__TCH__F__BCAST: return "RSL_CHRT_TCH_F_BCAST";
case RSL__CHRT__TCH__H__BCAST: return "RSL_CHRT_TCH_H_BCAST";
case RSL__CHRT__OSMO__TCH__F__VAMOS: return "RSL_CHRT_OSMO_TCH_F_VAMOS";
case RSL__CHRT__OSMO__TCH__H__VAMOS: return "RSL_CHRT_OSMO_TCH_H_VAMOS";
default:
return "<unknown>";
}
}

RSL__ChanRateType::enum_type RSL__ChanRateType::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, "RSL_CHRT_SDCCH")) return RSL__CHRT__SDCCH;
if (!strcmp(str_par, "RSL_CHRT_TCH_F")) return RSL__CHRT__TCH__F;
if (!strcmp(str_par, "RSL_CHRT_TCH_H")) return RSL__CHRT__TCH__H;
if (!strcmp(str_par, "RSL_CHRT_TCH_F_BD_MSLOT")) return RSL__CHRT__TCH__F__BD__MSLOT;
if (!strcmp(str_par, "RSL_CHRT_TCH_F_DL_MSLOT")) return RSL__CHRT__TCH__F__DL__MSLOT;
if (!strcmp(str_par, "RSL_CHRT_TCH_F_GROUP")) return RSL__CHRT__TCH__F__GROUP;
if (!strcmp(str_par, "RSL_CHRT_TCH_H_GROUP")) return RSL__CHRT__TCH__H__GROUP;
if (!strcmp(str_par, "RSL_CHRT_TCH_F_BCAST")) return RSL__CHRT__TCH__F__BCAST;
if (!strcmp(str_par, "RSL_CHRT_TCH_H_BCAST")) return RSL__CHRT__TCH__H__BCAST;
if (!strcmp(str_par, "RSL_CHRT_OSMO_TCH_F_VAMOS")) return RSL__CHRT__OSMO__TCH__F__VAMOS;
if (!strcmp(str_par, "RSL_CHRT_OSMO_TCH_H_VAMOS")) return RSL__CHRT__OSMO__TCH__H__VAMOS;
}
return UNKNOWN_VALUE;
}

boolean RSL__ChanRateType::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 8:
case 9:
case 10:
case 26:
case 24:
case 25:
case 40:
case 41:
case 136:
case 137:
return TRUE;
default:
return FALSE;
}
}

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

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

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

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

void RSL__ChanRateType::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 RSL__ChanRateType::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", "@RSL_Types.RSL_ChanRateType");
  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 @RSL_Types.RSL_ChanRateType.");
  }
}

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

void RSL__ChanRateType::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 @RSL_Types.RSL_ChanRateType.", enum_value);
}

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

void RSL__ChanRateType_template::copy_template(const RSL__ChanRateType_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 RSL__ChanRateType_template[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 RSL__ChanRateType_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__ChanRateType_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 @RSL_Types.RSL_ChanRateType.");
}
}

RSL__ChanRateType_template::RSL__ChanRateType_template()
{
}

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

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

RSL__ChanRateType_template::RSL__ChanRateType_template(RSL__ChanRateType::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__ChanRateType_template::match(RSL__ChanRateType::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 @RSL_Types.RSL_ChanRateType.");
}
return FALSE;
}

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

RSL__ChanRateType::enum_type RSL__ChanRateType_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 @RSL_Types.RSL_ChanRateType.");
return single_value;
}

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

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

void RSL__ChanRateType_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__ChanRateType::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 RSL__ChanRateType_template::log_match(const RSL__ChanRateType& 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 RSL__ChanRateType_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 @RSL_Types.RSL_ChanRateType.");
}
}

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

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

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

void RSL__ChanRateType_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 : "@RSL_Types.RSL_ChanRateType");
}

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

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

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

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

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

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

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

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

boolean RSL__ChanModeOct6Signalling::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 @RSL_Types.RSL_ChanModeOct6Signalling.");
return enum_value == other_value;
}

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

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

boolean RSL__ChanModeOct6Signalling::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 @RSL_Types.RSL_ChanModeOct6Signalling.");
return enum_value < other_value;
}

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

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

boolean RSL__ChanModeOct6Signalling::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 @RSL_Types.RSL_ChanModeOct6Signalling.");
return enum_value > other_value;
}

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

const char *RSL__ChanModeOct6Signalling::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__CMOD__NO__RESOURCE: return "RSL_CMOD_NO_RESOURCE";
default:
return "<unknown>";
}
}

RSL__ChanModeOct6Signalling::enum_type RSL__ChanModeOct6Signalling::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, "RSL_CMOD_NO_RESOURCE")) return RSL__CMOD__NO__RESOURCE;
}
return UNKNOWN_VALUE;
}

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

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

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

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

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

void RSL__ChanModeOct6Signalling::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 RSL__ChanModeOct6Signalling::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", "@RSL_Types.RSL_ChanModeOct6Signalling");
  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 @RSL_Types.RSL_ChanModeOct6Signalling.");
  }
}

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

void RSL__ChanModeOct6Signalling::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 @RSL_Types.RSL_ChanModeOct6Signalling.", enum_value);
}

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

void RSL__ChanModeOct6Signalling_template::copy_template(const RSL__ChanModeOct6Signalling_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 RSL__ChanModeOct6Signalling_template[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 RSL__ChanModeOct6Signalling_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__ChanModeOct6Signalling_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 @RSL_Types.RSL_ChanModeOct6Signalling.");
}
}

RSL__ChanModeOct6Signalling_template::RSL__ChanModeOct6Signalling_template()
{
}

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

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

RSL__ChanModeOct6Signalling_template::RSL__ChanModeOct6Signalling_template(RSL__ChanModeOct6Signalling::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__ChanModeOct6Signalling_template::match(RSL__ChanModeOct6Signalling::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 @RSL_Types.RSL_ChanModeOct6Signalling.");
}
return FALSE;
}

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

RSL__ChanModeOct6Signalling::enum_type RSL__ChanModeOct6Signalling_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 @RSL_Types.RSL_ChanModeOct6Signalling.");
return single_value;
}

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

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

void RSL__ChanModeOct6Signalling_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__ChanModeOct6Signalling::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 RSL__ChanModeOct6Signalling_template::log_match(const RSL__ChanModeOct6Signalling& 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 RSL__ChanModeOct6Signalling_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 @RSL_Types.RSL_ChanModeOct6Signalling.");
}
}

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

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

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

void RSL__ChanModeOct6Signalling_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 : "@RSL_Types.RSL_ChanModeOct6Signalling");
}

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

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

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

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

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

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

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

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

boolean RSL__ChanModeOct6SpeechAlgo::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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
return enum_value == other_value;
}

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

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

boolean RSL__ChanModeOct6SpeechAlgo::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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
return enum_value < other_value;
}

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

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

boolean RSL__ChanModeOct6SpeechAlgo::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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
return enum_value > other_value;
}

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

const char *RSL__ChanModeOct6SpeechAlgo::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__CMOD__SP__GSM1: return "RSL_CMOD_SP_GSM1";
case RSL__CMOD__SP__GSM2: return "RSL_CMOD_SP_GSM2";
case RSL__CMOD__SP__GSM3: return "RSL_CMOD_SP_GSM3";
case RSL__CMOD__SP__GSM4: return "RSL_CMOD_SP_GSM4";
case RSL__CMOD__SP__GSM5: return "RSL_CMOD_SP_GSM5";
case RSL__CMOD__SP__GSM6: return "RSL_CMOD_SP_GSM6";
default:
return "<unknown>";
}
}

RSL__ChanModeOct6SpeechAlgo::enum_type RSL__ChanModeOct6SpeechAlgo::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, "RSL_CMOD_SP_GSM1")) return RSL__CMOD__SP__GSM1;
if (!strcmp(str_par, "RSL_CMOD_SP_GSM2")) return RSL__CMOD__SP__GSM2;
if (!strcmp(str_par, "RSL_CMOD_SP_GSM3")) return RSL__CMOD__SP__GSM3;
if (!strcmp(str_par, "RSL_CMOD_SP_GSM4")) return RSL__CMOD__SP__GSM4;
if (!strcmp(str_par, "RSL_CMOD_SP_GSM5")) return RSL__CMOD__SP__GSM5;
if (!strcmp(str_par, "RSL_CMOD_SP_GSM6")) return RSL__CMOD__SP__GSM6;
}
return UNKNOWN_VALUE;
}

boolean RSL__ChanModeOct6SpeechAlgo::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 17:
case 33:
case 49:
case 9:
case 13:
return TRUE;
default:
return FALSE;
}
}

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

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

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

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

void RSL__ChanModeOct6SpeechAlgo::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 RSL__ChanModeOct6SpeechAlgo::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", "@RSL_Types.RSL_ChanModeOct6SpeechAlgo");
  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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
  }
}

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

void RSL__ChanModeOct6SpeechAlgo::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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.", enum_value);
}

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

void RSL__ChanModeOct6SpeechAlgo_template::copy_template(const RSL__ChanModeOct6SpeechAlgo_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 RSL__ChanModeOct6SpeechAlgo_template[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 RSL__ChanModeOct6SpeechAlgo_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__ChanModeOct6SpeechAlgo_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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
}
}

RSL__ChanModeOct6SpeechAlgo_template::RSL__ChanModeOct6SpeechAlgo_template()
{
}

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

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

RSL__ChanModeOct6SpeechAlgo_template::RSL__ChanModeOct6SpeechAlgo_template(RSL__ChanModeOct6SpeechAlgo::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__ChanModeOct6SpeechAlgo_template::match(RSL__ChanModeOct6SpeechAlgo::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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
}
return FALSE;
}

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

RSL__ChanModeOct6SpeechAlgo::enum_type RSL__ChanModeOct6SpeechAlgo_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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
return single_value;
}

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

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

void RSL__ChanModeOct6SpeechAlgo_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__ChanModeOct6SpeechAlgo::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 RSL__ChanModeOct6SpeechAlgo_template::log_match(const RSL__ChanModeOct6SpeechAlgo& 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 RSL__ChanModeOct6SpeechAlgo_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 @RSL_Types.RSL_ChanModeOct6SpeechAlgo.");
}
}

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

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

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

void RSL__ChanModeOct6SpeechAlgo_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 : "@RSL_Types.RSL_ChanModeOct6SpeechAlgo");
}

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

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

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

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

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

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

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

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

boolean RSL__ChanModeOct6DataRate::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 @RSL_Types.RSL_ChanModeOct6DataRate.");
return enum_value == other_value;
}

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

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

boolean RSL__ChanModeOct6DataRate::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 @RSL_Types.RSL_ChanModeOct6DataRate.");
return enum_value < other_value;
}

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

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

boolean RSL__ChanModeOct6DataRate::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 @RSL_Types.RSL_ChanModeOct6DataRate.");
return enum_value > other_value;
}

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

const char *RSL__ChanModeOct6DataRate::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__CMOD__CSD__NTA__43k5__14k5: return "RSL_CMOD_CSD_NTA_43k5_14k5";
case RSL__CMOD__CSD__NTA__29k0__14k5: return "RSL_CMOD_CSD_NTA_29k0_14k5";
case RSL__CMOD__CSD__NTA__43k5__29k0: return "RSL_CMOD_CSD_NTA_43k5_29k0";
case RSL__CMOD__CSD__NTA__14k5__43k5: return "RSL_CMOD_CSD_NTA_14k5_43k5";
case RSL__CMOD__CSD__NTA__14k5__29k0: return "RSL_CMOD_CSD_NTA_14k5_29k0";
case RSL__CMOD__CSD__NTA__29k0__43k5: return "RSL_CMOD_CSD_NTA_29k0_43k5";
case RSL__CMOD__CSD__NT__43k5: return "RSL_CMOD_CSD_NT_43k5";
case RSL__CMOD__CSD__NT__28k8: return "RSL_CMOD_CSD_NT_28k8";
case RSL__CMOD__CSD__NT__14k5: return "RSL_CMOD_CSD_NT_14k5";
case RSL__CMOD__CSD__NT__12k0: return "RSL_CMOD_CSD_NT_12k0";
case RSL__CMOD__CSD__NT__6k0: return "RSL_CMOD_CSD_NT_6k0";
case RSL__CMOD__CSD__T__32k0: return "RSL_CMOD_CSD_T_32k0";
case RSL__CMOD__CSD__T__29k0: return "RSL_CMOD_CSD_T_29k0";
case RSL__CMOD__CSD__T__14k4: return "RSL_CMOD_CSD_T_14k4";
case RSL__CMOD__CSD__T__9k6: return "RSL_CMOD_CSD_T_9k6";
case RSL__CMOD__CSD__T__4k8: return "RSL_CMOD_CSD_T_4k8";
case RSL__CMOD__CSD__T__2k4: return "RSL_CMOD_CSD_T_2k4";
case RSL__CMOD__CSD__T__1k2: return "RSL_CMOD_CSD_T_1k2";
case RSL__CMOD__CSD__T__600: return "RSL_CMOD_CSD_T_600";
case RSL__CMOD__CSD__T__1200__75: return "RSL_CMOD_CSD_T_1200_75";
default:
return "<unknown>";
}
}

RSL__ChanModeOct6DataRate::enum_type RSL__ChanModeOct6DataRate::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, "RSL_CMOD_CSD_NTA_43k5_14k5")) return RSL__CMOD__CSD__NTA__43k5__14k5;
if (!strcmp(str_par, "RSL_CMOD_CSD_NTA_29k0_14k5")) return RSL__CMOD__CSD__NTA__29k0__14k5;
if (!strcmp(str_par, "RSL_CMOD_CSD_NTA_43k5_29k0")) return RSL__CMOD__CSD__NTA__43k5__29k0;
if (!strcmp(str_par, "RSL_CMOD_CSD_NTA_14k5_43k5")) return RSL__CMOD__CSD__NTA__14k5__43k5;
if (!strcmp(str_par, "RSL_CMOD_CSD_NTA_14k5_29k0")) return RSL__CMOD__CSD__NTA__14k5__29k0;
if (!strcmp(str_par, "RSL_CMOD_CSD_NTA_29k0_43k5")) return RSL__CMOD__CSD__NTA__29k0__43k5;
if (!strcmp(str_par, "RSL_CMOD_CSD_NT_43k5")) return RSL__CMOD__CSD__NT__43k5;
if (!strcmp(str_par, "RSL_CMOD_CSD_NT_28k8")) return RSL__CMOD__CSD__NT__28k8;
if (!strcmp(str_par, "RSL_CMOD_CSD_NT_14k5")) return RSL__CMOD__CSD__NT__14k5;
if (!strcmp(str_par, "RSL_CMOD_CSD_NT_12k0")) return RSL__CMOD__CSD__NT__12k0;
if (!strcmp(str_par, "RSL_CMOD_CSD_NT_6k0")) return RSL__CMOD__CSD__NT__6k0;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_32k0")) return RSL__CMOD__CSD__T__32k0;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_29k0")) return RSL__CMOD__CSD__T__29k0;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_14k4")) return RSL__CMOD__CSD__T__14k4;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_9k6")) return RSL__CMOD__CSD__T__9k6;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_4k8")) return RSL__CMOD__CSD__T__4k8;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_2k4")) return RSL__CMOD__CSD__T__2k4;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_1k2")) return RSL__CMOD__CSD__T__1k2;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_600")) return RSL__CMOD__CSD__T__600;
if (!strcmp(str_par, "RSL_CMOD_CSD_T_1200_75")) return RSL__CMOD__CSD__T__1200__75;
}
return UNKNOWN_VALUE;
}

boolean RSL__ChanModeOct6DataRate::is_valid_enum(int int_par)
{
switch (int_par) {
case 97:
case 98:
case 99:
case 105:
case 106:
case 107:
case 116:
case 113:
case 88:
case 80:
case 81:
case 56:
case 57:
case 24:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
return TRUE;
default:
return FALSE;
}
}

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

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

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

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

void RSL__ChanModeOct6DataRate::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 RSL__ChanModeOct6DataRate::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", "@RSL_Types.RSL_ChanModeOct6DataRate");
  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 @RSL_Types.RSL_ChanModeOct6DataRate.");
  }
}

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

void RSL__ChanModeOct6DataRate::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 @RSL_Types.RSL_ChanModeOct6DataRate.", enum_value);
}

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

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

void RSL__ChanModeOct6DataRate_template::copy_template(const RSL__ChanModeOct6DataRate_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 RSL__ChanModeOct6DataRate_template[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 RSL__ChanModeOct6DataRate_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__ChanModeOct6DataRate_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 @RSL_Types.RSL_ChanModeOct6DataRate.");
}
}

RSL__ChanModeOct6DataRate_template::RSL__ChanModeOct6DataRate_template()
{
}

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

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

RSL__ChanModeOct6DataRate_template::RSL__ChanModeOct6DataRate_template(RSL__ChanModeOct6DataRate::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__ChanModeOct6DataRate_template::match(RSL__ChanModeOct6DataRate::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 @RSL_Types.RSL_ChanModeOct6DataRate.");
}
return FALSE;
}

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

RSL__ChanModeOct6DataRate::enum_type RSL__ChanModeOct6DataRate_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 @RSL_Types.RSL_ChanModeOct6DataRate.");
return single_value;
}

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

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

void RSL__ChanModeOct6DataRate_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__ChanModeOct6DataRate::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 RSL__ChanModeOct6DataRate_template::log_match(const RSL__ChanModeOct6DataRate& 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 RSL__ChanModeOct6DataRate_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 @RSL_Types.RSL_ChanModeOct6DataRate.");
}
}

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

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

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

void RSL__ChanModeOct6DataRate_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 : "@RSL_Types.RSL_ChanModeOct6DataRate");
}

void RSL__ChanModeOct6::copy_value(const RSL__ChanModeOct6& other_value)
{
switch (other_value.union_selection) {
case ALT_sign:
field_sign = new RSL__ChanModeOct6Signalling(*other_value.field_sign);
break;
case ALT_speech:
field_speech = new RSL__ChanModeOct6SpeechAlgo(*other_value.field_speech);
break;
case ALT_data:
field_data = new RSL__ChanModeOct6DataRate(*other_value.field_data);
break;
default:
TTCN_error("Assignment of an unbound union value of type @RSL_Types.RSL_ChanModeOct6.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean RSL__ChanModeOct6::operator==(const RSL__ChanModeOct6& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @RSL_Types.RSL_ChanModeOct6.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @RSL_Types.RSL_ChanModeOct6.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_sign:
return *field_sign == *other_value.field_sign;
case ALT_speech:
return *field_speech == *other_value.field_speech;
case ALT_data:
return *field_data == *other_value.field_data;
default:
return FALSE;
}
}

RSL__ChanModeOct6Signalling& RSL__ChanModeOct6::sign()
{
if (union_selection != ALT_sign) {
clean_up();
field_sign = new RSL__ChanModeOct6Signalling;
union_selection = ALT_sign;
}
return *field_sign;
}

const RSL__ChanModeOct6Signalling& RSL__ChanModeOct6::sign() const
{
if (union_selection != ALT_sign) TTCN_error("Using non-selected field sign in a value of union type @RSL_Types.RSL_ChanModeOct6.");
return *field_sign;
}

RSL__ChanModeOct6SpeechAlgo& RSL__ChanModeOct6::speech()
{
if (union_selection != ALT_speech) {
clean_up();
field_speech = new RSL__ChanModeOct6SpeechAlgo;
union_selection = ALT_speech;
}
return *field_speech;
}

const RSL__ChanModeOct6SpeechAlgo& RSL__ChanModeOct6::speech() const
{
if (union_selection != ALT_speech) TTCN_error("Using non-selected field speech in a value of union type @RSL_Types.RSL_ChanModeOct6.");
return *field_speech;
}

RSL__ChanModeOct6DataRate& RSL__ChanModeOct6::data()
{
if (union_selection != ALT_data) {
clean_up();
field_data = new RSL__ChanModeOct6DataRate;
union_selection = ALT_data;
}
return *field_data;
}

const RSL__ChanModeOct6DataRate& RSL__ChanModeOct6::data() const
{
if (union_selection != ALT_data) TTCN_error("Using non-selected field data in a value of union type @RSL_Types.RSL_ChanModeOct6.");
return *field_data;
}

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

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

boolean RSL__ChanModeOct6::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_sign: return field_sign->is_value();
case ALT_speech: return field_speech->is_value();
case ALT_data: return field_data->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void RSL__ChanModeOct6::clean_up()
{
switch (union_selection) {
case ALT_sign:
  delete field_sign;
  break;
case ALT_speech:
  delete field_speech;
  break;
case ALT_data:
  delete field_data;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void RSL__ChanModeOct6::log() const
{
switch (union_selection) {
case ALT_sign:
TTCN_Logger::log_event_str("{ sign := ");
field_sign->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_speech:
TTCN_Logger::log_event_str("{ speech := ");
field_speech->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_data:
TTCN_Logger::log_event_str("{ data := ");
field_data->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void RSL__ChanModeOct6::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, "sign")) {
    sign().set_param(*mp_last);
    if (!sign().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "speech")) {
    speech().set_param(*mp_last);
    if (!speech().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "data")) {
    data().set_param(*mp_last);
    if (!data().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @RSL_Types.RSL_ChanModeOct6.", last_name);
}

void RSL__ChanModeOct6::set_implicit_omit()
{
switch (union_selection) {
case ALT_sign:
field_sign->set_implicit_omit(); break;
case ALT_speech:
field_speech->set_implicit_omit(); break;
case ALT_data:
field_data->set_implicit_omit(); break;
default: break;
}
}

void RSL__ChanModeOct6::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_sign:
field_sign->encode_text(text_buf);
break;
case ALT_speech:
field_speech->encode_text(text_buf);
break;
case ALT_data:
field_data->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @RSL_Types.RSL_ChanModeOct6.");
}
}

void RSL__ChanModeOct6::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_sign:
sign().decode_text(text_buf);
break;
case ALT_speech:
speech().decode_text(text_buf);
break;
case ALT_data:
data().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @RSL_Types.RSL_ChanModeOct6.");
}
}

void RSL__ChanModeOct6::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 RSL__ChanModeOct6::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 RSL__ChanModeOct6::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, RSL__ChanModeOct6_sign_descr_.raw->forceomit);
      decoded_length = sign().RAW_decode(RSL__ChanModeOct6_sign_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, RSL__ChanModeOct6_speech_descr_.raw->forceomit);
      decoded_length = speech().RAW_decode(RSL__ChanModeOct6_speech_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, RSL__ChanModeOct6_data_descr_.raw->forceomit);
      decoded_length = data().RAW_decode(RSL__ChanModeOct6_data_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, RSL__ChanModeOct6_sign_descr_.raw->forceomit);
      decoded_length = sign().RAW_decode(RSL__ChanModeOct6_sign_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, RSL__ChanModeOct6_speech_descr_.raw->forceomit);
      decoded_length = speech().RAW_decode(RSL__ChanModeOct6_speech_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, RSL__ChanModeOct6_data_descr_.raw->forceomit);
      decoded_length = data().RAW_decode(RSL__ChanModeOct6_data_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_2_force_omit);
      if (decoded_length >= 0) {
         return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength;
       }
 }
 clean_up();
 return -1;
}

int RSL__ChanModeOct6::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const
{
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 3;  myleaf.body.node.nodes = init_nodes_of_enc_tree(3);
  memset(myleaf.body.node.nodes, 0, 3 * sizeof(RAW_enc_tree *));
  switch (union_selection) {
  case ALT_sign:
    myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, RSL__ChanModeOct6_sign_descr_.raw);
    encoded_length = field_sign->RAW_encode(RSL__ChanModeOct6_sign_descr_, *myleaf.body.node.nodes[0]);
    myleaf.body.node.nodes[0]->coding_descr = &RSL__ChanModeOct6_sign_descr_;
    break;
  case ALT_speech:
    myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, RSL__ChanModeOct6_speech_descr_.raw);
    encoded_length = field_speech->RAW_encode(RSL__ChanModeOct6_speech_descr_, *myleaf.body.node.nodes[1]);
    myleaf.body.node.nodes[1]->coding_descr = &RSL__ChanModeOct6_speech_descr_;
    break;
  case ALT_data:
    myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 2, RSL__ChanModeOct6_data_descr_.raw);
    encoded_length = field_data->RAW_encode(RSL__ChanModeOct6_data_descr_, *myleaf.body.node.nodes[2]);
    myleaf.body.node.nodes[2]->coding_descr = &RSL__ChanModeOct6_data_descr_;
    break;
  default:
    TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  }
  return encoded_length;
}

void RSL__ChanModeOct6_template::copy_value(const RSL__ChanModeOct6& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case RSL__ChanModeOct6::ALT_sign:
single_value.field_sign = new RSL__ChanModeOct6Signalling_template(other_value.sign());
break;
case RSL__ChanModeOct6::ALT_speech:
single_value.field_speech = new RSL__ChanModeOct6SpeechAlgo_template(other_value.speech());
break;
case RSL__ChanModeOct6::ALT_data:
single_value.field_data = new RSL__ChanModeOct6DataRate_template(other_value.data());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @RSL_Types.RSL_ChanModeOct6.");
}
set_selection(SPECIFIC_VALUE);
}

void RSL__ChanModeOct6_template::copy_template(const RSL__ChanModeOct6_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 RSL__ChanModeOct6::ALT_sign:
single_value.field_sign = new RSL__ChanModeOct6Signalling_template(*other_value.single_value.field_sign);
break;
case RSL__ChanModeOct6::ALT_speech:
single_value.field_speech = new RSL__ChanModeOct6SpeechAlgo_template(*other_value.single_value.field_speech);
break;
case RSL__ChanModeOct6::ALT_data:
single_value.field_data = new RSL__ChanModeOct6DataRate_template(*other_value.single_value.field_data);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @RSL_Types.RSL_ChanModeOct6.");
}
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 RSL__ChanModeOct6_template[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 RSL__ChanModeOct6_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__ChanModeOct6_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 @RSL_Types.RSL_ChanModeOct6.");
}
set_selection(other_value);
}

RSL__ChanModeOct6_template::RSL__ChanModeOct6_template()
{
}

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

RSL__ChanModeOct6_template::RSL__ChanModeOct6_template(const RSL__ChanModeOct6& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void RSL__ChanModeOct6_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RSL__ChanModeOct6::ALT_sign:
delete single_value.field_sign;
break;
case RSL__ChanModeOct6::ALT_speech:
delete single_value.field_speech;
break;
case RSL__ChanModeOct6::ALT_data:
delete single_value.field_data;
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;
}

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

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

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

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

boolean RSL__ChanModeOct6_template::match(const RSL__ChanModeOct6& 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:
{
RSL__ChanModeOct6::union_selection_type value_selection = other_value.get_selection();
if (value_selection == RSL__ChanModeOct6::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case RSL__ChanModeOct6::ALT_sign:
return single_value.field_sign->match(other_value.sign(), legacy);
case RSL__ChanModeOct6::ALT_speech:
return single_value.field_speech->match(other_value.speech(), legacy);
case RSL__ChanModeOct6::ALT_data:
return single_value.field_data->match(other_value.data(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @RSL_Types.RSL_ChanModeOct6.");
}
}
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 @RSL_Types.RSL_ChanModeOct6.");
}
return FALSE;
}

boolean RSL__ChanModeOct6_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case RSL__ChanModeOct6::ALT_sign:
return single_value.field_sign->is_value();
case RSL__ChanModeOct6::ALT_speech:
return single_value.field_speech->is_value();
case RSL__ChanModeOct6::ALT_data:
return single_value.field_data->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @RSL_Types.RSL_ChanModeOct6.");
}
}

RSL__ChanModeOct6 RSL__ChanModeOct6_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 @RSL_Types.RSL_ChanModeOct6.");
RSL__ChanModeOct6 ret_val;
switch (single_value.union_selection) {
case RSL__ChanModeOct6::ALT_sign:
ret_val.sign() = single_value.field_sign->valueof();
break;
case RSL__ChanModeOct6::ALT_speech:
ret_val.speech() = single_value.field_speech->valueof();
break;
case RSL__ChanModeOct6::ALT_data:
ret_val.data() = single_value.field_data->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @RSL_Types.RSL_ChanModeOct6.");
}
return ret_val;
}

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

RSL__ChanModeOct6Signalling_template& RSL__ChanModeOct6_template::sign()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RSL__ChanModeOct6::ALT_sign) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_sign = new RSL__ChanModeOct6Signalling_template(ANY_VALUE);
else single_value.field_sign = new RSL__ChanModeOct6Signalling_template;
single_value.union_selection = RSL__ChanModeOct6::ALT_sign;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_sign;
}

const RSL__ChanModeOct6Signalling_template& RSL__ChanModeOct6_template::sign() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field sign in a non-specific template of union type @RSL_Types.RSL_ChanModeOct6.");
if (single_value.union_selection != RSL__ChanModeOct6::ALT_sign) TTCN_error("Accessing non-selected field sign in a template of union type @RSL_Types.RSL_ChanModeOct6.");
return *single_value.field_sign;
}

RSL__ChanModeOct6SpeechAlgo_template& RSL__ChanModeOct6_template::speech()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RSL__ChanModeOct6::ALT_speech) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_speech = new RSL__ChanModeOct6SpeechAlgo_template(ANY_VALUE);
else single_value.field_speech = new RSL__ChanModeOct6SpeechAlgo_template;
single_value.union_selection = RSL__ChanModeOct6::ALT_speech;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_speech;
}

const RSL__ChanModeOct6SpeechAlgo_template& RSL__ChanModeOct6_template::speech() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field speech in a non-specific template of union type @RSL_Types.RSL_ChanModeOct6.");
if (single_value.union_selection != RSL__ChanModeOct6::ALT_speech) TTCN_error("Accessing non-selected field speech in a template of union type @RSL_Types.RSL_ChanModeOct6.");
return *single_value.field_speech;
}

RSL__ChanModeOct6DataRate_template& RSL__ChanModeOct6_template::data()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != RSL__ChanModeOct6::ALT_data) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_data = new RSL__ChanModeOct6DataRate_template(ANY_VALUE);
else single_value.field_data = new RSL__ChanModeOct6DataRate_template;
single_value.union_selection = RSL__ChanModeOct6::ALT_data;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_data;
}

const RSL__ChanModeOct6DataRate_template& RSL__ChanModeOct6_template::data() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field data in a non-specific template of union type @RSL_Types.RSL_ChanModeOct6.");
if (single_value.union_selection != RSL__ChanModeOct6::ALT_data) TTCN_error("Accessing non-selected field data in a template of union type @RSL_Types.RSL_ChanModeOct6.");
return *single_value.field_data;
}

boolean RSL__ChanModeOct6_template::ischosen(RSL__ChanModeOct6::union_selection_type checked_selection) const
{
if (checked_selection == RSL__ChanModeOct6::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RSL_Types.RSL_ChanModeOct6.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == RSL__ChanModeOct6::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @RSL_Types.RSL_ChanModeOct6.");
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 @RSL_Types.RSL_ChanModeOct6 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 RSL__ChanModeOct6_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case RSL__ChanModeOct6::ALT_sign:
TTCN_Logger::log_event_str("{ sign := ");
single_value.field_sign->log();
TTCN_Logger::log_event_str(" }");
break;
case RSL__ChanModeOct6::ALT_speech:
TTCN_Logger::log_event_str("{ speech := ");
single_value.field_speech->log();
TTCN_Logger::log_event_str(" }");
break;
case RSL__ChanModeOct6::ALT_data:
TTCN_Logger::log_event_str("{ data := ");
single_value.field_data->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 RSL__ChanModeOct6_template::log_match(const RSL__ChanModeOct6& 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 RSL__ChanModeOct6::ALT_sign:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".sign");
single_value.field_sign->log_match(match_value.sign(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ sign := ");
single_value.field_sign->log_match(match_value.sign(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RSL__ChanModeOct6::ALT_speech:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".speech");
single_value.field_speech->log_match(match_value.speech(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ speech := ");
single_value.field_speech->log_match(match_value.speech(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case RSL__ChanModeOct6::ALT_data:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".data");
single_value.field_data->log_match(match_value.data(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ data := ");
single_value.field_data->log_match(match_value.data(), 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 RSL__ChanModeOct6_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case RSL__ChanModeOct6::ALT_sign:
single_value.field_sign->set_implicit_omit(); break;
case RSL__ChanModeOct6::ALT_speech:
single_value.field_speech->set_implicit_omit(); break;
case RSL__ChanModeOct6::ALT_data:
single_value.field_data->set_implicit_omit(); break;
default: break;
}
}

void RSL__ChanModeOct6_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 RSL__ChanModeOct6::ALT_sign:
single_value.field_sign->encode_text(text_buf);
break;
case RSL__ChanModeOct6::ALT_speech:
single_value.field_speech->encode_text(text_buf);
break;
case RSL__ChanModeOct6::ALT_data:
single_value.field_data->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @RSL_Types.RSL_ChanModeOct6.");
}
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 @RSL_Types.RSL_ChanModeOct6.");
}
}

void RSL__ChanModeOct6_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = RSL__ChanModeOct6::UNBOUND_VALUE;
RSL__ChanModeOct6::union_selection_type new_selection = (RSL__ChanModeOct6::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case RSL__ChanModeOct6::ALT_sign:
single_value.field_sign = new RSL__ChanModeOct6Signalling_template;
single_value.field_sign->decode_text(text_buf);
break;
case RSL__ChanModeOct6::ALT_speech:
single_value.field_speech = new RSL__ChanModeOct6SpeechAlgo_template;
single_value.field_speech->decode_text(text_buf);
break;
case RSL__ChanModeOct6::ALT_data:
single_value.field_data = new RSL__ChanModeOct6DataRate_template;
single_value.field_data->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @RSL_Types.RSL_ChanModeOct6.");
}
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 RSL__ChanModeOct6_template[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 @RSL_Types.RSL_ChanModeOct6.");
}
}

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

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

void RSL__ChanModeOct6_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 RSL__ChanModeOct6::ALT_sign:
single_value.field_sign->check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_ChanModeOct6");
return;
case RSL__ChanModeOct6::ALT_speech:
single_value.field_speech->check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_ChanModeOct6");
return;
case RSL__ChanModeOct6::ALT_data:
single_value.field_data->check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_ChanModeOct6");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @RSL_Types.RSL_ChanModeOct6.");
}
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 : "@RSL_Types.RSL_ChanModeOct6");
}

RSL__IE__ChannelMode::RSL__IE__ChannelMode()
{
}

RSL__IE__ChannelMode::RSL__IE__ChannelMode(const INTEGER& par_len,
    const BITSTRING& par_reserved,
    const BOOLEAN& par_dtx__d,
    const BOOLEAN& par_dtx__u,
    const RSL__SpeechDataInd& par_spd__ind,
    const RSL__ChanRateType& par_ch__rate__type,
    const RSL__ChanModeOct6& par_u)
  :   field_len(par_len),
  field_reserved(par_reserved),
  field_dtx__d(par_dtx__d),
  field_dtx__u(par_dtx__u),
  field_spd__ind(par_spd__ind),
  field_ch__rate__type(par_ch__rate__type),
  field_u(par_u)
{
}

RSL__IE__ChannelMode::RSL__IE__ChannelMode(const RSL__IE__ChannelMode& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_ChannelMode.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.dtx__d().is_bound()) field_dtx__d = other_value.dtx__d();
else field_dtx__d.clean_up();
if (other_value.dtx__u().is_bound()) field_dtx__u = other_value.dtx__u();
else field_dtx__u.clean_up();
if (other_value.spd__ind().is_bound()) field_spd__ind = other_value.spd__ind();
else field_spd__ind.clean_up();
if (other_value.ch__rate__type().is_bound()) field_ch__rate__type = other_value.ch__rate__type();
else field_ch__rate__type.clean_up();
if (other_value.u().is_bound()) field_u = other_value.u();
else field_u.clean_up();
}

void RSL__IE__ChannelMode::clean_up()
{
field_len.clean_up();
field_reserved.clean_up();
field_dtx__d.clean_up();
field_dtx__u.clean_up();
field_spd__ind.clean_up();
field_ch__rate__type.clean_up();
field_u.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__ChannelMode::get_descriptor() const { return &RSL__IE__ChannelMode_descr_; }
RSL__IE__ChannelMode& RSL__IE__ChannelMode::operator=(const RSL__IE__ChannelMode& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_ChannelMode.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.dtx__d().is_bound()) field_dtx__d = other_value.dtx__d();
  else field_dtx__d.clean_up();
  if (other_value.dtx__u().is_bound()) field_dtx__u = other_value.dtx__u();
  else field_dtx__u.clean_up();
  if (other_value.spd__ind().is_bound()) field_spd__ind = other_value.spd__ind();
  else field_spd__ind.clean_up();
  if (other_value.ch__rate__type().is_bound()) field_ch__rate__type = other_value.ch__rate__type();
  else field_ch__rate__type.clean_up();
  if (other_value.u().is_bound()) field_u = other_value.u();
  else field_u.clean_up();
}
return *this;
}

boolean RSL__IE__ChannelMode::operator==(const RSL__IE__ChannelMode& other_value) const
{
return field_len==other_value.field_len
  && field_reserved==other_value.field_reserved
  && field_dtx__d==other_value.field_dtx__d
  && field_dtx__u==other_value.field_dtx__u
  && field_spd__ind==other_value.field_spd__ind
  && field_ch__rate__type==other_value.field_ch__rate__type
  && field_u==other_value.field_u;
}

boolean RSL__IE__ChannelMode::is_bound() const
{
return (field_len.is_bound())
  || (field_reserved.is_bound())
  || (field_dtx__d.is_bound())
  || (field_dtx__u.is_bound())
  || (field_spd__ind.is_bound())
  || (field_ch__rate__type.is_bound())
  || (field_u.is_bound());
}
boolean RSL__IE__ChannelMode::is_value() const
{
return field_len.is_value()
  && field_reserved.is_value()
  && field_dtx__d.is_value()
  && field_dtx__u.is_value()
  && field_spd__ind.is_value()
  && field_ch__rate__type.is_value()
  && field_u.is_value();
}
void RSL__IE__ChannelMode::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", dtx_d := ");
field_dtx__d.log();
TTCN_Logger::log_event_str(", dtx_u := ");
field_dtx__u.log();
TTCN_Logger::log_event_str(", spd_ind := ");
field_spd__ind.log();
TTCN_Logger::log_event_str(", ch_rate_type := ");
field_ch__rate__type.log();
TTCN_Logger::log_event_str(", u := ");
field_u.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__ChannelMode::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (dtx__d().is_bound()) dtx__d().set_implicit_omit();
if (dtx__u().is_bound()) dtx__u().set_implicit_omit();
if (spd__ind().is_bound()) spd__ind().set_implicit_omit();
if (ch__rate__type().is_bound()) ch__rate__type().set_implicit_omit();
if (u().is_bound()) u().set_implicit_omit();
}

void RSL__IE__ChannelMode::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 @RSL_Types.RSL_IE_ChannelMode 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) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dtx__d().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dtx__u().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spd__ind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ch__rate__type().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) u().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dtx_d")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__d().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spd_ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spd__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(), "ch_rate_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ch__rate__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_ChannelMode: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_IE_ChannelMode");
  }
}

void RSL__IE__ChannelMode::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_dtx__d.encode_text(text_buf);
field_dtx__u.encode_text(text_buf);
field_spd__ind.encode_text(text_buf);
field_ch__rate__type.encode_text(text_buf);
field_u.encode_text(text_buf);
}

void RSL__IE__ChannelMode::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_dtx__d.decode_text(text_buf);
field_dtx__u.decode_text(text_buf);
field_spd__ind.decode_text(text_buf);
field_ch__rate__type.decode_text(text_buf);
field_u.decode_text(text_buf);
}

void RSL__IE__ChannelMode::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 RSL__IE__ChannelMode::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 RSL__IE__ChannelMode::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  int selected_field = -1;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RSL__IE__ChannelMode_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(RSL__IE__ChannelMode_len_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_len.convert_to_Integer(RSL__IE__ChannelMode_len_descr_);
  field_len = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, RSL__IE__ChannelMode_reserved_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(RSL__IE__ChannelMode_reserved_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, RSL__IE__ChannelMode_dtx__d_descr_.raw->forceomit);
  decoded_field_length = field_dtx__d.RAW_decode(RSL__IE__ChannelMode_dtx__d_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, RSL__IE__ChannelMode_dtx__u_descr_.raw->forceomit);
  decoded_field_length = field_dtx__u.RAW_decode(RSL__IE__ChannelMode_dtx__u_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, RSL__IE__ChannelMode_spd__ind_descr_.raw->forceomit);
  decoded_field_length = field_spd__ind.RAW_decode(RSL__IE__ChannelMode_spd__ind_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, RSL__IE__ChannelMode_ch__rate__type_descr_.raw->forceomit);
  decoded_field_length = field_ch__rate__type.RAW_decode(RSL__IE__ChannelMode_ch__rate__type_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  if (field_spd__ind == RSL__SpeechDataInd::RSL__SPDI__SIGN) selected_field = 0;
  else if (field_spd__ind == RSL__SpeechDataInd::RSL__SPDI__SPEECH) selected_field = 1;
  else if (field_spd__ind == RSL__SpeechDataInd::RSL__SPDI__DATA) selected_field = 2;
  else selected_field = -1;
  RAW_Force_Omit field_6_force_omit(6, force_omit, RSL__IE__ChannelMode_u_descr_.raw->forceomit);
  decoded_field_length = field_u.RAW_decode(RSL__IE__ChannelMode_u_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, selected_field, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RSL__IE__ChannelMode::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, RSL__IE__ChannelMode_len_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__ChannelMode_reserved_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__ChannelMode_dtx__d_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RSL__IE__ChannelMode_dtx__u_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RSL__IE__ChannelMode_spd__ind_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RSL__IE__ChannelMode_ch__rate__type_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RSL__IE__ChannelMode_u_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RSL__IE__ChannelMode_len_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 6;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(6);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  encoded_length += field_reserved.RAW_encode(RSL__IE__ChannelMode_reserved_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dtx__d.RAW_encode(RSL__IE__ChannelMode_dtx__d_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_dtx__u.RAW_encode(RSL__IE__ChannelMode_dtx__u_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spd__ind.RAW_encode(RSL__IE__ChannelMode_spd__ind_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_ch__rate__type.RAW_encode(RSL__IE__ChannelMode_ch__rate__type_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_u.RAW_encode(RSL__IE__ChannelMode_u_descr_, *myleaf.body.node.nodes[6]);
  switch (field_u.get_selection()) {
  case RSL__ChanModeOct6::ALT_sign:
  if (field_spd__ind != RSL__SpeechDataInd::RSL__SPDI__SIGN) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 4 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RSL__SpeechDataInd new_val(RSL__SpeechDataInd::RSL__SPDI__SIGN);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(RSL__IE__ChannelMode_spd__ind_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 RSL__ChanModeOct6::ALT_speech:
  if (field_spd__ind != RSL__SpeechDataInd::RSL__SPDI__SPEECH) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 4 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RSL__SpeechDataInd new_val(RSL__SpeechDataInd::RSL__SPDI__SPEECH);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(RSL__IE__ChannelMode_spd__ind_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 RSL__ChanModeOct6::ALT_data:
  if (field_spd__ind != RSL__SpeechDataInd::RSL__SPDI__DATA) {
  RAW_enc_tr_pos pr_pos;
  pr_pos.level = myleaf.curr_pos.level + 1;
  int new_pos[] = { 4 };
  pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos);
  RSL__SpeechDataInd new_val(RSL__SpeechDataInd::RSL__SPDI__DATA);
  RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos);
  if (temp_leaf != NULL)
    new_val.RAW_encode(RSL__IE__ChannelMode_spd__ind_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 RSL__IE__ChannelMode_template::single_value_struct {
INTEGER_template field_len;
BITSTRING_template field_reserved;
BOOLEAN_template field_dtx__d;
BOOLEAN_template field_dtx__u;
RSL__SpeechDataInd_template field_spd__ind;
RSL__ChanRateType_template field_ch__rate__type;
RSL__ChanModeOct6_template field_u;
};

void RSL__IE__ChannelMode_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_len = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_dtx__d = ANY_VALUE;
single_value->field_dtx__u = ANY_VALUE;
single_value->field_spd__ind = ANY_VALUE;
single_value->field_ch__rate__type = ANY_VALUE;
single_value->field_u = ANY_VALUE;
}
}
}

void RSL__IE__ChannelMode_template::copy_value(const RSL__IE__ChannelMode& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.dtx__d().is_bound()) {
  single_value->field_dtx__d = other_value.dtx__d();
} else {
  single_value->field_dtx__d.clean_up();
}
if (other_value.dtx__u().is_bound()) {
  single_value->field_dtx__u = other_value.dtx__u();
} else {
  single_value->field_dtx__u.clean_up();
}
if (other_value.spd__ind().is_bound()) {
  single_value->field_spd__ind = other_value.spd__ind();
} else {
  single_value->field_spd__ind.clean_up();
}
if (other_value.ch__rate__type().is_bound()) {
  single_value->field_ch__rate__type = other_value.ch__rate__type();
} else {
  single_value->field_ch__rate__type.clean_up();
}
if (other_value.u().is_bound()) {
  single_value->field_u = other_value.u();
} else {
  single_value->field_u.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__ChannelMode_template::copy_template(const RSL__IE__ChannelMode_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dtx__d().get_selection()) {
single_value->field_dtx__d = other_value.dtx__d();
} else {
single_value->field_dtx__d.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dtx__u().get_selection()) {
single_value->field_dtx__u = other_value.dtx__u();
} else {
single_value->field_dtx__u.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spd__ind().get_selection()) {
single_value->field_spd__ind = other_value.spd__ind();
} else {
single_value->field_spd__ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ch__rate__type().get_selection()) {
single_value->field_ch__rate__type = other_value.ch__rate__type();
} else {
single_value->field_ch__rate__type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.u().get_selection()) {
single_value->field_u = other_value.u();
} else {
single_value->field_u.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 RSL__IE__ChannelMode_template[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 RSL__IE__ChannelMode_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__ChannelMode_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 @RSL_Types.RSL_IE_ChannelMode.");
break;
}
set_selection(other_value);
}

RSL__IE__ChannelMode_template::RSL__IE__ChannelMode_template()
{
}

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

RSL__IE__ChannelMode_template::RSL__IE__ChannelMode_template(const RSL__IE__ChannelMode& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__ChannelMode_template::match(const RSL__IE__ChannelMode& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.dtx__d().is_bound()) return FALSE;
if(!single_value->field_dtx__d.match(other_value.dtx__d(), legacy))return FALSE;
if(!other_value.dtx__u().is_bound()) return FALSE;
if(!single_value->field_dtx__u.match(other_value.dtx__u(), legacy))return FALSE;
if(!other_value.spd__ind().is_bound()) return FALSE;
if(!single_value->field_spd__ind.match(other_value.spd__ind(), legacy))return FALSE;
if(!other_value.ch__rate__type().is_bound()) return FALSE;
if(!single_value->field_ch__rate__type.match(other_value.ch__rate__type(), legacy))return FALSE;
if(!other_value.u().is_bound()) return FALSE;
if(!single_value->field_u.match(other_value.u(), 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 @RSL_Types.RSL_IE_ChannelMode.");
}
return FALSE;
}

boolean RSL__IE__ChannelMode_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_len.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_dtx__d.is_bound()
 || single_value->field_dtx__u.is_bound()
 || single_value->field_spd__ind.is_bound()
 || single_value->field_ch__rate__type.is_bound()
 || single_value->field_u.is_bound();
}

boolean RSL__IE__ChannelMode_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_len.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_dtx__d.is_value()
 && single_value->field_dtx__u.is_value()
 && single_value->field_spd__ind.is_value()
 && single_value->field_ch__rate__type.is_value()
 && single_value->field_u.is_value();
}

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

RSL__IE__ChannelMode RSL__IE__ChannelMode_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 @RSL_Types.RSL_IE_ChannelMode.");
RSL__IE__ChannelMode ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_dtx__d.is_bound()) {
ret_val.dtx__d() = single_value->field_dtx__d.valueof();
}
if (single_value->field_dtx__u.is_bound()) {
ret_val.dtx__u() = single_value->field_dtx__u.valueof();
}
if (single_value->field_spd__ind.is_bound()) {
ret_val.spd__ind() = single_value->field_spd__ind.valueof();
}
if (single_value->field_ch__rate__type.is_bound()) {
ret_val.ch__rate__type() = single_value->field_ch__rate__type.valueof();
}
if (single_value->field_u.is_bound()) {
ret_val.u() = single_value->field_u.valueof();
}
return ret_val;
}

void RSL__IE__ChannelMode_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 @RSL_Types.RSL_IE_ChannelMode.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__ChannelMode_template[list_length];
}

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

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

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

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

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

BOOLEAN_template& RSL__IE__ChannelMode_template::dtx__d()
{
set_specific();
return single_value->field_dtx__d;
}

const BOOLEAN_template& RSL__IE__ChannelMode_template::dtx__d() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx_d of a non-specific template of type @RSL_Types.RSL_IE_ChannelMode.");
return single_value->field_dtx__d;
}

BOOLEAN_template& RSL__IE__ChannelMode_template::dtx__u()
{
set_specific();
return single_value->field_dtx__u;
}

const BOOLEAN_template& RSL__IE__ChannelMode_template::dtx__u() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx_u of a non-specific template of type @RSL_Types.RSL_IE_ChannelMode.");
return single_value->field_dtx__u;
}

RSL__SpeechDataInd_template& RSL__IE__ChannelMode_template::spd__ind()
{
set_specific();
return single_value->field_spd__ind;
}

const RSL__SpeechDataInd_template& RSL__IE__ChannelMode_template::spd__ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spd_ind of a non-specific template of type @RSL_Types.RSL_IE_ChannelMode.");
return single_value->field_spd__ind;
}

RSL__ChanRateType_template& RSL__IE__ChannelMode_template::ch__rate__type()
{
set_specific();
return single_value->field_ch__rate__type;
}

const RSL__ChanRateType_template& RSL__IE__ChannelMode_template::ch__rate__type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ch_rate_type of a non-specific template of type @RSL_Types.RSL_IE_ChannelMode.");
return single_value->field_ch__rate__type;
}

RSL__ChanModeOct6_template& RSL__IE__ChannelMode_template::u()
{
set_specific();
return single_value->field_u;
}

const RSL__ChanModeOct6_template& RSL__IE__ChannelMode_template::u() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field u of a non-specific template of type @RSL_Types.RSL_IE_ChannelMode.");
return single_value->field_u;
}

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

void RSL__IE__ChannelMode_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", dtx_d := ");
single_value->field_dtx__d.log();
TTCN_Logger::log_event_str(", dtx_u := ");
single_value->field_dtx__u.log();
TTCN_Logger::log_event_str(", spd_ind := ");
single_value->field_spd__ind.log();
TTCN_Logger::log_event_str(", ch_rate_type := ");
single_value->field_ch__rate__type.log();
TTCN_Logger::log_event_str(", u := ");
single_value->field_u.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 RSL__IE__ChannelMode_template::log_match(const RSL__IE__ChannelMode& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dtx__d.match(match_value.dtx__d(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx_d");
single_value->field_dtx__d.log_match(match_value.dtx__d(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dtx__u.match(match_value.dtx__u(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx_u");
single_value->field_dtx__u.log_match(match_value.dtx__u(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_spd__ind.match(match_value.spd__ind(), legacy)){
TTCN_Logger::log_logmatch_info(".spd_ind");
single_value->field_spd__ind.log_match(match_value.spd__ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ch__rate__type.match(match_value.ch__rate__type(), legacy)){
TTCN_Logger::log_logmatch_info(".ch_rate_type");
single_value->field_ch__rate__type.log_match(match_value.ch__rate__type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_u.match(match_value.u(), legacy)){
TTCN_Logger::log_logmatch_info(".u");
single_value->field_u.log_match(match_value.u(), 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("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", dtx_d := ");
single_value->field_dtx__d.log_match(match_value.dtx__d(), legacy);
TTCN_Logger::log_event_str(", dtx_u := ");
single_value->field_dtx__u.log_match(match_value.dtx__u(), legacy);
TTCN_Logger::log_event_str(", spd_ind := ");
single_value->field_spd__ind.log_match(match_value.spd__ind(), legacy);
TTCN_Logger::log_event_str(", ch_rate_type := ");
single_value->field_ch__rate__type.log_match(match_value.ch__rate__type(), legacy);
TTCN_Logger::log_event_str(", u := ");
single_value->field_u.log_match(match_value.u(), 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 RSL__IE__ChannelMode_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (dtx__d().is_bound()) dtx__d().set_implicit_omit();
if (dtx__u().is_bound()) dtx__u().set_implicit_omit();
if (spd__ind().is_bound()) spd__ind().set_implicit_omit();
if (ch__rate__type().is_bound()) ch__rate__type().set_implicit_omit();
if (u().is_bound()) u().set_implicit_omit();
}

void RSL__IE__ChannelMode_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_dtx__d.encode_text(text_buf);
single_value->field_dtx__u.encode_text(text_buf);
single_value->field_spd__ind.encode_text(text_buf);
single_value->field_ch__rate__type.encode_text(text_buf);
single_value->field_u.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 @RSL_Types.RSL_IE_ChannelMode.");
}
}

void RSL__IE__ChannelMode_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_len.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_dtx__d.decode_text(text_buf);
single_value->field_dtx__u.decode_text(text_buf);
single_value->field_spd__ind.decode_text(text_buf);
single_value->field_ch__rate__type.decode_text(text_buf);
single_value->field_u.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 RSL__IE__ChannelMode_template[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 @RSL_Types.RSL_IE_ChannelMode.");
}
}

void RSL__IE__ChannelMode_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: {
    RSL__IE__ChannelMode_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 @RSL_Types.RSL_IE_ChannelMode 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) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dtx__d().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dtx__u().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spd__ind().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ch__rate__type().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) u().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dtx_d")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__d().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spd_ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spd__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(), "ch_rate_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ch__rate__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_ChannelMode: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__ChannelMode_template* precondition = new RSL__IE__ChannelMode_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__ChannelMode_template* implied_template = new RSL__IE__ChannelMode_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__ChannelMode_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_ChannelMode");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__ChannelMode_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelMode");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelMode");
single_value->field_dtx__d.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelMode");
single_value->field_dtx__u.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelMode");
single_value->field_spd__ind.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelMode");
single_value->field_ch__rate__type.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelMode");
single_value->field_u.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ChannelMode");
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 : "@RSL_Types.RSL_IE_ChannelMode");
}

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

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

RSL__IE__BS__Power::RSL__IE__BS__Power()
{
}

RSL__IE__BS__Power::RSL__IE__BS__Power(const INTEGER& par_reserved,
    const BOOLEAN& par_epc,
    const BOOLEAN& par_fpc,
    const INTEGER& par_power__level)
  :   field_reserved(par_reserved),
  field_epc(par_epc),
  field_fpc(par_fpc),
  field_power__level(par_power__level)
{
}

RSL__IE__BS__Power::RSL__IE__BS__Power(const RSL__IE__BS__Power& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_BS_Power.");
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.epc().is_bound()) field_epc = other_value.epc();
else field_epc.clean_up();
if (other_value.fpc().is_bound()) field_fpc = other_value.fpc();
else field_fpc.clean_up();
if (other_value.power__level().is_bound()) field_power__level = other_value.power__level();
else field_power__level.clean_up();
}

void RSL__IE__BS__Power::clean_up()
{
field_reserved.clean_up();
field_epc.clean_up();
field_fpc.clean_up();
field_power__level.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__BS__Power::get_descriptor() const { return &RSL__IE__BS__Power_descr_; }
RSL__IE__BS__Power& RSL__IE__BS__Power::operator=(const RSL__IE__BS__Power& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_BS_Power.");
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.epc().is_bound()) field_epc = other_value.epc();
  else field_epc.clean_up();
  if (other_value.fpc().is_bound()) field_fpc = other_value.fpc();
  else field_fpc.clean_up();
  if (other_value.power__level().is_bound()) field_power__level = other_value.power__level();
  else field_power__level.clean_up();
}
return *this;
}

boolean RSL__IE__BS__Power::operator==(const RSL__IE__BS__Power& other_value) const
{
return field_reserved==other_value.field_reserved
  && field_epc==other_value.field_epc
  && field_fpc==other_value.field_fpc
  && field_power__level==other_value.field_power__level;
}

boolean RSL__IE__BS__Power::is_bound() const
{
return (field_reserved.is_bound())
  || (field_epc.is_bound())
  || (field_fpc.is_bound())
  || (field_power__level.is_bound());
}
boolean RSL__IE__BS__Power::is_value() const
{
return field_reserved.is_value()
  && field_epc.is_value()
  && field_fpc.is_value()
  && field_power__level.is_value();
}
void RSL__IE__BS__Power::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", epc := ");
field_epc.log();
TTCN_Logger::log_event_str(", fpc := ");
field_fpc.log();
TTCN_Logger::log_event_str(", power_level := ");
field_power__level.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__BS__Power::set_implicit_omit()
{
if (reserved().is_bound()) reserved().set_implicit_omit();
if (epc().is_bound()) epc().set_implicit_omit();
if (fpc().is_bound()) fpc().set_implicit_omit();
if (power__level().is_bound()) power__level().set_implicit_omit();
}

void RSL__IE__BS__Power::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 @RSL_Types.RSL_IE_BS_Power has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) epc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fpc().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) power__level().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "epc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          epc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fpc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fpc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "power_level")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          power__level().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_BS_Power: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_IE_BS_Power");
  }
}

void RSL__IE__BS__Power::encode_text(Text_Buf& text_buf) const
{
field_reserved.encode_text(text_buf);
field_epc.encode_text(text_buf);
field_fpc.encode_text(text_buf);
field_power__level.encode_text(text_buf);
}

void RSL__IE__BS__Power::decode_text(Text_Buf& text_buf)
{
field_reserved.decode_text(text_buf);
field_epc.decode_text(text_buf);
field_fpc.decode_text(text_buf);
field_power__level.decode_text(text_buf);
}

void RSL__IE__BS__Power::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 RSL__IE__BS__Power::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 RSL__IE__BS__Power::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, RSL__IE__BS__Power_reserved_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(RSL__IE__BS__Power_reserved_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, RSL__IE__BS__Power_epc_descr_.raw->forceomit);
  decoded_field_length = field_epc.RAW_decode(RSL__IE__BS__Power_epc_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, RSL__IE__BS__Power_fpc_descr_.raw->forceomit);
  decoded_field_length = field_fpc.RAW_decode(RSL__IE__BS__Power_fpc_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, RSL__IE__BS__Power_power__level_descr_.raw->forceomit);
  decoded_field_length = field_power__level.RAW_decode(RSL__IE__BS__Power_power__level_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 RSL__IE__BS__Power::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, RSL__IE__BS__Power_reserved_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__BS__Power_epc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__BS__Power_fpc_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RSL__IE__BS__Power_power__level_descr_.raw);
  encoded_length += field_reserved.RAW_encode(RSL__IE__BS__Power_reserved_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_epc.RAW_encode(RSL__IE__BS__Power_epc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_fpc.RAW_encode(RSL__IE__BS__Power_fpc_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_power__level.RAW_encode(RSL__IE__BS__Power_power__level_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__BS__Power_template::single_value_struct {
INTEGER_template field_reserved;
BOOLEAN_template field_epc;
BOOLEAN_template field_fpc;
INTEGER_template field_power__level;
};

void RSL__IE__BS__Power_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_reserved = ANY_VALUE;
single_value->field_epc = ANY_VALUE;
single_value->field_fpc = ANY_VALUE;
single_value->field_power__level = ANY_VALUE;
}
}
}

void RSL__IE__BS__Power_template::copy_value(const RSL__IE__BS__Power& other_value)
{
single_value = new single_value_struct;
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.epc().is_bound()) {
  single_value->field_epc = other_value.epc();
} else {
  single_value->field_epc.clean_up();
}
if (other_value.fpc().is_bound()) {
  single_value->field_fpc = other_value.fpc();
} else {
  single_value->field_fpc.clean_up();
}
if (other_value.power__level().is_bound()) {
  single_value->field_power__level = other_value.power__level();
} else {
  single_value->field_power__level.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__BS__Power_template::copy_template(const RSL__IE__BS__Power_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.epc().get_selection()) {
single_value->field_epc = other_value.epc();
} else {
single_value->field_epc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fpc().get_selection()) {
single_value->field_fpc = other_value.fpc();
} else {
single_value->field_fpc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.power__level().get_selection()) {
single_value->field_power__level = other_value.power__level();
} else {
single_value->field_power__level.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 RSL__IE__BS__Power_template[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 RSL__IE__BS__Power_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__BS__Power_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 @RSL_Types.RSL_IE_BS_Power.");
break;
}
set_selection(other_value);
}

RSL__IE__BS__Power_template::RSL__IE__BS__Power_template()
{
}

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

RSL__IE__BS__Power_template::RSL__IE__BS__Power_template(const RSL__IE__BS__Power& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__BS__Power_template::match(const RSL__IE__BS__Power& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.epc().is_bound()) return FALSE;
if(!single_value->field_epc.match(other_value.epc(), legacy))return FALSE;
if(!other_value.fpc().is_bound()) return FALSE;
if(!single_value->field_fpc.match(other_value.fpc(), legacy))return FALSE;
if(!other_value.power__level().is_bound()) return FALSE;
if(!single_value->field_power__level.match(other_value.power__level(), 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 @RSL_Types.RSL_IE_BS_Power.");
}
return FALSE;
}

boolean RSL__IE__BS__Power_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_reserved.is_bound()
 || single_value->field_epc.is_bound()
 || single_value->field_fpc.is_bound()
 || single_value->field_power__level.is_bound();
}

boolean RSL__IE__BS__Power_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_reserved.is_value()
 && single_value->field_epc.is_value()
 && single_value->field_fpc.is_value()
 && single_value->field_power__level.is_value();
}

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

RSL__IE__BS__Power RSL__IE__BS__Power_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 @RSL_Types.RSL_IE_BS_Power.");
RSL__IE__BS__Power ret_val;
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_epc.is_bound()) {
ret_val.epc() = single_value->field_epc.valueof();
}
if (single_value->field_fpc.is_bound()) {
ret_val.fpc() = single_value->field_fpc.valueof();
}
if (single_value->field_power__level.is_bound()) {
ret_val.power__level() = single_value->field_power__level.valueof();
}
return ret_val;
}

void RSL__IE__BS__Power_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 @RSL_Types.RSL_IE_BS_Power.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__BS__Power_template[list_length];
}

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

INTEGER_template& RSL__IE__BS__Power_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const INTEGER_template& RSL__IE__BS__Power_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @RSL_Types.RSL_IE_BS_Power.");
return single_value->field_reserved;
}

BOOLEAN_template& RSL__IE__BS__Power_template::epc()
{
set_specific();
return single_value->field_epc;
}

const BOOLEAN_template& RSL__IE__BS__Power_template::epc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field epc of a non-specific template of type @RSL_Types.RSL_IE_BS_Power.");
return single_value->field_epc;
}

BOOLEAN_template& RSL__IE__BS__Power_template::fpc()
{
set_specific();
return single_value->field_fpc;
}

const BOOLEAN_template& RSL__IE__BS__Power_template::fpc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fpc of a non-specific template of type @RSL_Types.RSL_IE_BS_Power.");
return single_value->field_fpc;
}

INTEGER_template& RSL__IE__BS__Power_template::power__level()
{
set_specific();
return single_value->field_power__level;
}

const INTEGER_template& RSL__IE__BS__Power_template::power__level() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field power_level of a non-specific template of type @RSL_Types.RSL_IE_BS_Power.");
return single_value->field_power__level;
}

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

void RSL__IE__BS__Power_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", epc := ");
single_value->field_epc.log();
TTCN_Logger::log_event_str(", fpc := ");
single_value->field_fpc.log();
TTCN_Logger::log_event_str(", power_level := ");
single_value->field_power__level.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 RSL__IE__BS__Power_template::log_match(const RSL__IE__BS__Power& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_epc.match(match_value.epc(), legacy)){
TTCN_Logger::log_logmatch_info(".epc");
single_value->field_epc.log_match(match_value.epc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fpc.match(match_value.fpc(), legacy)){
TTCN_Logger::log_logmatch_info(".fpc");
single_value->field_fpc.log_match(match_value.fpc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_power__level.match(match_value.power__level(), legacy)){
TTCN_Logger::log_logmatch_info(".power_level");
single_value->field_power__level.log_match(match_value.power__level(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", epc := ");
single_value->field_epc.log_match(match_value.epc(), legacy);
TTCN_Logger::log_event_str(", fpc := ");
single_value->field_fpc.log_match(match_value.fpc(), legacy);
TTCN_Logger::log_event_str(", power_level := ");
single_value->field_power__level.log_match(match_value.power__level(), 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 RSL__IE__BS__Power_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (reserved().is_bound()) reserved().set_implicit_omit();
if (epc().is_bound()) epc().set_implicit_omit();
if (fpc().is_bound()) fpc().set_implicit_omit();
if (power__level().is_bound()) power__level().set_implicit_omit();
}

void RSL__IE__BS__Power_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_reserved.encode_text(text_buf);
single_value->field_epc.encode_text(text_buf);
single_value->field_fpc.encode_text(text_buf);
single_value->field_power__level.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 @RSL_Types.RSL_IE_BS_Power.");
}
}

void RSL__IE__BS__Power_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_reserved.decode_text(text_buf);
single_value->field_epc.decode_text(text_buf);
single_value->field_fpc.decode_text(text_buf);
single_value->field_power__level.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 RSL__IE__BS__Power_template[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 @RSL_Types.RSL_IE_BS_Power.");
}
}

void RSL__IE__BS__Power_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: {
    RSL__IE__BS__Power_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 @RSL_Types.RSL_IE_BS_Power has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) epc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fpc().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) power__level().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "epc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          epc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fpc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fpc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "power_level")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          power__level().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_BS_Power: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__BS__Power_template* precondition = new RSL__IE__BS__Power_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__BS__Power_template* implied_template = new RSL__IE__BS__Power_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__BS__Power_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_BS_Power");
  }
  is_ifpresent = param.get_ifpresent();
}

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__AlgId::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 @RSL_Types.RSL_AlgId.");
return enum_value == other_value;
}

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

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

boolean RSL__AlgId::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 @RSL_Types.RSL_AlgId.");
return enum_value < other_value;
}

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

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

boolean RSL__AlgId::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 @RSL_Types.RSL_AlgId.");
return enum_value > other_value;
}

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

const char *RSL__AlgId::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__ALG__ID__A5__0: return "RSL_ALG_ID_A5_0";
case RSL__ALG__ID__A5__1: return "RSL_ALG_ID_A5_1";
case RSL__ALG__ID__A5__2: return "RSL_ALG_ID_A5_2";
case RSL__ALG__ID__A5__3: return "RSL_ALG_ID_A5_3";
case RSL__ALG__ID__A5__4: return "RSL_ALG_ID_A5_4";
case RSL__ALG__ID__A5__5: return "RSL_ALG_ID_A5_5";
case RSL__ALG__ID__A5__6: return "RSL_ALG_ID_A5_6";
case RSL__ALG__ID__A5__7: return "RSL_ALG_ID_A5_7";
default:
return "<unknown>";
}
}

RSL__AlgId::enum_type RSL__AlgId::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, "RSL_ALG_ID_A5_0")) return RSL__ALG__ID__A5__0;
if (!strcmp(str_par, "RSL_ALG_ID_A5_1")) return RSL__ALG__ID__A5__1;
if (!strcmp(str_par, "RSL_ALG_ID_A5_2")) return RSL__ALG__ID__A5__2;
if (!strcmp(str_par, "RSL_ALG_ID_A5_3")) return RSL__ALG__ID__A5__3;
if (!strcmp(str_par, "RSL_ALG_ID_A5_4")) return RSL__ALG__ID__A5__4;
if (!strcmp(str_par, "RSL_ALG_ID_A5_5")) return RSL__ALG__ID__A5__5;
if (!strcmp(str_par, "RSL_ALG_ID_A5_6")) return RSL__ALG__ID__A5__6;
if (!strcmp(str_par, "RSL_ALG_ID_A5_7")) return RSL__ALG__ID__A5__7;
}
return UNKNOWN_VALUE;
}

boolean RSL__AlgId::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
return TRUE;
default:
return FALSE;
}
}

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

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

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

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

void RSL__AlgId::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 RSL__AlgId::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", "@RSL_Types.RSL_AlgId");
  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 @RSL_Types.RSL_AlgId.");
  }
}

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

void RSL__AlgId::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 @RSL_Types.RSL_AlgId.", enum_value);
}

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

void RSL__AlgId_template::copy_template(const RSL__AlgId_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 RSL__AlgId_template[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 RSL__AlgId_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__AlgId_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 @RSL_Types.RSL_AlgId.");
}
}

RSL__AlgId_template::RSL__AlgId_template()
{
}

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

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

RSL__AlgId_template::RSL__AlgId_template(RSL__AlgId::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__AlgId_template::match(RSL__AlgId::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 @RSL_Types.RSL_AlgId.");
}
return FALSE;
}

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

RSL__AlgId::enum_type RSL__AlgId_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 @RSL_Types.RSL_AlgId.");
return single_value;
}

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

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

void RSL__AlgId_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__AlgId::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 RSL__AlgId_template::log_match(const RSL__AlgId& 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 RSL__AlgId_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 @RSL_Types.RSL_AlgId.");
}
}

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

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

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

void RSL__AlgId_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 : "@RSL_Types.RSL_AlgId");
}

RSL__IE__EncryptionInfo::RSL__IE__EncryptionInfo()
{
}

RSL__IE__EncryptionInfo::RSL__IE__EncryptionInfo(const INTEGER& par_len,
    const RSL__AlgId& par_alg__id,
    const OCTETSTRING& par_key)
  :   field_len(par_len),
  field_alg__id(par_alg__id),
  field_key(par_key)
{
}

RSL__IE__EncryptionInfo::RSL__IE__EncryptionInfo(const RSL__IE__EncryptionInfo& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_EncryptionInfo.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.alg__id().is_bound()) field_alg__id = other_value.alg__id();
else field_alg__id.clean_up();
if (other_value.key().is_bound()) field_key = other_value.key();
else field_key.clean_up();
}

void RSL__IE__EncryptionInfo::clean_up()
{
field_len.clean_up();
field_alg__id.clean_up();
field_key.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__EncryptionInfo::get_descriptor() const { return &RSL__IE__EncryptionInfo_descr_; }
RSL__IE__EncryptionInfo& RSL__IE__EncryptionInfo::operator=(const RSL__IE__EncryptionInfo& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_EncryptionInfo.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.alg__id().is_bound()) field_alg__id = other_value.alg__id();
  else field_alg__id.clean_up();
  if (other_value.key().is_bound()) field_key = other_value.key();
  else field_key.clean_up();
}
return *this;
}

boolean RSL__IE__EncryptionInfo::operator==(const RSL__IE__EncryptionInfo& other_value) const
{
return field_len==other_value.field_len
  && field_alg__id==other_value.field_alg__id
  && field_key==other_value.field_key;
}

boolean RSL__IE__EncryptionInfo::is_bound() const
{
return (field_len.is_bound())
  || (field_alg__id.is_bound())
  || (field_key.is_bound());
}
boolean RSL__IE__EncryptionInfo::is_value() const
{
return field_len.is_value()
  && field_alg__id.is_value()
  && field_key.is_value();
}
void RSL__IE__EncryptionInfo::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", alg_id := ");
field_alg__id.log();
TTCN_Logger::log_event_str(", key := ");
field_key.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__EncryptionInfo::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (alg__id().is_bound()) alg__id().set_implicit_omit();
if (key().is_bound()) key().set_implicit_omit();
}

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

void RSL__IE__EncryptionInfo::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_alg__id.encode_text(text_buf);
field_key.encode_text(text_buf);
}

void RSL__IE__EncryptionInfo::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_alg__id.decode_text(text_buf);
field_key.decode_text(text_buf);
}

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

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

struct RSL__IE__EncryptionInfo_template::single_value_struct {
INTEGER_template field_len;
RSL__AlgId_template field_alg__id;
OCTETSTRING_template field_key;
};

void RSL__IE__EncryptionInfo_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_len = ANY_VALUE;
single_value->field_alg__id = ANY_VALUE;
single_value->field_key = ANY_VALUE;
}
}
}

void RSL__IE__EncryptionInfo_template::copy_value(const RSL__IE__EncryptionInfo& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.alg__id().is_bound()) {
  single_value->field_alg__id = other_value.alg__id();
} else {
  single_value->field_alg__id.clean_up();
}
if (other_value.key().is_bound()) {
  single_value->field_key = other_value.key();
} else {
  single_value->field_key.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__EncryptionInfo_template::copy_template(const RSL__IE__EncryptionInfo_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.alg__id().get_selection()) {
single_value->field_alg__id = other_value.alg__id();
} else {
single_value->field_alg__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.key().get_selection()) {
single_value->field_key = other_value.key();
} else {
single_value->field_key.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 RSL__IE__EncryptionInfo_template[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 RSL__IE__EncryptionInfo_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__EncryptionInfo_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 @RSL_Types.RSL_IE_EncryptionInfo.");
break;
}
set_selection(other_value);
}

RSL__IE__EncryptionInfo_template::RSL__IE__EncryptionInfo_template()
{
}

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

RSL__IE__EncryptionInfo_template::RSL__IE__EncryptionInfo_template(const RSL__IE__EncryptionInfo& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__EncryptionInfo_template::match(const RSL__IE__EncryptionInfo& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.alg__id().is_bound()) return FALSE;
if(!single_value->field_alg__id.match(other_value.alg__id(), legacy))return FALSE;
if(!other_value.key().is_bound()) return FALSE;
if(!single_value->field_key.match(other_value.key(), 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 @RSL_Types.RSL_IE_EncryptionInfo.");
}
return FALSE;
}

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

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

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

RSL__IE__EncryptionInfo RSL__IE__EncryptionInfo_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 @RSL_Types.RSL_IE_EncryptionInfo.");
RSL__IE__EncryptionInfo ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_alg__id.is_bound()) {
ret_val.alg__id() = single_value->field_alg__id.valueof();
}
if (single_value->field_key.is_bound()) {
ret_val.key() = single_value->field_key.valueof();
}
return ret_val;
}

void RSL__IE__EncryptionInfo_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 @RSL_Types.RSL_IE_EncryptionInfo.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__EncryptionInfo_template[list_length];
}

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

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

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

RSL__AlgId_template& RSL__IE__EncryptionInfo_template::alg__id()
{
set_specific();
return single_value->field_alg__id;
}

const RSL__AlgId_template& RSL__IE__EncryptionInfo_template::alg__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field alg_id of a non-specific template of type @RSL_Types.RSL_IE_EncryptionInfo.");
return single_value->field_alg__id;
}

OCTETSTRING_template& RSL__IE__EncryptionInfo_template::key()
{
set_specific();
return single_value->field_key;
}

const OCTETSTRING_template& RSL__IE__EncryptionInfo_template::key() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field key of a non-specific template of type @RSL_Types.RSL_IE_EncryptionInfo.");
return single_value->field_key;
}

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

void RSL__IE__EncryptionInfo_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", alg_id := ");
single_value->field_alg__id.log();
TTCN_Logger::log_event_str(", key := ");
single_value->field_key.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 RSL__IE__EncryptionInfo_template::log_match(const RSL__IE__EncryptionInfo& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_alg__id.match(match_value.alg__id(), legacy)){
TTCN_Logger::log_logmatch_info(".alg_id");
single_value->field_alg__id.log_match(match_value.alg__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_key.match(match_value.key(), legacy)){
TTCN_Logger::log_logmatch_info(".key");
single_value->field_key.log_match(match_value.key(), 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("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", alg_id := ");
single_value->field_alg__id.log_match(match_value.alg__id(), legacy);
TTCN_Logger::log_event_str(", key := ");
single_value->field_key.log_match(match_value.key(), 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 RSL__IE__EncryptionInfo_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (alg__id().is_bound()) alg__id().set_implicit_omit();
if (key().is_bound()) key().set_implicit_omit();
}

void RSL__IE__EncryptionInfo_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.encode_text(text_buf);
single_value->field_alg__id.encode_text(text_buf);
single_value->field_key.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 @RSL_Types.RSL_IE_EncryptionInfo.");
}
}

void RSL__IE__EncryptionInfo_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_len.decode_text(text_buf);
single_value->field_alg__id.decode_text(text_buf);
single_value->field_key.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 RSL__IE__EncryptionInfo_template[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 @RSL_Types.RSL_IE_EncryptionInfo.");
}
}

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

void RSL__IE__EncryptionInfo_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_EncryptionInfo");
single_value->field_alg__id.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_EncryptionInfo");
single_value->field_key.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_EncryptionInfo");
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 : "@RSL_Types.RSL_IE_EncryptionInfo");
}

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

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

RSL__IE__FrameNumber::RSL__IE__FrameNumber()
{
}

RSL__IE__FrameNumber::RSL__IE__FrameNumber(const INTEGER& par_t1__p,
    const INTEGER& par_t3,
    const INTEGER& par_t2)
  :   field_t1__p(par_t1__p),
  field_t3(par_t3),
  field_t2(par_t2)
{
}

RSL__IE__FrameNumber::RSL__IE__FrameNumber(const RSL__IE__FrameNumber& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_FrameNumber.");
if (other_value.t1__p().is_bound()) field_t1__p = other_value.t1__p();
else field_t1__p.clean_up();
if (other_value.t3().is_bound()) field_t3 = other_value.t3();
else field_t3.clean_up();
if (other_value.t2().is_bound()) field_t2 = other_value.t2();
else field_t2.clean_up();
}

void RSL__IE__FrameNumber::clean_up()
{
field_t1__p.clean_up();
field_t3.clean_up();
field_t2.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__FrameNumber::get_descriptor() const { return &RSL__IE__FrameNumber_descr_; }
RSL__IE__FrameNumber& RSL__IE__FrameNumber::operator=(const RSL__IE__FrameNumber& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_FrameNumber.");
  if (other_value.t1__p().is_bound()) field_t1__p = other_value.t1__p();
  else field_t1__p.clean_up();
  if (other_value.t3().is_bound()) field_t3 = other_value.t3();
  else field_t3.clean_up();
  if (other_value.t2().is_bound()) field_t2 = other_value.t2();
  else field_t2.clean_up();
}
return *this;
}

boolean RSL__IE__FrameNumber::operator==(const RSL__IE__FrameNumber& other_value) const
{
return field_t1__p==other_value.field_t1__p
  && field_t3==other_value.field_t3
  && field_t2==other_value.field_t2;
}

boolean RSL__IE__FrameNumber::is_bound() const
{
return (field_t1__p.is_bound())
  || (field_t3.is_bound())
  || (field_t2.is_bound());
}
boolean RSL__IE__FrameNumber::is_value() const
{
return field_t1__p.is_value()
  && field_t3.is_value()
  && field_t2.is_value();
}
void RSL__IE__FrameNumber::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ t1_p := ");
field_t1__p.log();
TTCN_Logger::log_event_str(", t3 := ");
field_t3.log();
TTCN_Logger::log_event_str(", t2 := ");
field_t2.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__FrameNumber::set_implicit_omit()
{
if (t1__p().is_bound()) t1__p().set_implicit_omit();
if (t3().is_bound()) t3().set_implicit_omit();
if (t2().is_bound()) t2().set_implicit_omit();
}

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

void RSL__IE__FrameNumber::encode_text(Text_Buf& text_buf) const
{
field_t1__p.encode_text(text_buf);
field_t3.encode_text(text_buf);
field_t2.encode_text(text_buf);
}

void RSL__IE__FrameNumber::decode_text(Text_Buf& text_buf)
{
field_t1__p.decode_text(text_buf);
field_t3.decode_text(text_buf);
field_t2.decode_text(text_buf);
}

void RSL__IE__FrameNumber::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 RSL__IE__FrameNumber::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 RSL__IE__FrameNumber::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, RSL__IE__FrameNumber_t1__p_descr_.raw->forceomit);
  decoded_field_length = field_t1__p.RAW_decode(RSL__IE__FrameNumber_t1__p_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, RSL__IE__FrameNumber_t3_descr_.raw->forceomit);
  decoded_field_length = field_t3.RAW_decode(RSL__IE__FrameNumber_t3_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, RSL__IE__FrameNumber_t2_descr_.raw->forceomit);
  decoded_field_length = field_t2.RAW_decode(RSL__IE__FrameNumber_t2_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 RSL__IE__FrameNumber::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, RSL__IE__FrameNumber_t1__p_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__FrameNumber_t3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__FrameNumber_t2_descr_.raw);
  encoded_length += field_t1__p.RAW_encode(RSL__IE__FrameNumber_t1__p_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_t3.RAW_encode(RSL__IE__FrameNumber_t3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_t2.RAW_encode(RSL__IE__FrameNumber_t2_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__FrameNumber_template::single_value_struct {
INTEGER_template field_t1__p;
INTEGER_template field_t3;
INTEGER_template field_t2;
};

void RSL__IE__FrameNumber_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_t1__p = ANY_VALUE;
single_value->field_t3 = ANY_VALUE;
single_value->field_t2 = ANY_VALUE;
}
}
}

void RSL__IE__FrameNumber_template::copy_value(const RSL__IE__FrameNumber& other_value)
{
single_value = new single_value_struct;
if (other_value.t1__p().is_bound()) {
  single_value->field_t1__p = other_value.t1__p();
} else {
  single_value->field_t1__p.clean_up();
}
if (other_value.t3().is_bound()) {
  single_value->field_t3 = other_value.t3();
} else {
  single_value->field_t3.clean_up();
}
if (other_value.t2().is_bound()) {
  single_value->field_t2 = other_value.t2();
} else {
  single_value->field_t2.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__FrameNumber_template::copy_template(const RSL__IE__FrameNumber_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.t1__p().get_selection()) {
single_value->field_t1__p = other_value.t1__p();
} else {
single_value->field_t1__p.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3().get_selection()) {
single_value->field_t3 = other_value.t3();
} else {
single_value->field_t3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t2().get_selection()) {
single_value->field_t2 = other_value.t2();
} else {
single_value->field_t2.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 RSL__IE__FrameNumber_template[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 RSL__IE__FrameNumber_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__FrameNumber_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 @RSL_Types.RSL_IE_FrameNumber.");
break;
}
set_selection(other_value);
}

RSL__IE__FrameNumber_template::RSL__IE__FrameNumber_template()
{
}

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

RSL__IE__FrameNumber_template::RSL__IE__FrameNumber_template(const RSL__IE__FrameNumber& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__FrameNumber_template::match(const RSL__IE__FrameNumber& 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.t1__p().is_bound()) return FALSE;
if(!single_value->field_t1__p.match(other_value.t1__p(), legacy))return FALSE;
if(!other_value.t3().is_bound()) return FALSE;
if(!single_value->field_t3.match(other_value.t3(), legacy))return FALSE;
if(!other_value.t2().is_bound()) return FALSE;
if(!single_value->field_t2.match(other_value.t2(), 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 @RSL_Types.RSL_IE_FrameNumber.");
}
return FALSE;
}

boolean RSL__IE__FrameNumber_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_t1__p.is_bound()
 || single_value->field_t3.is_bound()
 || single_value->field_t2.is_bound();
}

boolean RSL__IE__FrameNumber_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_t1__p.is_value()
 && single_value->field_t3.is_value()
 && single_value->field_t2.is_value();
}

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

RSL__IE__FrameNumber RSL__IE__FrameNumber_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 @RSL_Types.RSL_IE_FrameNumber.");
RSL__IE__FrameNumber ret_val;
if (single_value->field_t1__p.is_bound()) {
ret_val.t1__p() = single_value->field_t1__p.valueof();
}
if (single_value->field_t3.is_bound()) {
ret_val.t3() = single_value->field_t3.valueof();
}
if (single_value->field_t2.is_bound()) {
ret_val.t2() = single_value->field_t2.valueof();
}
return ret_val;
}

void RSL__IE__FrameNumber_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 @RSL_Types.RSL_IE_FrameNumber.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__FrameNumber_template[list_length];
}

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

INTEGER_template& RSL__IE__FrameNumber_template::t1__p()
{
set_specific();
return single_value->field_t1__p;
}

const INTEGER_template& RSL__IE__FrameNumber_template::t1__p() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t1_p of a non-specific template of type @RSL_Types.RSL_IE_FrameNumber.");
return single_value->field_t1__p;
}

INTEGER_template& RSL__IE__FrameNumber_template::t3()
{
set_specific();
return single_value->field_t3;
}

const INTEGER_template& RSL__IE__FrameNumber_template::t3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3 of a non-specific template of type @RSL_Types.RSL_IE_FrameNumber.");
return single_value->field_t3;
}

INTEGER_template& RSL__IE__FrameNumber_template::t2()
{
set_specific();
return single_value->field_t2;
}

const INTEGER_template& RSL__IE__FrameNumber_template::t2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t2 of a non-specific template of type @RSL_Types.RSL_IE_FrameNumber.");
return single_value->field_t2;
}

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

void RSL__IE__FrameNumber_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ t1_p := ");
single_value->field_t1__p.log();
TTCN_Logger::log_event_str(", t3 := ");
single_value->field_t3.log();
TTCN_Logger::log_event_str(", t2 := ");
single_value->field_t2.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 RSL__IE__FrameNumber_template::log_match(const RSL__IE__FrameNumber& 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_t1__p.match(match_value.t1__p(), legacy)){
TTCN_Logger::log_logmatch_info(".t1_p");
single_value->field_t1__p.log_match(match_value.t1__p(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_t3.match(match_value.t3(), legacy)){
TTCN_Logger::log_logmatch_info(".t3");
single_value->field_t3.log_match(match_value.t3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_t2.match(match_value.t2(), legacy)){
TTCN_Logger::log_logmatch_info(".t2");
single_value->field_t2.log_match(match_value.t2(), 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("{ t1_p := ");
single_value->field_t1__p.log_match(match_value.t1__p(), legacy);
TTCN_Logger::log_event_str(", t3 := ");
single_value->field_t3.log_match(match_value.t3(), legacy);
TTCN_Logger::log_event_str(", t2 := ");
single_value->field_t2.log_match(match_value.t2(), 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 RSL__IE__FrameNumber_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (t1__p().is_bound()) t1__p().set_implicit_omit();
if (t3().is_bound()) t3().set_implicit_omit();
if (t2().is_bound()) t2().set_implicit_omit();
}

void RSL__IE__FrameNumber_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_t1__p.encode_text(text_buf);
single_value->field_t3.encode_text(text_buf);
single_value->field_t2.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 @RSL_Types.RSL_IE_FrameNumber.");
}
}

void RSL__IE__FrameNumber_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_t1__p.decode_text(text_buf);
single_value->field_t3.decode_text(text_buf);
single_value->field_t2.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 RSL__IE__FrameNumber_template[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 @RSL_Types.RSL_IE_FrameNumber.");
}
}

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

void RSL__IE__FrameNumber_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_t1__p.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_FrameNumber");
single_value->field_t3.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_FrameNumber");
single_value->field_t2.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_FrameNumber");
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 : "@RSL_Types.RSL_IE_FrameNumber");
}

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

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

RSL__IE__L1Info::RSL__IE__L1Info()
{
}

RSL__IE__L1Info::RSL__IE__L1Info(const INTEGER& par_ms__power__lvl,
    const BOOLEAN& par_fpc,
    const INTEGER& par_reserved,
    const INTEGER& par_actual__ta)
  :   field_ms__power__lvl(par_ms__power__lvl),
  field_fpc(par_fpc),
  field_reserved(par_reserved),
  field_actual__ta(par_actual__ta)
{
}

RSL__IE__L1Info::RSL__IE__L1Info(const RSL__IE__L1Info& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_L1Info.");
if (other_value.ms__power__lvl().is_bound()) field_ms__power__lvl = other_value.ms__power__lvl();
else field_ms__power__lvl.clean_up();
if (other_value.fpc().is_bound()) field_fpc = other_value.fpc();
else field_fpc.clean_up();
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.actual__ta().is_bound()) field_actual__ta = other_value.actual__ta();
else field_actual__ta.clean_up();
}

void RSL__IE__L1Info::clean_up()
{
field_ms__power__lvl.clean_up();
field_fpc.clean_up();
field_reserved.clean_up();
field_actual__ta.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__L1Info::get_descriptor() const { return &RSL__IE__L1Info_descr_; }
RSL__IE__L1Info& RSL__IE__L1Info::operator=(const RSL__IE__L1Info& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_L1Info.");
  if (other_value.ms__power__lvl().is_bound()) field_ms__power__lvl = other_value.ms__power__lvl();
  else field_ms__power__lvl.clean_up();
  if (other_value.fpc().is_bound()) field_fpc = other_value.fpc();
  else field_fpc.clean_up();
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.actual__ta().is_bound()) field_actual__ta = other_value.actual__ta();
  else field_actual__ta.clean_up();
}
return *this;
}

boolean RSL__IE__L1Info::operator==(const RSL__IE__L1Info& other_value) const
{
return field_ms__power__lvl==other_value.field_ms__power__lvl
  && field_fpc==other_value.field_fpc
  && field_reserved==other_value.field_reserved
  && field_actual__ta==other_value.field_actual__ta;
}

boolean RSL__IE__L1Info::is_bound() const
{
return (field_ms__power__lvl.is_bound())
  || (field_fpc.is_bound())
  || (field_reserved.is_bound())
  || (field_actual__ta.is_bound());
}
boolean RSL__IE__L1Info::is_value() const
{
return field_ms__power__lvl.is_value()
  && field_fpc.is_value()
  && field_reserved.is_value()
  && field_actual__ta.is_value();
}
void RSL__IE__L1Info::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ms_power_lvl := ");
field_ms__power__lvl.log();
TTCN_Logger::log_event_str(", fpc := ");
field_fpc.log();
TTCN_Logger::log_event_str(", reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", actual_ta := ");
field_actual__ta.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__L1Info::set_implicit_omit()
{
if (ms__power__lvl().is_bound()) ms__power__lvl().set_implicit_omit();
if (fpc().is_bound()) fpc().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (actual__ta().is_bound()) actual__ta().set_implicit_omit();
}

void RSL__IE__L1Info::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 @RSL_Types.RSL_IE_L1Info 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) ms__power__lvl().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fpc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) actual__ta().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(), "ms_power_lvl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__power__lvl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fpc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fpc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "actual_ta")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          actual__ta().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_L1Info: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_IE_L1Info");
  }
}

void RSL__IE__L1Info::encode_text(Text_Buf& text_buf) const
{
field_ms__power__lvl.encode_text(text_buf);
field_fpc.encode_text(text_buf);
field_reserved.encode_text(text_buf);
field_actual__ta.encode_text(text_buf);
}

void RSL__IE__L1Info::decode_text(Text_Buf& text_buf)
{
field_ms__power__lvl.decode_text(text_buf);
field_fpc.decode_text(text_buf);
field_reserved.decode_text(text_buf);
field_actual__ta.decode_text(text_buf);
}

void RSL__IE__L1Info::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 RSL__IE__L1Info::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 RSL__IE__L1Info::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, RSL__IE__L1Info_ms__power__lvl_descr_.raw->forceomit);
  decoded_field_length = field_ms__power__lvl.RAW_decode(RSL__IE__L1Info_ms__power__lvl_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, RSL__IE__L1Info_fpc_descr_.raw->forceomit);
  decoded_field_length = field_fpc.RAW_decode(RSL__IE__L1Info_fpc_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, RSL__IE__L1Info_reserved_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(RSL__IE__L1Info_reserved_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, RSL__IE__L1Info_actual__ta_descr_.raw->forceomit);
  decoded_field_length = field_actual__ta.RAW_decode(RSL__IE__L1Info_actual__ta_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 RSL__IE__L1Info::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, RSL__IE__L1Info_ms__power__lvl_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__L1Info_fpc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__L1Info_reserved_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RSL__IE__L1Info_actual__ta_descr_.raw);
  encoded_length += field_ms__power__lvl.RAW_encode(RSL__IE__L1Info_ms__power__lvl_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_fpc.RAW_encode(RSL__IE__L1Info_fpc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_reserved.RAW_encode(RSL__IE__L1Info_reserved_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_actual__ta.RAW_encode(RSL__IE__L1Info_actual__ta_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__L1Info_template::single_value_struct {
INTEGER_template field_ms__power__lvl;
BOOLEAN_template field_fpc;
INTEGER_template field_reserved;
INTEGER_template field_actual__ta;
};

void RSL__IE__L1Info_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_ms__power__lvl = ANY_VALUE;
single_value->field_fpc = ANY_VALUE;
single_value->field_reserved = ANY_VALUE;
single_value->field_actual__ta = ANY_VALUE;
}
}
}

void RSL__IE__L1Info_template::copy_value(const RSL__IE__L1Info& other_value)
{
single_value = new single_value_struct;
if (other_value.ms__power__lvl().is_bound()) {
  single_value->field_ms__power__lvl = other_value.ms__power__lvl();
} else {
  single_value->field_ms__power__lvl.clean_up();
}
if (other_value.fpc().is_bound()) {
  single_value->field_fpc = other_value.fpc();
} else {
  single_value->field_fpc.clean_up();
}
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.actual__ta().is_bound()) {
  single_value->field_actual__ta = other_value.actual__ta();
} else {
  single_value->field_actual__ta.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__L1Info_template::copy_template(const RSL__IE__L1Info_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ms__power__lvl().get_selection()) {
single_value->field_ms__power__lvl = other_value.ms__power__lvl();
} else {
single_value->field_ms__power__lvl.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fpc().get_selection()) {
single_value->field_fpc = other_value.fpc();
} else {
single_value->field_fpc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.actual__ta().get_selection()) {
single_value->field_actual__ta = other_value.actual__ta();
} else {
single_value->field_actual__ta.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 RSL__IE__L1Info_template[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 RSL__IE__L1Info_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__L1Info_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 @RSL_Types.RSL_IE_L1Info.");
break;
}
set_selection(other_value);
}

RSL__IE__L1Info_template::RSL__IE__L1Info_template()
{
}

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

RSL__IE__L1Info_template::RSL__IE__L1Info_template(const RSL__IE__L1Info& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__L1Info_template::match(const RSL__IE__L1Info& 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.ms__power__lvl().is_bound()) return FALSE;
if(!single_value->field_ms__power__lvl.match(other_value.ms__power__lvl(), legacy))return FALSE;
if(!other_value.fpc().is_bound()) return FALSE;
if(!single_value->field_fpc.match(other_value.fpc(), legacy))return FALSE;
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.actual__ta().is_bound()) return FALSE;
if(!single_value->field_actual__ta.match(other_value.actual__ta(), 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 @RSL_Types.RSL_IE_L1Info.");
}
return FALSE;
}

boolean RSL__IE__L1Info_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_ms__power__lvl.is_bound()
 || single_value->field_fpc.is_bound()
 || single_value->field_reserved.is_bound()
 || single_value->field_actual__ta.is_bound();
}

boolean RSL__IE__L1Info_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ms__power__lvl.is_value()
 && single_value->field_fpc.is_value()
 && single_value->field_reserved.is_value()
 && single_value->field_actual__ta.is_value();
}

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

RSL__IE__L1Info RSL__IE__L1Info_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 @RSL_Types.RSL_IE_L1Info.");
RSL__IE__L1Info ret_val;
if (single_value->field_ms__power__lvl.is_bound()) {
ret_val.ms__power__lvl() = single_value->field_ms__power__lvl.valueof();
}
if (single_value->field_fpc.is_bound()) {
ret_val.fpc() = single_value->field_fpc.valueof();
}
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_actual__ta.is_bound()) {
ret_val.actual__ta() = single_value->field_actual__ta.valueof();
}
return ret_val;
}

void RSL__IE__L1Info_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 @RSL_Types.RSL_IE_L1Info.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__L1Info_template[list_length];
}

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

INTEGER_template& RSL__IE__L1Info_template::ms__power__lvl()
{
set_specific();
return single_value->field_ms__power__lvl;
}

const INTEGER_template& RSL__IE__L1Info_template::ms__power__lvl() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ms_power_lvl of a non-specific template of type @RSL_Types.RSL_IE_L1Info.");
return single_value->field_ms__power__lvl;
}

BOOLEAN_template& RSL__IE__L1Info_template::fpc()
{
set_specific();
return single_value->field_fpc;
}

const BOOLEAN_template& RSL__IE__L1Info_template::fpc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fpc of a non-specific template of type @RSL_Types.RSL_IE_L1Info.");
return single_value->field_fpc;
}

INTEGER_template& RSL__IE__L1Info_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const INTEGER_template& RSL__IE__L1Info_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @RSL_Types.RSL_IE_L1Info.");
return single_value->field_reserved;
}

INTEGER_template& RSL__IE__L1Info_template::actual__ta()
{
set_specific();
return single_value->field_actual__ta;
}

const INTEGER_template& RSL__IE__L1Info_template::actual__ta() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field actual_ta of a non-specific template of type @RSL_Types.RSL_IE_L1Info.");
return single_value->field_actual__ta;
}

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

void RSL__IE__L1Info_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ms_power_lvl := ");
single_value->field_ms__power__lvl.log();
TTCN_Logger::log_event_str(", fpc := ");
single_value->field_fpc.log();
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", actual_ta := ");
single_value->field_actual__ta.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 RSL__IE__L1Info_template::log_match(const RSL__IE__L1Info& 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_ms__power__lvl.match(match_value.ms__power__lvl(), legacy)){
TTCN_Logger::log_logmatch_info(".ms_power_lvl");
single_value->field_ms__power__lvl.log_match(match_value.ms__power__lvl(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fpc.match(match_value.fpc(), legacy)){
TTCN_Logger::log_logmatch_info(".fpc");
single_value->field_fpc.log_match(match_value.fpc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_actual__ta.match(match_value.actual__ta(), legacy)){
TTCN_Logger::log_logmatch_info(".actual_ta");
single_value->field_actual__ta.log_match(match_value.actual__ta(), 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("{ ms_power_lvl := ");
single_value->field_ms__power__lvl.log_match(match_value.ms__power__lvl(), legacy);
TTCN_Logger::log_event_str(", fpc := ");
single_value->field_fpc.log_match(match_value.fpc(), legacy);
TTCN_Logger::log_event_str(", reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", actual_ta := ");
single_value->field_actual__ta.log_match(match_value.actual__ta(), 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 RSL__IE__L1Info_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (ms__power__lvl().is_bound()) ms__power__lvl().set_implicit_omit();
if (fpc().is_bound()) fpc().set_implicit_omit();
if (reserved().is_bound()) reserved().set_implicit_omit();
if (actual__ta().is_bound()) actual__ta().set_implicit_omit();
}

void RSL__IE__L1Info_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ms__power__lvl.encode_text(text_buf);
single_value->field_fpc.encode_text(text_buf);
single_value->field_reserved.encode_text(text_buf);
single_value->field_actual__ta.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 @RSL_Types.RSL_IE_L1Info.");
}
}

void RSL__IE__L1Info_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_ms__power__lvl.decode_text(text_buf);
single_value->field_fpc.decode_text(text_buf);
single_value->field_reserved.decode_text(text_buf);
single_value->field_actual__ta.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 RSL__IE__L1Info_template[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 @RSL_Types.RSL_IE_L1Info.");
}
}

void RSL__IE__L1Info_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: {
    RSL__IE__L1Info_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 @RSL_Types.RSL_IE_L1Info 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) ms__power__lvl().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fpc().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) reserved().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) actual__ta().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(), "ms_power_lvl")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__power__lvl().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fpc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fpc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "actual_ta")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          actual__ta().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_L1Info: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__L1Info_template* precondition = new RSL__IE__L1Info_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__L1Info_template* implied_template = new RSL__IE__L1Info_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__L1Info_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_L1Info");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__L1Info_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_ms__power__lvl.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_L1Info");
single_value->field_fpc.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_L1Info");
single_value->field_reserved.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_L1Info");
single_value->field_actual__ta.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_L1Info");
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 : "@RSL_Types.RSL_IE_L1Info");
}

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

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

RSL__IE__MS__Power::RSL__IE__MS__Power()
{
}

RSL__IE__MS__Power::RSL__IE__MS__Power(const INTEGER& par_reserved,
    const BOOLEAN& par_fpc__epc,
    const INTEGER& par_power__level)
  :   field_reserved(par_reserved),
  field_fpc__epc(par_fpc__epc),
  field_power__level(par_power__level)
{
}

RSL__IE__MS__Power::RSL__IE__MS__Power(const RSL__IE__MS__Power& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_MS_Power.");
if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
else field_reserved.clean_up();
if (other_value.fpc__epc().is_bound()) field_fpc__epc = other_value.fpc__epc();
else field_fpc__epc.clean_up();
if (other_value.power__level().is_bound()) field_power__level = other_value.power__level();
else field_power__level.clean_up();
}

void RSL__IE__MS__Power::clean_up()
{
field_reserved.clean_up();
field_fpc__epc.clean_up();
field_power__level.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__MS__Power::get_descriptor() const { return &RSL__IE__MS__Power_descr_; }
RSL__IE__MS__Power& RSL__IE__MS__Power::operator=(const RSL__IE__MS__Power& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_MS_Power.");
  if (other_value.reserved().is_bound()) field_reserved = other_value.reserved();
  else field_reserved.clean_up();
  if (other_value.fpc__epc().is_bound()) field_fpc__epc = other_value.fpc__epc();
  else field_fpc__epc.clean_up();
  if (other_value.power__level().is_bound()) field_power__level = other_value.power__level();
  else field_power__level.clean_up();
}
return *this;
}

boolean RSL__IE__MS__Power::operator==(const RSL__IE__MS__Power& other_value) const
{
return field_reserved==other_value.field_reserved
  && field_fpc__epc==other_value.field_fpc__epc
  && field_power__level==other_value.field_power__level;
}

boolean RSL__IE__MS__Power::is_bound() const
{
return (field_reserved.is_bound())
  || (field_fpc__epc.is_bound())
  || (field_power__level.is_bound());
}
boolean RSL__IE__MS__Power::is_value() const
{
return field_reserved.is_value()
  && field_fpc__epc.is_value()
  && field_power__level.is_value();
}
void RSL__IE__MS__Power::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ reserved := ");
field_reserved.log();
TTCN_Logger::log_event_str(", fpc_epc := ");
field_fpc__epc.log();
TTCN_Logger::log_event_str(", power_level := ");
field_power__level.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__MS__Power::set_implicit_omit()
{
if (reserved().is_bound()) reserved().set_implicit_omit();
if (fpc__epc().is_bound()) fpc__epc().set_implicit_omit();
if (power__level().is_bound()) power__level().set_implicit_omit();
}

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

void RSL__IE__MS__Power::encode_text(Text_Buf& text_buf) const
{
field_reserved.encode_text(text_buf);
field_fpc__epc.encode_text(text_buf);
field_power__level.encode_text(text_buf);
}

void RSL__IE__MS__Power::decode_text(Text_Buf& text_buf)
{
field_reserved.decode_text(text_buf);
field_fpc__epc.decode_text(text_buf);
field_power__level.decode_text(text_buf);
}

void RSL__IE__MS__Power::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 RSL__IE__MS__Power::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 RSL__IE__MS__Power::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, RSL__IE__MS__Power_reserved_descr_.raw->forceomit);
  decoded_field_length = field_reserved.RAW_decode(RSL__IE__MS__Power_reserved_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, RSL__IE__MS__Power_fpc__epc_descr_.raw->forceomit);
  decoded_field_length = field_fpc__epc.RAW_decode(RSL__IE__MS__Power_fpc__epc_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, RSL__IE__MS__Power_power__level_descr_.raw->forceomit);
  decoded_field_length = field_power__level.RAW_decode(RSL__IE__MS__Power_power__level_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 RSL__IE__MS__Power::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, RSL__IE__MS__Power_reserved_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__MS__Power_fpc__epc_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__MS__Power_power__level_descr_.raw);
  encoded_length += field_reserved.RAW_encode(RSL__IE__MS__Power_reserved_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_fpc__epc.RAW_encode(RSL__IE__MS__Power_fpc__epc_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_power__level.RAW_encode(RSL__IE__MS__Power_power__level_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__MS__Power_template::single_value_struct {
INTEGER_template field_reserved;
BOOLEAN_template field_fpc__epc;
INTEGER_template field_power__level;
};

void RSL__IE__MS__Power_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_reserved = ANY_VALUE;
single_value->field_fpc__epc = ANY_VALUE;
single_value->field_power__level = ANY_VALUE;
}
}
}

void RSL__IE__MS__Power_template::copy_value(const RSL__IE__MS__Power& other_value)
{
single_value = new single_value_struct;
if (other_value.reserved().is_bound()) {
  single_value->field_reserved = other_value.reserved();
} else {
  single_value->field_reserved.clean_up();
}
if (other_value.fpc__epc().is_bound()) {
  single_value->field_fpc__epc = other_value.fpc__epc();
} else {
  single_value->field_fpc__epc.clean_up();
}
if (other_value.power__level().is_bound()) {
  single_value->field_power__level = other_value.power__level();
} else {
  single_value->field_power__level.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__MS__Power_template::copy_template(const RSL__IE__MS__Power_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.reserved().get_selection()) {
single_value->field_reserved = other_value.reserved();
} else {
single_value->field_reserved.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fpc__epc().get_selection()) {
single_value->field_fpc__epc = other_value.fpc__epc();
} else {
single_value->field_fpc__epc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.power__level().get_selection()) {
single_value->field_power__level = other_value.power__level();
} else {
single_value->field_power__level.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 RSL__IE__MS__Power_template[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 RSL__IE__MS__Power_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__MS__Power_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 @RSL_Types.RSL_IE_MS_Power.");
break;
}
set_selection(other_value);
}

RSL__IE__MS__Power_template::RSL__IE__MS__Power_template()
{
}

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

RSL__IE__MS__Power_template::RSL__IE__MS__Power_template(const RSL__IE__MS__Power& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__MS__Power_template::match(const RSL__IE__MS__Power& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.reserved().is_bound()) return FALSE;
if(!single_value->field_reserved.match(other_value.reserved(), legacy))return FALSE;
if(!other_value.fpc__epc().is_bound()) return FALSE;
if(!single_value->field_fpc__epc.match(other_value.fpc__epc(), legacy))return FALSE;
if(!other_value.power__level().is_bound()) return FALSE;
if(!single_value->field_power__level.match(other_value.power__level(), 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 @RSL_Types.RSL_IE_MS_Power.");
}
return FALSE;
}

boolean RSL__IE__MS__Power_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_reserved.is_bound()
 || single_value->field_fpc__epc.is_bound()
 || single_value->field_power__level.is_bound();
}

boolean RSL__IE__MS__Power_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_reserved.is_value()
 && single_value->field_fpc__epc.is_value()
 && single_value->field_power__level.is_value();
}

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

RSL__IE__MS__Power RSL__IE__MS__Power_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 @RSL_Types.RSL_IE_MS_Power.");
RSL__IE__MS__Power ret_val;
if (single_value->field_reserved.is_bound()) {
ret_val.reserved() = single_value->field_reserved.valueof();
}
if (single_value->field_fpc__epc.is_bound()) {
ret_val.fpc__epc() = single_value->field_fpc__epc.valueof();
}
if (single_value->field_power__level.is_bound()) {
ret_val.power__level() = single_value->field_power__level.valueof();
}
return ret_val;
}

void RSL__IE__MS__Power_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 @RSL_Types.RSL_IE_MS_Power.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__MS__Power_template[list_length];
}

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

INTEGER_template& RSL__IE__MS__Power_template::reserved()
{
set_specific();
return single_value->field_reserved;
}

const INTEGER_template& RSL__IE__MS__Power_template::reserved() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved of a non-specific template of type @RSL_Types.RSL_IE_MS_Power.");
return single_value->field_reserved;
}

BOOLEAN_template& RSL__IE__MS__Power_template::fpc__epc()
{
set_specific();
return single_value->field_fpc__epc;
}

const BOOLEAN_template& RSL__IE__MS__Power_template::fpc__epc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fpc_epc of a non-specific template of type @RSL_Types.RSL_IE_MS_Power.");
return single_value->field_fpc__epc;
}

INTEGER_template& RSL__IE__MS__Power_template::power__level()
{
set_specific();
return single_value->field_power__level;
}

const INTEGER_template& RSL__IE__MS__Power_template::power__level() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field power_level of a non-specific template of type @RSL_Types.RSL_IE_MS_Power.");
return single_value->field_power__level;
}

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

void RSL__IE__MS__Power_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ reserved := ");
single_value->field_reserved.log();
TTCN_Logger::log_event_str(", fpc_epc := ");
single_value->field_fpc__epc.log();
TTCN_Logger::log_event_str(", power_level := ");
single_value->field_power__level.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 RSL__IE__MS__Power_template::log_match(const RSL__IE__MS__Power& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_reserved.match(match_value.reserved(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fpc__epc.match(match_value.fpc__epc(), legacy)){
TTCN_Logger::log_logmatch_info(".fpc_epc");
single_value->field_fpc__epc.log_match(match_value.fpc__epc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_power__level.match(match_value.power__level(), legacy)){
TTCN_Logger::log_logmatch_info(".power_level");
single_value->field_power__level.log_match(match_value.power__level(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ reserved := ");
single_value->field_reserved.log_match(match_value.reserved(), legacy);
TTCN_Logger::log_event_str(", fpc_epc := ");
single_value->field_fpc__epc.log_match(match_value.fpc__epc(), legacy);
TTCN_Logger::log_event_str(", power_level := ");
single_value->field_power__level.log_match(match_value.power__level(), 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 RSL__IE__MS__Power_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (reserved().is_bound()) reserved().set_implicit_omit();
if (fpc__epc().is_bound()) fpc__epc().set_implicit_omit();
if (power__level().is_bound()) power__level().set_implicit_omit();
}

void RSL__IE__MS__Power_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_reserved.encode_text(text_buf);
single_value->field_fpc__epc.encode_text(text_buf);
single_value->field_power__level.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 @RSL_Types.RSL_IE_MS_Power.");
}
}

void RSL__IE__MS__Power_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_reserved.decode_text(text_buf);
single_value->field_fpc__epc.decode_text(text_buf);
single_value->field_power__level.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 RSL__IE__MS__Power_template[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 @RSL_Types.RSL_IE_MS_Power.");
}
}

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

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

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

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

RSL__IE__RachLoad::RSL__IE__RachLoad()
{
}

RSL__IE__RachLoad::RSL__IE__RachLoad(const INTEGER& par_len,
    const INTEGER& par_slot__count,
    const INTEGER& par_busy__count,
    const INTEGER& par_access__count)
  :   field_len(par_len),
  field_slot__count(par_slot__count),
  field_busy__count(par_busy__count),
  field_access__count(par_access__count)
{
}

RSL__IE__RachLoad::RSL__IE__RachLoad(const RSL__IE__RachLoad& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_RachLoad.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.slot__count().is_bound()) field_slot__count = other_value.slot__count();
else field_slot__count.clean_up();
if (other_value.busy__count().is_bound()) field_busy__count = other_value.busy__count();
else field_busy__count.clean_up();
if (other_value.access__count().is_bound()) field_access__count = other_value.access__count();
else field_access__count.clean_up();
}

void RSL__IE__RachLoad::clean_up()
{
field_len.clean_up();
field_slot__count.clean_up();
field_busy__count.clean_up();
field_access__count.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__RachLoad::get_descriptor() const { return &RSL__IE__RachLoad_descr_; }
RSL__IE__RachLoad& RSL__IE__RachLoad::operator=(const RSL__IE__RachLoad& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_RachLoad.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.slot__count().is_bound()) field_slot__count = other_value.slot__count();
  else field_slot__count.clean_up();
  if (other_value.busy__count().is_bound()) field_busy__count = other_value.busy__count();
  else field_busy__count.clean_up();
  if (other_value.access__count().is_bound()) field_access__count = other_value.access__count();
  else field_access__count.clean_up();
}
return *this;
}

boolean RSL__IE__RachLoad::operator==(const RSL__IE__RachLoad& other_value) const
{
return field_len==other_value.field_len
  && field_slot__count==other_value.field_slot__count
  && field_busy__count==other_value.field_busy__count
  && field_access__count==other_value.field_access__count;
}

boolean RSL__IE__RachLoad::is_bound() const
{
return (field_len.is_bound())
  || (field_slot__count.is_bound())
  || (field_busy__count.is_bound())
  || (field_access__count.is_bound());
}
boolean RSL__IE__RachLoad::is_value() const
{
return field_len.is_value()
  && field_slot__count.is_value()
  && field_busy__count.is_value()
  && field_access__count.is_value();
}
void RSL__IE__RachLoad::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", slot_count := ");
field_slot__count.log();
TTCN_Logger::log_event_str(", busy_count := ");
field_busy__count.log();
TTCN_Logger::log_event_str(", access_count := ");
field_access__count.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__RachLoad::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (slot__count().is_bound()) slot__count().set_implicit_omit();
if (busy__count().is_bound()) busy__count().set_implicit_omit();
if (access__count().is_bound()) access__count().set_implicit_omit();
}

void RSL__IE__RachLoad::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 @RSL_Types.RSL_IE_RachLoad 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) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) slot__count().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) busy__count().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) access__count().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "slot_count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          slot__count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "busy_count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          busy__count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "access_count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          access__count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_RachLoad: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_IE_RachLoad");
  }
}

void RSL__IE__RachLoad::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_slot__count.encode_text(text_buf);
field_busy__count.encode_text(text_buf);
field_access__count.encode_text(text_buf);
}

void RSL__IE__RachLoad::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_slot__count.decode_text(text_buf);
field_busy__count.decode_text(text_buf);
field_access__count.decode_text(text_buf);
}

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

int RSL__IE__RachLoad::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, RSL__IE__RachLoad_len_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__RachLoad_slot__count_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__RachLoad_busy__count_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RSL__IE__RachLoad_access__count_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RSL__IE__RachLoad_len_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 3;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(3);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  encoded_length += field_slot__count.RAW_encode(RSL__IE__RachLoad_slot__count_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_busy__count.RAW_encode(RSL__IE__RachLoad_busy__count_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_access__count.RAW_encode(RSL__IE__RachLoad_access__count_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__RachLoad_template::single_value_struct {
INTEGER_template field_len;
INTEGER_template field_slot__count;
INTEGER_template field_busy__count;
INTEGER_template field_access__count;
};

void RSL__IE__RachLoad_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_len = ANY_VALUE;
single_value->field_slot__count = ANY_VALUE;
single_value->field_busy__count = ANY_VALUE;
single_value->field_access__count = ANY_VALUE;
}
}
}

void RSL__IE__RachLoad_template::copy_value(const RSL__IE__RachLoad& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.slot__count().is_bound()) {
  single_value->field_slot__count = other_value.slot__count();
} else {
  single_value->field_slot__count.clean_up();
}
if (other_value.busy__count().is_bound()) {
  single_value->field_busy__count = other_value.busy__count();
} else {
  single_value->field_busy__count.clean_up();
}
if (other_value.access__count().is_bound()) {
  single_value->field_access__count = other_value.access__count();
} else {
  single_value->field_access__count.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__RachLoad_template::copy_template(const RSL__IE__RachLoad_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.slot__count().get_selection()) {
single_value->field_slot__count = other_value.slot__count();
} else {
single_value->field_slot__count.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.busy__count().get_selection()) {
single_value->field_busy__count = other_value.busy__count();
} else {
single_value->field_busy__count.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.access__count().get_selection()) {
single_value->field_access__count = other_value.access__count();
} else {
single_value->field_access__count.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 RSL__IE__RachLoad_template[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 RSL__IE__RachLoad_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__RachLoad_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 @RSL_Types.RSL_IE_RachLoad.");
break;
}
set_selection(other_value);
}

RSL__IE__RachLoad_template::RSL__IE__RachLoad_template()
{
}

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

RSL__IE__RachLoad_template::RSL__IE__RachLoad_template(const RSL__IE__RachLoad& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__IE__RachLoad_template::match(const RSL__IE__RachLoad& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.slot__count().is_bound()) return FALSE;
if(!single_value->field_slot__count.match(other_value.slot__count(), legacy))return FALSE;
if(!other_value.busy__count().is_bound()) return FALSE;
if(!single_value->field_busy__count.match(other_value.busy__count(), legacy))return FALSE;
if(!other_value.access__count().is_bound()) return FALSE;
if(!single_value->field_access__count.match(other_value.access__count(), 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 @RSL_Types.RSL_IE_RachLoad.");
}
return FALSE;
}

boolean RSL__IE__RachLoad_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_len.is_bound()
 || single_value->field_slot__count.is_bound()
 || single_value->field_busy__count.is_bound()
 || single_value->field_access__count.is_bound();
}

boolean RSL__IE__RachLoad_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_len.is_value()
 && single_value->field_slot__count.is_value()
 && single_value->field_busy__count.is_value()
 && single_value->field_access__count.is_value();
}

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

RSL__IE__RachLoad RSL__IE__RachLoad_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 @RSL_Types.RSL_IE_RachLoad.");
RSL__IE__RachLoad ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_slot__count.is_bound()) {
ret_val.slot__count() = single_value->field_slot__count.valueof();
}
if (single_value->field_busy__count.is_bound()) {
ret_val.busy__count() = single_value->field_busy__count.valueof();
}
if (single_value->field_access__count.is_bound()) {
ret_val.access__count() = single_value->field_access__count.valueof();
}
return ret_val;
}

void RSL__IE__RachLoad_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 @RSL_Types.RSL_IE_RachLoad.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__RachLoad_template[list_length];
}

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

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

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

INTEGER_template& RSL__IE__RachLoad_template::slot__count()
{
set_specific();
return single_value->field_slot__count;
}

const INTEGER_template& RSL__IE__RachLoad_template::slot__count() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field slot_count of a non-specific template of type @RSL_Types.RSL_IE_RachLoad.");
return single_value->field_slot__count;
}

INTEGER_template& RSL__IE__RachLoad_template::busy__count()
{
set_specific();
return single_value->field_busy__count;
}

const INTEGER_template& RSL__IE__RachLoad_template::busy__count() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field busy_count of a non-specific template of type @RSL_Types.RSL_IE_RachLoad.");
return single_value->field_busy__count;
}

INTEGER_template& RSL__IE__RachLoad_template::access__count()
{
set_specific();
return single_value->field_access__count;
}

const INTEGER_template& RSL__IE__RachLoad_template::access__count() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field access_count of a non-specific template of type @RSL_Types.RSL_IE_RachLoad.");
return single_value->field_access__count;
}

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

void RSL__IE__RachLoad_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", slot_count := ");
single_value->field_slot__count.log();
TTCN_Logger::log_event_str(", busy_count := ");
single_value->field_busy__count.log();
TTCN_Logger::log_event_str(", access_count := ");
single_value->field_access__count.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 RSL__IE__RachLoad_template::log_match(const RSL__IE__RachLoad& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_slot__count.match(match_value.slot__count(), legacy)){
TTCN_Logger::log_logmatch_info(".slot_count");
single_value->field_slot__count.log_match(match_value.slot__count(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_busy__count.match(match_value.busy__count(), legacy)){
TTCN_Logger::log_logmatch_info(".busy_count");
single_value->field_busy__count.log_match(match_value.busy__count(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_access__count.match(match_value.access__count(), legacy)){
TTCN_Logger::log_logmatch_info(".access_count");
single_value->field_access__count.log_match(match_value.access__count(), 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("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", slot_count := ");
single_value->field_slot__count.log_match(match_value.slot__count(), legacy);
TTCN_Logger::log_event_str(", busy_count := ");
single_value->field_busy__count.log_match(match_value.busy__count(), legacy);
TTCN_Logger::log_event_str(", access_count := ");
single_value->field_access__count.log_match(match_value.access__count(), 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 RSL__IE__RachLoad_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (slot__count().is_bound()) slot__count().set_implicit_omit();
if (busy__count().is_bound()) busy__count().set_implicit_omit();
if (access__count().is_bound()) access__count().set_implicit_omit();
}

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

void RSL__IE__RachLoad_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_len.decode_text(text_buf);
single_value->field_slot__count.decode_text(text_buf);
single_value->field_busy__count.decode_text(text_buf);
single_value->field_access__count.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RSL__IE__RachLoad_template[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 @RSL_Types.RSL_IE_RachLoad.");
}
}

void RSL__IE__RachLoad_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: {
    RSL__IE__RachLoad_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 @RSL_Types.RSL_IE_RachLoad 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) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) slot__count().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) busy__count().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) access__count().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "slot_count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          slot__count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "busy_count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          busy__count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "access_count")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          access__count().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_RachLoad: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__RachLoad_template* precondition = new RSL__IE__RachLoad_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__RachLoad_template* implied_template = new RSL__IE__RachLoad_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__RachLoad_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_RachLoad");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__RachLoad_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_RachLoad");
single_value->field_slot__count.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_RachLoad");
single_value->field_busy__count.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_RachLoad");
single_value->field_access__count.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_RachLoad");
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 : "@RSL_Types.RSL_IE_RachLoad");
}

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

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

RSL__IE__RequestRef::RSL__IE__RequestRef()
{
}

RSL__IE__RequestRef::RSL__IE__RequestRef(const OCTETSTRING& par_ra,
    const RSL__IE__FrameNumber& par_frame__nr)
  :   field_ra(par_ra),
  field_frame__nr(par_frame__nr)
{
}

RSL__IE__RequestRef::RSL__IE__RequestRef(const RSL__IE__RequestRef& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_RequestRef.");
if (other_value.ra().is_bound()) field_ra = other_value.ra();
else field_ra.clean_up();
if (other_value.frame__nr().is_bound()) field_frame__nr = other_value.frame__nr();
else field_frame__nr.clean_up();
}

void RSL__IE__RequestRef::clean_up()
{
field_ra.clean_up();
field_frame__nr.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__RequestRef::get_descriptor() const { return &RSL__IE__RequestRef_descr_; }
RSL__IE__RequestRef& RSL__IE__RequestRef::operator=(const RSL__IE__RequestRef& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_RequestRef.");
  if (other_value.ra().is_bound()) field_ra = other_value.ra();
  else field_ra.clean_up();
  if (other_value.frame__nr().is_bound()) field_frame__nr = other_value.frame__nr();
  else field_frame__nr.clean_up();
}
return *this;
}

boolean RSL__IE__RequestRef::operator==(const RSL__IE__RequestRef& other_value) const
{
return field_ra==other_value.field_ra
  && field_frame__nr==other_value.field_frame__nr;
}

boolean RSL__IE__RequestRef::is_bound() const
{
return (field_ra.is_bound())
  || (field_frame__nr.is_bound());
}
boolean RSL__IE__RequestRef::is_value() const
{
return field_ra.is_value()
  && field_frame__nr.is_value();
}
void RSL__IE__RequestRef::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ra := ");
field_ra.log();
TTCN_Logger::log_event_str(", frame_nr := ");
field_frame__nr.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__RequestRef::set_implicit_omit()
{
if (ra().is_bound()) ra().set_implicit_omit();
if (frame__nr().is_bound()) frame__nr().set_implicit_omit();
}

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

void RSL__IE__RequestRef::encode_text(Text_Buf& text_buf) const
{
field_ra.encode_text(text_buf);
field_frame__nr.encode_text(text_buf);
}

void RSL__IE__RequestRef::decode_text(Text_Buf& text_buf)
{
field_ra.decode_text(text_buf);
field_frame__nr.decode_text(text_buf);
}

void RSL__IE__RequestRef::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 RSL__IE__RequestRef::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 RSL__IE__RequestRef::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, RSL__IE__RequestRef_ra_descr_.raw->forceomit);
  decoded_field_length = field_ra.RAW_decode(RSL__IE__RequestRef_ra_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, RSL__IE__RequestRef_frame__nr_descr_.raw->forceomit);
  decoded_field_length = field_frame__nr.RAW_decode(RSL__IE__RequestRef_frame__nr_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 RSL__IE__RequestRef::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, RSL__IE__RequestRef_ra_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__RequestRef_frame__nr_descr_.raw);
  encoded_length += field_ra.RAW_encode(RSL__IE__RequestRef_ra_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_frame__nr.RAW_encode(RSL__IE__RequestRef_frame__nr_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__RequestRef_template::single_value_struct {
OCTETSTRING_template field_ra;
RSL__IE__FrameNumber_template field_frame__nr;
};

void RSL__IE__RequestRef_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_ra = ANY_VALUE;
single_value->field_frame__nr = ANY_VALUE;
}
}
}

void RSL__IE__RequestRef_template::copy_value(const RSL__IE__RequestRef& other_value)
{
single_value = new single_value_struct;
if (other_value.ra().is_bound()) {
  single_value->field_ra = other_value.ra();
} else {
  single_value->field_ra.clean_up();
}
if (other_value.frame__nr().is_bound()) {
  single_value->field_frame__nr = other_value.frame__nr();
} else {
  single_value->field_frame__nr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__RequestRef_template::copy_template(const RSL__IE__RequestRef_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ra().get_selection()) {
single_value->field_ra = other_value.ra();
} else {
single_value->field_ra.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.frame__nr().get_selection()) {
single_value->field_frame__nr = other_value.frame__nr();
} else {
single_value->field_frame__nr.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RSL__IE__RequestRef_template[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 RSL__IE__RequestRef_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__RequestRef_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 @RSL_Types.RSL_IE_RequestRef.");
break;
}
set_selection(other_value);
}

RSL__IE__RequestRef_template::RSL__IE__RequestRef_template()
{
}

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

RSL__IE__RequestRef_template::RSL__IE__RequestRef_template(const RSL__IE__RequestRef& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

boolean RSL__IE__RequestRef_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ra.is_value()
 && single_value->field_frame__nr.is_value();
}

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

RSL__IE__RequestRef RSL__IE__RequestRef_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 @RSL_Types.RSL_IE_RequestRef.");
RSL__IE__RequestRef ret_val;
if (single_value->field_ra.is_bound()) {
ret_val.ra() = single_value->field_ra.valueof();
}
if (single_value->field_frame__nr.is_bound()) {
ret_val.frame__nr() = single_value->field_frame__nr.valueof();
}
return ret_val;
}

void RSL__IE__RequestRef_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 @RSL_Types.RSL_IE_RequestRef.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__RequestRef_template[list_length];
}

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

OCTETSTRING_template& RSL__IE__RequestRef_template::ra()
{
set_specific();
return single_value->field_ra;
}

const OCTETSTRING_template& RSL__IE__RequestRef_template::ra() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ra of a non-specific template of type @RSL_Types.RSL_IE_RequestRef.");
return single_value->field_ra;
}

RSL__IE__FrameNumber_template& RSL__IE__RequestRef_template::frame__nr()
{
set_specific();
return single_value->field_frame__nr;
}

const RSL__IE__FrameNumber_template& RSL__IE__RequestRef_template::frame__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frame_nr of a non-specific template of type @RSL_Types.RSL_IE_RequestRef.");
return single_value->field_frame__nr;
}

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

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

void RSL__IE__RequestRef_template::log_match(const RSL__IE__RequestRef& 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_ra.match(match_value.ra(), legacy)){
TTCN_Logger::log_logmatch_info(".ra");
single_value->field_ra.log_match(match_value.ra(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_frame__nr.match(match_value.frame__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".frame_nr");
single_value->field_frame__nr.log_match(match_value.frame__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ ra := ");
single_value->field_ra.log_match(match_value.ra(), legacy);
TTCN_Logger::log_event_str(", frame_nr := ");
single_value->field_frame__nr.log_match(match_value.frame__nr(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RSL__IE__RequestRef_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (ra().is_bound()) ra().set_implicit_omit();
if (frame__nr().is_bound()) frame__nr().set_implicit_omit();
}

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

void RSL__IE__RequestRef_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_ra.decode_text(text_buf);
single_value->field_frame__nr.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RSL__IE__RequestRef_template[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 @RSL_Types.RSL_IE_RequestRef.");
}
}

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

void RSL__IE__RequestRef_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_ra.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_RequestRef");
single_value->field_frame__nr.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_RequestRef");
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 : "@RSL_Types.RSL_IE_RequestRef");
}

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

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


const RSL__ResourceInfoItem RSL__ResourceInfo::UNBOUND_ELEM;
RSL__ResourceInfo::RSL__ResourceInfo()
{
val_ptr = NULL;
}

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

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

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

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

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

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

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

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

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

RSL__ResourceInfoItem& RSL__ResourceInfo::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @RSL_Types.RSL_ResourceInfo.");
return (*this)[(int)index_value];
}

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

const RSL__ResourceInfoItem& RSL__ResourceInfo::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @RSL_Types.RSL_ResourceInfo.");
return (*this)[(int)index_value];
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

RSL__ResourceInfo_template::RSL__ResourceInfo_template()
{
}

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

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

RSL__ResourceInfo_template::RSL__ResourceInfo_template(const RSL__ResourceInfo& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

RSL__ResourceInfoItem::RSL__ResourceInfoItem(const GSM__Types::RslChannelNr& par_chan__nr,
    const INTEGER& par_interf__band,
    const BITSTRING& par_rfu)
  :   field_chan__nr(par_chan__nr),
  field_interf__band(par_interf__band),
  field_rfu(par_rfu)
{
}

RSL__ResourceInfoItem::RSL__ResourceInfoItem(const RSL__ResourceInfoItem& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_ResourceInfoItem.");
if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
else field_chan__nr.clean_up();
if (other_value.interf__band().is_bound()) field_interf__band = other_value.interf__band();
else field_interf__band.clean_up();
if (other_value.rfu().is_bound()) field_rfu = other_value.rfu();
else field_rfu.clean_up();
}

void RSL__ResourceInfoItem::clean_up()
{
field_chan__nr.clean_up();
field_interf__band.clean_up();
field_rfu.clean_up();
}

const TTCN_Typedescriptor_t* RSL__ResourceInfoItem::get_descriptor() const { return &RSL__ResourceInfoItem_descr_; }
RSL__ResourceInfoItem& RSL__ResourceInfoItem::operator=(const RSL__ResourceInfoItem& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_ResourceInfoItem.");
  if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
  else field_chan__nr.clean_up();
  if (other_value.interf__band().is_bound()) field_interf__band = other_value.interf__band();
  else field_interf__band.clean_up();
  if (other_value.rfu().is_bound()) field_rfu = other_value.rfu();
  else field_rfu.clean_up();
}
return *this;
}

boolean RSL__ResourceInfoItem::operator==(const RSL__ResourceInfoItem& other_value) const
{
return field_chan__nr==other_value.field_chan__nr
  && field_interf__band==other_value.field_interf__band
  && field_rfu==other_value.field_rfu;
}

boolean RSL__ResourceInfoItem::is_bound() const
{
return (field_chan__nr.is_bound())
  || (field_interf__band.is_bound())
  || (field_rfu.is_bound());
}
boolean RSL__ResourceInfoItem::is_value() const
{
return field_chan__nr.is_value()
  && field_interf__band.is_value()
  && field_rfu.is_value();
}
void RSL__ResourceInfoItem::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ chan_nr := ");
field_chan__nr.log();
TTCN_Logger::log_event_str(", interf_band := ");
field_interf__band.log();
TTCN_Logger::log_event_str(", rfu := ");
field_rfu.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__ResourceInfoItem::set_implicit_omit()
{
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (interf__band().is_bound()) interf__band().set_implicit_omit();
if (rfu().is_bound()) rfu().set_implicit_omit();
}

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

void RSL__ResourceInfoItem::encode_text(Text_Buf& text_buf) const
{
field_chan__nr.encode_text(text_buf);
field_interf__band.encode_text(text_buf);
field_rfu.encode_text(text_buf);
}

void RSL__ResourceInfoItem::decode_text(Text_Buf& text_buf)
{
field_chan__nr.decode_text(text_buf);
field_interf__band.decode_text(text_buf);
field_rfu.decode_text(text_buf);
}

void RSL__ResourceInfoItem::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 RSL__ResourceInfoItem::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 RSL__ResourceInfoItem::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, RSL__ResourceInfoItem_chan__nr_descr_.raw->forceomit);
  decoded_field_length = field_chan__nr.RAW_decode(RSL__ResourceInfoItem_chan__nr_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, RSL__ResourceInfoItem_interf__band_descr_.raw->forceomit);
  decoded_field_length = field_interf__band.RAW_decode(RSL__ResourceInfoItem_interf__band_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, RSL__ResourceInfoItem_rfu_descr_.raw->forceomit);
  decoded_field_length = field_rfu.RAW_decode(RSL__ResourceInfoItem_rfu_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 RSL__ResourceInfoItem::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, RSL__ResourceInfoItem_chan__nr_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__ResourceInfoItem_interf__band_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__ResourceInfoItem_rfu_descr_.raw);
  encoded_length += field_chan__nr.RAW_encode(RSL__ResourceInfoItem_chan__nr_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_interf__band.RAW_encode(RSL__ResourceInfoItem_interf__band_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_rfu.RAW_encode(RSL__ResourceInfoItem_rfu_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct RSL__ResourceInfoItem_template::single_value_struct {
GSM__Types::RslChannelNr_template field_chan__nr;
INTEGER_template field_interf__band;
BITSTRING_template field_rfu;
};

void RSL__ResourceInfoItem_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_chan__nr = ANY_VALUE;
single_value->field_interf__band = ANY_VALUE;
single_value->field_rfu = ANY_VALUE;
}
}
}

void RSL__ResourceInfoItem_template::copy_value(const RSL__ResourceInfoItem& other_value)
{
single_value = new single_value_struct;
if (other_value.chan__nr().is_bound()) {
  single_value->field_chan__nr = other_value.chan__nr();
} else {
  single_value->field_chan__nr.clean_up();
}
if (other_value.interf__band().is_bound()) {
  single_value->field_interf__band = other_value.interf__band();
} else {
  single_value->field_interf__band.clean_up();
}
if (other_value.rfu().is_bound()) {
  single_value->field_rfu = other_value.rfu();
} else {
  single_value->field_rfu.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__ResourceInfoItem_template::copy_template(const RSL__ResourceInfoItem_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.chan__nr().get_selection()) {
single_value->field_chan__nr = other_value.chan__nr();
} else {
single_value->field_chan__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.interf__band().get_selection()) {
single_value->field_interf__band = other_value.interf__band();
} else {
single_value->field_interf__band.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rfu().get_selection()) {
single_value->field_rfu = other_value.rfu();
} else {
single_value->field_rfu.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 RSL__ResourceInfoItem_template[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 RSL__ResourceInfoItem_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__ResourceInfoItem_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 @RSL_Types.RSL_ResourceInfoItem.");
break;
}
set_selection(other_value);
}

RSL__ResourceInfoItem_template::RSL__ResourceInfoItem_template()
{
}

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

RSL__ResourceInfoItem_template::RSL__ResourceInfoItem_template(const RSL__ResourceInfoItem& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean RSL__ResourceInfoItem_template::match(const RSL__ResourceInfoItem& 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.chan__nr().is_bound()) return FALSE;
if(!single_value->field_chan__nr.match(other_value.chan__nr(), legacy))return FALSE;
if(!other_value.interf__band().is_bound()) return FALSE;
if(!single_value->field_interf__band.match(other_value.interf__band(), legacy))return FALSE;
if(!other_value.rfu().is_bound()) return FALSE;
if(!single_value->field_rfu.match(other_value.rfu(), 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 @RSL_Types.RSL_ResourceInfoItem.");
}
return FALSE;
}

boolean RSL__ResourceInfoItem_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_chan__nr.is_bound()
 || single_value->field_interf__band.is_bound()
 || single_value->field_rfu.is_bound();
}

boolean RSL__ResourceInfoItem_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_chan__nr.is_value()
 && single_value->field_interf__band.is_value()
 && single_value->field_rfu.is_value();
}

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

RSL__ResourceInfoItem RSL__ResourceInfoItem_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 @RSL_Types.RSL_ResourceInfoItem.");
RSL__ResourceInfoItem ret_val;
if (single_value->field_chan__nr.is_bound()) {
ret_val.chan__nr() = single_value->field_chan__nr.valueof();
}
if (single_value->field_interf__band.is_bound()) {
ret_val.interf__band() = single_value->field_interf__band.valueof();
}
if (single_value->field_rfu.is_bound()) {
ret_val.rfu() = single_value->field_rfu.valueof();
}
return ret_val;
}

void RSL__ResourceInfoItem_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 @RSL_Types.RSL_ResourceInfoItem.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__ResourceInfoItem_template[list_length];
}

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

GSM__Types::RslChannelNr_template& RSL__ResourceInfoItem_template::chan__nr()
{
set_specific();
return single_value->field_chan__nr;
}

const GSM__Types::RslChannelNr_template& RSL__ResourceInfoItem_template::chan__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field chan_nr of a non-specific template of type @RSL_Types.RSL_ResourceInfoItem.");
return single_value->field_chan__nr;
}

INTEGER_template& RSL__ResourceInfoItem_template::interf__band()
{
set_specific();
return single_value->field_interf__band;
}

const INTEGER_template& RSL__ResourceInfoItem_template::interf__band() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field interf_band of a non-specific template of type @RSL_Types.RSL_ResourceInfoItem.");
return single_value->field_interf__band;
}

BITSTRING_template& RSL__ResourceInfoItem_template::rfu()
{
set_specific();
return single_value->field_rfu;
}

const BITSTRING_template& RSL__ResourceInfoItem_template::rfu() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rfu of a non-specific template of type @RSL_Types.RSL_ResourceInfoItem.");
return single_value->field_rfu;
}

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

void RSL__ResourceInfoItem_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ chan_nr := ");
single_value->field_chan__nr.log();
TTCN_Logger::log_event_str(", interf_band := ");
single_value->field_interf__band.log();
TTCN_Logger::log_event_str(", rfu := ");
single_value->field_rfu.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 RSL__ResourceInfoItem_template::log_match(const RSL__ResourceInfoItem& 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_chan__nr.match(match_value.chan__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".chan_nr");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_interf__band.match(match_value.interf__band(), legacy)){
TTCN_Logger::log_logmatch_info(".interf_band");
single_value->field_interf__band.log_match(match_value.interf__band(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rfu.match(match_value.rfu(), legacy)){
TTCN_Logger::log_logmatch_info(".rfu");
single_value->field_rfu.log_match(match_value.rfu(), 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("{ chan_nr := ");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::log_event_str(", interf_band := ");
single_value->field_interf__band.log_match(match_value.interf__band(), legacy);
TTCN_Logger::log_event_str(", rfu := ");
single_value->field_rfu.log_match(match_value.rfu(), 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 RSL__ResourceInfoItem_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (interf__band().is_bound()) interf__band().set_implicit_omit();
if (rfu().is_bound()) rfu().set_implicit_omit();
}

void RSL__ResourceInfoItem_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_chan__nr.encode_text(text_buf);
single_value->field_interf__band.encode_text(text_buf);
single_value->field_rfu.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 @RSL_Types.RSL_ResourceInfoItem.");
}
}

void RSL__ResourceInfoItem_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_chan__nr.decode_text(text_buf);
single_value->field_interf__band.decode_text(text_buf);
single_value->field_rfu.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 RSL__ResourceInfoItem_template[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 @RSL_Types.RSL_ResourceInfoItem.");
}
}

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

void RSL__ResourceInfoItem_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_chan__nr.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_ResourceInfoItem");
single_value->field_interf__band.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_ResourceInfoItem");
single_value->field_rfu.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_ResourceInfoItem");
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 : "@RSL_Types.RSL_ResourceInfoItem");
}

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

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

RSL__IE__ResourceInfo::RSL__IE__ResourceInfo()
{
}

RSL__IE__ResourceInfo::RSL__IE__ResourceInfo(const INTEGER& par_len,
    const RSL__ResourceInfo& par_info)
  :   field_len(par_len),
  field_info(par_info)
{
}

RSL__IE__ResourceInfo::RSL__IE__ResourceInfo(const RSL__IE__ResourceInfo& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_ResourceInfo.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.info().is_bound()) field_info = other_value.info();
else field_info.clean_up();
}

void RSL__IE__ResourceInfo::clean_up()
{
field_len.clean_up();
field_info.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__ResourceInfo::get_descriptor() const { return &RSL__IE__ResourceInfo_descr_; }
RSL__IE__ResourceInfo& RSL__IE__ResourceInfo::operator=(const RSL__IE__ResourceInfo& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_ResourceInfo.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.info().is_bound()) field_info = other_value.info();
  else field_info.clean_up();
}
return *this;
}

boolean RSL__IE__ResourceInfo::operator==(const RSL__IE__ResourceInfo& other_value) const
{
return field_len==other_value.field_len
  && field_info==other_value.field_info;
}

boolean RSL__IE__ResourceInfo::is_bound() const
{
return (field_len.is_bound())
  || (field_info.is_bound());
}
boolean RSL__IE__ResourceInfo::is_value() const
{
return field_len.is_value()
  && field_info.is_value();
}
void RSL__IE__ResourceInfo::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", info := ");
field_info.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__ResourceInfo::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (info().is_bound()) info().set_implicit_omit();
}

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

void RSL__IE__ResourceInfo::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_info.encode_text(text_buf);
}

void RSL__IE__ResourceInfo::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_info.decode_text(text_buf);
}

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

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

struct RSL__IE__ResourceInfo_template::single_value_struct {
INTEGER_template field_len;
RSL__ResourceInfo_template field_info;
};

void RSL__IE__ResourceInfo_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_len = ANY_VALUE;
single_value->field_info = ANY_VALUE;
}
}
}

void RSL__IE__ResourceInfo_template::copy_value(const RSL__IE__ResourceInfo& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.info().is_bound()) {
  single_value->field_info = other_value.info();
} else {
  single_value->field_info.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__ResourceInfo_template::copy_template(const RSL__IE__ResourceInfo_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.info().get_selection()) {
single_value->field_info = other_value.info();
} else {
single_value->field_info.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 RSL__IE__ResourceInfo_template[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 RSL__IE__ResourceInfo_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__ResourceInfo_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 @RSL_Types.RSL_IE_ResourceInfo.");
break;
}
set_selection(other_value);
}

RSL__IE__ResourceInfo_template::RSL__IE__ResourceInfo_template()
{
}

RSL__IE__ResourceInfo_template::RSL__IE__ResourceInfo_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__IE__ResourceInfo_template::RSL__IE__ResourceInfo_template(const RSL__IE__ResourceInfo& other_value)
{
copy_value(other_value);
}

RSL__IE__ResourceInfo_template::RSL__IE__ResourceInfo_template(const OPTIONAL<RSL__IE__ResourceInfo>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__ResourceInfo&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @RSL_Types.RSL_IE_ResourceInfo from an unbound optional field.");
}
}

RSL__IE__ResourceInfo_template::RSL__IE__ResourceInfo_template(RSL__IE__ResourceInfo_template* p_precondition, RSL__IE__ResourceInfo_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__IE__ResourceInfo_template::RSL__IE__ResourceInfo_template(Dynamic_Match_Interface<RSL__IE__ResourceInfo>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__IE__ResourceInfo>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__IE__ResourceInfo_template::RSL__IE__ResourceInfo_template(const RSL__IE__ResourceInfo_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RSL__IE__ResourceInfo_template::~RSL__IE__ResourceInfo_template()
{
clean_up();
}

RSL__IE__ResourceInfo_template& RSL__IE__ResourceInfo_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__IE__ResourceInfo_template& RSL__IE__ResourceInfo_template::operator=(const RSL__IE__ResourceInfo& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RSL__IE__ResourceInfo_template& RSL__IE__ResourceInfo_template::operator=(const OPTIONAL<RSL__IE__ResourceInfo>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__ResourceInfo&)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 @RSL_Types.RSL_IE_ResourceInfo.");
}
return *this;
}

RSL__IE__ResourceInfo_template& RSL__IE__ResourceInfo_template::operator=(const RSL__IE__ResourceInfo_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__IE__ResourceInfo_template::match(const RSL__IE__ResourceInfo& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.info().is_bound()) return FALSE;
if(!single_value->field_info.match(other_value.info(), 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 @RSL_Types.RSL_IE_ResourceInfo.");
}
return FALSE;
}

boolean RSL__IE__ResourceInfo_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_len.is_bound()
 || single_value->field_info.is_bound();
}

boolean RSL__IE__ResourceInfo_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_len.is_value()
 && single_value->field_info.is_value();
}

void RSL__IE__ResourceInfo_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;
}

RSL__IE__ResourceInfo RSL__IE__ResourceInfo_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 @RSL_Types.RSL_IE_ResourceInfo.");
RSL__IE__ResourceInfo ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_info.is_bound()) {
ret_val.info() = single_value->field_info.valueof();
}
return ret_val;
}

void RSL__IE__ResourceInfo_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 @RSL_Types.RSL_IE_ResourceInfo.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__ResourceInfo_template[list_length];
}

RSL__IE__ResourceInfo_template& RSL__IE__ResourceInfo_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 @RSL_Types.RSL_IE_ResourceInfo.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @RSL_Types.RSL_IE_ResourceInfo.");
return value_list.list_value[list_index];
}

INTEGER_template& RSL__IE__ResourceInfo_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& RSL__IE__ResourceInfo_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @RSL_Types.RSL_IE_ResourceInfo.");
return single_value->field_len;
}

RSL__ResourceInfo_template& RSL__IE__ResourceInfo_template::info()
{
set_specific();
return single_value->field_info;
}

const RSL__ResourceInfo_template& RSL__IE__ResourceInfo_template::info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field info of a non-specific template of type @RSL_Types.RSL_IE_ResourceInfo.");
return single_value->field_info;
}

int RSL__IE__ResourceInfo_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_ResourceInfo 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 @RSL_Types.RSL_IE_ResourceInfo 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 @RSL_Types.RSL_IE_ResourceInfo containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_ResourceInfo containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_ResourceInfo containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_ResourceInfo containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_ResourceInfo containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_ResourceInfo containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_ResourceInfo containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Types.RSL_IE_ResourceInfo.");
  }
  return 0;
}

void RSL__IE__ResourceInfo_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", info := ");
single_value->field_info.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 RSL__IE__ResourceInfo_template::log_match(const RSL__IE__ResourceInfo& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_info.match(match_value.info(), legacy)){
TTCN_Logger::log_logmatch_info(".info");
single_value->field_info.log_match(match_value.info(), 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("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", info := ");
single_value->field_info.log_match(match_value.info(), 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 RSL__IE__ResourceInfo_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (info().is_bound()) info().set_implicit_omit();
}

void RSL__IE__ResourceInfo_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.encode_text(text_buf);
single_value->field_info.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 @RSL_Types.RSL_IE_ResourceInfo.");
}
}

void RSL__IE__ResourceInfo_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_len.decode_text(text_buf);
single_value->field_info.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 RSL__IE__ResourceInfo_template[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 @RSL_Types.RSL_IE_ResourceInfo.");
}
}

void RSL__IE__ResourceInfo_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: {
    RSL__IE__ResourceInfo_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 @RSL_Types.RSL_IE_ResourceInfo 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) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) info().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_ResourceInfo: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__ResourceInfo_template* precondition = new RSL__IE__ResourceInfo_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__ResourceInfo_template* implied_template = new RSL__IE__ResourceInfo_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__ResourceInfo_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_ResourceInfo");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__ResourceInfo_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ResourceInfo");
single_value->field_info.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_ResourceInfo");
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 : "@RSL_Types.RSL_IE_ResourceInfo");
}

boolean RSL__IE__ResourceInfo_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__IE__ResourceInfo_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;
}

RSL__IE__UplinkMeasSuppMeasInfo::RSL__IE__UplinkMeasSuppMeasInfo()
{
}

RSL__IE__UplinkMeasSuppMeasInfo::RSL__IE__UplinkMeasSuppMeasInfo(const INTEGER& par_toa256__mean,
    const INTEGER& par_toa256__min,
    const INTEGER& par_toa256__max,
    const INTEGER& par_toa256__std__dev)
  :   field_toa256__mean(par_toa256__mean),
  field_toa256__min(par_toa256__min),
  field_toa256__max(par_toa256__max),
  field_toa256__std__dev(par_toa256__std__dev)
{
}

RSL__IE__UplinkMeasSuppMeasInfo::RSL__IE__UplinkMeasSuppMeasInfo(const RSL__IE__UplinkMeasSuppMeasInfo& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
if (other_value.toa256__mean().is_bound()) field_toa256__mean = other_value.toa256__mean();
else field_toa256__mean.clean_up();
if (other_value.toa256__min().is_bound()) field_toa256__min = other_value.toa256__min();
else field_toa256__min.clean_up();
if (other_value.toa256__max().is_bound()) field_toa256__max = other_value.toa256__max();
else field_toa256__max.clean_up();
if (other_value.toa256__std__dev().is_bound()) field_toa256__std__dev = other_value.toa256__std__dev();
else field_toa256__std__dev.clean_up();
}

void RSL__IE__UplinkMeasSuppMeasInfo::clean_up()
{
field_toa256__mean.clean_up();
field_toa256__min.clean_up();
field_toa256__max.clean_up();
field_toa256__std__dev.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__UplinkMeasSuppMeasInfo::get_descriptor() const { return &RSL__IE__UplinkMeasSuppMeasInfo_descr_; }
RSL__IE__UplinkMeasSuppMeasInfo& RSL__IE__UplinkMeasSuppMeasInfo::operator=(const RSL__IE__UplinkMeasSuppMeasInfo& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
  if (other_value.toa256__mean().is_bound()) field_toa256__mean = other_value.toa256__mean();
  else field_toa256__mean.clean_up();
  if (other_value.toa256__min().is_bound()) field_toa256__min = other_value.toa256__min();
  else field_toa256__min.clean_up();
  if (other_value.toa256__max().is_bound()) field_toa256__max = other_value.toa256__max();
  else field_toa256__max.clean_up();
  if (other_value.toa256__std__dev().is_bound()) field_toa256__std__dev = other_value.toa256__std__dev();
  else field_toa256__std__dev.clean_up();
}
return *this;
}

boolean RSL__IE__UplinkMeasSuppMeasInfo::operator==(const RSL__IE__UplinkMeasSuppMeasInfo& other_value) const
{
return field_toa256__mean==other_value.field_toa256__mean
  && field_toa256__min==other_value.field_toa256__min
  && field_toa256__max==other_value.field_toa256__max
  && field_toa256__std__dev==other_value.field_toa256__std__dev;
}

boolean RSL__IE__UplinkMeasSuppMeasInfo::is_bound() const
{
return (field_toa256__mean.is_bound())
  || (field_toa256__min.is_bound())
  || (field_toa256__max.is_bound())
  || (field_toa256__std__dev.is_bound());
}
boolean RSL__IE__UplinkMeasSuppMeasInfo::is_value() const
{
return field_toa256__mean.is_value()
  && field_toa256__min.is_value()
  && field_toa256__max.is_value()
  && field_toa256__std__dev.is_value();
}
void RSL__IE__UplinkMeasSuppMeasInfo::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ toa256_mean := ");
field_toa256__mean.log();
TTCN_Logger::log_event_str(", toa256_min := ");
field_toa256__min.log();
TTCN_Logger::log_event_str(", toa256_max := ");
field_toa256__max.log();
TTCN_Logger::log_event_str(", toa256_std_dev := ");
field_toa256__std__dev.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__UplinkMeasSuppMeasInfo::set_implicit_omit()
{
if (toa256__mean().is_bound()) toa256__mean().set_implicit_omit();
if (toa256__min().is_bound()) toa256__min().set_implicit_omit();
if (toa256__max().is_bound()) toa256__max().set_implicit_omit();
if (toa256__std__dev().is_bound()) toa256__std__dev().set_implicit_omit();
}

void RSL__IE__UplinkMeasSuppMeasInfo::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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo 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) toa256__mean().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) toa256__min().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) toa256__max().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) toa256__std__dev().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(), "toa256_mean")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__mean().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__min().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_max")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__max().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_std_dev")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__std__dev().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo");
  }
}

void RSL__IE__UplinkMeasSuppMeasInfo::encode_text(Text_Buf& text_buf) const
{
field_toa256__mean.encode_text(text_buf);
field_toa256__min.encode_text(text_buf);
field_toa256__max.encode_text(text_buf);
field_toa256__std__dev.encode_text(text_buf);
}

void RSL__IE__UplinkMeasSuppMeasInfo::decode_text(Text_Buf& text_buf)
{
field_toa256__mean.decode_text(text_buf);
field_toa256__min.decode_text(text_buf);
field_toa256__max.decode_text(text_buf);
field_toa256__std__dev.decode_text(text_buf);
}

void RSL__IE__UplinkMeasSuppMeasInfo::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 RSL__IE__UplinkMeasSuppMeasInfo::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 RSL__IE__UplinkMeasSuppMeasInfo::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, RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_descr_.raw->forceomit);
  decoded_field_length = field_toa256__mean.RAW_decode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_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, RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_descr_.raw->forceomit);
  decoded_field_length = field_toa256__min.RAW_decode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_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, RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_descr_.raw->forceomit);
  decoded_field_length = field_toa256__max.RAW_decode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_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, RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_descr_.raw->forceomit);
  decoded_field_length = field_toa256__std__dev.RAW_decode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_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 RSL__IE__UplinkMeasSuppMeasInfo::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, RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_descr_.raw);
  encoded_length += field_toa256__mean.RAW_encode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__mean_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_toa256__min.RAW_encode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__min_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_toa256__max.RAW_encode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__max_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_toa256__std__dev.RAW_encode(RSL__IE__UplinkMeasSuppMeasInfo_toa256__std__dev_descr_, *myleaf.body.node.nodes[3]);
  return myleaf.length = encoded_length;
}

struct RSL__IE__UplinkMeasSuppMeasInfo_template::single_value_struct {
INTEGER_template field_toa256__mean;
INTEGER_template field_toa256__min;
INTEGER_template field_toa256__max;
INTEGER_template field_toa256__std__dev;
};

void RSL__IE__UplinkMeasSuppMeasInfo_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_toa256__mean = ANY_VALUE;
single_value->field_toa256__min = ANY_VALUE;
single_value->field_toa256__max = ANY_VALUE;
single_value->field_toa256__std__dev = ANY_VALUE;
}
}
}

void RSL__IE__UplinkMeasSuppMeasInfo_template::copy_value(const RSL__IE__UplinkMeasSuppMeasInfo& other_value)
{
single_value = new single_value_struct;
if (other_value.toa256__mean().is_bound()) {
  single_value->field_toa256__mean = other_value.toa256__mean();
} else {
  single_value->field_toa256__mean.clean_up();
}
if (other_value.toa256__min().is_bound()) {
  single_value->field_toa256__min = other_value.toa256__min();
} else {
  single_value->field_toa256__min.clean_up();
}
if (other_value.toa256__max().is_bound()) {
  single_value->field_toa256__max = other_value.toa256__max();
} else {
  single_value->field_toa256__max.clean_up();
}
if (other_value.toa256__std__dev().is_bound()) {
  single_value->field_toa256__std__dev = other_value.toa256__std__dev();
} else {
  single_value->field_toa256__std__dev.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__UplinkMeasSuppMeasInfo_template::copy_template(const RSL__IE__UplinkMeasSuppMeasInfo_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.toa256__mean().get_selection()) {
single_value->field_toa256__mean = other_value.toa256__mean();
} else {
single_value->field_toa256__mean.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.toa256__min().get_selection()) {
single_value->field_toa256__min = other_value.toa256__min();
} else {
single_value->field_toa256__min.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.toa256__max().get_selection()) {
single_value->field_toa256__max = other_value.toa256__max();
} else {
single_value->field_toa256__max.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.toa256__std__dev().get_selection()) {
single_value->field_toa256__std__dev = other_value.toa256__std__dev();
} else {
single_value->field_toa256__std__dev.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 RSL__IE__UplinkMeasSuppMeasInfo_template[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 RSL__IE__UplinkMeasSuppMeasInfo_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__UplinkMeasSuppMeasInfo_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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
break;
}
set_selection(other_value);
}

RSL__IE__UplinkMeasSuppMeasInfo_template::RSL__IE__UplinkMeasSuppMeasInfo_template()
{
}

RSL__IE__UplinkMeasSuppMeasInfo_template::RSL__IE__UplinkMeasSuppMeasInfo_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__IE__UplinkMeasSuppMeasInfo_template::RSL__IE__UplinkMeasSuppMeasInfo_template(const RSL__IE__UplinkMeasSuppMeasInfo& other_value)
{
copy_value(other_value);
}

RSL__IE__UplinkMeasSuppMeasInfo_template::RSL__IE__UplinkMeasSuppMeasInfo_template(const OPTIONAL<RSL__IE__UplinkMeasSuppMeasInfo>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__UplinkMeasSuppMeasInfo&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo from an unbound optional field.");
}
}

RSL__IE__UplinkMeasSuppMeasInfo_template::RSL__IE__UplinkMeasSuppMeasInfo_template(RSL__IE__UplinkMeasSuppMeasInfo_template* p_precondition, RSL__IE__UplinkMeasSuppMeasInfo_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__IE__UplinkMeasSuppMeasInfo_template::RSL__IE__UplinkMeasSuppMeasInfo_template(Dynamic_Match_Interface<RSL__IE__UplinkMeasSuppMeasInfo>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__IE__UplinkMeasSuppMeasInfo>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__IE__UplinkMeasSuppMeasInfo_template::RSL__IE__UplinkMeasSuppMeasInfo_template(const RSL__IE__UplinkMeasSuppMeasInfo_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RSL__IE__UplinkMeasSuppMeasInfo_template::~RSL__IE__UplinkMeasSuppMeasInfo_template()
{
clean_up();
}

RSL__IE__UplinkMeasSuppMeasInfo_template& RSL__IE__UplinkMeasSuppMeasInfo_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__IE__UplinkMeasSuppMeasInfo_template& RSL__IE__UplinkMeasSuppMeasInfo_template::operator=(const RSL__IE__UplinkMeasSuppMeasInfo& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RSL__IE__UplinkMeasSuppMeasInfo_template& RSL__IE__UplinkMeasSuppMeasInfo_template::operator=(const OPTIONAL<RSL__IE__UplinkMeasSuppMeasInfo>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__UplinkMeasSuppMeasInfo&)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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
}
return *this;
}

RSL__IE__UplinkMeasSuppMeasInfo_template& RSL__IE__UplinkMeasSuppMeasInfo_template::operator=(const RSL__IE__UplinkMeasSuppMeasInfo_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__IE__UplinkMeasSuppMeasInfo_template::match(const RSL__IE__UplinkMeasSuppMeasInfo& 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.toa256__mean().is_bound()) return FALSE;
if(!single_value->field_toa256__mean.match(other_value.toa256__mean(), legacy))return FALSE;
if(!other_value.toa256__min().is_bound()) return FALSE;
if(!single_value->field_toa256__min.match(other_value.toa256__min(), legacy))return FALSE;
if(!other_value.toa256__max().is_bound()) return FALSE;
if(!single_value->field_toa256__max.match(other_value.toa256__max(), legacy))return FALSE;
if(!other_value.toa256__std__dev().is_bound()) return FALSE;
if(!single_value->field_toa256__std__dev.match(other_value.toa256__std__dev(), 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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
}
return FALSE;
}

boolean RSL__IE__UplinkMeasSuppMeasInfo_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_toa256__mean.is_bound()
 || single_value->field_toa256__min.is_bound()
 || single_value->field_toa256__max.is_bound()
 || single_value->field_toa256__std__dev.is_bound();
}

boolean RSL__IE__UplinkMeasSuppMeasInfo_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_toa256__mean.is_value()
 && single_value->field_toa256__min.is_value()
 && single_value->field_toa256__max.is_value()
 && single_value->field_toa256__std__dev.is_value();
}

void RSL__IE__UplinkMeasSuppMeasInfo_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;
}

RSL__IE__UplinkMeasSuppMeasInfo RSL__IE__UplinkMeasSuppMeasInfo_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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
RSL__IE__UplinkMeasSuppMeasInfo ret_val;
if (single_value->field_toa256__mean.is_bound()) {
ret_val.toa256__mean() = single_value->field_toa256__mean.valueof();
}
if (single_value->field_toa256__min.is_bound()) {
ret_val.toa256__min() = single_value->field_toa256__min.valueof();
}
if (single_value->field_toa256__max.is_bound()) {
ret_val.toa256__max() = single_value->field_toa256__max.valueof();
}
if (single_value->field_toa256__std__dev.is_bound()) {
ret_val.toa256__std__dev() = single_value->field_toa256__std__dev.valueof();
}
return ret_val;
}

void RSL__IE__UplinkMeasSuppMeasInfo_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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__UplinkMeasSuppMeasInfo_template[list_length];
}

RSL__IE__UplinkMeasSuppMeasInfo_template& RSL__IE__UplinkMeasSuppMeasInfo_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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
return value_list.list_value[list_index];
}

INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__mean()
{
set_specific();
return single_value->field_toa256__mean;
}

const INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__mean() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field toa256_mean of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
return single_value->field_toa256__mean;
}

INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__min()
{
set_specific();
return single_value->field_toa256__min;
}

const INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__min() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field toa256_min of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
return single_value->field_toa256__min;
}

INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__max()
{
set_specific();
return single_value->field_toa256__max;
}

const INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__max() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field toa256_max of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
return single_value->field_toa256__max;
}

INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__std__dev()
{
set_specific();
return single_value->field_toa256__std__dev;
}

const INTEGER_template& RSL__IE__UplinkMeasSuppMeasInfo_template::toa256__std__dev() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field toa256_std_dev of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
return single_value->field_toa256__std__dev;
}

int RSL__IE__UplinkMeasSuppMeasInfo_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo 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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo 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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
  }
  return 0;
}

void RSL__IE__UplinkMeasSuppMeasInfo_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ toa256_mean := ");
single_value->field_toa256__mean.log();
TTCN_Logger::log_event_str(", toa256_min := ");
single_value->field_toa256__min.log();
TTCN_Logger::log_event_str(", toa256_max := ");
single_value->field_toa256__max.log();
TTCN_Logger::log_event_str(", toa256_std_dev := ");
single_value->field_toa256__std__dev.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 RSL__IE__UplinkMeasSuppMeasInfo_template::log_match(const RSL__IE__UplinkMeasSuppMeasInfo& 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_toa256__mean.match(match_value.toa256__mean(), legacy)){
TTCN_Logger::log_logmatch_info(".toa256_mean");
single_value->field_toa256__mean.log_match(match_value.toa256__mean(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_toa256__min.match(match_value.toa256__min(), legacy)){
TTCN_Logger::log_logmatch_info(".toa256_min");
single_value->field_toa256__min.log_match(match_value.toa256__min(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_toa256__max.match(match_value.toa256__max(), legacy)){
TTCN_Logger::log_logmatch_info(".toa256_max");
single_value->field_toa256__max.log_match(match_value.toa256__max(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_toa256__std__dev.match(match_value.toa256__std__dev(), legacy)){
TTCN_Logger::log_logmatch_info(".toa256_std_dev");
single_value->field_toa256__std__dev.log_match(match_value.toa256__std__dev(), 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("{ toa256_mean := ");
single_value->field_toa256__mean.log_match(match_value.toa256__mean(), legacy);
TTCN_Logger::log_event_str(", toa256_min := ");
single_value->field_toa256__min.log_match(match_value.toa256__min(), legacy);
TTCN_Logger::log_event_str(", toa256_max := ");
single_value->field_toa256__max.log_match(match_value.toa256__max(), legacy);
TTCN_Logger::log_event_str(", toa256_std_dev := ");
single_value->field_toa256__std__dev.log_match(match_value.toa256__std__dev(), 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 RSL__IE__UplinkMeasSuppMeasInfo_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (toa256__mean().is_bound()) toa256__mean().set_implicit_omit();
if (toa256__min().is_bound()) toa256__min().set_implicit_omit();
if (toa256__max().is_bound()) toa256__max().set_implicit_omit();
if (toa256__std__dev().is_bound()) toa256__std__dev().set_implicit_omit();
}

void RSL__IE__UplinkMeasSuppMeasInfo_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_toa256__mean.encode_text(text_buf);
single_value->field_toa256__min.encode_text(text_buf);
single_value->field_toa256__max.encode_text(text_buf);
single_value->field_toa256__std__dev.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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
}
}

void RSL__IE__UplinkMeasSuppMeasInfo_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_toa256__mean.decode_text(text_buf);
single_value->field_toa256__min.decode_text(text_buf);
single_value->field_toa256__max.decode_text(text_buf);
single_value->field_toa256__std__dev.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 RSL__IE__UplinkMeasSuppMeasInfo_template[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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo.");
}
}

void RSL__IE__UplinkMeasSuppMeasInfo_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: {
    RSL__IE__UplinkMeasSuppMeasInfo_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 @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo 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) toa256__mean().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) toa256__min().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) toa256__max().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) toa256__std__dev().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(), "toa256_mean")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__mean().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_min")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__min().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_max")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__max().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_std_dev")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__std__dev().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__UplinkMeasSuppMeasInfo_template* precondition = new RSL__IE__UplinkMeasSuppMeasInfo_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__UplinkMeasSuppMeasInfo_template* implied_template = new RSL__IE__UplinkMeasSuppMeasInfo_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__UplinkMeasSuppMeasInfo_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__UplinkMeasSuppMeasInfo_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_toa256__mean.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo");
single_value->field_toa256__min.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo");
single_value->field_toa256__max.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo");
single_value->field_toa256__std__dev.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo");
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 : "@RSL_Types.RSL_IE_UplinkMeasSuppMeasInfo");
}

boolean RSL__IE__UplinkMeasSuppMeasInfo_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__IE__UplinkMeasSuppMeasInfo_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;
}

RSL__IE__UplinkMeas::RSL__IE__UplinkMeas()
{
}

RSL__IE__UplinkMeas::RSL__IE__UplinkMeas(const INTEGER& par_len,
    const BITSTRING& par_rfu,
    const BOOLEAN& par_dtx__d,
    const INTEGER& par_rxlev__f__u,
    const BITSTRING& par_reserved1,
    const INTEGER& par_rxlev__s__u,
    const BITSTRING& par_reserved2,
    const INTEGER& par_rxq__f__u,
    const INTEGER& par_rxq__s__u,
    const OPTIONAL< RSL__IE__UplinkMeasSuppMeasInfo >& par_supp__meas__info)
  :   field_len(par_len),
  field_rfu(par_rfu),
  field_dtx__d(par_dtx__d),
  field_rxlev__f__u(par_rxlev__f__u),
  field_reserved1(par_reserved1),
  field_rxlev__s__u(par_rxlev__s__u),
  field_reserved2(par_reserved2),
  field_rxq__f__u(par_rxq__f__u),
  field_rxq__s__u(par_rxq__s__u),
  field_supp__meas__info(par_supp__meas__info)
{
}

RSL__IE__UplinkMeas::RSL__IE__UplinkMeas(const RSL__IE__UplinkMeas& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_UplinkMeas.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.rfu().is_bound()) field_rfu = other_value.rfu();
else field_rfu.clean_up();
if (other_value.dtx__d().is_bound()) field_dtx__d = other_value.dtx__d();
else field_dtx__d.clean_up();
if (other_value.rxlev__f__u().is_bound()) field_rxlev__f__u = other_value.rxlev__f__u();
else field_rxlev__f__u.clean_up();
if (other_value.reserved1().is_bound()) field_reserved1 = other_value.reserved1();
else field_reserved1.clean_up();
if (other_value.rxlev__s__u().is_bound()) field_rxlev__s__u = other_value.rxlev__s__u();
else field_rxlev__s__u.clean_up();
if (other_value.reserved2().is_bound()) field_reserved2 = other_value.reserved2();
else field_reserved2.clean_up();
if (other_value.rxq__f__u().is_bound()) field_rxq__f__u = other_value.rxq__f__u();
else field_rxq__f__u.clean_up();
if (other_value.rxq__s__u().is_bound()) field_rxq__s__u = other_value.rxq__s__u();
else field_rxq__s__u.clean_up();
if (other_value.supp__meas__info().is_bound()) field_supp__meas__info = other_value.supp__meas__info();
else field_supp__meas__info.clean_up();
}

void RSL__IE__UplinkMeas::clean_up()
{
field_len.clean_up();
field_rfu.clean_up();
field_dtx__d.clean_up();
field_rxlev__f__u.clean_up();
field_reserved1.clean_up();
field_rxlev__s__u.clean_up();
field_reserved2.clean_up();
field_rxq__f__u.clean_up();
field_rxq__s__u.clean_up();
field_supp__meas__info.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__UplinkMeas::get_descriptor() const { return &RSL__IE__UplinkMeas_descr_; }
RSL__IE__UplinkMeas& RSL__IE__UplinkMeas::operator=(const RSL__IE__UplinkMeas& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_UplinkMeas.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.rfu().is_bound()) field_rfu = other_value.rfu();
  else field_rfu.clean_up();
  if (other_value.dtx__d().is_bound()) field_dtx__d = other_value.dtx__d();
  else field_dtx__d.clean_up();
  if (other_value.rxlev__f__u().is_bound()) field_rxlev__f__u = other_value.rxlev__f__u();
  else field_rxlev__f__u.clean_up();
  if (other_value.reserved1().is_bound()) field_reserved1 = other_value.reserved1();
  else field_reserved1.clean_up();
  if (other_value.rxlev__s__u().is_bound()) field_rxlev__s__u = other_value.rxlev__s__u();
  else field_rxlev__s__u.clean_up();
  if (other_value.reserved2().is_bound()) field_reserved2 = other_value.reserved2();
  else field_reserved2.clean_up();
  if (other_value.rxq__f__u().is_bound()) field_rxq__f__u = other_value.rxq__f__u();
  else field_rxq__f__u.clean_up();
  if (other_value.rxq__s__u().is_bound()) field_rxq__s__u = other_value.rxq__s__u();
  else field_rxq__s__u.clean_up();
  if (other_value.supp__meas__info().is_bound()) field_supp__meas__info = other_value.supp__meas__info();
  else field_supp__meas__info.clean_up();
}
return *this;
}

boolean RSL__IE__UplinkMeas::operator==(const RSL__IE__UplinkMeas& other_value) const
{
return field_len==other_value.field_len
  && field_rfu==other_value.field_rfu
  && field_dtx__d==other_value.field_dtx__d
  && field_rxlev__f__u==other_value.field_rxlev__f__u
  && field_reserved1==other_value.field_reserved1
  && field_rxlev__s__u==other_value.field_rxlev__s__u
  && field_reserved2==other_value.field_reserved2
  && field_rxq__f__u==other_value.field_rxq__f__u
  && field_rxq__s__u==other_value.field_rxq__s__u
  && field_supp__meas__info==other_value.field_supp__meas__info;
}

boolean RSL__IE__UplinkMeas::is_bound() const
{
return (field_len.is_bound())
  || (field_rfu.is_bound())
  || (field_dtx__d.is_bound())
  || (field_rxlev__f__u.is_bound())
  || (field_reserved1.is_bound())
  || (field_rxlev__s__u.is_bound())
  || (field_reserved2.is_bound())
  || (field_rxq__f__u.is_bound())
  || (field_rxq__s__u.is_bound())
  || (OPTIONAL_OMIT == field_supp__meas__info.get_selection() || field_supp__meas__info.is_bound());
}
boolean RSL__IE__UplinkMeas::is_value() const
{
return field_len.is_value()
  && field_rfu.is_value()
  && field_dtx__d.is_value()
  && field_rxlev__f__u.is_value()
  && field_reserved1.is_value()
  && field_rxlev__s__u.is_value()
  && field_reserved2.is_value()
  && field_rxq__f__u.is_value()
  && field_rxq__s__u.is_value()
  && (OPTIONAL_OMIT == field_supp__meas__info.get_selection() || field_supp__meas__info.is_value());
}
int RSL__IE__UplinkMeas::size_of() const
{
  int ret_val = 9;
  if (field_supp__meas__info.ispresent()) ret_val++;
  return ret_val;
}

void RSL__IE__UplinkMeas::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", rfu := ");
field_rfu.log();
TTCN_Logger::log_event_str(", dtx_d := ");
field_dtx__d.log();
TTCN_Logger::log_event_str(", rxlev_f_u := ");
field_rxlev__f__u.log();
TTCN_Logger::log_event_str(", reserved1 := ");
field_reserved1.log();
TTCN_Logger::log_event_str(", rxlev_s_u := ");
field_rxlev__s__u.log();
TTCN_Logger::log_event_str(", reserved2 := ");
field_reserved2.log();
TTCN_Logger::log_event_str(", rxq_f_u := ");
field_rxq__f__u.log();
TTCN_Logger::log_event_str(", rxq_s_u := ");
field_rxq__s__u.log();
TTCN_Logger::log_event_str(", supp_meas_info := ");
field_supp__meas__info.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__UplinkMeas::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (rfu().is_bound()) rfu().set_implicit_omit();
if (dtx__d().is_bound()) dtx__d().set_implicit_omit();
if (rxlev__f__u().is_bound()) rxlev__f__u().set_implicit_omit();
if (reserved1().is_bound()) reserved1().set_implicit_omit();
if (rxlev__s__u().is_bound()) rxlev__s__u().set_implicit_omit();
if (reserved2().is_bound()) reserved2().set_implicit_omit();
if (rxq__f__u().is_bound()) rxq__f__u().set_implicit_omit();
if (rxq__s__u().is_bound()) rxq__s__u().set_implicit_omit();
if (!supp__meas__info().is_bound()) supp__meas__info() = OMIT_VALUE;
else supp__meas__info().set_implicit_omit();
}

void RSL__IE__UplinkMeas::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 (10<param.get_size()) {
      param.error("record value of type @RSL_Types.RSL_IE_UplinkMeas has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rfu().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dtx__d().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rxlev__f__u().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rxlev__s__u().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reserved2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rxq__f__u().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) rxq__s__u().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) supp__meas__info().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rfu")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rfu().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_d")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__d().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_f_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev__f__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_s_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev__s__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxq_f_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxq__f__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxq_s_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxq__s__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supp_meas_info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supp__meas__info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_UplinkMeas: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_IE_UplinkMeas");
  }
}

void RSL__IE__UplinkMeas::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_rfu.encode_text(text_buf);
field_dtx__d.encode_text(text_buf);
field_rxlev__f__u.encode_text(text_buf);
field_reserved1.encode_text(text_buf);
field_rxlev__s__u.encode_text(text_buf);
field_reserved2.encode_text(text_buf);
field_rxq__f__u.encode_text(text_buf);
field_rxq__s__u.encode_text(text_buf);
field_supp__meas__info.encode_text(text_buf);
}

void RSL__IE__UplinkMeas::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_rfu.decode_text(text_buf);
field_dtx__d.decode_text(text_buf);
field_rxlev__f__u.decode_text(text_buf);
field_reserved1.decode_text(text_buf);
field_rxlev__s__u.decode_text(text_buf);
field_reserved2.decode_text(text_buf);
field_rxq__f__u.decode_text(text_buf);
field_rxq__s__u.decode_text(text_buf);
field_supp__meas__info.decode_text(text_buf);
}

void RSL__IE__UplinkMeas::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 RSL__IE__UplinkMeas::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 RSL__IE__UplinkMeas::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RSL__IE__UplinkMeas_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(RSL__IE__UplinkMeas_len_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_len.convert_to_Integer(RSL__IE__UplinkMeas_len_descr_);
  field_len = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, RSL__IE__UplinkMeas_rfu_descr_.raw->forceomit);
  decoded_field_length = field_rfu.RAW_decode(RSL__IE__UplinkMeas_rfu_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, RSL__IE__UplinkMeas_dtx__d_descr_.raw->forceomit);
  decoded_field_length = field_dtx__d.RAW_decode(RSL__IE__UplinkMeas_dtx__d_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_3_force_omit(3, force_omit, RSL__IE__UplinkMeas_rxlev__f__u_descr_.raw->forceomit);
  decoded_field_length = field_rxlev__f__u.RAW_decode(RSL__IE__UplinkMeas_rxlev__f__u_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_4_force_omit(4, force_omit, RSL__IE__UplinkMeas_reserved1_descr_.raw->forceomit);
  decoded_field_length = field_reserved1.RAW_decode(RSL__IE__UplinkMeas_reserved1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_5_force_omit(5, force_omit, RSL__IE__UplinkMeas_rxlev__s__u_descr_.raw->forceomit);
  decoded_field_length = field_rxlev__s__u.RAW_decode(RSL__IE__UplinkMeas_rxlev__s__u_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_6_force_omit(6, force_omit, RSL__IE__UplinkMeas_reserved2_descr_.raw->forceomit);
  decoded_field_length = field_reserved2.RAW_decode(RSL__IE__UplinkMeas_reserved2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_7_force_omit(7, force_omit, RSL__IE__UplinkMeas_rxq__f__u_descr_.raw->forceomit);
  decoded_field_length = field_rxq__f__u.RAW_decode(RSL__IE__UplinkMeas_rxq__f__u_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_8_force_omit(8, force_omit, RSL__IE__UplinkMeas_rxq__s__u_descr_.raw->forceomit);
  decoded_field_length = field_rxq__s__u.RAW_decode(RSL__IE__UplinkMeas_rxq__s__u_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_supp__meas__info = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, RSL__IE__UplinkMeas_supp__meas__info_descr_.raw->forceomit);
  decoded_field_length = field_supp__meas__info().RAW_decode(RSL__IE__UplinkMeas_supp__meas__info_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_supp__meas__info = 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());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_supp__meas__info=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RSL__IE__UplinkMeas::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 = 10;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(10);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, RSL__IE__UplinkMeas_len_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__UplinkMeas_rfu_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__UplinkMeas_dtx__d_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RSL__IE__UplinkMeas_rxlev__f__u_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RSL__IE__UplinkMeas_reserved1_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RSL__IE__UplinkMeas_rxlev__s__u_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RSL__IE__UplinkMeas_reserved2_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, RSL__IE__UplinkMeas_rxq__f__u_descr_.raw);
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, RSL__IE__UplinkMeas_rxq__s__u_descr_.raw);
  if (field_supp__meas__info.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, RSL__IE__UplinkMeas_supp__meas__info_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RSL__IE__UplinkMeas_len_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 9;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(9);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[4]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[4]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[5]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[5]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[6]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[6]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].level = myleaf.body.node.nodes[7]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[6].pos = myleaf.body.node.nodes[7]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[7].level = myleaf.body.node.nodes[8]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[7].pos = myleaf.body.node.nodes[8]->curr_pos.pos;
  if (field_supp__meas__info.ispresent()) {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[8].level = myleaf.body.node.nodes[9]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[8].pos = myleaf.body.node.nodes[9]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[8].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[8].pos = 0;
  }
  encoded_length += field_rfu.RAW_encode(RSL__IE__UplinkMeas_rfu_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_dtx__d.RAW_encode(RSL__IE__UplinkMeas_dtx__d_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_rxlev__f__u.RAW_encode(RSL__IE__UplinkMeas_rxlev__f__u_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_reserved1.RAW_encode(RSL__IE__UplinkMeas_reserved1_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_rxlev__s__u.RAW_encode(RSL__IE__UplinkMeas_rxlev__s__u_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_reserved2.RAW_encode(RSL__IE__UplinkMeas_reserved2_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_rxq__f__u.RAW_encode(RSL__IE__UplinkMeas_rxq__f__u_descr_, *myleaf.body.node.nodes[7]);
  encoded_length += field_rxq__s__u.RAW_encode(RSL__IE__UplinkMeas_rxq__s__u_descr_, *myleaf.body.node.nodes[8]);
  if (field_supp__meas__info.ispresent()) {
  encoded_length += field_supp__meas__info().RAW_encode(RSL__IE__UplinkMeas_supp__meas__info_descr_, *myleaf.body.node.nodes[9]);
  }
  return myleaf.length = encoded_length;
}

struct RSL__IE__UplinkMeas_template::single_value_struct {
INTEGER_template field_len;
BITSTRING_template field_rfu;
BOOLEAN_template field_dtx__d;
INTEGER_template field_rxlev__f__u;
BITSTRING_template field_reserved1;
INTEGER_template field_rxlev__s__u;
BITSTRING_template field_reserved2;
INTEGER_template field_rxq__f__u;
INTEGER_template field_rxq__s__u;
RSL__IE__UplinkMeasSuppMeasInfo_template field_supp__meas__info;
};

void RSL__IE__UplinkMeas_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_len = ANY_VALUE;
single_value->field_rfu = ANY_VALUE;
single_value->field_dtx__d = ANY_VALUE;
single_value->field_rxlev__f__u = ANY_VALUE;
single_value->field_reserved1 = ANY_VALUE;
single_value->field_rxlev__s__u = ANY_VALUE;
single_value->field_reserved2 = ANY_VALUE;
single_value->field_rxq__f__u = ANY_VALUE;
single_value->field_rxq__s__u = ANY_VALUE;
single_value->field_supp__meas__info = ANY_OR_OMIT;
}
}
}

void RSL__IE__UplinkMeas_template::copy_value(const RSL__IE__UplinkMeas& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.rfu().is_bound()) {
  single_value->field_rfu = other_value.rfu();
} else {
  single_value->field_rfu.clean_up();
}
if (other_value.dtx__d().is_bound()) {
  single_value->field_dtx__d = other_value.dtx__d();
} else {
  single_value->field_dtx__d.clean_up();
}
if (other_value.rxlev__f__u().is_bound()) {
  single_value->field_rxlev__f__u = other_value.rxlev__f__u();
} else {
  single_value->field_rxlev__f__u.clean_up();
}
if (other_value.reserved1().is_bound()) {
  single_value->field_reserved1 = other_value.reserved1();
} else {
  single_value->field_reserved1.clean_up();
}
if (other_value.rxlev__s__u().is_bound()) {
  single_value->field_rxlev__s__u = other_value.rxlev__s__u();
} else {
  single_value->field_rxlev__s__u.clean_up();
}
if (other_value.reserved2().is_bound()) {
  single_value->field_reserved2 = other_value.reserved2();
} else {
  single_value->field_reserved2.clean_up();
}
if (other_value.rxq__f__u().is_bound()) {
  single_value->field_rxq__f__u = other_value.rxq__f__u();
} else {
  single_value->field_rxq__f__u.clean_up();
}
if (other_value.rxq__s__u().is_bound()) {
  single_value->field_rxq__s__u = other_value.rxq__s__u();
} else {
  single_value->field_rxq__s__u.clean_up();
}
if (other_value.supp__meas__info().is_bound()) {
  if (other_value.supp__meas__info().ispresent()) single_value->field_supp__meas__info = other_value.supp__meas__info()();
  else single_value->field_supp__meas__info = OMIT_VALUE;
} else {
  single_value->field_supp__meas__info.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__UplinkMeas_template::copy_template(const RSL__IE__UplinkMeas_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rfu().get_selection()) {
single_value->field_rfu = other_value.rfu();
} else {
single_value->field_rfu.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.dtx__d().get_selection()) {
single_value->field_dtx__d = other_value.dtx__d();
} else {
single_value->field_dtx__d.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rxlev__f__u().get_selection()) {
single_value->field_rxlev__f__u = other_value.rxlev__f__u();
} else {
single_value->field_rxlev__f__u.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved1().get_selection()) {
single_value->field_reserved1 = other_value.reserved1();
} else {
single_value->field_reserved1.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rxlev__s__u().get_selection()) {
single_value->field_rxlev__s__u = other_value.rxlev__s__u();
} else {
single_value->field_rxlev__s__u.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reserved2().get_selection()) {
single_value->field_reserved2 = other_value.reserved2();
} else {
single_value->field_reserved2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rxq__f__u().get_selection()) {
single_value->field_rxq__f__u = other_value.rxq__f__u();
} else {
single_value->field_rxq__f__u.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rxq__s__u().get_selection()) {
single_value->field_rxq__s__u = other_value.rxq__s__u();
} else {
single_value->field_rxq__s__u.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supp__meas__info().get_selection()) {
single_value->field_supp__meas__info = other_value.supp__meas__info();
} else {
single_value->field_supp__meas__info.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 RSL__IE__UplinkMeas_template[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 RSL__IE__UplinkMeas_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__UplinkMeas_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 @RSL_Types.RSL_IE_UplinkMeas.");
break;
}
set_selection(other_value);
}

RSL__IE__UplinkMeas_template::RSL__IE__UplinkMeas_template()
{
}

RSL__IE__UplinkMeas_template::RSL__IE__UplinkMeas_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__IE__UplinkMeas_template::RSL__IE__UplinkMeas_template(const RSL__IE__UplinkMeas& other_value)
{
copy_value(other_value);
}

RSL__IE__UplinkMeas_template::RSL__IE__UplinkMeas_template(const OPTIONAL<RSL__IE__UplinkMeas>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__UplinkMeas&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @RSL_Types.RSL_IE_UplinkMeas from an unbound optional field.");
}
}

RSL__IE__UplinkMeas_template::RSL__IE__UplinkMeas_template(RSL__IE__UplinkMeas_template* p_precondition, RSL__IE__UplinkMeas_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__IE__UplinkMeas_template::RSL__IE__UplinkMeas_template(Dynamic_Match_Interface<RSL__IE__UplinkMeas>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__IE__UplinkMeas>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__IE__UplinkMeas_template::RSL__IE__UplinkMeas_template(const RSL__IE__UplinkMeas_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RSL__IE__UplinkMeas_template::~RSL__IE__UplinkMeas_template()
{
clean_up();
}

RSL__IE__UplinkMeas_template& RSL__IE__UplinkMeas_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__IE__UplinkMeas_template& RSL__IE__UplinkMeas_template::operator=(const RSL__IE__UplinkMeas& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RSL__IE__UplinkMeas_template& RSL__IE__UplinkMeas_template::operator=(const OPTIONAL<RSL__IE__UplinkMeas>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__UplinkMeas&)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 @RSL_Types.RSL_IE_UplinkMeas.");
}
return *this;
}

RSL__IE__UplinkMeas_template& RSL__IE__UplinkMeas_template::operator=(const RSL__IE__UplinkMeas_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__IE__UplinkMeas_template::match(const RSL__IE__UplinkMeas& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.rfu().is_bound()) return FALSE;
if(!single_value->field_rfu.match(other_value.rfu(), legacy))return FALSE;
if(!other_value.dtx__d().is_bound()) return FALSE;
if(!single_value->field_dtx__d.match(other_value.dtx__d(), legacy))return FALSE;
if(!other_value.rxlev__f__u().is_bound()) return FALSE;
if(!single_value->field_rxlev__f__u.match(other_value.rxlev__f__u(), legacy))return FALSE;
if(!other_value.reserved1().is_bound()) return FALSE;
if(!single_value->field_reserved1.match(other_value.reserved1(), legacy))return FALSE;
if(!other_value.rxlev__s__u().is_bound()) return FALSE;
if(!single_value->field_rxlev__s__u.match(other_value.rxlev__s__u(), legacy))return FALSE;
if(!other_value.reserved2().is_bound()) return FALSE;
if(!single_value->field_reserved2.match(other_value.reserved2(), legacy))return FALSE;
if(!other_value.rxq__f__u().is_bound()) return FALSE;
if(!single_value->field_rxq__f__u.match(other_value.rxq__f__u(), legacy))return FALSE;
if(!other_value.rxq__s__u().is_bound()) return FALSE;
if(!single_value->field_rxq__s__u.match(other_value.rxq__s__u(), legacy))return FALSE;
if(!other_value.supp__meas__info().is_bound()) return FALSE;
if((other_value.supp__meas__info().ispresent() ? !single_value->field_supp__meas__info.match((const RSL__IE__UplinkMeasSuppMeasInfo&)other_value.supp__meas__info(), legacy) : !single_value->field_supp__meas__info.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @RSL_Types.RSL_IE_UplinkMeas.");
}
return FALSE;
}

boolean RSL__IE__UplinkMeas_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_len.is_bound()
 || single_value->field_rfu.is_bound()
 || single_value->field_dtx__d.is_bound()
 || single_value->field_rxlev__f__u.is_bound()
 || single_value->field_reserved1.is_bound()
 || single_value->field_rxlev__s__u.is_bound()
 || single_value->field_reserved2.is_bound()
 || single_value->field_rxq__f__u.is_bound()
 || single_value->field_rxq__s__u.is_bound()
 || (single_value->field_supp__meas__info.is_omit() || single_value->field_supp__meas__info.is_bound());
}

boolean RSL__IE__UplinkMeas_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_len.is_value()
 && single_value->field_rfu.is_value()
 && single_value->field_dtx__d.is_value()
 && single_value->field_rxlev__f__u.is_value()
 && single_value->field_reserved1.is_value()
 && single_value->field_rxlev__s__u.is_value()
 && single_value->field_reserved2.is_value()
 && single_value->field_rxq__f__u.is_value()
 && single_value->field_rxq__s__u.is_value()
 && (single_value->field_supp__meas__info.is_omit() || single_value->field_supp__meas__info.is_value());
}

void RSL__IE__UplinkMeas_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;
}

RSL__IE__UplinkMeas RSL__IE__UplinkMeas_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 @RSL_Types.RSL_IE_UplinkMeas.");
RSL__IE__UplinkMeas ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_rfu.is_bound()) {
ret_val.rfu() = single_value->field_rfu.valueof();
}
if (single_value->field_dtx__d.is_bound()) {
ret_val.dtx__d() = single_value->field_dtx__d.valueof();
}
if (single_value->field_rxlev__f__u.is_bound()) {
ret_val.rxlev__f__u() = single_value->field_rxlev__f__u.valueof();
}
if (single_value->field_reserved1.is_bound()) {
ret_val.reserved1() = single_value->field_reserved1.valueof();
}
if (single_value->field_rxlev__s__u.is_bound()) {
ret_val.rxlev__s__u() = single_value->field_rxlev__s__u.valueof();
}
if (single_value->field_reserved2.is_bound()) {
ret_val.reserved2() = single_value->field_reserved2.valueof();
}
if (single_value->field_rxq__f__u.is_bound()) {
ret_val.rxq__f__u() = single_value->field_rxq__f__u.valueof();
}
if (single_value->field_rxq__s__u.is_bound()) {
ret_val.rxq__s__u() = single_value->field_rxq__s__u.valueof();
}
if (single_value->field_supp__meas__info.is_omit()) ret_val.supp__meas__info() = OMIT_VALUE;
else if (single_value->field_supp__meas__info.is_bound()) {
ret_val.supp__meas__info() = single_value->field_supp__meas__info.valueof();
}
return ret_val;
}

void RSL__IE__UplinkMeas_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 @RSL_Types.RSL_IE_UplinkMeas.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__UplinkMeas_template[list_length];
}

RSL__IE__UplinkMeas_template& RSL__IE__UplinkMeas_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 @RSL_Types.RSL_IE_UplinkMeas.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @RSL_Types.RSL_IE_UplinkMeas.");
return value_list.list_value[list_index];
}

INTEGER_template& RSL__IE__UplinkMeas_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& RSL__IE__UplinkMeas_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_len;
}

BITSTRING_template& RSL__IE__UplinkMeas_template::rfu()
{
set_specific();
return single_value->field_rfu;
}

const BITSTRING_template& RSL__IE__UplinkMeas_template::rfu() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rfu of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_rfu;
}

BOOLEAN_template& RSL__IE__UplinkMeas_template::dtx__d()
{
set_specific();
return single_value->field_dtx__d;
}

const BOOLEAN_template& RSL__IE__UplinkMeas_template::dtx__d() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx_d of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_dtx__d;
}

INTEGER_template& RSL__IE__UplinkMeas_template::rxlev__f__u()
{
set_specific();
return single_value->field_rxlev__f__u;
}

const INTEGER_template& RSL__IE__UplinkMeas_template::rxlev__f__u() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rxlev_f_u of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_rxlev__f__u;
}

BITSTRING_template& RSL__IE__UplinkMeas_template::reserved1()
{
set_specific();
return single_value->field_reserved1;
}

const BITSTRING_template& RSL__IE__UplinkMeas_template::reserved1() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved1 of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_reserved1;
}

INTEGER_template& RSL__IE__UplinkMeas_template::rxlev__s__u()
{
set_specific();
return single_value->field_rxlev__s__u;
}

const INTEGER_template& RSL__IE__UplinkMeas_template::rxlev__s__u() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rxlev_s_u of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_rxlev__s__u;
}

BITSTRING_template& RSL__IE__UplinkMeas_template::reserved2()
{
set_specific();
return single_value->field_reserved2;
}

const BITSTRING_template& RSL__IE__UplinkMeas_template::reserved2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reserved2 of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_reserved2;
}

INTEGER_template& RSL__IE__UplinkMeas_template::rxq__f__u()
{
set_specific();
return single_value->field_rxq__f__u;
}

const INTEGER_template& RSL__IE__UplinkMeas_template::rxq__f__u() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rxq_f_u of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_rxq__f__u;
}

INTEGER_template& RSL__IE__UplinkMeas_template::rxq__s__u()
{
set_specific();
return single_value->field_rxq__s__u;
}

const INTEGER_template& RSL__IE__UplinkMeas_template::rxq__s__u() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rxq_s_u of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_rxq__s__u;
}

RSL__IE__UplinkMeasSuppMeasInfo_template& RSL__IE__UplinkMeas_template::supp__meas__info()
{
set_specific();
return single_value->field_supp__meas__info;
}

const RSL__IE__UplinkMeasSuppMeasInfo_template& RSL__IE__UplinkMeas_template::supp__meas__info() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field supp_meas_info of a non-specific template of type @RSL_Types.RSL_IE_UplinkMeas.");
return single_value->field_supp__meas__info;
}

int RSL__IE__UplinkMeas_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeas which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 9;
      if (single_value->field_supp__meas__info.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 @RSL_Types.RSL_IE_UplinkMeas 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 @RSL_Types.RSL_IE_UplinkMeas containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeas containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeas containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeas containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeas containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeas containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_UplinkMeas containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Types.RSL_IE_UplinkMeas.");
  }
  return 0;
}

void RSL__IE__UplinkMeas_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", rfu := ");
single_value->field_rfu.log();
TTCN_Logger::log_event_str(", dtx_d := ");
single_value->field_dtx__d.log();
TTCN_Logger::log_event_str(", rxlev_f_u := ");
single_value->field_rxlev__f__u.log();
TTCN_Logger::log_event_str(", reserved1 := ");
single_value->field_reserved1.log();
TTCN_Logger::log_event_str(", rxlev_s_u := ");
single_value->field_rxlev__s__u.log();
TTCN_Logger::log_event_str(", reserved2 := ");
single_value->field_reserved2.log();
TTCN_Logger::log_event_str(", rxq_f_u := ");
single_value->field_rxq__f__u.log();
TTCN_Logger::log_event_str(", rxq_s_u := ");
single_value->field_rxq__s__u.log();
TTCN_Logger::log_event_str(", supp_meas_info := ");
single_value->field_supp__meas__info.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 RSL__IE__UplinkMeas_template::log_match(const RSL__IE__UplinkMeas& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rfu.match(match_value.rfu(), legacy)){
TTCN_Logger::log_logmatch_info(".rfu");
single_value->field_rfu.log_match(match_value.rfu(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_dtx__d.match(match_value.dtx__d(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx_d");
single_value->field_dtx__d.log_match(match_value.dtx__d(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rxlev__f__u.match(match_value.rxlev__f__u(), legacy)){
TTCN_Logger::log_logmatch_info(".rxlev_f_u");
single_value->field_rxlev__f__u.log_match(match_value.rxlev__f__u(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved1.match(match_value.reserved1(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved1");
single_value->field_reserved1.log_match(match_value.reserved1(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rxlev__s__u.match(match_value.rxlev__s__u(), legacy)){
TTCN_Logger::log_logmatch_info(".rxlev_s_u");
single_value->field_rxlev__s__u.log_match(match_value.rxlev__s__u(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_reserved2.match(match_value.reserved2(), legacy)){
TTCN_Logger::log_logmatch_info(".reserved2");
single_value->field_reserved2.log_match(match_value.reserved2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rxq__f__u.match(match_value.rxq__f__u(), legacy)){
TTCN_Logger::log_logmatch_info(".rxq_f_u");
single_value->field_rxq__f__u.log_match(match_value.rxq__f__u(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rxq__s__u.match(match_value.rxq__s__u(), legacy)){
TTCN_Logger::log_logmatch_info(".rxq_s_u");
single_value->field_rxq__s__u.log_match(match_value.rxq__s__u(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.supp__meas__info().ispresent()){
if(!single_value->field_supp__meas__info.match(match_value.supp__meas__info(), legacy)){
TTCN_Logger::log_logmatch_info(".supp_meas_info");
single_value->field_supp__meas__info.log_match(match_value.supp__meas__info(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supp__meas__info.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supp_meas_info := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supp__meas__info.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", rfu := ");
single_value->field_rfu.log_match(match_value.rfu(), legacy);
TTCN_Logger::log_event_str(", dtx_d := ");
single_value->field_dtx__d.log_match(match_value.dtx__d(), legacy);
TTCN_Logger::log_event_str(", rxlev_f_u := ");
single_value->field_rxlev__f__u.log_match(match_value.rxlev__f__u(), legacy);
TTCN_Logger::log_event_str(", reserved1 := ");
single_value->field_reserved1.log_match(match_value.reserved1(), legacy);
TTCN_Logger::log_event_str(", rxlev_s_u := ");
single_value->field_rxlev__s__u.log_match(match_value.rxlev__s__u(), legacy);
TTCN_Logger::log_event_str(", reserved2 := ");
single_value->field_reserved2.log_match(match_value.reserved2(), legacy);
TTCN_Logger::log_event_str(", rxq_f_u := ");
single_value->field_rxq__f__u.log_match(match_value.rxq__f__u(), legacy);
TTCN_Logger::log_event_str(", rxq_s_u := ");
single_value->field_rxq__s__u.log_match(match_value.rxq__s__u(), legacy);
TTCN_Logger::log_event_str(", supp_meas_info := ");
if (match_value.supp__meas__info().ispresent()) {
single_value->field_supp__meas__info.log_match(match_value.supp__meas__info(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supp__meas__info.log();
if (single_value->field_supp__meas__info.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RSL__IE__UplinkMeas_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (rfu().is_bound()) rfu().set_implicit_omit();
if (dtx__d().is_bound()) dtx__d().set_implicit_omit();
if (rxlev__f__u().is_bound()) rxlev__f__u().set_implicit_omit();
if (reserved1().is_bound()) reserved1().set_implicit_omit();
if (rxlev__s__u().is_bound()) rxlev__s__u().set_implicit_omit();
if (reserved2().is_bound()) reserved2().set_implicit_omit();
if (rxq__f__u().is_bound()) rxq__f__u().set_implicit_omit();
if (rxq__s__u().is_bound()) rxq__s__u().set_implicit_omit();
if (!supp__meas__info().is_bound()) supp__meas__info() = OMIT_VALUE;
else supp__meas__info().set_implicit_omit();
}

void RSL__IE__UplinkMeas_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.encode_text(text_buf);
single_value->field_rfu.encode_text(text_buf);
single_value->field_dtx__d.encode_text(text_buf);
single_value->field_rxlev__f__u.encode_text(text_buf);
single_value->field_reserved1.encode_text(text_buf);
single_value->field_rxlev__s__u.encode_text(text_buf);
single_value->field_reserved2.encode_text(text_buf);
single_value->field_rxq__f__u.encode_text(text_buf);
single_value->field_rxq__s__u.encode_text(text_buf);
single_value->field_supp__meas__info.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 @RSL_Types.RSL_IE_UplinkMeas.");
}
}

void RSL__IE__UplinkMeas_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_len.decode_text(text_buf);
single_value->field_rfu.decode_text(text_buf);
single_value->field_dtx__d.decode_text(text_buf);
single_value->field_rxlev__f__u.decode_text(text_buf);
single_value->field_reserved1.decode_text(text_buf);
single_value->field_rxlev__s__u.decode_text(text_buf);
single_value->field_reserved2.decode_text(text_buf);
single_value->field_rxq__f__u.decode_text(text_buf);
single_value->field_rxq__s__u.decode_text(text_buf);
single_value->field_supp__meas__info.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 RSL__IE__UplinkMeas_template[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 @RSL_Types.RSL_IE_UplinkMeas.");
}
}

void RSL__IE__UplinkMeas_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: {
    RSL__IE__UplinkMeas_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 (10<param.get_size()) {
      param.error("record template of type @RSL_Types.RSL_IE_UplinkMeas has 10 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rfu().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dtx__d().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rxlev__f__u().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) reserved1().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rxlev__s__u().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reserved2().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) rxq__f__u().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) rxq__s__u().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) supp__meas__info().set_param(*param.get_elem(9));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rfu")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rfu().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_d")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__d().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_f_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev__f__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved1")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved1().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_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_s_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev__s__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reserved2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reserved2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxq_f_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxq__f__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxq_s_u")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxq__s__u().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supp_meas_info")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supp__meas__info().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_UplinkMeas: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__UplinkMeas_template* precondition = new RSL__IE__UplinkMeas_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__UplinkMeas_template* implied_template = new RSL__IE__UplinkMeas_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__UplinkMeas_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_UplinkMeas");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__UplinkMeas_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_rfu.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_dtx__d.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_rxlev__f__u.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_reserved1.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_rxlev__s__u.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_reserved2.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_rxq__f__u.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_rxq__s__u.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
single_value->field_supp__meas__info.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_UplinkMeas");
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 : "@RSL_Types.RSL_IE_UplinkMeas");
}

boolean RSL__IE__UplinkMeas_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__IE__UplinkMeas_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;
}

RSL__Cause::RSL__Cause()
{
enum_value = UNBOUND_VALUE;
}

RSL__Cause::RSL__Cause(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RSL_Types.RSL_Cause with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

RSL__Cause::RSL__Cause(enum_type other_value)
{
enum_value = other_value;
}

RSL__Cause::RSL__Cause(const RSL__Cause& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RSL_Types.RSL_Cause.");
enum_value = other_value.enum_value;
}

RSL__Cause& RSL__Cause::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RSL_Types.RSL_Cause.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

RSL__Cause& RSL__Cause::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

RSL__Cause& RSL__Cause::operator=(const RSL__Cause& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RSL_Types.RSL_Cause.");
enum_value = other_value.enum_value;
return *this;
}

boolean RSL__Cause::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RSL_Types.RSL_Cause comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean RSL__Cause::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 @RSL_Types.RSL_Cause.");
return enum_value == other_value;
}

boolean RSL__Cause::operator==(const RSL__Cause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
return enum_value == other_value.enum_value;
}

boolean RSL__Cause::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RSL_Types.RSL_Cause comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean RSL__Cause::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 @RSL_Types.RSL_Cause.");
return enum_value < other_value;
}

boolean RSL__Cause::operator<(const RSL__Cause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
return enum_value < other_value.enum_value;
}

boolean RSL__Cause::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RSL_Types.RSL_Cause comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean RSL__Cause::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 @RSL_Types.RSL_Cause.");
return enum_value > other_value;
}

boolean RSL__Cause::operator>(const RSL__Cause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_Cause.");
return enum_value > other_value.enum_value;
}

const char *RSL__Cause::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__ERR__RADIO__IF__FAIL: return "RSL_ERR_RADIO_IF_FAIL";
case RSL__ERR__RADIO__LINK__FAIL: return "RSL_ERR_RADIO_LINK_FAIL";
case RSL__ERR__HANDOVER__ACC__FAIL: return "RSL_ERR_HANDOVER_ACC_FAIL";
case RSL__ERR__TALKER__ACC__FAIL: return "RSL_ERR_TALKER_ACC_FAIL";
case RSL__ERR__OM__INTERVENTION: return "RSL_ERR_OM_INTERVENTION";
case RSL__ERR__NORMAL__UNSPEC: return "RSL_ERR_NORMAL_UNSPEC";
case RSL__ERR__T__MSRFPCI__EXP: return "RSL_ERR_T_MSRFPCI_EXP";
case RSL__ERR__EQUIPMENT__FAIL: return "RSL_ERR_EQUIPMENT_FAIL";
case RSL__ERR__RR__UNAVAIL: return "RSL_ERR_RR_UNAVAIL";
case RSL__ERR__TERR__CH__FAIL: return "RSL_ERR_TERR_CH_FAIL";
case RSL__ERR__CCCH__OVERLOAD: return "RSL_ERR_CCCH_OVERLOAD";
case RSL__ERR__ACCH__OVERLOAD: return "RSL_ERR_ACCH_OVERLOAD";
case RSL__ERR__PROCESSOR__OVERLOAD: return "RSL_ERR_PROCESSOR_OVERLOAD";
case RSL__ERR__BTS__NOT__EQUIPPED: return "RSL_ERR_BTS_NOT_EQUIPPED";
case RSL__ERR__REMOTE__TRAU__FAILURE: return "RSL_ERR_REMOTE_TRAU_FAILURE";
case RSL__ERR__NOTIF__OVERFLOW: return "RSL_ERR_NOTIF_OVERFLOW";
case RSL__ERR__RES__UNAVAIL: return "RSL_ERR_RES_UNAVAIL";
case RSL__ERR__TRANSC__UNAVAIL: return "RSL_ERR_TRANSC_UNAVAIL";
case RSL__ERR__SERV__OPT__UNAVAIL: return "RSL_ERR_SERV_OPT_UNAVAIL";
case RSL__ERR__ENCR__UNIMPL: return "RSL_ERR_ENCR_UNIMPL";
case RSL__ERR__SERV__OPT__UNIMPL: return "RSL_ERR_SERV_OPT_UNIMPL";
case RSL__ERR__RCH__ALR__ACTV__ALLOC: return "RSL_ERR_RCH_ALR_ACTV_ALLOC";
case RSL__ERR__IPA__RCH__NOT__ACTV__ALLOC: return "RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC";
case RSL__ERR__IPA__CONN__INVALID: return "RSL_ERR_IPA_CONN_INVALID";
case RSL__ERR__IPA__CONN__IN__USE: return "RSL_ERR_IPA_CONN_IN_USE";
case RSL__ERR__IPA__CONN__ALREADY__EXISTS: return "RSL_ERR_IPA_CONN_ALREADY_EXISTS";
case RSL__ERR__INVALID__MESSAGE: return "RSL_ERR_INVALID_MESSAGE";
case RSL__ERR__MSG__DISCR: return "RSL_ERR_MSG_DISCR";
case RSL__ERR__MSG__TYPE: return "RSL_ERR_MSG_TYPE";
case RSL__ERR__MSG__SEQ: return "RSL_ERR_MSG_SEQ";
case RSL__ERR__IE__ERROR: return "RSL_ERR_IE_ERROR";
case RSL__ERR__MAND__IE__ERROR: return "RSL_ERR_MAND_IE_ERROR";
case RSL__ERR__OPT__IE__ERROR: return "RSL_ERR_OPT_IE_ERROR";
case RSL__ERR__IE__NONEXIST: return "RSL_ERR_IE_NONEXIST";
case RSL__ERR__IE__LENGTH: return "RSL_ERR_IE_LENGTH";
case RSL__ERR__IE__CONTENT: return "RSL_ERR_IE_CONTENT";
case RSL__ERR__PROTO: return "RSL_ERR_PROTO";
case RSL__ERR__INTERWORKING: return "RSL_ERR_INTERWORKING";
default:
return "<unknown>";
}
}

RSL__Cause::enum_type RSL__Cause::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, "RSL_ERR_RADIO_IF_FAIL")) return RSL__ERR__RADIO__IF__FAIL;
if (!strcmp(str_par, "RSL_ERR_RADIO_LINK_FAIL")) return RSL__ERR__RADIO__LINK__FAIL;
if (!strcmp(str_par, "RSL_ERR_HANDOVER_ACC_FAIL")) return RSL__ERR__HANDOVER__ACC__FAIL;
if (!strcmp(str_par, "RSL_ERR_TALKER_ACC_FAIL")) return RSL__ERR__TALKER__ACC__FAIL;
if (!strcmp(str_par, "RSL_ERR_OM_INTERVENTION")) return RSL__ERR__OM__INTERVENTION;
if (!strcmp(str_par, "RSL_ERR_NORMAL_UNSPEC")) return RSL__ERR__NORMAL__UNSPEC;
if (!strcmp(str_par, "RSL_ERR_T_MSRFPCI_EXP")) return RSL__ERR__T__MSRFPCI__EXP;
if (!strcmp(str_par, "RSL_ERR_EQUIPMENT_FAIL")) return RSL__ERR__EQUIPMENT__FAIL;
if (!strcmp(str_par, "RSL_ERR_RR_UNAVAIL")) return RSL__ERR__RR__UNAVAIL;
if (!strcmp(str_par, "RSL_ERR_TERR_CH_FAIL")) return RSL__ERR__TERR__CH__FAIL;
if (!strcmp(str_par, "RSL_ERR_CCCH_OVERLOAD")) return RSL__ERR__CCCH__OVERLOAD;
if (!strcmp(str_par, "RSL_ERR_ACCH_OVERLOAD")) return RSL__ERR__ACCH__OVERLOAD;
if (!strcmp(str_par, "RSL_ERR_PROCESSOR_OVERLOAD")) return RSL__ERR__PROCESSOR__OVERLOAD;
if (!strcmp(str_par, "RSL_ERR_BTS_NOT_EQUIPPED")) return RSL__ERR__BTS__NOT__EQUIPPED;
if (!strcmp(str_par, "RSL_ERR_REMOTE_TRAU_FAILURE")) return RSL__ERR__REMOTE__TRAU__FAILURE;
if (!strcmp(str_par, "RSL_ERR_NOTIF_OVERFLOW")) return RSL__ERR__NOTIF__OVERFLOW;
if (!strcmp(str_par, "RSL_ERR_RES_UNAVAIL")) return RSL__ERR__RES__UNAVAIL;
if (!strcmp(str_par, "RSL_ERR_TRANSC_UNAVAIL")) return RSL__ERR__TRANSC__UNAVAIL;
if (!strcmp(str_par, "RSL_ERR_SERV_OPT_UNAVAIL")) return RSL__ERR__SERV__OPT__UNAVAIL;
if (!strcmp(str_par, "RSL_ERR_ENCR_UNIMPL")) return RSL__ERR__ENCR__UNIMPL;
if (!strcmp(str_par, "RSL_ERR_SERV_OPT_UNIMPL")) return RSL__ERR__SERV__OPT__UNIMPL;
if (!strcmp(str_par, "RSL_ERR_RCH_ALR_ACTV_ALLOC")) return RSL__ERR__RCH__ALR__ACTV__ALLOC;
if (!strcmp(str_par, "RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC")) return RSL__ERR__IPA__RCH__NOT__ACTV__ALLOC;
if (!strcmp(str_par, "RSL_ERR_IPA_CONN_INVALID")) return RSL__ERR__IPA__CONN__INVALID;
if (!strcmp(str_par, "RSL_ERR_IPA_CONN_IN_USE")) return RSL__ERR__IPA__CONN__IN__USE;
if (!strcmp(str_par, "RSL_ERR_IPA_CONN_ALREADY_EXISTS")) return RSL__ERR__IPA__CONN__ALREADY__EXISTS;
if (!strcmp(str_par, "RSL_ERR_INVALID_MESSAGE")) return RSL__ERR__INVALID__MESSAGE;
if (!strcmp(str_par, "RSL_ERR_MSG_DISCR")) return RSL__ERR__MSG__DISCR;
if (!strcmp(str_par, "RSL_ERR_MSG_TYPE")) return RSL__ERR__MSG__TYPE;
if (!strcmp(str_par, "RSL_ERR_MSG_SEQ")) return RSL__ERR__MSG__SEQ;
if (!strcmp(str_par, "RSL_ERR_IE_ERROR")) return RSL__ERR__IE__ERROR;
if (!strcmp(str_par, "RSL_ERR_MAND_IE_ERROR")) return RSL__ERR__MAND__IE__ERROR;
if (!strcmp(str_par, "RSL_ERR_OPT_IE_ERROR")) return RSL__ERR__OPT__IE__ERROR;
if (!strcmp(str_par, "RSL_ERR_IE_NONEXIST")) return RSL__ERR__IE__NONEXIST;
if (!strcmp(str_par, "RSL_ERR_IE_LENGTH")) return RSL__ERR__IE__LENGTH;
if (!strcmp(str_par, "RSL_ERR_IE_CONTENT")) return RSL__ERR__IE__CONTENT;
if (!strcmp(str_par, "RSL_ERR_PROTO")) return RSL__ERR__PROTO;
if (!strcmp(str_par, "RSL_ERR_INTERWORKING")) return RSL__ERR__INTERWORKING;
}
return UNKNOWN_VALUE;
}

boolean RSL__Cause::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 7:
case 15:
case 24:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 39:
case 40:
case 41:
case 47:
case 48:
case 63:
case 64:
case 79:
case 80:
case 81:
case 82:
case 83:
case 84:
case 95:
case 96:
case 97:
case 98:
case 99:
case 100:
case 101:
case 102:
case 103:
case 104:
case 111:
case 127:
return TRUE;
default:
return FALSE;
}
}

int RSL__Cause::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 @RSL_Types.RSL_Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int RSL__Cause::enum2int(const RSL__Cause& 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 @RSL_Types.RSL_Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void RSL__Cause::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RSL_Types.RSL_Cause.", int_val);
enum_value = (enum_type)int_val;
}

RSL__Cause::operator RSL__Cause::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RSL_Types.RSL_Cause.");
return enum_value;
}

void RSL__Cause::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 RSL__Cause::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", "@RSL_Types.RSL_Cause");
  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 @RSL_Types.RSL_Cause.");
  }
}

void RSL__Cause::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RSL_Types.RSL_Cause.");
text_buf.push_int(enum_value);
}

void RSL__Cause::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 @RSL_Types.RSL_Cause.", enum_value);
}

void RSL__Cause::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(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 RSL__Cause::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RSL__Cause::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 7, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int RSL__Cause::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 7);
}

void RSL__Cause_template::copy_template(const RSL__Cause_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 RSL__Cause_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RSL__Cause_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__Cause_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @RSL_Types.RSL_Cause.");
}
}

RSL__Cause_template::RSL__Cause_template()
{
}

RSL__Cause_template::RSL__Cause_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__Cause_template::RSL__Cause_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!RSL__Cause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RSL_Types.RSL_Cause with unknown numeric value %d.", other_value);
single_value = (RSL__Cause::enum_type)other_value;
}

RSL__Cause_template::RSL__Cause_template(RSL__Cause::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

RSL__Cause_template::RSL__Cause_template(const RSL__Cause& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == RSL__Cause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RSL_Types.RSL_Cause.");
single_value = other_value.enum_value;
}

RSL__Cause_template::RSL__Cause_template(const OPTIONAL<RSL__Cause>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RSL__Cause::enum_type)(const RSL__Cause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @RSL_Types.RSL_Cause from an unbound optional field.");
}
}

RSL__Cause_template::RSL__Cause_template(RSL__Cause_template* p_precondition, RSL__Cause_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__Cause_template::RSL__Cause_template(Dynamic_Match_Interface<RSL__Cause>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__Cause>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__Cause_template::RSL__Cause_template(const RSL__Cause_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

RSL__Cause_template::~RSL__Cause_template()
{
clean_up();
}

boolean RSL__Cause_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean RSL__Cause_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != RSL__Cause::UNBOUND_VALUE;
}

void RSL__Cause_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;
}

RSL__Cause_template& RSL__Cause_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__Cause_template& RSL__Cause_template::operator=(int other_value)
{
if (!RSL__Cause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RSL_Types.RSL_Cause.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (RSL__Cause::enum_type)other_value;
return *this;
}

RSL__Cause_template& RSL__Cause_template::operator=(RSL__Cause::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

RSL__Cause_template& RSL__Cause_template::operator=(const RSL__Cause& other_value)
{
if (other_value.enum_value == RSL__Cause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RSL_Types.RSL_Cause to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

RSL__Cause_template& RSL__Cause_template::operator=(const OPTIONAL<RSL__Cause>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RSL__Cause::enum_type)(const RSL__Cause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RSL_Types.RSL_Cause.");
}
return *this;
}

RSL__Cause_template& RSL__Cause_template::operator=(const RSL__Cause_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__Cause_template::match(RSL__Cause::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 @RSL_Types.RSL_Cause.");
}
return FALSE;
}

boolean RSL__Cause_template::match(const RSL__Cause& other_value, boolean) const
{
if (other_value.enum_value == RSL__Cause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RSL_Types.RSL_Cause with an unbound value.");
return match(other_value.enum_value);
}

RSL__Cause::enum_type RSL__Cause_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RSL_Types.RSL_Cause.");
return single_value;
}

void RSL__Cause_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 RSL__Cause_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @RSL_Types.RSL_Cause.");
}
}

RSL__Cause_template& RSL__Cause_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 @RSL_Types.RSL_Cause.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RSL_Types.RSL_Cause.");
return value_list.list_value[list_index];
}

void RSL__Cause_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__Cause::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 RSL__Cause_template::log_match(const RSL__Cause& 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 RSL__Cause_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 @RSL_Types.RSL_Cause.");
}
}

void RSL__Cause_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (RSL__Cause::enum_type)text_buf.pull_int().get_val();
if (!RSL__Cause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RSL_Types.RSL_Cause.", 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 RSL__Cause_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 @RSL_Types.RSL_Cause.");
}
}

boolean RSL__Cause_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__Cause_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int 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 RSL__Cause_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: {
    RSL__Cause_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: {
    RSL__Cause::enum_type enum_val = RSL__Cause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!RSL__Cause::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @RSL_Types.RSL_Cause.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__Cause_template* precondition = new RSL__Cause_template;
    precondition->set_param(*m_p->get_elem(0));
    RSL__Cause_template* implied_template = new RSL__Cause_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RSL__Cause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@RSL_Types.RSL_Cause");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__Cause_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_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 : "@RSL_Types.RSL_Cause");
}

RSL__IE__Cause::RSL__IE__Cause()
{
}

RSL__IE__Cause::RSL__IE__Cause(const INTEGER& par_len,
    const INTEGER& par_e,
    const RSL__Cause& par_cause,
    const OPTIONAL< OCTETSTRING >& par_cause__ext)
  :   field_len(par_len),
  field_e(par_e),
  field_cause(par_cause),
  field_cause__ext(par_cause__ext)
{
}

RSL__IE__Cause::RSL__IE__Cause(const RSL__IE__Cause& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_IE_Cause.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.e().is_bound()) field_e = other_value.e();
else field_e.clean_up();
if (other_value.cause().is_bound()) field_cause = other_value.cause();
else field_cause.clean_up();
if (other_value.cause__ext().is_bound()) field_cause__ext = other_value.cause__ext();
else field_cause__ext.clean_up();
}

void RSL__IE__Cause::clean_up()
{
field_len.clean_up();
field_e.clean_up();
field_cause.clean_up();
field_cause__ext.clean_up();
}

const TTCN_Typedescriptor_t* RSL__IE__Cause::get_descriptor() const { return &RSL__IE__Cause_descr_; }
RSL__IE__Cause& RSL__IE__Cause::operator=(const RSL__IE__Cause& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_IE_Cause.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.e().is_bound()) field_e = other_value.e();
  else field_e.clean_up();
  if (other_value.cause().is_bound()) field_cause = other_value.cause();
  else field_cause.clean_up();
  if (other_value.cause__ext().is_bound()) field_cause__ext = other_value.cause__ext();
  else field_cause__ext.clean_up();
}
return *this;
}

boolean RSL__IE__Cause::operator==(const RSL__IE__Cause& other_value) const
{
return field_len==other_value.field_len
  && field_e==other_value.field_e
  && field_cause==other_value.field_cause
  && field_cause__ext==other_value.field_cause__ext;
}

boolean RSL__IE__Cause::is_bound() const
{
return (field_len.is_bound())
  || (field_e.is_bound())
  || (field_cause.is_bound())
  || (OPTIONAL_OMIT == field_cause__ext.get_selection() || field_cause__ext.is_bound());
}
boolean RSL__IE__Cause::is_value() const
{
return field_len.is_value()
  && field_e.is_value()
  && field_cause.is_value()
  && (OPTIONAL_OMIT == field_cause__ext.get_selection() || field_cause__ext.is_value());
}
int RSL__IE__Cause::size_of() const
{
  int ret_val = 3;
  if (field_cause__ext.ispresent()) ret_val++;
  return ret_val;
}

void RSL__IE__Cause::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", e := ");
field_e.log();
TTCN_Logger::log_event_str(", cause := ");
field_cause.log();
TTCN_Logger::log_event_str(", cause_ext := ");
field_cause__ext.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__IE__Cause::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (e().is_bound()) e().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!cause__ext().is_bound()) cause__ext() = OMIT_VALUE;
else cause__ext().set_implicit_omit();
}

void RSL__IE__Cause::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @RSL_Types.RSL_IE_Cause has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) e().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause__ext().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "e")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause_ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause__ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_Cause: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_IE_Cause");
  }
}

void RSL__IE__Cause::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_e.encode_text(text_buf);
field_cause.encode_text(text_buf);
field_cause__ext.encode_text(text_buf);
}

void RSL__IE__Cause::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_e.decode_text(text_buf);
field_cause.decode_text(text_buf);
field_cause__ext.decode_text(text_buf);
}

void RSL__IE__Cause::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RSL__IE__Cause::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RSL__IE__Cause::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RSL__IE__Cause_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(RSL__IE__Cause_len_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_len.convert_to_Integer(RSL__IE__Cause_len_descr_);
  field_len = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, RSL__IE__Cause_e_descr_.raw->forceomit);
  decoded_field_length = field_e.RAW_decode(RSL__IE__Cause_e_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, RSL__IE__Cause_cause_descr_.raw->forceomit);
  decoded_field_length = field_cause.RAW_decode(RSL__IE__Cause_cause_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  if (limit > 0 && value_of_length_field0 > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_cause__ext = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, RSL__IE__Cause_cause__ext_descr_.raw->forceomit);
  decoded_field_length = field_cause__ext().RAW_decode(RSL__IE__Cause_cause__ext_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_cause__ext = 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());
  value_of_length_field0 -= decoded_field_length;
  }
  }
  }
  else field_cause__ext=OMIT_VALUE;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RSL__IE__Cause::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const {
  if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value.");
  int encoded_length = 0;
  myleaf.isleaf = FALSE;
  myleaf.body.node.num_of_nodes = 4;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(4);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, RSL__IE__Cause_len_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__IE__Cause_e_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__IE__Cause_cause_descr_.raw);
  if (field_cause__ext.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RSL__IE__Cause_cause__ext_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RSL__IE__Cause_len_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 3;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(3);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  if (field_cause__ext.ispresent()) {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[3]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[3]->curr_pos.pos;
  } else {
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].level = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[2].pos = 0;
  }
  encoded_length += field_e.RAW_encode(RSL__IE__Cause_e_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_cause.RAW_encode(RSL__IE__Cause_cause_descr_, *myleaf.body.node.nodes[2]);
  if (field_cause__ext.ispresent()) {
  encoded_length += field_cause__ext().RAW_encode(RSL__IE__Cause_cause__ext_descr_, *myleaf.body.node.nodes[3]);
  }
  return myleaf.length = encoded_length;
}

struct RSL__IE__Cause_template::single_value_struct {
INTEGER_template field_len;
INTEGER_template field_e;
RSL__Cause_template field_cause;
OCTETSTRING_template field_cause__ext;
};

void RSL__IE__Cause_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_len = ANY_VALUE;
single_value->field_e = ANY_VALUE;
single_value->field_cause = ANY_VALUE;
single_value->field_cause__ext = ANY_OR_OMIT;
}
}
}

void RSL__IE__Cause_template::copy_value(const RSL__IE__Cause& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.e().is_bound()) {
  single_value->field_e = other_value.e();
} else {
  single_value->field_e.clean_up();
}
if (other_value.cause().is_bound()) {
  single_value->field_cause = other_value.cause();
} else {
  single_value->field_cause.clean_up();
}
if (other_value.cause__ext().is_bound()) {
  if (other_value.cause__ext().ispresent()) single_value->field_cause__ext = other_value.cause__ext()();
  else single_value->field_cause__ext = OMIT_VALUE;
} else {
  single_value->field_cause__ext.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__IE__Cause_template::copy_template(const RSL__IE__Cause_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.e().get_selection()) {
single_value->field_e = other_value.e();
} else {
single_value->field_e.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) {
single_value->field_cause = other_value.cause();
} else {
single_value->field_cause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cause__ext().get_selection()) {
single_value->field_cause__ext = other_value.cause__ext();
} else {
single_value->field_cause__ext.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 RSL__IE__Cause_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RSL__IE__Cause_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__Cause_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @RSL_Types.RSL_IE_Cause.");
break;
}
set_selection(other_value);
}

RSL__IE__Cause_template::RSL__IE__Cause_template()
{
}

RSL__IE__Cause_template::RSL__IE__Cause_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__IE__Cause_template::RSL__IE__Cause_template(const RSL__IE__Cause& other_value)
{
copy_value(other_value);
}

RSL__IE__Cause_template::RSL__IE__Cause_template(const OPTIONAL<RSL__IE__Cause>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__Cause&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @RSL_Types.RSL_IE_Cause from an unbound optional field.");
}
}

RSL__IE__Cause_template::RSL__IE__Cause_template(RSL__IE__Cause_template* p_precondition, RSL__IE__Cause_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__IE__Cause_template::RSL__IE__Cause_template(Dynamic_Match_Interface<RSL__IE__Cause>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__IE__Cause>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__IE__Cause_template::RSL__IE__Cause_template(const RSL__IE__Cause_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RSL__IE__Cause_template::~RSL__IE__Cause_template()
{
clean_up();
}

RSL__IE__Cause_template& RSL__IE__Cause_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__IE__Cause_template& RSL__IE__Cause_template::operator=(const RSL__IE__Cause& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RSL__IE__Cause_template& RSL__IE__Cause_template::operator=(const OPTIONAL<RSL__IE__Cause>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__IE__Cause&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @RSL_Types.RSL_IE_Cause.");
}
return *this;
}

RSL__IE__Cause_template& RSL__IE__Cause_template::operator=(const RSL__IE__Cause_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__IE__Cause_template::match(const RSL__IE__Cause& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.e().is_bound()) return FALSE;
if(!single_value->field_e.match(other_value.e(), legacy))return FALSE;
if(!other_value.cause().is_bound()) return FALSE;
if(!single_value->field_cause.match(other_value.cause(), legacy))return FALSE;
if(!other_value.cause__ext().is_bound()) return FALSE;
if((other_value.cause__ext().ispresent() ? !single_value->field_cause__ext.match((const OCTETSTRING&)other_value.cause__ext(), legacy) : !single_value->field_cause__ext.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @RSL_Types.RSL_IE_Cause.");
}
return FALSE;
}

boolean RSL__IE__Cause_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_len.is_bound()
 || single_value->field_e.is_bound()
 || single_value->field_cause.is_bound()
 || (single_value->field_cause__ext.is_omit() || single_value->field_cause__ext.is_bound());
}

boolean RSL__IE__Cause_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_len.is_value()
 && single_value->field_e.is_value()
 && single_value->field_cause.is_value()
 && (single_value->field_cause__ext.is_omit() || single_value->field_cause__ext.is_value());
}

void RSL__IE__Cause_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RSL__IE__Cause RSL__IE__Cause_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @RSL_Types.RSL_IE_Cause.");
RSL__IE__Cause ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_e.is_bound()) {
ret_val.e() = single_value->field_e.valueof();
}
if (single_value->field_cause.is_bound()) {
ret_val.cause() = single_value->field_cause.valueof();
}
if (single_value->field_cause__ext.is_omit()) ret_val.cause__ext() = OMIT_VALUE;
else if (single_value->field_cause__ext.is_bound()) {
ret_val.cause__ext() = single_value->field_cause__ext.valueof();
}
return ret_val;
}

void RSL__IE__Cause_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @RSL_Types.RSL_IE_Cause.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__IE__Cause_template[list_length];
}

RSL__IE__Cause_template& RSL__IE__Cause_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @RSL_Types.RSL_IE_Cause.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @RSL_Types.RSL_IE_Cause.");
return value_list.list_value[list_index];
}

INTEGER_template& RSL__IE__Cause_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& RSL__IE__Cause_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @RSL_Types.RSL_IE_Cause.");
return single_value->field_len;
}

INTEGER_template& RSL__IE__Cause_template::e()
{
set_specific();
return single_value->field_e;
}

const INTEGER_template& RSL__IE__Cause_template::e() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field e of a non-specific template of type @RSL_Types.RSL_IE_Cause.");
return single_value->field_e;
}

RSL__Cause_template& RSL__IE__Cause_template::cause()
{
set_specific();
return single_value->field_cause;
}

const RSL__Cause_template& RSL__IE__Cause_template::cause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause of a non-specific template of type @RSL_Types.RSL_IE_Cause.");
return single_value->field_cause;
}

OCTETSTRING_template& RSL__IE__Cause_template::cause__ext()
{
set_specific();
return single_value->field_cause__ext;
}

const OCTETSTRING_template& RSL__IE__Cause_template::cause__ext() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cause_ext of a non-specific template of type @RSL_Types.RSL_IE_Cause.");
return single_value->field_cause__ext;
}

int RSL__IE__Cause_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_cause__ext.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 @RSL_Types.RSL_IE_Cause containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_IE_Cause containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Types.RSL_IE_Cause.");
  }
  return 0;
}

void RSL__IE__Cause_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", e := ");
single_value->field_e.log();
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log();
TTCN_Logger::log_event_str(", cause_ext := ");
single_value->field_cause__ext.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 RSL__IE__Cause_template::log_match(const RSL__IE__Cause& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_e.match(match_value.e(), legacy)){
TTCN_Logger::log_logmatch_info(".e");
single_value->field_e.log_match(match_value.e(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cause.match(match_value.cause(), legacy)){
TTCN_Logger::log_logmatch_info(".cause");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.cause__ext().ispresent()){
if(!single_value->field_cause__ext.match(match_value.cause__ext(), legacy)){
TTCN_Logger::log_logmatch_info(".cause_ext");
single_value->field_cause__ext.log_match(match_value.cause__ext(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cause__ext.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cause_ext := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cause__ext.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", e := ");
single_value->field_e.log_match(match_value.e(), legacy);
TTCN_Logger::log_event_str(", cause := ");
single_value->field_cause.log_match(match_value.cause(), legacy);
TTCN_Logger::log_event_str(", cause_ext := ");
if (match_value.cause__ext().ispresent()) {
single_value->field_cause__ext.log_match(match_value.cause__ext(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cause__ext.log();
if (single_value->field_cause__ext.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RSL__IE__Cause_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (e().is_bound()) e().set_implicit_omit();
if (cause().is_bound()) cause().set_implicit_omit();
if (!cause__ext().is_bound()) cause__ext() = OMIT_VALUE;
else cause__ext().set_implicit_omit();
}

void RSL__IE__Cause_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.encode_text(text_buf);
single_value->field_e.encode_text(text_buf);
single_value->field_cause.encode_text(text_buf);
single_value->field_cause__ext.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 @RSL_Types.RSL_IE_Cause.");
}
}

void RSL__IE__Cause_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_len.decode_text(text_buf);
single_value->field_e.decode_text(text_buf);
single_value->field_cause.decode_text(text_buf);
single_value->field_cause__ext.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 RSL__IE__Cause_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @RSL_Types.RSL_IE_Cause.");
}
}

void RSL__IE__Cause_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RSL__IE__Cause_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @RSL_Types.RSL_IE_Cause has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) e().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cause__ext().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "e")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          e().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cause_ext")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cause__ext().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_IE_Cause: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__Cause_template* precondition = new RSL__IE__Cause_template;
    precondition->set_param(*param.get_elem(0));
    RSL__IE__Cause_template* implied_template = new RSL__IE__Cause_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__IE__Cause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_IE_Cause");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__Cause_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_Cause");
single_value->field_e.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_Cause");
single_value->field_cause.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_Cause");
single_value->field_cause__ext.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_IE_Cause");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@RSL_Types.RSL_IE_Cause");
}

boolean RSL__IE__Cause_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__IE__Cause_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


const RSL__SacchInfoElement RSL__SacchInfoElements::UNBOUND_ELEM;
RSL__SacchInfoElements::RSL__SacchInfoElements()
{
val_ptr = NULL;
}

RSL__SacchInfoElements::RSL__SacchInfoElements(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

RSL__SacchInfoElements::RSL__SacchInfoElements(const RSL__SacchInfoElements& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

RSL__SacchInfoElements::~RSL__SacchInfoElements()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void RSL__SacchInfoElements::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

RSL__SacchInfoElements& RSL__SacchInfoElements::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

RSL__SacchInfoElements& RSL__SacchInfoElements::operator=(const RSL__SacchInfoElements& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean RSL__SacchInfoElements::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
return val_ptr->n_elements == 0 ;
}

boolean RSL__SacchInfoElements::operator==(const RSL__SacchInfoElements& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

RSL__SacchInfoElement& RSL__SacchInfoElements::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @RSL_Types.RSL_SacchInfoElements using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (RSL__SacchInfoElement**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new RSL__SacchInfoElement(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new RSL__SacchInfoElement;
}
return *val_ptr->value_elements[index_value];
}

RSL__SacchInfoElement& RSL__SacchInfoElements::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @RSL_Types.RSL_SacchInfoElements.");
return (*this)[(int)index_value];
}

const RSL__SacchInfoElement& RSL__SacchInfoElements::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
if (index_value < 0) TTCN_error("Accessing an element of type @RSL_Types.RSL_SacchInfoElements using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @RSL_Types.RSL_SacchInfoElements: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const RSL__SacchInfoElement& RSL__SacchInfoElements::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @RSL_Types.RSL_SacchInfoElements.");
return (*this)[(int)index_value];
}

RSL__SacchInfoElements RSL__SacchInfoElements::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

RSL__SacchInfoElements RSL__SacchInfoElements::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

RSL__SacchInfoElements RSL__SacchInfoElements::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

RSL__SacchInfoElements RSL__SacchInfoElements::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
RSL__SacchInfoElements ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new RSL__SacchInfoElement(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

RSL__SacchInfoElements RSL__SacchInfoElements::operator+(const RSL__SacchInfoElements& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @RSL_Types.RSL_SacchInfoElements concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
RSL__SacchInfoElements ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new RSL__SacchInfoElement(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new RSL__SacchInfoElement(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

RSL__SacchInfoElements RSL__SacchInfoElements::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@RSL_Types.RSL_SacchInfoElements","element");
RSL__SacchInfoElements ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new RSL__SacchInfoElement(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

RSL__SacchInfoElements RSL__SacchInfoElements::replace(int index, int len, const RSL__SacchInfoElements& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
check_replace_arguments(val_ptr->n_elements, index, len, "@RSL_Types.RSL_SacchInfoElements","element");
RSL__SacchInfoElements ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new RSL__SacchInfoElement(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new RSL__SacchInfoElement(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new RSL__SacchInfoElement(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

RSL__SacchInfoElements RSL__SacchInfoElements::replace(int index, int len, const RSL__SacchInfoElements_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void RSL__SacchInfoElements::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @RSL_Types.RSL_SacchInfoElements.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (RSL__SacchInfoElement**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new RSL__SacchInfoElement(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (RSL__SacchInfoElement**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @RSL_Types.RSL_SacchInfoElements: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (RSL__SacchInfoElement**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean RSL__SacchInfoElements::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int RSL__SacchInfoElements::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
return val_ptr->n_elements;
}

int RSL__SacchInfoElements::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void RSL__SacchInfoElements::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void RSL__SacchInfoElements::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void RSL__SacchInfoElements::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@RSL_Types.RSL_SacchInfoElements");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@RSL_Types.RSL_SacchInfoElements");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void RSL__SacchInfoElements::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @RSL_Types.RSL_SacchInfoElements.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void RSL__SacchInfoElements::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @RSL_Types.RSL_SacchInfoElements.");
val_ptr->value_elements = (RSL__SacchInfoElement**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new RSL__SacchInfoElement;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void RSL__SacchInfoElements::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 RSL__SacchInfoElements::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 RSL__SacchInfoElements::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean /*no_err*/, int sel_field, boolean first_call, const RAW_Force_Omit*){
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  int decoded_length=0;
  int decoded_field_length=0;
  size_t start_of_field=0;
  if(first_call) {
    clean_up();
    val_ptr=new recordof_setof_struct;
    val_ptr->ref_count=1;
    val_ptr->n_elements=0;
    val_ptr->value_elements=NULL;
  }
  int start_field=val_ptr->n_elements;
  if(p_td.raw->fieldlength || sel_field!=-1){
    int a=0;
    if(sel_field==-1) sel_field=p_td.raw->fieldlength;
    start_of_field=p_buf.get_pos_bit();
    for(a=0;a<sel_field;a++){
      decoded_field_length=(*this)[a+start_field].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        while(a>=0){
          delete &(*this)[a+start_field];
          a--;
          val_ptr->n_elements--;
        }
        p_buf.set_pos_bit(start_of_field);
        return decoded_field_length;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
    }
    if(a==0) val_ptr->n_elements=0;
  } else {
    if(limit==0){
      if(!first_call) return -1;
      val_ptr->n_elements=0;
      return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
    }
    int a=start_field;
    while(limit>0){
      start_of_field=p_buf.get_pos_bit();
      decoded_field_length=(*this)[a].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE);
      if(decoded_field_length < 0){
        delete &(*this)[a];
        val_ptr->n_elements--;
        p_buf.set_pos_bit(start_of_field);
        if(a>start_field){
        return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
        } else return -1;
      }
      decoded_length+=decoded_field_length;
      limit-=decoded_field_length;
      a++;
    }
  }
 return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength;
}

int RSL__SacchInfoElements::RAW_encode(const TTCN_Typedescriptor_t& p_td,RAW_enc_tree& myleaf) const{
  int encoded_length=0;
  int encoded_num_of_records=p_td.raw->fieldlength?smaller(val_ptr->n_elements, p_td.raw->fieldlength):val_ptr->n_elements;
  myleaf.isleaf=FALSE;
  myleaf.rec_of=TRUE;
  myleaf.body.node.num_of_nodes=encoded_num_of_records;
  myleaf.body.node.nodes=init_nodes_of_enc_tree(encoded_num_of_records);
  for(int a=0;a<encoded_num_of_records;a++){
    myleaf.body.node.nodes[a]=new RAW_enc_tree(TRUE,&myleaf,&(myleaf.curr_pos),a,p_td.oftype_descr->raw);
    encoded_length+=(*this)[a].RAW_encode(*p_td.oftype_descr,*myleaf.body.node.nodes[a]);
  }
 return myleaf.length=encoded_length;
}

void RSL__SacchInfoElements_template::copy_value(const RSL__SacchInfoElements& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @RSL_Types.RSL_SacchInfoElements with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (RSL__SacchInfoElement_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new RSL__SacchInfoElement_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new RSL__SacchInfoElement_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void RSL__SacchInfoElements_template::copy_template(const RSL__SacchInfoElements_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (RSL__SacchInfoElement_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new RSL__SacchInfoElement_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new RSL__SacchInfoElement_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RSL__SacchInfoElements_template[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 RSL__SacchInfoElements_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__SacchInfoElements_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 @RSL_Types.RSL_SacchInfoElements.");
break;
}
set_selection(other_value);
}

boolean RSL__SacchInfoElements_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const RSL__SacchInfoElements_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const RSL__SacchInfoElements*)value_ptr)[value_index], legacy);
else return ((const RSL__SacchInfoElements_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template()
{
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template(const RSL__SacchInfoElements& other_value)
{
copy_value(other_value);
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template(const OPTIONAL<RSL__SacchInfoElements>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__SacchInfoElements&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @RSL_Types.RSL_SacchInfoElements from an unbound optional field.");
}
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template(RSL__SacchInfoElements_template* p_precondition, RSL__SacchInfoElements_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template(Dynamic_Match_Interface<RSL__SacchInfoElements>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__SacchInfoElements>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__SacchInfoElements_template::RSL__SacchInfoElements_template(const RSL__SacchInfoElements_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

RSL__SacchInfoElements_template::~RSL__SacchInfoElements_template()
{
clean_up();
}

void RSL__SacchInfoElements_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RSL__SacchInfoElements_template& RSL__SacchInfoElements_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__SacchInfoElements_template& RSL__SacchInfoElements_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

RSL__SacchInfoElements_template& RSL__SacchInfoElements_template::operator=(const RSL__SacchInfoElements& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RSL__SacchInfoElements_template& RSL__SacchInfoElements_template::operator=(const OPTIONAL<RSL__SacchInfoElements>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__SacchInfoElements&)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 @RSL_Types.RSL_SacchInfoElements.");
}
return *this;
}

RSL__SacchInfoElements_template& RSL__SacchInfoElements_template::operator=(const RSL__SacchInfoElements_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

RSL__SacchInfoElement_template& RSL__SacchInfoElements_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @RSL_Types.RSL_SacchInfoElements using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @RSL_Types.RSL_SacchInfoElements.");
    break;
}
return *single_value.value_elements[index_value];
}

RSL__SacchInfoElement_template& RSL__SacchInfoElements_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @RSL_Types.RSL_SacchInfoElements.");
return (*this)[(int)index_value];
}

const RSL__SacchInfoElement_template& RSL__SacchInfoElements_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @RSL_Types.RSL_SacchInfoElements using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @RSL_Types.RSL_SacchInfoElements.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @RSL_Types.RSL_SacchInfoElements: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const RSL__SacchInfoElement_template& RSL__SacchInfoElements_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @RSL_Types.RSL_SacchInfoElements.");
return (*this)[(int)index_value];
}

void RSL__SacchInfoElements_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @RSL_Types.RSL_SacchInfoElements.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (RSL__SacchInfoElement_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new RSL__SacchInfoElement_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new RSL__SacchInfoElement_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (RSL__SacchInfoElement_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int RSL__SacchInfoElements_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int RSL__SacchInfoElements_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @RSL_Types.RSL_SacchInfoElements which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @RSL_Types.RSL_SacchInfoElements containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @RSL_Types.RSL_SacchInfoElements containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @RSL_Types.RSL_SacchInfoElements containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @RSL_Types.RSL_SacchInfoElements containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @RSL_Types.RSL_SacchInfoElements containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @RSL_Types.RSL_SacchInfoElements.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @RSL_Types.RSL_SacchInfoElements");
}

boolean RSL__SacchInfoElements_template::match(const RSL__SacchInfoElements& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @RSL_Types.RSL_SacchInfoElements.");
}
return FALSE;
}

boolean RSL__SacchInfoElements_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

RSL__SacchInfoElements RSL__SacchInfoElements_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 @RSL_Types.RSL_SacchInfoElements.");
RSL__SacchInfoElements ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

RSL__SacchInfoElements RSL__SacchInfoElements_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

RSL__SacchInfoElements RSL__SacchInfoElements_template::replace(int index, int len, const RSL__SacchInfoElements_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

RSL__SacchInfoElements RSL__SacchInfoElements_template::replace(int index, int len, const RSL__SacchInfoElements& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void RSL__SacchInfoElements_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new RSL__SacchInfoElements_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @RSL_Types.RSL_SacchInfoElements.");
}
set_selection(template_type);
}

RSL__SacchInfoElements_template& RSL__SacchInfoElements_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @RSL_Types.RSL_SacchInfoElements.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @RSL_Types.RSL_SacchInfoElements.");
return value_list.list_value[list_index];
}

void RSL__SacchInfoElements_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void RSL__SacchInfoElements_template::log_match(const RSL__SacchInfoElements& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RSL__SacchInfoElements_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @RSL_Types.RSL_SacchInfoElements.");
}
}

void RSL__SacchInfoElements_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @RSL_Types.RSL_SacchInfoElements.");
single_value.value_elements = (RSL__SacchInfoElement_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new RSL__SacchInfoElement_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RSL__SacchInfoElements_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @RSL_Types.RSL_SacchInfoElements.");
}
}

boolean RSL__SacchInfoElements_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__SacchInfoElements_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 RSL__SacchInfoElements_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void RSL__SacchInfoElements_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RSL__SacchInfoElements_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__SacchInfoElements_template* precondition = new RSL__SacchInfoElements_template;
    precondition->set_param(*param.get_elem(0));
    RSL__SacchInfoElements_template* implied_template = new RSL__SacchInfoElements_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__SacchInfoElements_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@RSL_Types.RSL_SacchInfoElements");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void RSL__SacchInfoElements_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_SacchInfoElements");
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 : "@RSL_Types.RSL_SacchInfoElements");
}

boolean RSL__SacchInfoElements_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
RSL__IE__SysinfoType::RSL__IE__SysinfoType()
{
enum_value = UNBOUND_VALUE;
}

RSL__IE__SysinfoType::RSL__IE__SysinfoType(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RSL_Types.RSL_IE_SysinfoType with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

RSL__IE__SysinfoType::RSL__IE__SysinfoType(enum_type other_value)
{
enum_value = other_value;
}

RSL__IE__SysinfoType::RSL__IE__SysinfoType(const RSL__IE__SysinfoType& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
enum_value = other_value.enum_value;
}

RSL__IE__SysinfoType& RSL__IE__SysinfoType::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RSL_Types.RSL_IE_SysinfoType.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

RSL__IE__SysinfoType& RSL__IE__SysinfoType::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

RSL__IE__SysinfoType& RSL__IE__SysinfoType::operator=(const RSL__IE__SysinfoType& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
enum_value = other_value.enum_value;
return *this;
}

boolean RSL__IE__SysinfoType::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RSL_Types.RSL_IE_SysinfoType comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean RSL__IE__SysinfoType::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 @RSL_Types.RSL_IE_SysinfoType.");
return enum_value == other_value;
}

boolean RSL__IE__SysinfoType::operator==(const RSL__IE__SysinfoType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
return enum_value == other_value.enum_value;
}

boolean RSL__IE__SysinfoType::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RSL_Types.RSL_IE_SysinfoType comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean RSL__IE__SysinfoType::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 @RSL_Types.RSL_IE_SysinfoType.");
return enum_value < other_value;
}

boolean RSL__IE__SysinfoType::operator<(const RSL__IE__SysinfoType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
return enum_value < other_value.enum_value;
}

boolean RSL__IE__SysinfoType::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RSL_Types.RSL_IE_SysinfoType comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean RSL__IE__SysinfoType::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 @RSL_Types.RSL_IE_SysinfoType.");
return enum_value > other_value;
}

boolean RSL__IE__SysinfoType::operator>(const RSL__IE__SysinfoType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
return enum_value > other_value.enum_value;
}

const char *RSL__IE__SysinfoType::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case RSL__SYSTEM__INFO__8: return "RSL_SYSTEM_INFO_8";
case RSL__SYSTEM__INFO__1: return "RSL_SYSTEM_INFO_1";
case RSL__SYSTEM__INFO__2: return "RSL_SYSTEM_INFO_2";
case RSL__SYSTEM__INFO__3: return "RSL_SYSTEM_INFO_3";
case RSL__SYSTEM__INFO__4: return "RSL_SYSTEM_INFO_4";
case RSL__SYSTEM__INFO__5: return "RSL_SYSTEM_INFO_5";
case RSL__SYSTEM__INFO__6: return "RSL_SYSTEM_INFO_6";
case RSL__SYSTEM__INFO__7: return "RSL_SYSTEM_INFO_7";
case RSL__SYSTEM__INFO__16: return "RSL_SYSTEM_INFO_16";
case RSL__SYSTEM__INFO__17: return "RSL_SYSTEM_INFO_17";
case RSL__SYSTEM__INFO__2bis: return "RSL_SYSTEM_INFO_2bis";
case RSL__SYSTEM__INFO__2ter: return "RSL_SYSTEM_INFO_2ter";
case RSL__SYSTEM__INFO__5bis: return "RSL_SYSTEM_INFO_5bis";
case RSL__SYSTEM__INFO__5ter: return "RSL_SYSTEM_INFO_5ter";
case RSL__SYSTEM__INFO__10: return "RSL_SYSTEM_INFO_10";
case RSL__EXT__MEAS__ORDER: return "RSL_EXT_MEAS_ORDER";
case RSL__MEAS__INFO: return "RSL_MEAS_INFO";
case RSL__SYSTEM__INFO__13: return "RSL_SYSTEM_INFO_13";
case RSL__ERIC__SYSTEM__INFO__13: return "RSL_ERIC_SYSTEM_INFO_13";
case RSL__SYSTEM__INFO__2quater: return "RSL_SYSTEM_INFO_2quater";
case RSL__SYSTEM__INFO__9: return "RSL_SYSTEM_INFO_9";
case RSL__SYSTEM__INFO__18: return "RSL_SYSTEM_INFO_18";
case RSL__SYSTEM__INFO__19: return "RSL_SYSTEM_INFO_19";
case RSL__SYSTEM__INFO__20: return "RSL_SYSTEM_INFO_20";
default:
return "<unknown>";
}
}

RSL__IE__SysinfoType::enum_type RSL__IE__SysinfoType::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, "RSL_SYSTEM_INFO_8")) return RSL__SYSTEM__INFO__8;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_1")) return RSL__SYSTEM__INFO__1;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_2")) return RSL__SYSTEM__INFO__2;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_3")) return RSL__SYSTEM__INFO__3;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_4")) return RSL__SYSTEM__INFO__4;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_5")) return RSL__SYSTEM__INFO__5;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_6")) return RSL__SYSTEM__INFO__6;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_7")) return RSL__SYSTEM__INFO__7;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_16")) return RSL__SYSTEM__INFO__16;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_17")) return RSL__SYSTEM__INFO__17;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_2bis")) return RSL__SYSTEM__INFO__2bis;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_2ter")) return RSL__SYSTEM__INFO__2ter;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_5bis")) return RSL__SYSTEM__INFO__5bis;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_5ter")) return RSL__SYSTEM__INFO__5ter;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_10")) return RSL__SYSTEM__INFO__10;
if (!strcmp(str_par, "RSL_EXT_MEAS_ORDER")) return RSL__EXT__MEAS__ORDER;
if (!strcmp(str_par, "RSL_MEAS_INFO")) return RSL__MEAS__INFO;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_13")) return RSL__SYSTEM__INFO__13;
if (!strcmp(str_par, "RSL_ERIC_SYSTEM_INFO_13")) return RSL__ERIC__SYSTEM__INFO__13;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_2quater")) return RSL__SYSTEM__INFO__2quater;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_9")) return RSL__SYSTEM__INFO__9;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_18")) return RSL__SYSTEM__INFO__18;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_19")) return RSL__SYSTEM__INFO__19;
if (!strcmp(str_par, "RSL_SYSTEM_INFO_20")) return RSL__SYSTEM__INFO__20;
}
return UNKNOWN_VALUE;
}

boolean RSL__IE__SysinfoType::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 13:
case 14:
case 15:
case 71:
case 72:
case 40:
case 12:
case 41:
case 42:
case 43:
case 44:
case 45:
return TRUE;
default:
return FALSE;
}
}

int RSL__IE__SysinfoType::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 @RSL_Types.RSL_IE_SysinfoType.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int RSL__IE__SysinfoType::enum2int(const RSL__IE__SysinfoType& 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 @RSL_Types.RSL_IE_SysinfoType.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void RSL__IE__SysinfoType::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RSL_Types.RSL_IE_SysinfoType.", int_val);
enum_value = (enum_type)int_val;
}

RSL__IE__SysinfoType::operator RSL__IE__SysinfoType::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
return enum_value;
}

void RSL__IE__SysinfoType::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 RSL__IE__SysinfoType::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", "@RSL_Types.RSL_IE_SysinfoType");
  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 @RSL_Types.RSL_IE_SysinfoType.");
  }
}

void RSL__IE__SysinfoType::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
text_buf.push_int(enum_value);
}

void RSL__IE__SysinfoType::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 @RSL_Types.RSL_IE_SysinfoType.", enum_value);
}

void RSL__IE__SysinfoType::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 RSL__IE__SysinfoType::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 RSL__IE__SysinfoType::RAW_decode(const TTCN_Typedescriptor_t& p_td,TTCN_Buffer& p_buf,int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 7, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int RSL__IE__SysinfoType::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 7);
}

void RSL__IE__SysinfoType_template::copy_template(const RSL__IE__SysinfoType_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 RSL__IE__SysinfoType_template[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 RSL__IE__SysinfoType_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__IE__SysinfoType_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 @RSL_Types.RSL_IE_SysinfoType.");
}
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template()
{
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!RSL__IE__SysinfoType::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RSL_Types.RSL_IE_SysinfoType with unknown numeric value %d.", other_value);
single_value = (RSL__IE__SysinfoType::enum_type)other_value;
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(RSL__IE__SysinfoType::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(const RSL__IE__SysinfoType& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == RSL__IE__SysinfoType::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
single_value = other_value.enum_value;
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(const OPTIONAL<RSL__IE__SysinfoType>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RSL__IE__SysinfoType::enum_type)(const RSL__IE__SysinfoType&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @RSL_Types.RSL_IE_SysinfoType from an unbound optional field.");
}
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(RSL__IE__SysinfoType_template* p_precondition, RSL__IE__SysinfoType_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(Dynamic_Match_Interface<RSL__IE__SysinfoType>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__IE__SysinfoType>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__IE__SysinfoType_template::RSL__IE__SysinfoType_template(const RSL__IE__SysinfoType_template& other_value)
 : Base_Template()
{
copy_template(other_value);
}

RSL__IE__SysinfoType_template::~RSL__IE__SysinfoType_template()
{
clean_up();
}

boolean RSL__IE__SysinfoType_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean RSL__IE__SysinfoType_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != RSL__IE__SysinfoType::UNBOUND_VALUE;
}

void RSL__IE__SysinfoType_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;
}

RSL__IE__SysinfoType_template& RSL__IE__SysinfoType_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__IE__SysinfoType_template& RSL__IE__SysinfoType_template::operator=(int other_value)
{
if (!RSL__IE__SysinfoType::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RSL_Types.RSL_IE_SysinfoType.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (RSL__IE__SysinfoType::enum_type)other_value;
return *this;
}

RSL__IE__SysinfoType_template& RSL__IE__SysinfoType_template::operator=(RSL__IE__SysinfoType::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

RSL__IE__SysinfoType_template& RSL__IE__SysinfoType_template::operator=(const RSL__IE__SysinfoType& other_value)
{
if (other_value.enum_value == RSL__IE__SysinfoType::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RSL_Types.RSL_IE_SysinfoType to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

RSL__IE__SysinfoType_template& RSL__IE__SysinfoType_template::operator=(const OPTIONAL<RSL__IE__SysinfoType>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (RSL__IE__SysinfoType::enum_type)(const RSL__IE__SysinfoType&)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 @RSL_Types.RSL_IE_SysinfoType.");
}
return *this;
}

RSL__IE__SysinfoType_template& RSL__IE__SysinfoType_template::operator=(const RSL__IE__SysinfoType_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__IE__SysinfoType_template::match(RSL__IE__SysinfoType::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 @RSL_Types.RSL_IE_SysinfoType.");
}
return FALSE;
}

boolean RSL__IE__SysinfoType_template::match(const RSL__IE__SysinfoType& other_value, boolean) const
{
if (other_value.enum_value == RSL__IE__SysinfoType::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RSL_Types.RSL_IE_SysinfoType with an unbound value.");
return match(other_value.enum_value);
}

RSL__IE__SysinfoType::enum_type RSL__IE__SysinfoType_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 @RSL_Types.RSL_IE_SysinfoType.");
return single_value;
}

void RSL__IE__SysinfoType_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 RSL__IE__SysinfoType_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
}
}

RSL__IE__SysinfoType_template& RSL__IE__SysinfoType_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 @RSL_Types.RSL_IE_SysinfoType.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RSL_Types.RSL_IE_SysinfoType.");
return value_list.list_value[list_index];
}

void RSL__IE__SysinfoType_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(RSL__IE__SysinfoType::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 RSL__IE__SysinfoType_template::log_match(const RSL__IE__SysinfoType& 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 RSL__IE__SysinfoType_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 @RSL_Types.RSL_IE_SysinfoType.");
}
}

void RSL__IE__SysinfoType_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (RSL__IE__SysinfoType::enum_type)text_buf.pull_int().get_val();
if (!RSL__IE__SysinfoType::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RSL_Types.RSL_IE_SysinfoType.", 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 RSL__IE__SysinfoType_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 @RSL_Types.RSL_IE_SysinfoType.");
}
}

boolean RSL__IE__SysinfoType_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__IE__SysinfoType_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 RSL__IE__SysinfoType_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: {
    RSL__IE__SysinfoType_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: {
    RSL__IE__SysinfoType::enum_type enum_val = RSL__IE__SysinfoType::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!RSL__IE__SysinfoType::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @RSL_Types.RSL_IE_SysinfoType.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__IE__SysinfoType_template* precondition = new RSL__IE__SysinfoType_template;
    precondition->set_param(*m_p->get_elem(0));
    RSL__IE__SysinfoType_template* implied_template = new RSL__IE__SysinfoType_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = RSL__IE__SysinfoType_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@RSL_Types.RSL_IE_SysinfoType");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__IE__SysinfoType_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 : "@RSL_Types.RSL_IE_SysinfoType");
}

RSL__SacchInfoElement::RSL__SacchInfoElement()
{
}

RSL__SacchInfoElement::RSL__SacchInfoElement(const RSL__IE__SysinfoType& par_si__type,
    const INTEGER& par_len,
    const OCTETSTRING& par_msg)
  :   field_si__type(par_si__type),
  field_len(par_len),
  field_msg(par_msg)
{
}

RSL__SacchInfoElement::RSL__SacchInfoElement(const RSL__SacchInfoElement& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_SacchInfoElement.");
if (other_value.si__type().is_bound()) field_si__type = other_value.si__type();
else field_si__type.clean_up();
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.msg().is_bound()) field_msg = other_value.msg();
else field_msg.clean_up();
}

void RSL__SacchInfoElement::clean_up()
{
field_si__type.clean_up();
field_len.clean_up();
field_msg.clean_up();
}

const TTCN_Typedescriptor_t* RSL__SacchInfoElement::get_descriptor() const { return &RSL__SacchInfoElement_descr_; }
RSL__SacchInfoElement& RSL__SacchInfoElement::operator=(const RSL__SacchInfoElement& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_SacchInfoElement.");
  if (other_value.si__type().is_bound()) field_si__type = other_value.si__type();
  else field_si__type.clean_up();
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.msg().is_bound()) field_msg = other_value.msg();
  else field_msg.clean_up();
}
return *this;
}

boolean RSL__SacchInfoElement::operator==(const RSL__SacchInfoElement& other_value) const
{
return field_si__type==other_value.field_si__type
  && field_len==other_value.field_len
  && field_msg==other_value.field_msg;
}

boolean RSL__SacchInfoElement::is_bound() const
{
return (field_si__type.is_bound())
  || (field_len.is_bound())
  || (field_msg.is_bound());
}
boolean RSL__SacchInfoElement::is_value() const
{
return field_si__type.is_value()
  && field_len.is_value()
  && field_msg.is_value();
}
void RSL__SacchInfoElement::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ si_type := ");
field_si__type.log();
TTCN_Logger::log_event_str(", len := ");
field_len.log();
TTCN_Logger::log_event_str(", msg := ");
field_msg.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__SacchInfoElement::set_implicit_omit()
{
if (si__type().is_bound()) si__type().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (msg().is_bound()) msg().set_implicit_omit();
}

void RSL__SacchInfoElement::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 @RSL_Types.RSL_SacchInfoElement 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) si__type().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msg().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(), "si_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_SacchInfoElement: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_SacchInfoElement");
  }
}

void RSL__SacchInfoElement::encode_text(Text_Buf& text_buf) const
{
field_si__type.encode_text(text_buf);
field_len.encode_text(text_buf);
field_msg.encode_text(text_buf);
}

void RSL__SacchInfoElement::decode_text(Text_Buf& text_buf)
{
field_si__type.decode_text(text_buf);
field_len.decode_text(text_buf);
field_msg.decode_text(text_buf);
}

void RSL__SacchInfoElement::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 RSL__SacchInfoElement::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 RSL__SacchInfoElement::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RSL__SacchInfoElement_si__type_descr_.raw->forceomit);
  decoded_field_length = field_si__type.RAW_decode(RSL__SacchInfoElement_si__type_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  RAW_Force_Omit field_1_force_omit(1, force_omit, RSL__SacchInfoElement_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(RSL__SacchInfoElement_len_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_len.convert_to_Integer(RSL__SacchInfoElement_len_descr_);
  field_len = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, RSL__SacchInfoElement_msg_descr_.raw->forceomit);
  decoded_field_length = field_msg.RAW_decode(RSL__SacchInfoElement_msg_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RSL__SacchInfoElement::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, RSL__SacchInfoElement_si__type_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__SacchInfoElement_len_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__SacchInfoElement_msg_descr_.raw);
  encoded_length += field_si__type.RAW_encode(RSL__SacchInfoElement_si__type_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &RSL__SacchInfoElement_len_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_msg.RAW_encode(RSL__SacchInfoElement_msg_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct RSL__SacchInfoElement_template::single_value_struct {
RSL__IE__SysinfoType_template field_si__type;
INTEGER_template field_len;
OCTETSTRING_template field_msg;
};

void RSL__SacchInfoElement_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_si__type = ANY_VALUE;
single_value->field_len = ANY_VALUE;
single_value->field_msg = ANY_VALUE;
}
}
}

void RSL__SacchInfoElement_template::copy_value(const RSL__SacchInfoElement& other_value)
{
single_value = new single_value_struct;
if (other_value.si__type().is_bound()) {
  single_value->field_si__type = other_value.si__type();
} else {
  single_value->field_si__type.clean_up();
}
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.msg().is_bound()) {
  single_value->field_msg = other_value.msg();
} else {
  single_value->field_msg.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__SacchInfoElement_template::copy_template(const RSL__SacchInfoElement_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.si__type().get_selection()) {
single_value->field_si__type = other_value.si__type();
} else {
single_value->field_si__type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msg().get_selection()) {
single_value->field_msg = other_value.msg();
} else {
single_value->field_msg.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 RSL__SacchInfoElement_template[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 RSL__SacchInfoElement_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__SacchInfoElement_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 @RSL_Types.RSL_SacchInfoElement.");
break;
}
set_selection(other_value);
}

RSL__SacchInfoElement_template::RSL__SacchInfoElement_template()
{
}

RSL__SacchInfoElement_template::RSL__SacchInfoElement_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__SacchInfoElement_template::RSL__SacchInfoElement_template(const RSL__SacchInfoElement& other_value)
{
copy_value(other_value);
}

RSL__SacchInfoElement_template::RSL__SacchInfoElement_template(const OPTIONAL<RSL__SacchInfoElement>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__SacchInfoElement&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @RSL_Types.RSL_SacchInfoElement from an unbound optional field.");
}
}

RSL__SacchInfoElement_template::RSL__SacchInfoElement_template(RSL__SacchInfoElement_template* p_precondition, RSL__SacchInfoElement_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__SacchInfoElement_template::RSL__SacchInfoElement_template(Dynamic_Match_Interface<RSL__SacchInfoElement>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__SacchInfoElement>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__SacchInfoElement_template::RSL__SacchInfoElement_template(const RSL__SacchInfoElement_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RSL__SacchInfoElement_template::~RSL__SacchInfoElement_template()
{
clean_up();
}

RSL__SacchInfoElement_template& RSL__SacchInfoElement_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__SacchInfoElement_template& RSL__SacchInfoElement_template::operator=(const RSL__SacchInfoElement& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RSL__SacchInfoElement_template& RSL__SacchInfoElement_template::operator=(const OPTIONAL<RSL__SacchInfoElement>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__SacchInfoElement&)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 @RSL_Types.RSL_SacchInfoElement.");
}
return *this;
}

RSL__SacchInfoElement_template& RSL__SacchInfoElement_template::operator=(const RSL__SacchInfoElement_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__SacchInfoElement_template::match(const RSL__SacchInfoElement& 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.si__type().is_bound()) return FALSE;
if(!single_value->field_si__type.match(other_value.si__type(), legacy))return FALSE;
if(!other_value.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.msg().is_bound()) return FALSE;
if(!single_value->field_msg.match(other_value.msg(), 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 @RSL_Types.RSL_SacchInfoElement.");
}
return FALSE;
}

boolean RSL__SacchInfoElement_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_si__type.is_bound()
 || single_value->field_len.is_bound()
 || single_value->field_msg.is_bound();
}

boolean RSL__SacchInfoElement_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_si__type.is_value()
 && single_value->field_len.is_value()
 && single_value->field_msg.is_value();
}

void RSL__SacchInfoElement_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;
}

RSL__SacchInfoElement RSL__SacchInfoElement_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 @RSL_Types.RSL_SacchInfoElement.");
RSL__SacchInfoElement ret_val;
if (single_value->field_si__type.is_bound()) {
ret_val.si__type() = single_value->field_si__type.valueof();
}
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_msg.is_bound()) {
ret_val.msg() = single_value->field_msg.valueof();
}
return ret_val;
}

void RSL__SacchInfoElement_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 @RSL_Types.RSL_SacchInfoElement.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__SacchInfoElement_template[list_length];
}

RSL__SacchInfoElement_template& RSL__SacchInfoElement_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 @RSL_Types.RSL_SacchInfoElement.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @RSL_Types.RSL_SacchInfoElement.");
return value_list.list_value[list_index];
}

RSL__IE__SysinfoType_template& RSL__SacchInfoElement_template::si__type()
{
set_specific();
return single_value->field_si__type;
}

const RSL__IE__SysinfoType_template& RSL__SacchInfoElement_template::si__type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si_type of a non-specific template of type @RSL_Types.RSL_SacchInfoElement.");
return single_value->field_si__type;
}

INTEGER_template& RSL__SacchInfoElement_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& RSL__SacchInfoElement_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @RSL_Types.RSL_SacchInfoElement.");
return single_value->field_len;
}

OCTETSTRING_template& RSL__SacchInfoElement_template::msg()
{
set_specific();
return single_value->field_msg;
}

const OCTETSTRING_template& RSL__SacchInfoElement_template::msg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msg of a non-specific template of type @RSL_Types.RSL_SacchInfoElement.");
return single_value->field_msg;
}

int RSL__SacchInfoElement_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfoElement 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 @RSL_Types.RSL_SacchInfoElement 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 @RSL_Types.RSL_SacchInfoElement containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfoElement containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfoElement containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfoElement containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfoElement containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfoElement containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfoElement containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Types.RSL_SacchInfoElement.");
  }
  return 0;
}

void RSL__SacchInfoElement_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ si_type := ");
single_value->field_si__type.log();
TTCN_Logger::log_event_str(", len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", msg := ");
single_value->field_msg.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 RSL__SacchInfoElement_template::log_match(const RSL__SacchInfoElement& 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_si__type.match(match_value.si__type(), legacy)){
TTCN_Logger::log_logmatch_info(".si_type");
single_value->field_si__type.log_match(match_value.si__type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msg.match(match_value.msg(), legacy)){
TTCN_Logger::log_logmatch_info(".msg");
single_value->field_msg.log_match(match_value.msg(), 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("{ si_type := ");
single_value->field_si__type.log_match(match_value.si__type(), legacy);
TTCN_Logger::log_event_str(", len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", msg := ");
single_value->field_msg.log_match(match_value.msg(), 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 RSL__SacchInfoElement_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (si__type().is_bound()) si__type().set_implicit_omit();
if (len().is_bound()) len().set_implicit_omit();
if (msg().is_bound()) msg().set_implicit_omit();
}

void RSL__SacchInfoElement_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_si__type.encode_text(text_buf);
single_value->field_len.encode_text(text_buf);
single_value->field_msg.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 @RSL_Types.RSL_SacchInfoElement.");
}
}

void RSL__SacchInfoElement_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_si__type.decode_text(text_buf);
single_value->field_len.decode_text(text_buf);
single_value->field_msg.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 RSL__SacchInfoElement_template[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 @RSL_Types.RSL_SacchInfoElement.");
}
}

void RSL__SacchInfoElement_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: {
    RSL__SacchInfoElement_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 @RSL_Types.RSL_SacchInfoElement 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) si__type().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) len().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) msg().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(), "si_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msg().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_SacchInfoElement: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__SacchInfoElement_template* precondition = new RSL__SacchInfoElement_template;
    precondition->set_param(*param.get_elem(0));
    RSL__SacchInfoElement_template* implied_template = new RSL__SacchInfoElement_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__SacchInfoElement_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_SacchInfoElement");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__SacchInfoElement_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_si__type.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_SacchInfoElement");
single_value->field_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_SacchInfoElement");
single_value->field_msg.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_SacchInfoElement");
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 : "@RSL_Types.RSL_SacchInfoElement");
}

boolean RSL__SacchInfoElement_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__SacchInfoElement_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;
}

RSL__SacchInfo::RSL__SacchInfo()
{
}

RSL__SacchInfo::RSL__SacchInfo(const INTEGER& par_len,
    const INTEGER& par_num__msgs,
    const RSL__SacchInfoElements& par_elems)
  :   field_len(par_len),
  field_num__msgs(par_num__msgs),
  field_elems(par_elems)
{
}

RSL__SacchInfo::RSL__SacchInfo(const RSL__SacchInfo& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RSL_Types.RSL_SacchInfo.");
if (other_value.len().is_bound()) field_len = other_value.len();
else field_len.clean_up();
if (other_value.num__msgs().is_bound()) field_num__msgs = other_value.num__msgs();
else field_num__msgs.clean_up();
if (other_value.elems().is_bound()) field_elems = other_value.elems();
else field_elems.clean_up();
}

void RSL__SacchInfo::clean_up()
{
field_len.clean_up();
field_num__msgs.clean_up();
field_elems.clean_up();
}

const TTCN_Typedescriptor_t* RSL__SacchInfo::get_descriptor() const { return &RSL__SacchInfo_descr_; }
RSL__SacchInfo& RSL__SacchInfo::operator=(const RSL__SacchInfo& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RSL_Types.RSL_SacchInfo.");
  if (other_value.len().is_bound()) field_len = other_value.len();
  else field_len.clean_up();
  if (other_value.num__msgs().is_bound()) field_num__msgs = other_value.num__msgs();
  else field_num__msgs.clean_up();
  if (other_value.elems().is_bound()) field_elems = other_value.elems();
  else field_elems.clean_up();
}
return *this;
}

boolean RSL__SacchInfo::operator==(const RSL__SacchInfo& other_value) const
{
return field_len==other_value.field_len
  && field_num__msgs==other_value.field_num__msgs
  && field_elems==other_value.field_elems;
}

boolean RSL__SacchInfo::is_bound() const
{
return (field_len.is_bound())
  || (field_num__msgs.is_bound())
  || (field_elems.is_bound());
}
boolean RSL__SacchInfo::is_value() const
{
return field_len.is_value()
  && field_num__msgs.is_value()
  && field_elems.is_value();
}
void RSL__SacchInfo::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ len := ");
field_len.log();
TTCN_Logger::log_event_str(", num_msgs := ");
field_num__msgs.log();
TTCN_Logger::log_event_str(", elems := ");
field_elems.log();
TTCN_Logger::log_event_str(" }");
}

void RSL__SacchInfo::set_implicit_omit()
{
if (len().is_bound()) len().set_implicit_omit();
if (num__msgs().is_bound()) num__msgs().set_implicit_omit();
if (elems().is_bound()) elems().set_implicit_omit();
}

void RSL__SacchInfo::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 @RSL_Types.RSL_SacchInfo 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) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) num__msgs().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) elems().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elems")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elems().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_SacchInfo: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@RSL_Types.RSL_SacchInfo");
  }
}

void RSL__SacchInfo::encode_text(Text_Buf& text_buf) const
{
field_len.encode_text(text_buf);
field_num__msgs.encode_text(text_buf);
field_elems.encode_text(text_buf);
}

void RSL__SacchInfo::decode_text(Text_Buf& text_buf)
{
field_len.decode_text(text_buf);
field_num__msgs.decode_text(text_buf);
field_elems.decode_text(text_buf);
}

void RSL__SacchInfo::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 RSL__SacchInfo::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 RSL__SacchInfo::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit)
{ (void)no_err;
  int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding);
  limit-=prepaddlength;
  size_t last_decoded_pos = p_buf.get_pos_bit();
  int decoded_length = 0;
  int decoded_field_length = 0;
  raw_order_t local_top_order;
  if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord;
  else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB;
  else local_top_order=ORDER_LSB;
  int value_of_length_field0 = 0;
  int value_of_length_field1 = 0;
  RAW_Force_Omit field_0_force_omit(0, force_omit, RSL__SacchInfo_len_descr_.raw->forceomit);
  decoded_field_length = field_len.RAW_decode(RSL__SacchInfo_len_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp0 = field_len.convert_to_Integer(RSL__SacchInfo_len_descr_);
  field_len = tmp0;
  value_of_length_field0 += tmp0.get_long_long_val() * 8;
  RAW_Force_Omit field_1_force_omit(1, force_omit, RSL__SacchInfo_num__msgs_descr_.raw->forceomit);
  decoded_field_length = field_num__msgs.RAW_decode(RSL__SacchInfo_num__msgs_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  INTEGER tmp1 = field_num__msgs.convert_to_Integer(RSL__SacchInfo_num__msgs_descr_);
  field_num__msgs = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 1;
  value_of_length_field0 -= decoded_field_length;
  RAW_Force_Omit field_2_force_omit(2, force_omit, RSL__SacchInfo_elems_descr_.raw->forceomit);
  decoded_field_length = field_elems.RAW_decode(RSL__SacchInfo_elems_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, value_of_length_field1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 0) return decoded_field_length;
  decoded_length+=decoded_field_length;
  limit-=decoded_field_length;
  last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit());
  value_of_length_field0 -= decoded_field_length;
  value_of_length_field1 -= decoded_field_length;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int RSL__SacchInfo::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, RSL__SacchInfo_len_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, RSL__SacchInfo_num__msgs_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RSL__SacchInfo_elems_descr_.raw);
  encoded_length += 8;
  myleaf.body.node.nodes[0]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[0]->coding_descr = &RSL__SacchInfo_len_descr_;
  myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 2;
  myleaf.body.node.nodes[0]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(2);
  myleaf.body.node.nodes[0]->length = 8;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &RSL__SacchInfo_num__msgs_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = -1;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos;
  encoded_length += field_elems.RAW_encode(RSL__SacchInfo_elems_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct RSL__SacchInfo_template::single_value_struct {
INTEGER_template field_len;
INTEGER_template field_num__msgs;
RSL__SacchInfoElements_template field_elems;
};

void RSL__SacchInfo_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_len = ANY_VALUE;
single_value->field_num__msgs = ANY_VALUE;
single_value->field_elems = ANY_VALUE;
}
}
}

void RSL__SacchInfo_template::copy_value(const RSL__SacchInfo& other_value)
{
single_value = new single_value_struct;
if (other_value.len().is_bound()) {
  single_value->field_len = other_value.len();
} else {
  single_value->field_len.clean_up();
}
if (other_value.num__msgs().is_bound()) {
  single_value->field_num__msgs = other_value.num__msgs();
} else {
  single_value->field_num__msgs.clean_up();
}
if (other_value.elems().is_bound()) {
  single_value->field_elems = other_value.elems();
} else {
  single_value->field_elems.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RSL__SacchInfo_template::copy_template(const RSL__SacchInfo_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.len().get_selection()) {
single_value->field_len = other_value.len();
} else {
single_value->field_len.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__msgs().get_selection()) {
single_value->field_num__msgs = other_value.num__msgs();
} else {
single_value->field_num__msgs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elems().get_selection()) {
single_value->field_elems = other_value.elems();
} else {
single_value->field_elems.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 RSL__SacchInfo_template[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 RSL__SacchInfo_template(*other_value.implication_.precondition);
implication_.implied_template = new RSL__SacchInfo_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 @RSL_Types.RSL_SacchInfo.");
break;
}
set_selection(other_value);
}

RSL__SacchInfo_template::RSL__SacchInfo_template()
{
}

RSL__SacchInfo_template::RSL__SacchInfo_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RSL__SacchInfo_template::RSL__SacchInfo_template(const RSL__SacchInfo& other_value)
{
copy_value(other_value);
}

RSL__SacchInfo_template::RSL__SacchInfo_template(const OPTIONAL<RSL__SacchInfo>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__SacchInfo&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @RSL_Types.RSL_SacchInfo from an unbound optional field.");
}
}

RSL__SacchInfo_template::RSL__SacchInfo_template(RSL__SacchInfo_template* p_precondition, RSL__SacchInfo_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RSL__SacchInfo_template::RSL__SacchInfo_template(Dynamic_Match_Interface<RSL__SacchInfo>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RSL__SacchInfo>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RSL__SacchInfo_template::RSL__SacchInfo_template(const RSL__SacchInfo_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RSL__SacchInfo_template::~RSL__SacchInfo_template()
{
clean_up();
}

RSL__SacchInfo_template& RSL__SacchInfo_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RSL__SacchInfo_template& RSL__SacchInfo_template::operator=(const RSL__SacchInfo& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RSL__SacchInfo_template& RSL__SacchInfo_template::operator=(const OPTIONAL<RSL__SacchInfo>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RSL__SacchInfo&)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 @RSL_Types.RSL_SacchInfo.");
}
return *this;
}

RSL__SacchInfo_template& RSL__SacchInfo_template::operator=(const RSL__SacchInfo_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RSL__SacchInfo_template::match(const RSL__SacchInfo& 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.len().is_bound()) return FALSE;
if(!single_value->field_len.match(other_value.len(), legacy))return FALSE;
if(!other_value.num__msgs().is_bound()) return FALSE;
if(!single_value->field_num__msgs.match(other_value.num__msgs(), legacy))return FALSE;
if(!other_value.elems().is_bound()) return FALSE;
if(!single_value->field_elems.match(other_value.elems(), 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 @RSL_Types.RSL_SacchInfo.");
}
return FALSE;
}

boolean RSL__SacchInfo_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_len.is_bound()
 || single_value->field_num__msgs.is_bound()
 || single_value->field_elems.is_bound();
}

boolean RSL__SacchInfo_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_len.is_value()
 && single_value->field_num__msgs.is_value()
 && single_value->field_elems.is_value();
}

void RSL__SacchInfo_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;
}

RSL__SacchInfo RSL__SacchInfo_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 @RSL_Types.RSL_SacchInfo.");
RSL__SacchInfo ret_val;
if (single_value->field_len.is_bound()) {
ret_val.len() = single_value->field_len.valueof();
}
if (single_value->field_num__msgs.is_bound()) {
ret_val.num__msgs() = single_value->field_num__msgs.valueof();
}
if (single_value->field_elems.is_bound()) {
ret_val.elems() = single_value->field_elems.valueof();
}
return ret_val;
}

void RSL__SacchInfo_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 @RSL_Types.RSL_SacchInfo.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RSL__SacchInfo_template[list_length];
}

RSL__SacchInfo_template& RSL__SacchInfo_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 @RSL_Types.RSL_SacchInfo.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @RSL_Types.RSL_SacchInfo.");
return value_list.list_value[list_index];
}

INTEGER_template& RSL__SacchInfo_template::len()
{
set_specific();
return single_value->field_len;
}

const INTEGER_template& RSL__SacchInfo_template::len() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field len of a non-specific template of type @RSL_Types.RSL_SacchInfo.");
return single_value->field_len;
}

INTEGER_template& RSL__SacchInfo_template::num__msgs()
{
set_specific();
return single_value->field_num__msgs;
}

const INTEGER_template& RSL__SacchInfo_template::num__msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_msgs of a non-specific template of type @RSL_Types.RSL_SacchInfo.");
return single_value->field_num__msgs;
}

RSL__SacchInfoElements_template& RSL__SacchInfo_template::elems()
{
set_specific();
return single_value->field_elems;
}

const RSL__SacchInfoElements_template& RSL__SacchInfo_template::elems() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elems of a non-specific template of type @RSL_Types.RSL_SacchInfo.");
return single_value->field_elems;
}

int RSL__SacchInfo_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfo 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 @RSL_Types.RSL_SacchInfo 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 @RSL_Types.RSL_SacchInfo containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfo containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfo containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfo containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfo containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfo containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @RSL_Types.RSL_SacchInfo containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RSL_Types.RSL_SacchInfo.");
  }
  return 0;
}

void RSL__SacchInfo_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ len := ");
single_value->field_len.log();
TTCN_Logger::log_event_str(", num_msgs := ");
single_value->field_num__msgs.log();
TTCN_Logger::log_event_str(", elems := ");
single_value->field_elems.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 RSL__SacchInfo_template::log_match(const RSL__SacchInfo& 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_len.match(match_value.len(), legacy)){
TTCN_Logger::log_logmatch_info(".len");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__msgs.match(match_value.num__msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".num_msgs");
single_value->field_num__msgs.log_match(match_value.num__msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elems.match(match_value.elems(), legacy)){
TTCN_Logger::log_logmatch_info(".elems");
single_value->field_elems.log_match(match_value.elems(), 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("{ len := ");
single_value->field_len.log_match(match_value.len(), legacy);
TTCN_Logger::log_event_str(", num_msgs := ");
single_value->field_num__msgs.log_match(match_value.num__msgs(), legacy);
TTCN_Logger::log_event_str(", elems := ");
single_value->field_elems.log_match(match_value.elems(), 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 RSL__SacchInfo_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (len().is_bound()) len().set_implicit_omit();
if (num__msgs().is_bound()) num__msgs().set_implicit_omit();
if (elems().is_bound()) elems().set_implicit_omit();
}

void RSL__SacchInfo_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_len.encode_text(text_buf);
single_value->field_num__msgs.encode_text(text_buf);
single_value->field_elems.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 @RSL_Types.RSL_SacchInfo.");
}
}

void RSL__SacchInfo_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_len.decode_text(text_buf);
single_value->field_num__msgs.decode_text(text_buf);
single_value->field_elems.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 RSL__SacchInfo_template[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 @RSL_Types.RSL_SacchInfo.");
}
}

void RSL__SacchInfo_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: {
    RSL__SacchInfo_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 @RSL_Types.RSL_SacchInfo 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) len().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) num__msgs().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) elems().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(), "len")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          len().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elems")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elems().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @RSL_Types.RSL_SacchInfo: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RSL__SacchInfo_template* precondition = new RSL__SacchInfo_template;
    precondition->set_param(*param.get_elem(0));
    RSL__SacchInfo_template* implied_template = new RSL__SacchInfo_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RSL__SacchInfo_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@RSL_Types.RSL_SacchInfo");
  }
  is_ifpresent = param.get_ifpresent();
}

void RSL__SacchInfo_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_len.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_SacchInfo");
single_value->field_num__msgs.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_SacchInfo");
single_value->field_elems.check_restriction(t_res, t_name ? t_name : "@RSL_Types.RSL_SacchInfo");
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 : "@RSL_Types.RSL_SacchInfo");
}

boolean RSL__SacchInfo_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RSL__SacchInfo_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


} /* end of namespace */
