blob: d82a42500b0c9ff3b87ff2aeee2ce27b59644590 [file] [log] [blame]
// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version CRL 113 200/6 R6A
// for Lénárd Nagy (elnrnag@elx78355y6x) on Thu Oct 24 10:29:40 2019
// Copyright (c) 2000-2019 Ericsson Telecom AB
// Do not edit this file unless you know what you are doing.
/* Including header files */
#include "CANFD_matrix_messages.hh"
namespace CANFD__matrix__messages {
/* Prototypes of static functions */
static void pre_init_module();
static void post_init_module();
/* Literal string constants */
static const unsigned char os_0_octets[] = { 0, 0, 1, 34 },
os_1_octets[] = { 0, 0, 1, 35 },
os_2_octets[] = { 0, 0, 1, 36 },
os_3_octets[] = { 0, 0, 1, 37 },
os_4_octets[] = { 128, 0, 0, 1 };
static const OCTETSTRING os_0(4, os_0_octets),
os_1(4, os_1_octets),
os_2(4, os_2_octets),
os_3(4, os_3_octets),
os_4(4, os_4_octets);
static const unsigned char module_checksum[] = { 0x23, 0x12, 0x87, 0x6a, 0xa7, 0xe1, 0xed, 0x39, 0xe3, 0x5a, 0xcf, 0xde, 0x64, 0xd8, 0x44, 0x22 };
/* Global variable definitions */
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_raw_ = {11,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_MSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,11,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_xer_ = { {"test_sig_11_bit_bitstring_lsb_coded>\n", "test_sig_11_bit_bitstring_lsb_coded>\n"}, {37, 37}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.test_sig_11_bit_bitstring_lsb_coded", &BITSTRING_ber_, &CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_raw_, NULL, &CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_xer_, &BITSTRING_json_, &CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_raw_ = {5,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_MSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,5,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_xer_ = { {"test_sig_5_bit_bitstring_lsb_coded>\n", "test_sig_5_bit_bitstring_lsb_coded>\n"}, {36, 36}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.test_sig_5_bit_bitstring_lsb_coded", &BITSTRING_ber_, &CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_raw_, NULL, &CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_xer_, &BITSTRING_json_, &CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__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,NULL,false};
// No XER for CANFD__MESSAGE__TESTFRAME0__msg__type
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME0__msg__type_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type", NULL, &CANFD__MESSAGE__TESTFRAME0__msg__type_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_raw_ = {11,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_MSB,ORDER_MSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,11,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_xer_ = { {"test_sig_11_bit_bitstring_msb_coded>\n", "test_sig_11_bit_bitstring_msb_coded>\n"}, {37, 37}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.test_sig_11_bit_bitstring_msb_coded", &BITSTRING_ber_, &CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_raw_, NULL, &CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_xer_, &BITSTRING_json_, &CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_raw_ = {5,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_MSB,ORDER_MSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,5,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_xer_ = { {"test_sig_5_bit_bitstring_msb_coded>\n", "test_sig_5_bit_bitstring_msb_coded>\n"}, {36, 36}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.test_sig_5_bit_bitstring_msb_coded", &BITSTRING_ber_, &CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_raw_, NULL, &CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_xer_, &BITSTRING_json_, &CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__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,NULL,false};
// No XER for CANFD__MESSAGE__TESTFRAME1__msg__type
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME1__msg__type_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type", NULL, &CANFD__MESSAGE__TESTFRAME1__msg__type_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_raw_ = {11,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_MSB,ORDER_MSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_xer_ = { {"test_sig_11_bit_integer_msb_coded>\n", "test_sig_11_bit_integer_msb_coded>\n"}, {35, 35}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type.test_sig_11_bit_integer_msb_coded", &INTEGER_ber_, &CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_raw_, &INTEGER_text_, &CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_xer_, &INTEGER_json_, &CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_raw_ = {5,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_MSB,ORDER_MSB,EXT_BIT_NO,ORDER_LSB,ORDER_MSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_xer_ = { {"test_sig_5_bit_integer_msb_coded>\n", "test_sig_5_bit_integer_msb_coded>\n"}, {34, 34}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type.test_sig_5_bit_integer_msb_coded", &INTEGER_ber_, &CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_raw_, &INTEGER_text_, &CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_xer_, &INTEGER_json_, &CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__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,NULL,false};
// No XER for CANFD__MESSAGE__TESTFRAME2__msg__type
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME2__msg__type_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type", NULL, &CANFD__MESSAGE__TESTFRAME2__msg__type_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_xer_ = { {"test_sig_1_byte_octetstring_msb_coded>\n", "test_sig_1_byte_octetstring_msb_coded>\n"}, {39, 39}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_oer_ext_arr_[0] = {};
const int CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_oer_p_[0] = {};
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_oer_ = { -1, TRUE, 1, FALSE, 0, 0, CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_oer_ext_arr_, 0, CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_oer_p_};
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME3_msg_type.test_sig_1_byte_octetstring_msb_coded", &OCTETSTRING_ber_, &CAN__matrix__signals::OCT1__signal__type_raw_, &OCTETSTRING_text_, &CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_xer_, &OCTETSTRING_json_, &CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__1__byte__octetstring__msb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_xer_ = { {"test_sig_2_byte_octetstring_msb_coded>\n", "test_sig_2_byte_octetstring_msb_coded>\n"}, {39, 39}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_ext_arr_[0] = {};
const int CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_p_[0] = {};
const TTCN_OERdescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_ = { -1, TRUE, 2, FALSE, 0, 0, CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_ext_arr_, 0, CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_p_};
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME3_msg_type.test_sig_2_byte_octetstring_msb_coded", &OCTETSTRING_ber_, &CAN__matrix__signals::OCT2__signal__type_raw_, &OCTETSTRING_text_, &CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_xer_, &OCTETSTRING_json_, &CANFD__MESSAGE__TESTFRAME3__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for CANFD__MESSAGE__TESTFRAME3__msg__type
const TTCN_Typedescriptor_t CANFD__MESSAGE__TESTFRAME3__msg__type_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME3_msg_type", NULL, &CANFD__MESSAGE__TESTFRAME3__msg__type_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_xer_ = { {"test_sig_2_byte_octetstring_msb_coded>\n", "test_sig_2_byte_octetstring_msb_coded>\n"}, {39, 39}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_ext_arr_[0] = {};
const int CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_p_[0] = {};
const TTCN_OERdescriptor_t CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_ = { -1, TRUE, 2, FALSE, 0, 0, CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_ext_arr_, 0, CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_p_};
const TTCN_Typedescriptor_t CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_EXTENDEDFRAME1_msg_type.test_sig_2_byte_octetstring_msb_coded", &OCTETSTRING_ber_, &CAN__matrix__signals::OCT2__signal__type_raw_, &OCTETSTRING_text_, &CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_xer_, &OCTETSTRING_json_, &CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_test__sig__2__byte__octetstring__msb__coded_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for CANFD__MESSAGE__EXTENDEDFRAME1__msg__type
const TTCN_Typedescriptor_t CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_descr_ = { "@CANFD_matrix_messages.CANFD_MESSAGE_EXTENDEDFRAME1_msg_type", NULL, &CANFD__MESSAGE__EXTENDEDFRAME1__msg__type_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MatrixPayloadUnion_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for CANFD__MatrixPayloadUnion
const TTCN_Typedescriptor_t CANFD__MatrixPayloadUnion_descr_ = { "@CANFD_matrix_messages.CANFD_MatrixPayloadUnion", NULL, &CANFD__MatrixPayloadUnion_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__MatrixUnion_can__id_xer_ = { {"can_id>\n", "can_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CANFD__MatrixUnion_can__id_oer_ext_arr_[0] = {};
const int CANFD__MatrixUnion_can__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t CANFD__MatrixUnion_can__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, CANFD__MatrixUnion_can__id_oer_ext_arr_, 0, CANFD__MatrixUnion_can__id_oer_p_};
const TTCN_Typedescriptor_t CANFD__MatrixUnion_can__id_descr_ = { "@CANFD_matrix_messages.CANFD_MatrixUnion.can_id", &OCTETSTRING_ber_, &Can::CAN__id_raw_, &OCTETSTRING_text_, &CANFD__MatrixUnion_can__id_xer_, &OCTETSTRING_json_, &CANFD__MatrixUnion_can__id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__MatrixUnion_can__flags_xer_ = { {"can_flags>\n", "can_flags>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__MatrixUnion_can__flags_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__MatrixUnion_can__flags_descr_ = { "@CANFD_matrix_messages.CANFD_MatrixUnion.can_flags", &BITSTRING_ber_, &Can::CAN__flags_raw_, NULL, &CANFD__MatrixUnion_can__flags_xer_, &BITSTRING_json_, &CANFD__MatrixUnion_can__flags_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MatrixUnion_can__pdu_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for CANFD__MatrixUnion_can__pdu
const TTCN_Typedescriptor_t CANFD__MatrixUnion_can__pdu_descr_ = { "@CANFD_matrix_messages.CANFD_MatrixUnion.can_pdu", NULL, &CANFD__MatrixUnion_can__pdu_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CANFD__MatrixUnion_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
// No XER for CANFD__MatrixUnion
const TTCN_Typedescriptor_t CANFD__MatrixUnion_descr_ = { "@CANFD_matrix_messages.CANFD_MatrixUnion", NULL, &CANFD__MatrixUnion_raw_, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
TTCN_Module module_object("CANFD_matrix_messages", __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);
static const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_6,
current_runtime_version.requires_minor_version_6,
current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1);
/* Member functions of C++ classes */
CANFD__MESSAGE__TESTFRAME0__msg__type::CANFD__MESSAGE__TESTFRAME0__msg__type()
{
}
CANFD__MESSAGE__TESTFRAME0__msg__type::CANFD__MESSAGE__TESTFRAME0__msg__type(const BITSTRING& par_test__sig__11__bit__bitstring__lsb__coded,
const BITSTRING& par_test__sig__5__bit__bitstring__lsb__coded)
: field_test__sig__11__bit__bitstring__lsb__coded(par_test__sig__11__bit__bitstring__lsb__coded),
field_test__sig__5__bit__bitstring__lsb__coded(par_test__sig__5__bit__bitstring__lsb__coded)
{
}
CANFD__MESSAGE__TESTFRAME0__msg__type::CANFD__MESSAGE__TESTFRAME0__msg__type(const CANFD__MESSAGE__TESTFRAME0__msg__type& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
if (other_value.test__sig__11__bit__bitstring__lsb__coded().is_bound()) field_test__sig__11__bit__bitstring__lsb__coded = other_value.test__sig__11__bit__bitstring__lsb__coded();
else field_test__sig__11__bit__bitstring__lsb__coded.clean_up();
if (other_value.test__sig__5__bit__bitstring__lsb__coded().is_bound()) field_test__sig__5__bit__bitstring__lsb__coded = other_value.test__sig__5__bit__bitstring__lsb__coded();
else field_test__sig__5__bit__bitstring__lsb__coded.clean_up();
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::clean_up()
{
field_test__sig__11__bit__bitstring__lsb__coded.clean_up();
field_test__sig__5__bit__bitstring__lsb__coded.clean_up();
}
const TTCN_Typedescriptor_t* CANFD__MESSAGE__TESTFRAME0__msg__type::get_descriptor() const { return &CANFD__MESSAGE__TESTFRAME0__msg__type_descr_; }
CANFD__MESSAGE__TESTFRAME0__msg__type& CANFD__MESSAGE__TESTFRAME0__msg__type::operator=(const CANFD__MESSAGE__TESTFRAME0__msg__type& other_value)
{
if (this != &other_value) {
if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
if (other_value.test__sig__11__bit__bitstring__lsb__coded().is_bound()) field_test__sig__11__bit__bitstring__lsb__coded = other_value.test__sig__11__bit__bitstring__lsb__coded();
else field_test__sig__11__bit__bitstring__lsb__coded.clean_up();
if (other_value.test__sig__5__bit__bitstring__lsb__coded().is_bound()) field_test__sig__5__bit__bitstring__lsb__coded = other_value.test__sig__5__bit__bitstring__lsb__coded();
else field_test__sig__5__bit__bitstring__lsb__coded.clean_up();
}
return *this;
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__type::operator==(const CANFD__MESSAGE__TESTFRAME0__msg__type& other_value) const
{
return field_test__sig__11__bit__bitstring__lsb__coded==other_value.field_test__sig__11__bit__bitstring__lsb__coded
&& field_test__sig__5__bit__bitstring__lsb__coded==other_value.field_test__sig__5__bit__bitstring__lsb__coded;
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__type::is_bound() const
{
return (field_test__sig__11__bit__bitstring__lsb__coded.is_bound())
|| (field_test__sig__5__bit__bitstring__lsb__coded.is_bound());
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__type::is_value() const
{
return field_test__sig__11__bit__bitstring__lsb__coded.is_value()
&& field_test__sig__5__bit__bitstring__lsb__coded.is_value();
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ test_sig_11_bit_bitstring_lsb_coded := ");
field_test__sig__11__bit__bitstring__lsb__coded.log();
TTCN_Logger::log_event_str(", test_sig_5_bit_bitstring_lsb_coded := ");
field_test__sig__5__bit__bitstring__lsb__coded.log();
TTCN_Logger::log_event_str(" }");
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type 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) test__sig__11__bit__bitstring__lsb__coded().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) test__sig__5__bit__bitstring__lsb__coded().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(), "test_sig_11_bit_bitstring_lsb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__11__bit__bitstring__lsb__coded().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "test_sig_5_bit_bitstring_lsb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__5__bit__bitstring__lsb__coded().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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record value", "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type");
}
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::set_implicit_omit()
{
if (test__sig__11__bit__bitstring__lsb__coded().is_bound()) test__sig__11__bit__bitstring__lsb__coded().set_implicit_omit();
if (test__sig__5__bit__bitstring__lsb__coded().is_bound()) test__sig__5__bit__bitstring__lsb__coded().set_implicit_omit();
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::encode_text(Text_Buf& text_buf) const
{
field_test__sig__11__bit__bitstring__lsb__coded.encode_text(text_buf);
field_test__sig__5__bit__bitstring__lsb__coded.encode_text(text_buf);
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::decode_text(Text_Buf& text_buf)
{
field_test__sig__11__bit__bitstring__lsb__coded.decode_text(text_buf);
field_test__sig__5__bit__bitstring__lsb__coded.decode_text(text_buf);
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t 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);
p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
break;}
case TTCN_EncDec::CT_OER: {
TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
if(!p_td.oer)
TTCN_EncDec_ErrorContext::error_internal
("No OER descriptor available for type '%s'.", p_td.name);
OER_encode(p_td, p_buf);
break;}
default:
TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
}
va_end(pvar);
}
void CANFD__MESSAGE__TESTFRAME0__msg__type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t 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();
if(b_data[p_buf.get_len()-1]!='\0'){
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);
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)<0)
ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
p_buf.set_pos(tok.get_buf_pos());
break;}
case TTCN_EncDec::CT_OER: {
TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
if(!p_td.oer)
TTCN_EncDec_ErrorContext::error_internal
("No OER descriptor available for type '%s'.", p_td.name);
OER_struct p_oer;
OER_decode(p_td, p_buf, p_oer);
break;}
default:
TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
}
va_end(pvar);
}
int CANFD__MESSAGE__TESTFRAME0__msg__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* 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, CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_descr_.raw->forceomit);
decoded_field_length = field_test__sig__11__bit__bitstring__lsb__coded.RAW_decode(CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_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, CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_descr_.raw->forceomit);
decoded_field_length = field_test__sig__5__bit__bitstring__lsb__coded.RAW_decode(CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_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 CANFD__MESSAGE__TESTFRAME0__msg__type::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, CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_descr_.raw);
myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_descr_.raw);
encoded_length += field_test__sig__11__bit__bitstring__lsb__coded.RAW_encode(CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__11__bit__bitstring__lsb__coded_descr_, *myleaf.body.node.nodes[0]);
encoded_length += field_test__sig__5__bit__bitstring__lsb__coded.RAW_encode(CANFD__MESSAGE__TESTFRAME0__msg__type_test__sig__5__bit__bitstring__lsb__coded_descr_, *myleaf.body.node.nodes[1]);
return myleaf.length = encoded_length;
}
struct CANFD__MESSAGE__TESTFRAME0__msg__type_template::single_value_struct {
BITSTRING_template field_test__sig__11__bit__bitstring__lsb__coded;
BITSTRING_template field_test__sig__5__bit__bitstring__lsb__coded;
};
void CANFD__MESSAGE__TESTFRAME0__msg__type_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_test__sig__11__bit__bitstring__lsb__coded = ANY_VALUE;
single_value->field_test__sig__5__bit__bitstring__lsb__coded = ANY_VALUE;
}
}
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_template::copy_value(const CANFD__MESSAGE__TESTFRAME0__msg__type& other_value)
{
single_value = new single_value_struct;
if (other_value.test__sig__11__bit__bitstring__lsb__coded().is_bound()) {
single_value->field_test__sig__11__bit__bitstring__lsb__coded = other_value.test__sig__11__bit__bitstring__lsb__coded();
} else {
single_value->field_test__sig__11__bit__bitstring__lsb__coded.clean_up();
}
if (other_value.test__sig__5__bit__bitstring__lsb__coded().is_bound()) {
single_value->field_test__sig__5__bit__bitstring__lsb__coded = other_value.test__sig__5__bit__bitstring__lsb__coded();
} else {
single_value->field_test__sig__5__bit__bitstring__lsb__coded.clean_up();
}
set_selection(SPECIFIC_VALUE);
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_template::copy_template(const CANFD__MESSAGE__TESTFRAME0__msg__type_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.test__sig__11__bit__bitstring__lsb__coded().get_selection()) {
single_value->field_test__sig__11__bit__bitstring__lsb__coded = other_value.test__sig__11__bit__bitstring__lsb__coded();
} else {
single_value->field_test__sig__11__bit__bitstring__lsb__coded.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.test__sig__5__bit__bitstring__lsb__coded().get_selection()) {
single_value->field_test__sig__5__bit__bitstring__lsb__coded = other_value.test__sig__5__bit__bitstring__lsb__coded();
} else {
single_value->field_test__sig__5__bit__bitstring__lsb__coded.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CANFD__MESSAGE__TESTFRAME0__msg__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;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
break;
}
set_selection(other_value);
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template::CANFD__MESSAGE__TESTFRAME0__msg__type_template()
{
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template::CANFD__MESSAGE__TESTFRAME0__msg__type_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template::CANFD__MESSAGE__TESTFRAME0__msg__type_template(const CANFD__MESSAGE__TESTFRAME0__msg__type& other_value)
{
copy_value(other_value);
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template::CANFD__MESSAGE__TESTFRAME0__msg__type_template(const OPTIONAL<CANFD__MESSAGE__TESTFRAME0__msg__type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CANFD__MESSAGE__TESTFRAME0__msg__type&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type from an unbound optional field.");
}
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template::CANFD__MESSAGE__TESTFRAME0__msg__type_template(const CANFD__MESSAGE__TESTFRAME0__msg__type_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template::~CANFD__MESSAGE__TESTFRAME0__msg__type_template()
{
clean_up();
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::operator=(const CANFD__MESSAGE__TESTFRAME0__msg__type& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::operator=(const OPTIONAL<CANFD__MESSAGE__TESTFRAME0__msg__type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CANFD__MESSAGE__TESTFRAME0__msg__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 type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
}
return *this;
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::operator=(const CANFD__MESSAGE__TESTFRAME0__msg__type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__type_template::match(const CANFD__MESSAGE__TESTFRAME0__msg__type& 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.test__sig__11__bit__bitstring__lsb__coded().is_bound()) return FALSE;
if(!single_value->field_test__sig__11__bit__bitstring__lsb__coded.match(other_value.test__sig__11__bit__bitstring__lsb__coded(), legacy))return FALSE;
if(!other_value.test__sig__5__bit__bitstring__lsb__coded().is_bound()) return FALSE;
if(!single_value->field_test__sig__5__bit__bitstring__lsb__coded.match(other_value.test__sig__5__bit__bitstring__lsb__coded(), 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;
default:
TTCN_error("Matching an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
}
return FALSE;
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_test__sig__11__bit__bitstring__lsb__coded.is_bound()
||single_value->field_test__sig__5__bit__bitstring__lsb__coded.is_bound()
;
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_test__sig__11__bit__bitstring__lsb__coded.is_value()
&&single_value->field_test__sig__5__bit__bitstring__lsb__coded.is_value();
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
delete [] value_list.list_value;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}
CANFD__MESSAGE__TESTFRAME0__msg__type CANFD__MESSAGE__TESTFRAME0__msg__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 type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
CANFD__MESSAGE__TESTFRAME0__msg__type ret_val;
if (single_value->field_test__sig__11__bit__bitstring__lsb__coded.is_bound()) {
ret_val.test__sig__11__bit__bitstring__lsb__coded() = single_value->field_test__sig__11__bit__bitstring__lsb__coded.valueof();
}
if (single_value->field_test__sig__5__bit__bitstring__lsb__coded.is_bound()) {
ret_val.test__sig__5__bit__bitstring__lsb__coded() = single_value->field_test__sig__5__bit__bitstring__lsb__coded.valueof();
}
return ret_val;
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST)
TTCN_error("Setting an invalid list for a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CANFD__MESSAGE__TESTFRAME0__msg__type_template[list_length];
}
CANFD__MESSAGE__TESTFRAME0__msg__type_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST)
TTCN_error("Accessing a list element of a non-list template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
return value_list.list_value[list_index];
}
BITSTRING_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::test__sig__11__bit__bitstring__lsb__coded()
{
set_specific();
return single_value->field_test__sig__11__bit__bitstring__lsb__coded;
}
const BITSTRING_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::test__sig__11__bit__bitstring__lsb__coded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field test_sig_11_bit_bitstring_lsb_coded of a non-specific template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
return single_value->field_test__sig__11__bit__bitstring__lsb__coded;
}
BITSTRING_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::test__sig__5__bit__bitstring__lsb__coded()
{
set_specific();
return single_value->field_test__sig__5__bit__bitstring__lsb__coded;
}
const BITSTRING_template& CANFD__MESSAGE__TESTFRAME0__msg__type_template::test__sig__5__bit__bitstring__lsb__coded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field test_sig_5_bit_bitstring_lsb_coded of a non-specific template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
return single_value->field_test__sig__5__bit__bitstring__lsb__coded;
}
int CANFD__MESSAGE__TESTFRAME0__msg__type_template::size_of() const
{
if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type 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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type 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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type containing a value list with different sizes.");
}
return item_size;
}
case OMIT_VALUE:
TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type containing omit value.");
case ANY_VALUE:
case ANY_OR_OMIT:
TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type containing */? value.");
case COMPLEMENTED_LIST:
TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type containing complemented list.");
default:
TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
}
return 0;
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ test_sig_11_bit_bitstring_lsb_coded := ");
single_value->field_test__sig__11__bit__bitstring__lsb__coded.log();
TTCN_Logger::log_event_str(", test_sig_5_bit_bitstring_lsb_coded := ");
single_value->field_test__sig__5__bit__bitstring__lsb__coded.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
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;
default:
log_generic();
}
log_ifpresent();
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_template::log_match(const CANFD__MESSAGE__TESTFRAME0__msg__type& 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_test__sig__11__bit__bitstring__lsb__coded.match(match_value.test__sig__11__bit__bitstring__lsb__coded(), legacy)){
TTCN_Logger::log_logmatch_info(".test_sig_11_bit_bitstring_lsb_coded");
single_value->field_test__sig__11__bit__bitstring__lsb__coded.log_match(match_value.test__sig__11__bit__bitstring__lsb__coded(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_test__sig__5__bit__bitstring__lsb__coded.match(match_value.test__sig__5__bit__bitstring__lsb__coded(), legacy)){
TTCN_Logger::log_logmatch_info(".test_sig_5_bit_bitstring_lsb_coded");
single_value->field_test__sig__5__bit__bitstring__lsb__coded.log_match(match_value.test__sig__5__bit__bitstring__lsb__coded(), 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("{ test_sig_11_bit_bitstring_lsb_coded := ");
single_value->field_test__sig__11__bit__bitstring__lsb__coded.log_match(match_value.test__sig__11__bit__bitstring__lsb__coded(), legacy);
TTCN_Logger::log_event_str(", test_sig_5_bit_bitstring_lsb_coded := ");
single_value->field_test__sig__5__bit__bitstring__lsb__coded.log_match(match_value.test__sig__5__bit__bitstring__lsb__coded(), 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 CANFD__MESSAGE__TESTFRAME0__msg__type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_test__sig__11__bit__bitstring__lsb__coded.encode_text(text_buf);
single_value->field_test__sig__5__bit__bitstring__lsb__coded.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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
}
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_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_test__sig__11__bit__bitstring__lsb__coded.decode_text(text_buf);
single_value->field_test__sig__5__bit__bitstring__lsb__coded.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 CANFD__MESSAGE__TESTFRAME0__msg__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].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type.");
}
}
void CANFD__MESSAGE__TESTFRAME0__msg__type_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: {
CANFD__MESSAGE__TESTFRAME0__msg__type_template new_temp;
new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : 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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type 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) test__sig__11__bit__bitstring__lsb__coded().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) test__sig__5__bit__bitstring__lsb__coded().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(), "test_sig_11_bit_bitstring_lsb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__11__bit__bitstring__lsb__coded().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "test_sig_5_bit_bitstring_lsb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__5__bit__bitstring__lsb__coded().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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record template", "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type");
}
is_ifpresent = param.get_ifpresent();
}
void CANFD__MESSAGE__TESTFRAME0__msg__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_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_test__sig__11__bit__bitstring__lsb__coded.check_restriction(t_res, t_name ? t_name : "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type");
single_value->field_test__sig__5__bit__bitstring__lsb__coded.check_restriction(t_res, t_name ? t_name : "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type");
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 : "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME0_msg_type");
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}
boolean CANFD__MESSAGE__TESTFRAME0__msg__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 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;
}
CANFD__MESSAGE__TESTFRAME1__msg__type::CANFD__MESSAGE__TESTFRAME1__msg__type()
{
}
CANFD__MESSAGE__TESTFRAME1__msg__type::CANFD__MESSAGE__TESTFRAME1__msg__type(const BITSTRING& par_test__sig__11__bit__bitstring__msb__coded,
const BITSTRING& par_test__sig__5__bit__bitstring__msb__coded)
: field_test__sig__11__bit__bitstring__msb__coded(par_test__sig__11__bit__bitstring__msb__coded),
field_test__sig__5__bit__bitstring__msb__coded(par_test__sig__5__bit__bitstring__msb__coded)
{
}
CANFD__MESSAGE__TESTFRAME1__msg__type::CANFD__MESSAGE__TESTFRAME1__msg__type(const CANFD__MESSAGE__TESTFRAME1__msg__type& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
if (other_value.test__sig__11__bit__bitstring__msb__coded().is_bound()) field_test__sig__11__bit__bitstring__msb__coded = other_value.test__sig__11__bit__bitstring__msb__coded();
else field_test__sig__11__bit__bitstring__msb__coded.clean_up();
if (other_value.test__sig__5__bit__bitstring__msb__coded().is_bound()) field_test__sig__5__bit__bitstring__msb__coded = other_value.test__sig__5__bit__bitstring__msb__coded();
else field_test__sig__5__bit__bitstring__msb__coded.clean_up();
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::clean_up()
{
field_test__sig__11__bit__bitstring__msb__coded.clean_up();
field_test__sig__5__bit__bitstring__msb__coded.clean_up();
}
const TTCN_Typedescriptor_t* CANFD__MESSAGE__TESTFRAME1__msg__type::get_descriptor() const { return &CANFD__MESSAGE__TESTFRAME1__msg__type_descr_; }
CANFD__MESSAGE__TESTFRAME1__msg__type& CANFD__MESSAGE__TESTFRAME1__msg__type::operator=(const CANFD__MESSAGE__TESTFRAME1__msg__type& other_value)
{
if (this != &other_value) {
if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
if (other_value.test__sig__11__bit__bitstring__msb__coded().is_bound()) field_test__sig__11__bit__bitstring__msb__coded = other_value.test__sig__11__bit__bitstring__msb__coded();
else field_test__sig__11__bit__bitstring__msb__coded.clean_up();
if (other_value.test__sig__5__bit__bitstring__msb__coded().is_bound()) field_test__sig__5__bit__bitstring__msb__coded = other_value.test__sig__5__bit__bitstring__msb__coded();
else field_test__sig__5__bit__bitstring__msb__coded.clean_up();
}
return *this;
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__type::operator==(const CANFD__MESSAGE__TESTFRAME1__msg__type& other_value) const
{
return field_test__sig__11__bit__bitstring__msb__coded==other_value.field_test__sig__11__bit__bitstring__msb__coded
&& field_test__sig__5__bit__bitstring__msb__coded==other_value.field_test__sig__5__bit__bitstring__msb__coded;
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__type::is_bound() const
{
return (field_test__sig__11__bit__bitstring__msb__coded.is_bound())
|| (field_test__sig__5__bit__bitstring__msb__coded.is_bound());
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__type::is_value() const
{
return field_test__sig__11__bit__bitstring__msb__coded.is_value()
&& field_test__sig__5__bit__bitstring__msb__coded.is_value();
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ test_sig_11_bit_bitstring_msb_coded := ");
field_test__sig__11__bit__bitstring__msb__coded.log();
TTCN_Logger::log_event_str(", test_sig_5_bit_bitstring_msb_coded := ");
field_test__sig__5__bit__bitstring__msb__coded.log();
TTCN_Logger::log_event_str(" }");
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type 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) test__sig__11__bit__bitstring__msb__coded().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) test__sig__5__bit__bitstring__msb__coded().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(), "test_sig_11_bit_bitstring_msb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__11__bit__bitstring__msb__coded().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "test_sig_5_bit_bitstring_msb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__5__bit__bitstring__msb__coded().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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record value", "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type");
}
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::set_implicit_omit()
{
if (test__sig__11__bit__bitstring__msb__coded().is_bound()) test__sig__11__bit__bitstring__msb__coded().set_implicit_omit();
if (test__sig__5__bit__bitstring__msb__coded().is_bound()) test__sig__5__bit__bitstring__msb__coded().set_implicit_omit();
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::encode_text(Text_Buf& text_buf) const
{
field_test__sig__11__bit__bitstring__msb__coded.encode_text(text_buf);
field_test__sig__5__bit__bitstring__msb__coded.encode_text(text_buf);
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::decode_text(Text_Buf& text_buf)
{
field_test__sig__11__bit__bitstring__msb__coded.decode_text(text_buf);
field_test__sig__5__bit__bitstring__msb__coded.decode_text(text_buf);
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t 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);
p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
break;}
case TTCN_EncDec::CT_OER: {
TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
if(!p_td.oer)
TTCN_EncDec_ErrorContext::error_internal
("No OER descriptor available for type '%s'.", p_td.name);
OER_encode(p_td, p_buf);
break;}
default:
TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
}
va_end(pvar);
}
void CANFD__MESSAGE__TESTFRAME1__msg__type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t 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();
if(b_data[p_buf.get_len()-1]!='\0'){
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);
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)<0)
ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
p_buf.set_pos(tok.get_buf_pos());
break;}
case TTCN_EncDec::CT_OER: {
TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
if(!p_td.oer)
TTCN_EncDec_ErrorContext::error_internal
("No OER descriptor available for type '%s'.", p_td.name);
OER_struct p_oer;
OER_decode(p_td, p_buf, p_oer);
break;}
default:
TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
}
va_end(pvar);
}
int CANFD__MESSAGE__TESTFRAME1__msg__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* 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, CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_descr_.raw->forceomit);
decoded_field_length = field_test__sig__11__bit__bitstring__msb__coded.RAW_decode(CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_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, CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_descr_.raw->forceomit);
decoded_field_length = field_test__sig__5__bit__bitstring__msb__coded.RAW_decode(CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_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 CANFD__MESSAGE__TESTFRAME1__msg__type::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, CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_descr_.raw);
myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_descr_.raw);
encoded_length += field_test__sig__11__bit__bitstring__msb__coded.RAW_encode(CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__11__bit__bitstring__msb__coded_descr_, *myleaf.body.node.nodes[0]);
encoded_length += field_test__sig__5__bit__bitstring__msb__coded.RAW_encode(CANFD__MESSAGE__TESTFRAME1__msg__type_test__sig__5__bit__bitstring__msb__coded_descr_, *myleaf.body.node.nodes[1]);
return myleaf.length = encoded_length;
}
struct CANFD__MESSAGE__TESTFRAME1__msg__type_template::single_value_struct {
BITSTRING_template field_test__sig__11__bit__bitstring__msb__coded;
BITSTRING_template field_test__sig__5__bit__bitstring__msb__coded;
};
void CANFD__MESSAGE__TESTFRAME1__msg__type_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_test__sig__11__bit__bitstring__msb__coded = ANY_VALUE;
single_value->field_test__sig__5__bit__bitstring__msb__coded = ANY_VALUE;
}
}
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_template::copy_value(const CANFD__MESSAGE__TESTFRAME1__msg__type& other_value)
{
single_value = new single_value_struct;
if (other_value.test__sig__11__bit__bitstring__msb__coded().is_bound()) {
single_value->field_test__sig__11__bit__bitstring__msb__coded = other_value.test__sig__11__bit__bitstring__msb__coded();
} else {
single_value->field_test__sig__11__bit__bitstring__msb__coded.clean_up();
}
if (other_value.test__sig__5__bit__bitstring__msb__coded().is_bound()) {
single_value->field_test__sig__5__bit__bitstring__msb__coded = other_value.test__sig__5__bit__bitstring__msb__coded();
} else {
single_value->field_test__sig__5__bit__bitstring__msb__coded.clean_up();
}
set_selection(SPECIFIC_VALUE);
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_template::copy_template(const CANFD__MESSAGE__TESTFRAME1__msg__type_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.test__sig__11__bit__bitstring__msb__coded().get_selection()) {
single_value->field_test__sig__11__bit__bitstring__msb__coded = other_value.test__sig__11__bit__bitstring__msb__coded();
} else {
single_value->field_test__sig__11__bit__bitstring__msb__coded.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.test__sig__5__bit__bitstring__msb__coded().get_selection()) {
single_value->field_test__sig__5__bit__bitstring__msb__coded = other_value.test__sig__5__bit__bitstring__msb__coded();
} else {
single_value->field_test__sig__5__bit__bitstring__msb__coded.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CANFD__MESSAGE__TESTFRAME1__msg__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;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
break;
}
set_selection(other_value);
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template::CANFD__MESSAGE__TESTFRAME1__msg__type_template()
{
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template::CANFD__MESSAGE__TESTFRAME1__msg__type_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template::CANFD__MESSAGE__TESTFRAME1__msg__type_template(const CANFD__MESSAGE__TESTFRAME1__msg__type& other_value)
{
copy_value(other_value);
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template::CANFD__MESSAGE__TESTFRAME1__msg__type_template(const OPTIONAL<CANFD__MESSAGE__TESTFRAME1__msg__type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CANFD__MESSAGE__TESTFRAME1__msg__type&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type from an unbound optional field.");
}
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template::CANFD__MESSAGE__TESTFRAME1__msg__type_template(const CANFD__MESSAGE__TESTFRAME1__msg__type_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template::~CANFD__MESSAGE__TESTFRAME1__msg__type_template()
{
clean_up();
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::operator=(const CANFD__MESSAGE__TESTFRAME1__msg__type& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::operator=(const OPTIONAL<CANFD__MESSAGE__TESTFRAME1__msg__type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CANFD__MESSAGE__TESTFRAME1__msg__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 type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
}
return *this;
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::operator=(const CANFD__MESSAGE__TESTFRAME1__msg__type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__type_template::match(const CANFD__MESSAGE__TESTFRAME1__msg__type& 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.test__sig__11__bit__bitstring__msb__coded().is_bound()) return FALSE;
if(!single_value->field_test__sig__11__bit__bitstring__msb__coded.match(other_value.test__sig__11__bit__bitstring__msb__coded(), legacy))return FALSE;
if(!other_value.test__sig__5__bit__bitstring__msb__coded().is_bound()) return FALSE;
if(!single_value->field_test__sig__5__bit__bitstring__msb__coded.match(other_value.test__sig__5__bit__bitstring__msb__coded(), 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;
default:
TTCN_error("Matching an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
}
return FALSE;
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_test__sig__11__bit__bitstring__msb__coded.is_bound()
||single_value->field_test__sig__5__bit__bitstring__msb__coded.is_bound()
;
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_test__sig__11__bit__bitstring__msb__coded.is_value()
&&single_value->field_test__sig__5__bit__bitstring__msb__coded.is_value();
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
delete [] value_list.list_value;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}
CANFD__MESSAGE__TESTFRAME1__msg__type CANFD__MESSAGE__TESTFRAME1__msg__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 type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
CANFD__MESSAGE__TESTFRAME1__msg__type ret_val;
if (single_value->field_test__sig__11__bit__bitstring__msb__coded.is_bound()) {
ret_val.test__sig__11__bit__bitstring__msb__coded() = single_value->field_test__sig__11__bit__bitstring__msb__coded.valueof();
}
if (single_value->field_test__sig__5__bit__bitstring__msb__coded.is_bound()) {
ret_val.test__sig__5__bit__bitstring__msb__coded() = single_value->field_test__sig__5__bit__bitstring__msb__coded.valueof();
}
return ret_val;
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST)
TTCN_error("Setting an invalid list for a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CANFD__MESSAGE__TESTFRAME1__msg__type_template[list_length];
}
CANFD__MESSAGE__TESTFRAME1__msg__type_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST)
TTCN_error("Accessing a list element of a non-list template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
return value_list.list_value[list_index];
}
BITSTRING_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::test__sig__11__bit__bitstring__msb__coded()
{
set_specific();
return single_value->field_test__sig__11__bit__bitstring__msb__coded;
}
const BITSTRING_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::test__sig__11__bit__bitstring__msb__coded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field test_sig_11_bit_bitstring_msb_coded of a non-specific template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
return single_value->field_test__sig__11__bit__bitstring__msb__coded;
}
BITSTRING_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::test__sig__5__bit__bitstring__msb__coded()
{
set_specific();
return single_value->field_test__sig__5__bit__bitstring__msb__coded;
}
const BITSTRING_template& CANFD__MESSAGE__TESTFRAME1__msg__type_template::test__sig__5__bit__bitstring__msb__coded() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field test_sig_5_bit_bitstring_msb_coded of a non-specific template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
return single_value->field_test__sig__5__bit__bitstring__msb__coded;
}
int CANFD__MESSAGE__TESTFRAME1__msg__type_template::size_of() const
{
if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type 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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type 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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type containing a value list with different sizes.");
}
return item_size;
}
case OMIT_VALUE:
TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type containing omit value.");
case ANY_VALUE:
case ANY_OR_OMIT:
TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type containing */? value.");
case COMPLEMENTED_LIST:
TTCN_error("Performing sizeof() operation on a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type containing complemented list.");
default:
TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
}
return 0;
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ test_sig_11_bit_bitstring_msb_coded := ");
single_value->field_test__sig__11__bit__bitstring__msb__coded.log();
TTCN_Logger::log_event_str(", test_sig_5_bit_bitstring_msb_coded := ");
single_value->field_test__sig__5__bit__bitstring__msb__coded.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
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;
default:
log_generic();
}
log_ifpresent();
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_template::log_match(const CANFD__MESSAGE__TESTFRAME1__msg__type& 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_test__sig__11__bit__bitstring__msb__coded.match(match_value.test__sig__11__bit__bitstring__msb__coded(), legacy)){
TTCN_Logger::log_logmatch_info(".test_sig_11_bit_bitstring_msb_coded");
single_value->field_test__sig__11__bit__bitstring__msb__coded.log_match(match_value.test__sig__11__bit__bitstring__msb__coded(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_test__sig__5__bit__bitstring__msb__coded.match(match_value.test__sig__5__bit__bitstring__msb__coded(), legacy)){
TTCN_Logger::log_logmatch_info(".test_sig_5_bit_bitstring_msb_coded");
single_value->field_test__sig__5__bit__bitstring__msb__coded.log_match(match_value.test__sig__5__bit__bitstring__msb__coded(), 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("{ test_sig_11_bit_bitstring_msb_coded := ");
single_value->field_test__sig__11__bit__bitstring__msb__coded.log_match(match_value.test__sig__11__bit__bitstring__msb__coded(), legacy);
TTCN_Logger::log_event_str(", test_sig_5_bit_bitstring_msb_coded := ");
single_value->field_test__sig__5__bit__bitstring__msb__coded.log_match(match_value.test__sig__5__bit__bitstring__msb__coded(), 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 CANFD__MESSAGE__TESTFRAME1__msg__type_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_test__sig__11__bit__bitstring__msb__coded.encode_text(text_buf);
single_value->field_test__sig__5__bit__bitstring__msb__coded.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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
}
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_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_test__sig__11__bit__bitstring__msb__coded.decode_text(text_buf);
single_value->field_test__sig__5__bit__bitstring__msb__coded.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 CANFD__MESSAGE__TESTFRAME1__msg__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].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type.");
}
}
void CANFD__MESSAGE__TESTFRAME1__msg__type_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: {
CANFD__MESSAGE__TESTFRAME1__msg__type_template new_temp;
new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : 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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type 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) test__sig__11__bit__bitstring__msb__coded().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) test__sig__5__bit__bitstring__msb__coded().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(), "test_sig_11_bit_bitstring_msb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__11__bit__bitstring__msb__coded().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "test_sig_5_bit_bitstring_msb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__5__bit__bitstring__msb__coded().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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record template", "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type");
}
is_ifpresent = param.get_ifpresent();
}
void CANFD__MESSAGE__TESTFRAME1__msg__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_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_test__sig__11__bit__bitstring__msb__coded.check_restriction(t_res, t_name ? t_name : "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type");
single_value->field_test__sig__5__bit__bitstring__msb__coded.check_restriction(t_res, t_name ? t_name : "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type");
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 : "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME1_msg_type");
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__type_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}
boolean CANFD__MESSAGE__TESTFRAME1__msg__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 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;
}
CANFD__MESSAGE__TESTFRAME2__msg__type::CANFD__MESSAGE__TESTFRAME2__msg__type()
{
}
CANFD__MESSAGE__TESTFRAME2__msg__type::CANFD__MESSAGE__TESTFRAME2__msg__type(const INTEGER& par_test__sig__11__bit__integer__msb__coded,
const INTEGER& par_test__sig__5__bit__integer__msb__coded)
: field_test__sig__11__bit__integer__msb__coded(par_test__sig__11__bit__integer__msb__coded),
field_test__sig__5__bit__integer__msb__coded(par_test__sig__5__bit__integer__msb__coded)
{
}
CANFD__MESSAGE__TESTFRAME2__msg__type::CANFD__MESSAGE__TESTFRAME2__msg__type(const CANFD__MESSAGE__TESTFRAME2__msg__type& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type.");
if (other_value.test__sig__11__bit__integer__msb__coded().is_bound()) field_test__sig__11__bit__integer__msb__coded = other_value.test__sig__11__bit__integer__msb__coded();
else field_test__sig__11__bit__integer__msb__coded.clean_up();
if (other_value.test__sig__5__bit__integer__msb__coded().is_bound()) field_test__sig__5__bit__integer__msb__coded = other_value.test__sig__5__bit__integer__msb__coded();
else field_test__sig__5__bit__integer__msb__coded.clean_up();
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::clean_up()
{
field_test__sig__11__bit__integer__msb__coded.clean_up();
field_test__sig__5__bit__integer__msb__coded.clean_up();
}
const TTCN_Typedescriptor_t* CANFD__MESSAGE__TESTFRAME2__msg__type::get_descriptor() const { return &CANFD__MESSAGE__TESTFRAME2__msg__type_descr_; }
CANFD__MESSAGE__TESTFRAME2__msg__type& CANFD__MESSAGE__TESTFRAME2__msg__type::operator=(const CANFD__MESSAGE__TESTFRAME2__msg__type& other_value)
{
if (this != &other_value) {
if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type.");
if (other_value.test__sig__11__bit__integer__msb__coded().is_bound()) field_test__sig__11__bit__integer__msb__coded = other_value.test__sig__11__bit__integer__msb__coded();
else field_test__sig__11__bit__integer__msb__coded.clean_up();
if (other_value.test__sig__5__bit__integer__msb__coded().is_bound()) field_test__sig__5__bit__integer__msb__coded = other_value.test__sig__5__bit__integer__msb__coded();
else field_test__sig__5__bit__integer__msb__coded.clean_up();
}
return *this;
}
boolean CANFD__MESSAGE__TESTFRAME2__msg__type::operator==(const CANFD__MESSAGE__TESTFRAME2__msg__type& other_value) const
{
return field_test__sig__11__bit__integer__msb__coded==other_value.field_test__sig__11__bit__integer__msb__coded
&& field_test__sig__5__bit__integer__msb__coded==other_value.field_test__sig__5__bit__integer__msb__coded;
}
boolean CANFD__MESSAGE__TESTFRAME2__msg__type::is_bound() const
{
return (field_test__sig__11__bit__integer__msb__coded.is_bound())
|| (field_test__sig__5__bit__integer__msb__coded.is_bound());
}
boolean CANFD__MESSAGE__TESTFRAME2__msg__type::is_value() const
{
return field_test__sig__11__bit__integer__msb__coded.is_value()
&& field_test__sig__5__bit__integer__msb__coded.is_value();
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ test_sig_11_bit_integer_msb_coded := ");
field_test__sig__11__bit__integer__msb__coded.log();
TTCN_Logger::log_event_str(", test_sig_5_bit_integer_msb_coded := ");
field_test__sig__5__bit__integer__msb__coded.log();
TTCN_Logger::log_event_str(" }");
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type 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) test__sig__11__bit__integer__msb__coded().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) test__sig__5__bit__integer__msb__coded().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(), "test_sig_11_bit_integer_msb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__11__bit__integer__msb__coded().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "test_sig_5_bit_integer_msb_coded")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
test__sig__5__bit__integer__msb__coded().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 @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record value", "@CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type");
}
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::set_implicit_omit()
{
if (test__sig__11__bit__integer__msb__coded().is_bound()) test__sig__11__bit__integer__msb__coded().set_implicit_omit();
if (test__sig__5__bit__integer__msb__coded().is_bound()) test__sig__5__bit__integer__msb__coded().set_implicit_omit();
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::encode_text(Text_Buf& text_buf) const
{
field_test__sig__11__bit__integer__msb__coded.encode_text(text_buf);
field_test__sig__5__bit__integer__msb__coded.encode_text(text_buf);
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::decode_text(Text_Buf& text_buf)
{
field_test__sig__11__bit__integer__msb__coded.decode_text(text_buf);
field_test__sig__5__bit__integer__msb__coded.decode_text(text_buf);
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t 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);
p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
break;}
case TTCN_EncDec::CT_OER: {
TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
if(!p_td.oer)
TTCN_EncDec_ErrorContext::error_internal
("No OER descriptor available for type '%s'.", p_td.name);
OER_encode(p_td, p_buf);
break;}
default:
TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
}
va_end(pvar);
}
void CANFD__MESSAGE__TESTFRAME2__msg__type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t 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();
if(b_data[p_buf.get_len()-1]!='\0'){
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);
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)<0)
ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
p_buf.set_pos(tok.get_buf_pos());
break;}
case TTCN_EncDec::CT_OER: {
TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
if(!p_td.oer)
TTCN_EncDec_ErrorContext::error_internal
("No OER descriptor available for type '%s'.", p_td.name);
OER_struct p_oer;
OER_decode(p_td, p_buf, p_oer);
break;}
default:
TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
}
va_end(pvar);
}
int CANFD__MESSAGE__TESTFRAME2__msg__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* 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, CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_descr_.raw->forceomit);
decoded_field_length = field_test__sig__11__bit__integer__msb__coded.RAW_decode(CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_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, CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_descr_.raw->forceomit);
decoded_field_length = field_test__sig__5__bit__integer__msb__coded.RAW_decode(CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_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 CANFD__MESSAGE__TESTFRAME2__msg__type::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, CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_descr_.raw);
myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_descr_.raw);
encoded_length += field_test__sig__11__bit__integer__msb__coded.RAW_encode(CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__11__bit__integer__msb__coded_descr_, *myleaf.body.node.nodes[0]);
encoded_length += field_test__sig__5__bit__integer__msb__coded.RAW_encode(CANFD__MESSAGE__TESTFRAME2__msg__type_test__sig__5__bit__integer__msb__coded_descr_, *myleaf.body.node.nodes[1]);
return myleaf.length = encoded_length;
}
struct CANFD__MESSAGE__TESTFRAME2__msg__type_template::single_value_struct {
INTEGER_template field_test__sig__11__bit__integer__msb__coded;
INTEGER_template field_test__sig__5__bit__integer__msb__coded;
};
void CANFD__MESSAGE__TESTFRAME2__msg__type_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_test__sig__11__bit__integer__msb__coded = ANY_VALUE;
single_value->field_test__sig__5__bit__integer__msb__coded = ANY_VALUE;
}
}
}
void CANFD__MESSAGE__TESTFRAME2__msg__type_template::copy_value(const CANFD__MESSAGE__TESTFRAME2__msg__type& other_value)
{
single_value = new single_value_struct;
if (other_value.test__sig__11__bit__integer__msb__coded().is_bound()) {
single_value->field_test__sig__11__bit__integer__msb__coded = other_value.test__sig__11__bit__integer__msb__coded();
} else {
single_value->field_test__sig__11__bit__integer__msb__coded.clean_up();
}
if (other_value.test__sig__5__bit__integer__msb__coded().is_bound()) {
single_value->field_test__sig__5__bit__integer__msb__coded = other_value.test__sig__5__bit__integer__msb__coded();
} else {
single_value->field_test__sig__5__bit__integer__msb__coded.clean_up();
}
set_selection(SPECIFIC_VALUE);
}
void CANFD__MESSAGE__TESTFRAME2__msg__type_template::copy_template(const CANFD__MESSAGE__TESTFRAME2__msg__type_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.test__sig__11__bit__integer__msb__coded().get_selection()) {
single_value->field_test__sig__11__bit__integer__msb__coded = other_value.test__sig__11__bit__integer__msb__coded();
} else {
single_value->field_test__sig__11__bit__integer__msb__coded.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.test__sig__5__bit__integer__msb__coded().get_selection()) {
single_value->field_test__sig__5__bit__integer__msb__coded = other_value.test__sig__5__bit__integer__msb__coded();
} else {
single_value->field_test__sig__5__bit__integer__msb__coded.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new CANFD__MESSAGE__TESTFRAME2__msg__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;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type.");
break;
}
set_selection(other_value);
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template::CANFD__MESSAGE__TESTFRAME2__msg__type_template()
{
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template::CANFD__MESSAGE__TESTFRAME2__msg__type_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template::CANFD__MESSAGE__TESTFRAME2__msg__type_template(const CANFD__MESSAGE__TESTFRAME2__msg__type& other_value)
{
copy_value(other_value);
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template::CANFD__MESSAGE__TESTFRAME2__msg__type_template(const OPTIONAL<CANFD__MESSAGE__TESTFRAME2__msg__type>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CANFD__MESSAGE__TESTFRAME2__msg__type&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type from an unbound optional field.");
}
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template::CANFD__MESSAGE__TESTFRAME2__msg__type_template(const CANFD__MESSAGE__TESTFRAME2__msg__type_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template::~CANFD__MESSAGE__TESTFRAME2__msg__type_template()
{
clean_up();
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template& CANFD__MESSAGE__TESTFRAME2__msg__type_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template& CANFD__MESSAGE__TESTFRAME2__msg__type_template::operator=(const CANFD__MESSAGE__TESTFRAME2__msg__type& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template& CANFD__MESSAGE__TESTFRAME2__msg__type_template::operator=(const OPTIONAL<CANFD__MESSAGE__TESTFRAME2__msg__type>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CANFD__MESSAGE__TESTFRAME2__msg__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 type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type.");
}
return *this;
}
CANFD__MESSAGE__TESTFRAME2__msg__type_template& CANFD__MESSAGE__TESTFRAME2__msg__type_template::operator=(const CANFD__MESSAGE__TESTFRAME2__msg__type_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean CANFD__MESSAGE__TESTFRAME2__msg__type_template::match(const CANFD__MESSAGE__TESTFRAME2__msg__type& 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.test__sig__11__bit__integer__msb__coded().is_bound()) return FALSE;
if(!single_value->field_test__sig__11__bit__integer__msb__coded.match(other_value.test__sig__11__bit__integer__msb__coded(), legacy))return FALSE;
if(!other_value.test__sig__5__bit__integer__msb__coded().is_bound()) return FALSE;
if(!single_value->field_test__sig__5__bit__integer__msb__coded.match(other_value.test__sig__5__bit__integer__msb__coded(), 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;
default:
TTCN_error("Matching an uninitialized/unsupported template of type @CANFD_matrix_messages.CANFD_MESSAGE_TESTFRAME2_msg_type.");
}
return FALSE;
}
boolean CANFD__MESSAGE__TESTFRAME2__msg__type_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_test__sig__11__bit__integer__msb__coded.is_bound()
||single_value->field_test__sig__5__bit__integer__msb__coded.is_bound()
;
}
boolean CANFD__MESSAGE__TESTFRAME2__msg__type_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_test__sig__11__bit__integer__msb__coded.is_value()
&&single_value->field_test__sig__5__bit__integer__msb__coded.is_value();
}