blob: 5313084a553582e7dd136a5e258d935915406373 [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 "SocketCAN_Types.hh"
namespace SocketCAN__Types {
/* Prototypes of static functions */
static void pre_init_module();
static void post_init_module();
/* Literal string constants */
static const unsigned char module_checksum[] = { 0x17, 0xa2, 0xfc, 0xbb, 0xb1, 0x49, 0x47, 0xfa, 0x84, 0xf5, 0x7a, 0x2b, 0x20, 0x15, 0x8e, 0x7d };
/* Global variable definitions */
const XERdescriptor_t SocketCAN__socketid_xer_ = { {"SocketCAN_socketid>\n", "SocketCAN_socketid>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__socketid_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__socketid_descr_ = { "@SocketCAN_Types.SocketCAN_socketid", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__socketid_xer_, &INTEGER_json_, &SocketCAN__socketid_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__if__name_xer_ = { {"SocketCAN_if_name>\n", "SocketCAN_if_name>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SocketCAN__if__name_descr_ = { "@SocketCAN_Types.SocketCAN_if_name", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &SocketCAN__if__name_xer_, &CHARSTRING_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__if__index_xer_ = { {"SocketCAN_if_index>\n", "SocketCAN_if_index>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__if__index_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__if__index_descr_ = { "@SocketCAN_Types.SocketCAN_if_index", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__if__index_xer_, &INTEGER_json_, &SocketCAN__if__index_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__Isotp__PDU_xer_ = { {"SocketCAN_Isotp_PDU>\n", "SocketCAN_Isotp_PDU>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SocketCAN__Isotp__PDU_oer_ext_arr_[0] = {};
const int SocketCAN__Isotp__PDU_oer_p_[0] = {};
const TTCN_OERdescriptor_t SocketCAN__Isotp__PDU_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SocketCAN__Isotp__PDU_oer_ext_arr_, 0, SocketCAN__Isotp__PDU_oer_p_};
const TTCN_Typedescriptor_t SocketCAN__Isotp__PDU_descr_ = { "@SocketCAN_Types.SocketCAN_Isotp_PDU", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SocketCAN__Isotp__PDU_xer_, &OCTETSTRING_json_, &SocketCAN__Isotp__PDU_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__timeval_tv__sec_xer_ = { {"tv_sec>\n", "tv_sec>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__timeval_tv__sec_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__timeval_tv__sec_descr_ = { "@SocketCAN_Types.SocketCAN_timeval.tv_sec", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__timeval_tv__sec_xer_, &INTEGER_json_, &SocketCAN__timeval_tv__sec_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__timeval_tv__usec_xer_ = { {"tv_usec>\n", "tv_usec>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__timeval_tv__usec_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__timeval_tv__usec_descr_ = { "@SocketCAN_Types.SocketCAN_timeval.tv_usec", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__timeval_tv__usec_xer_, &INTEGER_json_, &SocketCAN__timeval_tv__usec_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__timeval
const TTCN_Typedescriptor_t SocketCAN__timeval_descr_ = { "@SocketCAN_Types.SocketCAN_timeval", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__CAN__or__CAN__FD__frame
const TTCN_Typedescriptor_t SocketCAN__CAN__or__CAN__FD__frame_descr_ = { "@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__ifr
const TTCN_Typedescriptor_t SocketCAN__ifr_descr_ = { "@SocketCAN_Types.SocketCAN_ifr", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__ifr_if__name_xer_ = { {"if_name>\n", "if_name>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SocketCAN__ifr_if__name_descr_ = { "@SocketCAN_Types.SocketCAN_ifr.if_name", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &SocketCAN__ifr_if__name_xer_, &CHARSTRING_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__ifr_if__index_xer_ = { {"if_index>\n", "if_index>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__ifr_if__index_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__ifr_if__index_descr_ = { "@SocketCAN_Types.SocketCAN_ifr.if_index", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__ifr_if__index_xer_, &INTEGER_json_, &SocketCAN__ifr_if__index_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__if__any
const TTCN_Typedescriptor_t SocketCAN__if__any_descr_ = { "@SocketCAN_Types.SocketCAN_if_any", NULL, NULL, NULL, NULL, &ENUMERATED_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__send__data__ifu
const TTCN_Typedescriptor_t SocketCAN__send__data__ifu_descr_ = { "@SocketCAN_Types.SocketCAN_send_data_ifu", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__send__data__ifu_if__name_xer_ = { {"if_name>\n", "if_name>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SocketCAN__send__data__ifu_if__name_descr_ = { "@SocketCAN_Types.SocketCAN_send_data_ifu.if_name", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &SocketCAN__send__data__ifu_if__name_xer_, &CHARSTRING_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__send__data__ifu_if__index_xer_ = { {"if_index>\n", "if_index>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__send__data__ifu_if__index_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__send__data__ifu_if__index_descr_ = { "@SocketCAN_Types.SocketCAN_send_data_ifu.if_index", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__send__data__ifu_if__index_xer_, &INTEGER_json_, &SocketCAN__send__data__ifu_if__index_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__ioctl__ifu
const TTCN_Typedescriptor_t SocketCAN__ioctl__ifu_descr_ = { "@SocketCAN_Types.SocketCAN_ioctl_ifu", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__ioctl__ifu_if__name_xer_ = { {"if_name>\n", "if_name>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SocketCAN__ioctl__ifu_if__name_descr_ = { "@SocketCAN_Types.SocketCAN_ioctl_ifu.if_name", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &SocketCAN__ioctl__ifu_if__name_xer_, &CHARSTRING_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__ioctl__ifu_if__index_xer_ = { {"if_index>\n", "if_index>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__ioctl__ifu_if__index_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__ioctl__ifu_if__index_descr_ = { "@SocketCAN_Types.SocketCAN_ioctl_ifu.if_index", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__ioctl__ifu_if__index_xer_, &INTEGER_json_, &SocketCAN__ioctl__ifu_if__index_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__Result__code
const TTCN_Typedescriptor_t SocketCAN__Result__code_descr_ = { "@SocketCAN_Types.SocketCAN_Result_code", NULL, NULL, NULL, NULL, &ENUMERATED_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__Result
const TTCN_Typedescriptor_t SocketCAN__Result_descr_ = { "@SocketCAN_Types.SocketCAN_Result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__Result_err_xer_ = { {"err>\n", "err>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__Result_err_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__Result_err_descr_ = { "@SocketCAN_Types.SocketCAN_Result.err", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__Result_err_xer_, &INTEGER_json_, &SocketCAN__Result_err_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__Result_err__text_xer_ = { {"err_text>\n", "err_text>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SocketCAN__Result_err__text_descr_ = { "@SocketCAN_Types.SocketCAN_Result.err_text", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &SocketCAN__Result_err__text_xer_, &CHARSTRING_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__socket
const TTCN_Typedescriptor_t SocketCAN__socket_descr_ = { "@SocketCAN_Types.SocketCAN_socket", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__socket__result_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__socket__result_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__socket__result_id_descr_ = { "@SocketCAN_Types.SocketCAN_socket_result.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__socket__result_id_xer_, &INTEGER_json_, &SocketCAN__socket__result_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__socket__result
const TTCN_Typedescriptor_t SocketCAN__socket__result_descr_ = { "@SocketCAN_Types.SocketCAN_socket_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__ioctl_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__ioctl_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__ioctl_id_descr_ = { "@SocketCAN_Types.SocketCAN_ioctl.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__ioctl_id_xer_, &INTEGER_json_, &SocketCAN__ioctl_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__ioctl
const TTCN_Typedescriptor_t SocketCAN__ioctl_descr_ = { "@SocketCAN_Types.SocketCAN_ioctl", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__ioctl__result
const TTCN_Typedescriptor_t SocketCAN__ioctl__result_descr_ = { "@SocketCAN_Types.SocketCAN_ioctl_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__connectu
const TTCN_Typedescriptor_t SocketCAN__connectu_descr_ = { "@SocketCAN_Types.SocketCAN_connectu", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__connect__bcm_if__index_xer_ = { {"if_index>\n", "if_index>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__connect__bcm_if__index_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__connect__bcm_if__index_descr_ = { "@SocketCAN_Types.SocketCAN_connect_bcm.if_index", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__connect__bcm_if__index_xer_, &INTEGER_json_, &SocketCAN__connect__bcm_if__index_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__connect__bcm
const TTCN_Typedescriptor_t SocketCAN__connect__bcm_descr_ = { "@SocketCAN_Types.SocketCAN_connect_bcm", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__connect_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__connect_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__connect_id_descr_ = { "@SocketCAN_Types.SocketCAN_connect.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__connect_id_xer_, &INTEGER_json_, &SocketCAN__connect_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__connect
const TTCN_Typedescriptor_t SocketCAN__connect_descr_ = { "@SocketCAN_Types.SocketCAN_connect", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__connect__result
const TTCN_Typedescriptor_t SocketCAN__connect__result_descr_ = { "@SocketCAN_Types.SocketCAN_connect_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__bind__raw_if__index_xer_ = { {"if_index>\n", "if_index>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__bind__raw_if__index_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__bind__raw_if__index_descr_ = { "@SocketCAN_Types.SocketCAN_bind_raw.if_index", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__bind__raw_if__index_xer_, &INTEGER_json_, &SocketCAN__bind__raw_if__index_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__bind__raw
const TTCN_Typedescriptor_t SocketCAN__bind__raw_descr_ = { "@SocketCAN_Types.SocketCAN_bind_raw", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__bind__isotp_if__index_xer_ = { {"if_index>\n", "if_index>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__bind__isotp_if__index_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__bind__isotp_if__index_descr_ = { "@SocketCAN_Types.SocketCAN_bind_isotp.if_index", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__bind__isotp_if__index_xer_, &INTEGER_json_, &SocketCAN__bind__isotp_if__index_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__bind__isotp_rx__can__id_xer_ = { {"rx_can_id>\n", "rx_can_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SocketCAN__bind__isotp_rx__can__id_oer_ext_arr_[0] = {};
const int SocketCAN__bind__isotp_rx__can__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t SocketCAN__bind__isotp_rx__can__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, SocketCAN__bind__isotp_rx__can__id_oer_ext_arr_, 0, SocketCAN__bind__isotp_rx__can__id_oer_p_};
const TTCN_Typedescriptor_t SocketCAN__bind__isotp_rx__can__id_descr_ = { "@SocketCAN_Types.SocketCAN_bind_isotp.rx_can_id", &OCTETSTRING_ber_, &Can::CAN__id_raw_, &OCTETSTRING_text_, &SocketCAN__bind__isotp_rx__can__id_xer_, &OCTETSTRING_json_, &SocketCAN__bind__isotp_rx__can__id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__bind__isotp_tx__can__id_xer_ = { {"tx_can_id>\n", "tx_can_id>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SocketCAN__bind__isotp_tx__can__id_oer_ext_arr_[0] = {};
const int SocketCAN__bind__isotp_tx__can__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t SocketCAN__bind__isotp_tx__can__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, SocketCAN__bind__isotp_tx__can__id_oer_ext_arr_, 0, SocketCAN__bind__isotp_tx__can__id_oer_p_};
const TTCN_Typedescriptor_t SocketCAN__bind__isotp_tx__can__id_descr_ = { "@SocketCAN_Types.SocketCAN_bind_isotp.tx_can_id", &OCTETSTRING_ber_, &Can::CAN__id_raw_, &OCTETSTRING_text_, &SocketCAN__bind__isotp_tx__can__id_xer_, &OCTETSTRING_json_, &SocketCAN__bind__isotp_tx__can__id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__bind__isotp
const TTCN_Typedescriptor_t SocketCAN__bind__isotp_descr_ = { "@SocketCAN_Types.SocketCAN_bind_isotp", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__bindu
const TTCN_Typedescriptor_t SocketCAN__bindu_descr_ = { "@SocketCAN_Types.SocketCAN_bindu", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__bind_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__bind_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__bind_id_descr_ = { "@SocketCAN_Types.SocketCAN_bind.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__bind_id_xer_, &INTEGER_json_, &SocketCAN__bind_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__bind
const TTCN_Typedescriptor_t SocketCAN__bind_descr_ = { "@SocketCAN_Types.SocketCAN_bind", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__bind__result
const TTCN_Typedescriptor_t SocketCAN__bind__result_descr_ = { "@SocketCAN_Types.SocketCAN_bind_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__send__data_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__send__data_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__send__data_id_descr_ = { "@SocketCAN_Types.SocketCAN_send_data.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__send__data_id_xer_, &INTEGER_json_, &SocketCAN__send__data_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__send__data
const TTCN_Typedescriptor_t SocketCAN__send__data_descr_ = { "@SocketCAN_Types.SocketCAN_send_data", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__send__data__result
const TTCN_Typedescriptor_t SocketCAN__send__data__result_descr_ = { "@SocketCAN_Types.SocketCAN_send_data_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__write__data_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__write__data_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__write__data_id_descr_ = { "@SocketCAN_Types.SocketCAN_write_data.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__write__data_id_xer_, &INTEGER_json_, &SocketCAN__write__data_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__write__data
const TTCN_Typedescriptor_t SocketCAN__write__data_descr_ = { "@SocketCAN_Types.SocketCAN_write_data", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__write__data__result
const TTCN_Typedescriptor_t SocketCAN__write__data__result_descr_ = { "@SocketCAN_Types.SocketCAN_write_data_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__write__isotp_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__write__isotp_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__write__isotp_id_descr_ = { "@SocketCAN_Types.SocketCAN_write_isotp.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__write__isotp_id_xer_, &INTEGER_json_, &SocketCAN__write__isotp_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__write__isotp_pdu_xer_ = { {"pdu>\n", "pdu>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SocketCAN__write__isotp_pdu_oer_ext_arr_[0] = {};
const int SocketCAN__write__isotp_pdu_oer_p_[0] = {};
const TTCN_OERdescriptor_t SocketCAN__write__isotp_pdu_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SocketCAN__write__isotp_pdu_oer_ext_arr_, 0, SocketCAN__write__isotp_pdu_oer_p_};
const TTCN_Typedescriptor_t SocketCAN__write__isotp_pdu_descr_ = { "@SocketCAN_Types.SocketCAN_write_isotp.pdu", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SocketCAN__write__isotp_pdu_xer_, &OCTETSTRING_json_, &SocketCAN__write__isotp_pdu_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__write__isotp
const TTCN_Typedescriptor_t SocketCAN__write__isotp_descr_ = { "@SocketCAN_Types.SocketCAN_write_isotp", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__write__isotp__result
const TTCN_Typedescriptor_t SocketCAN__write__isotp__result_descr_ = { "@SocketCAN_Types.SocketCAN_write_isotp_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__receive__CAN__or__CAN__FD__frame_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__receive__CAN__or__CAN__FD__frame_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__receive__CAN__or__CAN__FD__frame_id_descr_ = { "@SocketCAN_Types.SocketCAN_receive_CAN_or_CAN_FD_frame.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__receive__CAN__or__CAN__FD__frame_id_xer_, &INTEGER_json_, &SocketCAN__receive__CAN__or__CAN__FD__frame_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__receive__CAN__or__CAN__FD__frame
const TTCN_Typedescriptor_t SocketCAN__receive__CAN__or__CAN__FD__frame_descr_ = { "@SocketCAN_Types.SocketCAN_receive_CAN_or_CAN_FD_frame", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__receive__BCM__message_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__receive__BCM__message_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__receive__BCM__message_id_descr_ = { "@SocketCAN_Types.SocketCAN_receive_BCM_message.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__receive__BCM__message_id_xer_, &INTEGER_json_, &SocketCAN__receive__BCM__message_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__receive__BCM__message
const TTCN_Typedescriptor_t SocketCAN__receive__BCM__message_descr_ = { "@SocketCAN_Types.SocketCAN_receive_BCM_message", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__receive__isotp__pdu_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__receive__isotp__pdu_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__receive__isotp__pdu_id_descr_ = { "@SocketCAN_Types.SocketCAN_receive_isotp_pdu.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__receive__isotp__pdu_id_xer_, &INTEGER_json_, &SocketCAN__receive__isotp__pdu_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__receive__isotp__pdu_pdu_xer_ = { {"pdu>\n", "pdu>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SocketCAN__receive__isotp__pdu_pdu_oer_ext_arr_[0] = {};
const int SocketCAN__receive__isotp__pdu_pdu_oer_p_[0] = {};
const TTCN_OERdescriptor_t SocketCAN__receive__isotp__pdu_pdu_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SocketCAN__receive__isotp__pdu_pdu_oer_ext_arr_, 0, SocketCAN__receive__isotp__pdu_pdu_oer_p_};
const TTCN_Typedescriptor_t SocketCAN__receive__isotp__pdu_pdu_descr_ = { "@SocketCAN_Types.SocketCAN_receive_isotp_pdu.pdu", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &SocketCAN__receive__isotp__pdu_pdu_xer_, &OCTETSTRING_json_, &SocketCAN__receive__isotp__pdu_pdu_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__receive__isotp__pdu
const TTCN_Typedescriptor_t SocketCAN__receive__isotp__pdu_descr_ = { "@SocketCAN_Types.SocketCAN_receive_isotp_pdu", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for CAN__RAW__filters
const TTCN_Typedescriptor_t CAN__RAW__filters_descr_ = { "@SocketCAN_Types.CAN_RAW_filters", NULL, NULL, NULL, NULL, NULL, NULL, &Raw::CAN__RAW__filter_descr_, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__setsockopt__commandu
const TTCN_Typedescriptor_t SocketCAN__setsockopt__commandu_descr_ = { "@SocketCAN_Types.SocketCAN_setsockopt_commandu", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__setsockopt__commandu_err__mask_xer_ = { {"err_mask>\n", "err_mask>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__setsockopt__commandu_err__mask_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__setsockopt__commandu_err__mask_descr_ = { "@SocketCAN_Types.SocketCAN_setsockopt_commandu.err_mask", &BITSTRING_ber_, &Raw::CAN__RAW__err__mask_raw_, NULL, &SocketCAN__setsockopt__commandu_err__mask_xer_, &BITSTRING_json_, &SocketCAN__setsockopt__commandu_err__mask_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__setsockopt_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__setsockopt_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__setsockopt_id_descr_ = { "@SocketCAN_Types.SocketCAN_setsockopt.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__setsockopt_id_xer_, &INTEGER_json_, &SocketCAN__setsockopt_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__setsockopt
const TTCN_Typedescriptor_t SocketCAN__setsockopt_descr_ = { "@SocketCAN_Types.SocketCAN_setsockopt", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__setsockopt__result
const TTCN_Typedescriptor_t SocketCAN__setsockopt__result_descr_ = { "@SocketCAN_Types.SocketCAN_setsockopt_result", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t SocketCAN__close_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t SocketCAN__close_id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t SocketCAN__close_id_descr_ = { "@SocketCAN_Types.SocketCAN_close.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &SocketCAN__close_id_xer_, &INTEGER_json_, &SocketCAN__close_id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SocketCAN__close
const TTCN_Typedescriptor_t SocketCAN__close_descr_ = { "@SocketCAN_Types.SocketCAN_close", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
TTCN_Module module_object("SocketCAN_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
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 */
SocketCAN__timeval::SocketCAN__timeval()
{
}
SocketCAN__timeval::SocketCAN__timeval(const INTEGER& par_tv__sec,
const INTEGER& par_tv__usec)
: field_tv__sec(par_tv__sec),
field_tv__usec(par_tv__usec)
{
}
SocketCAN__timeval::SocketCAN__timeval(const SocketCAN__timeval& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SocketCAN_Types.SocketCAN_timeval.");
if (other_value.tv__sec().is_bound()) field_tv__sec = other_value.tv__sec();
else field_tv__sec.clean_up();
if (other_value.tv__usec().is_bound()) field_tv__usec = other_value.tv__usec();
else field_tv__usec.clean_up();
}
void SocketCAN__timeval::clean_up()
{
field_tv__sec.clean_up();
field_tv__usec.clean_up();
}
const TTCN_Typedescriptor_t* SocketCAN__timeval::get_descriptor() const { return &SocketCAN__timeval_descr_; }
SocketCAN__timeval& SocketCAN__timeval::operator=(const SocketCAN__timeval& other_value)
{
if (this != &other_value) {
if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SocketCAN_Types.SocketCAN_timeval.");
if (other_value.tv__sec().is_bound()) field_tv__sec = other_value.tv__sec();
else field_tv__sec.clean_up();
if (other_value.tv__usec().is_bound()) field_tv__usec = other_value.tv__usec();
else field_tv__usec.clean_up();
}
return *this;
}
boolean SocketCAN__timeval::operator==(const SocketCAN__timeval& other_value) const
{
return field_tv__sec==other_value.field_tv__sec
&& field_tv__usec==other_value.field_tv__usec;
}
boolean SocketCAN__timeval::is_bound() const
{
return (field_tv__sec.is_bound())
|| (field_tv__usec.is_bound());
}
boolean SocketCAN__timeval::is_value() const
{
return field_tv__sec.is_value()
&& field_tv__usec.is_value();
}
void SocketCAN__timeval::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ tv_sec := ");
field_tv__sec.log();
TTCN_Logger::log_event_str(", tv_usec := ");
field_tv__usec.log();
TTCN_Logger::log_event_str(" }");
}
void SocketCAN__timeval::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 @SocketCAN_Types.SocketCAN_timeval 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) tv__sec().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tv__usec().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(), "tv_sec")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
tv__sec().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "tv_usec")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
tv__usec().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 @SocketCAN_Types.SocketCAN_timeval: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record value", "@SocketCAN_Types.SocketCAN_timeval");
}
}
void SocketCAN__timeval::set_implicit_omit()
{
if (tv__sec().is_bound()) tv__sec().set_implicit_omit();
if (tv__usec().is_bound()) tv__usec().set_implicit_omit();
}
void SocketCAN__timeval::encode_text(Text_Buf& text_buf) const
{
field_tv__sec.encode_text(text_buf);
field_tv__usec.encode_text(text_buf);
}
void SocketCAN__timeval::decode_text(Text_Buf& text_buf)
{
field_tv__sec.decode_text(text_buf);
field_tv__usec.decode_text(text_buf);
}
struct SocketCAN__timeval_template::single_value_struct {
INTEGER_template field_tv__sec;
INTEGER_template field_tv__usec;
};
void SocketCAN__timeval_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_tv__sec = ANY_VALUE;
single_value->field_tv__usec = ANY_VALUE;
}
}
}
void SocketCAN__timeval_template::copy_value(const SocketCAN__timeval& other_value)
{
single_value = new single_value_struct;
if (other_value.tv__sec().is_bound()) {
single_value->field_tv__sec = other_value.tv__sec();
} else {
single_value->field_tv__sec.clean_up();
}
if (other_value.tv__usec().is_bound()) {
single_value->field_tv__usec = other_value.tv__usec();
} else {
single_value->field_tv__usec.clean_up();
}
set_selection(SPECIFIC_VALUE);
}
void SocketCAN__timeval_template::copy_template(const SocketCAN__timeval_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.tv__sec().get_selection()) {
single_value->field_tv__sec = other_value.tv__sec();
} else {
single_value->field_tv__sec.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tv__usec().get_selection()) {
single_value->field_tv__usec = other_value.tv__usec();
} else {
single_value->field_tv__usec.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 SocketCAN__timeval_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 @SocketCAN_Types.SocketCAN_timeval.");
break;
}
set_selection(other_value);
}
SocketCAN__timeval_template::SocketCAN__timeval_template()
{
}
SocketCAN__timeval_template::SocketCAN__timeval_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
SocketCAN__timeval_template::SocketCAN__timeval_template(const SocketCAN__timeval& other_value)
{
copy_value(other_value);
}
SocketCAN__timeval_template::SocketCAN__timeval_template(const OPTIONAL<SocketCAN__timeval>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SocketCAN__timeval&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SocketCAN_Types.SocketCAN_timeval from an unbound optional field.");
}
}
SocketCAN__timeval_template::SocketCAN__timeval_template(const SocketCAN__timeval_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
SocketCAN__timeval_template::~SocketCAN__timeval_template()
{
clean_up();
}
SocketCAN__timeval_template& SocketCAN__timeval_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
SocketCAN__timeval_template& SocketCAN__timeval_template::operator=(const SocketCAN__timeval& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}
SocketCAN__timeval_template& SocketCAN__timeval_template::operator=(const OPTIONAL<SocketCAN__timeval>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SocketCAN__timeval&)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 @SocketCAN_Types.SocketCAN_timeval.");
}
return *this;
}
SocketCAN__timeval_template& SocketCAN__timeval_template::operator=(const SocketCAN__timeval_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean SocketCAN__timeval_template::match(const SocketCAN__timeval& 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.tv__sec().is_bound()) return FALSE;
if(!single_value->field_tv__sec.match(other_value.tv__sec(), legacy))return FALSE;
if(!other_value.tv__usec().is_bound()) return FALSE;
if(!single_value->field_tv__usec.match(other_value.tv__usec(), 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 @SocketCAN_Types.SocketCAN_timeval.");
}
return FALSE;
}
boolean SocketCAN__timeval_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_tv__sec.is_bound()
||single_value->field_tv__usec.is_bound()
;
}
boolean SocketCAN__timeval_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_tv__sec.is_value()
&&single_value->field_tv__usec.is_value();
}
void SocketCAN__timeval_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;
}
SocketCAN__timeval SocketCAN__timeval_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 @SocketCAN_Types.SocketCAN_timeval.");
SocketCAN__timeval ret_val;
if (single_value->field_tv__sec.is_bound()) {
ret_val.tv__sec() = single_value->field_tv__sec.valueof();
}
if (single_value->field_tv__usec.is_bound()) {
ret_val.tv__usec() = single_value->field_tv__usec.valueof();
}
return ret_val;
}
void SocketCAN__timeval_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 @SocketCAN_Types.SocketCAN_timeval.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SocketCAN__timeval_template[list_length];
}
SocketCAN__timeval_template& SocketCAN__timeval_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 @SocketCAN_Types.SocketCAN_timeval.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SocketCAN_Types.SocketCAN_timeval.");
return value_list.list_value[list_index];
}
INTEGER_template& SocketCAN__timeval_template::tv__sec()
{
set_specific();
return single_value->field_tv__sec;
}
const INTEGER_template& SocketCAN__timeval_template::tv__sec() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tv_sec of a non-specific template of type @SocketCAN_Types.SocketCAN_timeval.");
return single_value->field_tv__sec;
}
INTEGER_template& SocketCAN__timeval_template::tv__usec()
{
set_specific();
return single_value->field_tv__usec;
}
const INTEGER_template& SocketCAN__timeval_template::tv__usec() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tv_usec of a non-specific template of type @SocketCAN_Types.SocketCAN_timeval.");
return single_value->field_tv__usec;
}
int SocketCAN__timeval_template::size_of() const
{
if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_timeval 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 @SocketCAN_Types.SocketCAN_timeval 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 @SocketCAN_Types.SocketCAN_timeval containing a value list with different sizes.");
}
return item_size;
}
case OMIT_VALUE:
TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_timeval containing omit value.");
case ANY_VALUE:
case ANY_OR_OMIT:
TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_timeval containing */? value.");
case COMPLEMENTED_LIST:
TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_timeval containing complemented list.");
default:
TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SocketCAN_Types.SocketCAN_timeval.");
}
return 0;
}
void SocketCAN__timeval_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ tv_sec := ");
single_value->field_tv__sec.log();
TTCN_Logger::log_event_str(", tv_usec := ");
single_value->field_tv__usec.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 SocketCAN__timeval_template::log_match(const SocketCAN__timeval& 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_tv__sec.match(match_value.tv__sec(), legacy)){
TTCN_Logger::log_logmatch_info(".tv_sec");
single_value->field_tv__sec.log_match(match_value.tv__sec(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tv__usec.match(match_value.tv__usec(), legacy)){
TTCN_Logger::log_logmatch_info(".tv_usec");
single_value->field_tv__usec.log_match(match_value.tv__usec(), 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("{ tv_sec := ");
single_value->field_tv__sec.log_match(match_value.tv__sec(), legacy);
TTCN_Logger::log_event_str(", tv_usec := ");
single_value->field_tv__usec.log_match(match_value.tv__usec(), 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 SocketCAN__timeval_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_tv__sec.encode_text(text_buf);
single_value->field_tv__usec.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 @SocketCAN_Types.SocketCAN_timeval.");
}
}
void SocketCAN__timeval_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_tv__sec.decode_text(text_buf);
single_value->field_tv__usec.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 SocketCAN__timeval_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 @SocketCAN_Types.SocketCAN_timeval.");
}
}
void SocketCAN__timeval_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: {
SocketCAN__timeval_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 @SocketCAN_Types.SocketCAN_timeval 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) tv__sec().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tv__usec().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(), "tv_sec")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
tv__sec().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "tv_usec")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
tv__usec().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 @SocketCAN_Types.SocketCAN_timeval: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record template", "@SocketCAN_Types.SocketCAN_timeval");
}
is_ifpresent = param.get_ifpresent();
}
void SocketCAN__timeval_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_tv__sec.check_restriction(t_res, t_name ? t_name : "@SocketCAN_Types.SocketCAN_timeval");
single_value->field_tv__usec.check_restriction(t_res, t_name ? t_name : "@SocketCAN_Types.SocketCAN_timeval");
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 : "@SocketCAN_Types.SocketCAN_timeval");
}
boolean SocketCAN__timeval_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}
boolean SocketCAN__timeval_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;
}
void SocketCAN__CAN__or__CAN__FD__frame::copy_value(const SocketCAN__CAN__or__CAN__FD__frame& other_value)
{
switch (other_value.union_selection) {
case ALT_can__frame:
field_can__frame = new Can::CAN__frame(*other_value.field_can__frame);
break;
case ALT_canfd__frame:
field_canfd__frame = new Can::CANFD__frame(*other_value.field_canfd__frame);
break;
default:
TTCN_error("Assignment of an unbound union value of type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
union_selection = other_value.union_selection;
}
SocketCAN__CAN__or__CAN__FD__frame::SocketCAN__CAN__or__CAN__FD__frame()
{
union_selection = UNBOUND_VALUE;
}
SocketCAN__CAN__or__CAN__FD__frame::SocketCAN__CAN__or__CAN__FD__frame(const SocketCAN__CAN__or__CAN__FD__frame& other_value)
: Base_Type(){
copy_value(other_value);
}
SocketCAN__CAN__or__CAN__FD__frame::~SocketCAN__CAN__or__CAN__FD__frame()
{
clean_up();
}
SocketCAN__CAN__or__CAN__FD__frame& SocketCAN__CAN__or__CAN__FD__frame::operator=(const SocketCAN__CAN__or__CAN__FD__frame& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}
boolean SocketCAN__CAN__or__CAN__FD__frame::operator==(const SocketCAN__CAN__or__CAN__FD__frame& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_can__frame:
return *field_can__frame == *other_value.field_can__frame;
case ALT_canfd__frame:
return *field_canfd__frame == *other_value.field_canfd__frame;
default:
return FALSE;
}
}
Can::CAN__frame& SocketCAN__CAN__or__CAN__FD__frame::can__frame()
{
if (union_selection != ALT_can__frame) {
clean_up();
field_can__frame = new Can::CAN__frame;
union_selection = ALT_can__frame;
}
return *field_can__frame;
}
const Can::CAN__frame& SocketCAN__CAN__or__CAN__FD__frame::can__frame() const
{
if (union_selection != ALT_can__frame) TTCN_error("Using non-selected field can_frame in a value of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
return *field_can__frame;
}
Can::CANFD__frame& SocketCAN__CAN__or__CAN__FD__frame::canfd__frame()
{
if (union_selection != ALT_canfd__frame) {
clean_up();
field_canfd__frame = new Can::CANFD__frame;
union_selection = ALT_canfd__frame;
}
return *field_canfd__frame;
}
const Can::CANFD__frame& SocketCAN__CAN__or__CAN__FD__frame::canfd__frame() const
{
if (union_selection != ALT_canfd__frame) TTCN_error("Using non-selected field canfd_frame in a value of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
return *field_canfd__frame;
}
boolean SocketCAN__CAN__or__CAN__FD__frame::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
return union_selection == checked_selection;
}
boolean SocketCAN__CAN__or__CAN__FD__frame::is_bound() const
{
return union_selection != UNBOUND_VALUE;
}
boolean SocketCAN__CAN__or__CAN__FD__frame::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_can__frame: return field_can__frame->is_value();
case ALT_canfd__frame: return field_canfd__frame->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}
void SocketCAN__CAN__or__CAN__FD__frame::clean_up()
{
switch (union_selection) {
case ALT_can__frame:
delete field_can__frame;
break;
case ALT_canfd__frame:
delete field_canfd__frame;
break;
default:
break;
}
union_selection = UNBOUND_VALUE;
}
void SocketCAN__CAN__or__CAN__FD__frame::log() const
{
switch (union_selection) {
case ALT_can__frame:
TTCN_Logger::log_event_str("{ can_frame := ");
field_can__frame->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_canfd__frame:
TTCN_Logger::log_event_str("{ canfd_frame := ");
field_canfd__frame->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}
void SocketCAN__CAN__or__CAN__FD__frame::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_VALUE, "union value");
Module_Param_Ptr m_p = &param;
if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
param.error("union value with field name was expected");
}
Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
char* last_name = mp_last->get_id()->get_name();
if (!strcmp(last_name, "can_frame")) {
can__frame().set_param(*mp_last);
if (!can__frame().is_bound()) clean_up();
return;
}
if (!strcmp(last_name, "canfd_frame")) {
canfd__frame().set_param(*mp_last);
if (!canfd__frame().is_bound()) clean_up();
return;
}
mp_last->error("Field %s does not exist in type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.", last_name);
}
void SocketCAN__CAN__or__CAN__FD__frame::set_implicit_omit()
{
switch (union_selection) {
case ALT_can__frame:
field_can__frame->set_implicit_omit(); break;
case ALT_canfd__frame:
field_canfd__frame->set_implicit_omit(); break;
default: break;
}
}
void SocketCAN__CAN__or__CAN__FD__frame::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_can__frame:
field_can__frame->encode_text(text_buf);
break;
case ALT_canfd__frame:
field_canfd__frame->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
}
void SocketCAN__CAN__or__CAN__FD__frame::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_can__frame:
can__frame().decode_text(text_buf);
break;
case ALT_canfd__frame:
canfd__frame().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
}
void SocketCAN__CAN__or__CAN__FD__frame_template::copy_value(const SocketCAN__CAN__or__CAN__FD__frame& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
single_value.field_can__frame = new Can::CAN__frame_template(other_value.can__frame());
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
single_value.field_canfd__frame = new Can::CANFD__frame_template(other_value.canfd__frame());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
set_selection(SPECIFIC_VALUE);
}
void SocketCAN__CAN__or__CAN__FD__frame_template::copy_template(const SocketCAN__CAN__or__CAN__FD__frame_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
single_value.field_can__frame = new Can::CAN__frame_template(*other_value.single_value.field_can__frame);
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
single_value.field_canfd__frame = new Can::CANFD__frame_template(*other_value.single_value.field_canfd__frame);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
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 SocketCAN__CAN__or__CAN__FD__frame_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 template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
set_selection(other_value);
}
SocketCAN__CAN__or__CAN__FD__frame_template::SocketCAN__CAN__or__CAN__FD__frame_template()
{
}
SocketCAN__CAN__or__CAN__FD__frame_template::SocketCAN__CAN__or__CAN__FD__frame_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
SocketCAN__CAN__or__CAN__FD__frame_template::SocketCAN__CAN__or__CAN__FD__frame_template(const SocketCAN__CAN__or__CAN__FD__frame& other_value)
{
copy_value(other_value);
}
SocketCAN__CAN__or__CAN__FD__frame_template::SocketCAN__CAN__or__CAN__FD__frame_template(const OPTIONAL<SocketCAN__CAN__or__CAN__FD__frame>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SocketCAN__CAN__or__CAN__FD__frame&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame from an unbound optional field.");
}
}
SocketCAN__CAN__or__CAN__FD__frame_template::SocketCAN__CAN__or__CAN__FD__frame_template(const SocketCAN__CAN__or__CAN__FD__frame_template& other_value)
: Base_Template(){
copy_template(other_value);
}
SocketCAN__CAN__or__CAN__FD__frame_template::~SocketCAN__CAN__or__CAN__FD__frame_template()
{
clean_up();
}
void SocketCAN__CAN__or__CAN__FD__frame_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
delete single_value.field_can__frame;
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
delete single_value.field_canfd__frame;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
delete [] value_list.list_value;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}
SocketCAN__CAN__or__CAN__FD__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
SocketCAN__CAN__or__CAN__FD__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::operator=(const SocketCAN__CAN__or__CAN__FD__frame& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}
SocketCAN__CAN__or__CAN__FD__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::operator=(const OPTIONAL<SocketCAN__CAN__or__CAN__FD__frame>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SocketCAN__CAN__or__CAN__FD__frame&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
return *this;
}
SocketCAN__CAN__or__CAN__FD__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::operator=(const SocketCAN__CAN__or__CAN__FD__frame_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean SocketCAN__CAN__or__CAN__FD__frame_template::match(const SocketCAN__CAN__or__CAN__FD__frame& 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:
{
SocketCAN__CAN__or__CAN__FD__frame::union_selection_type value_selection = other_value.get_selection();
if (value_selection == SocketCAN__CAN__or__CAN__FD__frame::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
return single_value.field_can__frame->match(other_value.can__frame(), legacy);
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
return single_value.field_canfd__frame->match(other_value.canfd__frame(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
}
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 template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
return FALSE;
}
boolean SocketCAN__CAN__or__CAN__FD__frame_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
return single_value.field_can__frame->is_value();
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
return single_value.field_canfd__frame->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
}
SocketCAN__CAN__or__CAN__FD__frame SocketCAN__CAN__or__CAN__FD__frame_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
SocketCAN__CAN__or__CAN__FD__frame ret_val;
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
ret_val.can__frame() = single_value.field_can__frame->valueof();
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
ret_val.canfd__frame() = single_value.field_canfd__frame->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
return ret_val;
}
SocketCAN__CAN__or__CAN__FD__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
return value_list.list_value[list_index];
}
void SocketCAN__CAN__or__CAN__FD__frame_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST) TTCN_error ("Internal error: Setting an invalid list for a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SocketCAN__CAN__or__CAN__FD__frame_template[list_length];
}
Can::CAN__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::can__frame()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_can__frame = new Can::CAN__frame_template(ANY_VALUE);
else single_value.field_can__frame = new Can::CAN__frame_template;
single_value.union_selection = SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_can__frame;
}
const Can::CAN__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::can__frame() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field can_frame in a non-specific template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
if (single_value.union_selection != SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame) TTCN_error("Accessing non-selected field can_frame in a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
return *single_value.field_can__frame;
}
Can::CANFD__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::canfd__frame()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_canfd__frame = new Can::CANFD__frame_template(ANY_VALUE);
else single_value.field_canfd__frame = new Can::CANFD__frame_template;
single_value.union_selection = SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_canfd__frame;
}
const Can::CANFD__frame_template& SocketCAN__CAN__or__CAN__FD__frame_template::canfd__frame() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field canfd_frame in a non-specific template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
if (single_value.union_selection != SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame) TTCN_error("Accessing non-selected field canfd_frame in a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
return *single_value.field_canfd__frame;
}
boolean SocketCAN__CAN__or__CAN__FD__frame_template::ischosen(SocketCAN__CAN__or__CAN__FD__frame::union_selection_type checked_selection) const
{
if (checked_selection == SocketCAN__CAN__or__CAN__FD__frame::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == SocketCAN__CAN__or__CAN__FD__frame::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}
void SocketCAN__CAN__or__CAN__FD__frame_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
TTCN_Logger::log_event_str("{ can_frame := ");
single_value.field_can__frame->log();
TTCN_Logger::log_event_str(" }");
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
TTCN_Logger::log_event_str("{ canfd_frame := ");
single_value.field_canfd__frame->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case 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 SocketCAN__CAN__or__CAN__FD__frame_template::log_match(const SocketCAN__CAN__or__CAN__FD__frame& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".can_frame");
single_value.field_can__frame->log_match(match_value.can__frame(), legacy);
} else {
TTCN_Logger::log_event_str("{ can_frame := ");
single_value.field_can__frame->log_match(match_value.can__frame(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".canfd_frame");
single_value.field_canfd__frame->log_match(match_value.canfd__frame(), legacy);
} else {
TTCN_Logger::log_event_str("{ canfd_frame := ");
single_value.field_canfd__frame->log_match(match_value.canfd__frame(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}
void SocketCAN__CAN__or__CAN__FD__frame_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
single_value.field_can__frame->encode_text(text_buf);
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
single_value.field_canfd__frame->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
}
void SocketCAN__CAN__or__CAN__FD__frame_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = SocketCAN__CAN__or__CAN__FD__frame::UNBOUND_VALUE;
SocketCAN__CAN__or__CAN__FD__frame::union_selection_type new_selection = (SocketCAN__CAN__or__CAN__FD__frame::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
single_value.field_can__frame = new Can::CAN__frame_template;
single_value.field_can__frame->decode_text(text_buf);
break;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
single_value.field_canfd__frame = new Can::CANFD__frame_template;
single_value.field_canfd__frame->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SocketCAN__CAN__or__CAN__FD__frame_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
}
boolean SocketCAN__CAN__or__CAN__FD__frame_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}
boolean SocketCAN__CAN__or__CAN__FD__frame_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 v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}
void SocketCAN__CAN__or__CAN__FD__frame_template::set_param(Module_Param& param)
{
if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
param.get_id()->next_name()) {
char* param_field = param.get_id()->get_current_name();
if (param_field[0] >= '0' && param_field[0] <= '9') {
param.error("Unexpected array index in module parameter, expected a valid field"
" name for union template type `@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame'");
}
if (strcmp("can_frame", param_field) == 0) {
can__frame().set_param(param);
return;
} else if (strcmp("canfd_frame", param_field) == 0) {
canfd__frame().set_param(param);
return;
} else param.error("Field `%s' not found in union template type `@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame'", param_field);
}
param.basic_check(Module_Param::BC_TEMPLATE, "union template");
Module_Param_Ptr m_p = &param;
switch (m_p->get_type()) {
case Module_Param::MP_Omit:
*this = OMIT_VALUE;
break;
case Module_Param::MP_Any:
*this = ANY_VALUE;
break;
case Module_Param::MP_AnyOrNone:
*this = ANY_OR_OMIT;
break;
case Module_Param::MP_List_Template:
case Module_Param::MP_ComplementList_Template: {
SocketCAN__CAN__or__CAN__FD__frame_template new_temp;
new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : COMPLEMENTED_LIST, m_p->get_size());
for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
}
*this = new_temp;
break; }
case Module_Param::MP_Value_List:
if (m_p->get_size()==0) break;
param.type_error("union template", "@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame");
break;
case Module_Param::MP_Assignment_List: {
Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
char* last_name = mp_last->get_id()->get_name();
if (!strcmp(last_name, "can_frame")) {
can__frame().set_param(*mp_last);
break;
}
if (!strcmp(last_name, "canfd_frame")) {
canfd__frame().set_param(*mp_last);
break;
}
mp_last->error("Field %s does not exist in type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.", last_name);
} break;
default:
param.type_error("union template", "@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame");
}
is_ifpresent = param.get_ifpresent();
}
void SocketCAN__CAN__or__CAN__FD__frame_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case SocketCAN__CAN__or__CAN__FD__frame::ALT_can__frame:
single_value.field_can__frame->check_restriction(t_res, t_name ? t_name : "@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame");
return;
case SocketCAN__CAN__or__CAN__FD__frame::ALT_canfd__frame:
single_value.field_canfd__frame->check_restriction(t_res, t_name ? t_name : "@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame.");
}
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 : "@SocketCAN_Types.SocketCAN_CAN_or_CAN_FD_frame");
}
SocketCAN__ifr::SocketCAN__ifr()
{
}
SocketCAN__ifr::SocketCAN__ifr(const OPTIONAL<CHARSTRING>& par_if__name,
const OPTIONAL<INTEGER>& par_if__index)
: field_if__name(par_if__name),
field_if__index(par_if__index)
{
}
SocketCAN__ifr::SocketCAN__ifr(const SocketCAN__ifr& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @SocketCAN_Types.SocketCAN_ifr.");
if (other_value.if__name().is_bound()) field_if__name = other_value.if__name();
else field_if__name.clean_up();
if (other_value.if__index().is_bound()) field_if__index = other_value.if__index();
else field_if__index.clean_up();
}
void SocketCAN__ifr::clean_up()
{
field_if__name.clean_up();
field_if__index.clean_up();
}
const TTCN_Typedescriptor_t* SocketCAN__ifr::get_descriptor() const { return &SocketCAN__ifr_descr_; }
SocketCAN__ifr& SocketCAN__ifr::operator=(const SocketCAN__ifr& other_value)
{
if (this != &other_value) {
if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @SocketCAN_Types.SocketCAN_ifr.");
if (other_value.if__name().is_bound()) field_if__name = other_value.if__name();
else field_if__name.clean_up();
if (other_value.if__index().is_bound()) field_if__index = other_value.if__index();
else field_if__index.clean_up();
}
return *this;
}
boolean SocketCAN__ifr::operator==(const SocketCAN__ifr& other_value) const
{
return field_if__name==other_value.field_if__name
&& field_if__index==other_value.field_if__index;
}
boolean SocketCAN__ifr::is_bound() const
{
return (OPTIONAL_OMIT == field_if__name.get_selection() || field_if__name.is_bound())
|| (OPTIONAL_OMIT == field_if__index.get_selection() || field_if__index.is_bound());
}
boolean SocketCAN__ifr::is_value() const
{
return (OPTIONAL_OMIT == field_if__name.get_selection() || field_if__name.is_value())
&& (OPTIONAL_OMIT == field_if__index.get_selection() || field_if__index.is_value());
}
int SocketCAN__ifr::size_of() const
{
int ret_val = 0;
if (field_if__name.ispresent()) ret_val++;
if (field_if__index.ispresent()) ret_val++;
return ret_val;
}
void SocketCAN__ifr::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ if_name := ");
field_if__name.log();
TTCN_Logger::log_event_str(", if_index := ");
field_if__index.log();
TTCN_Logger::log_event_str(" }");
}
void SocketCAN__ifr::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 @SocketCAN_Types.SocketCAN_ifr 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) if__name().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) if__index().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(), "if_name")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
if__name().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "if_index")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
if__index().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 @SocketCAN_Types.SocketCAN_ifr: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record value", "@SocketCAN_Types.SocketCAN_ifr");
}
}
void SocketCAN__ifr::set_implicit_omit()
{
if (!if__name().is_bound()) if__name() = OMIT_VALUE;
else if__name().set_implicit_omit();
if (!if__index().is_bound()) if__index() = OMIT_VALUE;
else if__index().set_implicit_omit();
}
void SocketCAN__ifr::encode_text(Text_Buf& text_buf) const
{
field_if__name.encode_text(text_buf);
field_if__index.encode_text(text_buf);
}
void SocketCAN__ifr::decode_text(Text_Buf& text_buf)
{
field_if__name.decode_text(text_buf);
field_if__index.decode_text(text_buf);
}
struct SocketCAN__ifr_template::single_value_struct {
CHARSTRING_template field_if__name;
INTEGER_template field_if__index;
};
void SocketCAN__ifr_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_if__name = ANY_OR_OMIT;
single_value->field_if__index = ANY_OR_OMIT;
}
}
}
void SocketCAN__ifr_template::copy_value(const SocketCAN__ifr& other_value)
{
single_value = new single_value_struct;
if (other_value.if__name().is_bound()) {
if (other_value.if__name().ispresent()) single_value->field_if__name = other_value.if__name()();
else single_value->field_if__name = OMIT_VALUE;
} else {
single_value->field_if__name.clean_up();
}
if (other_value.if__index().is_bound()) {
if (other_value.if__index().ispresent()) single_value->field_if__index = other_value.if__index()();
else single_value->field_if__index = OMIT_VALUE;
} else {
single_value->field_if__index.clean_up();
}
set_selection(SPECIFIC_VALUE);
}
void SocketCAN__ifr_template::copy_template(const SocketCAN__ifr_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.if__name().get_selection()) {
single_value->field_if__name = other_value.if__name();
} else {
single_value->field_if__name.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.if__index().get_selection()) {
single_value->field_if__index = other_value.if__index();
} else {
single_value->field_if__index.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 SocketCAN__ifr_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 @SocketCAN_Types.SocketCAN_ifr.");
break;
}
set_selection(other_value);
}
SocketCAN__ifr_template::SocketCAN__ifr_template()
{
}
SocketCAN__ifr_template::SocketCAN__ifr_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
SocketCAN__ifr_template::SocketCAN__ifr_template(const SocketCAN__ifr& other_value)
{
copy_value(other_value);
}
SocketCAN__ifr_template::SocketCAN__ifr_template(const OPTIONAL<SocketCAN__ifr>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SocketCAN__ifr&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @SocketCAN_Types.SocketCAN_ifr from an unbound optional field.");
}
}
SocketCAN__ifr_template::SocketCAN__ifr_template(const SocketCAN__ifr_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
SocketCAN__ifr_template::~SocketCAN__ifr_template()
{
clean_up();
}
SocketCAN__ifr_template& SocketCAN__ifr_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
SocketCAN__ifr_template& SocketCAN__ifr_template::operator=(const SocketCAN__ifr& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}
SocketCAN__ifr_template& SocketCAN__ifr_template::operator=(const OPTIONAL<SocketCAN__ifr>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SocketCAN__ifr&)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 @SocketCAN_Types.SocketCAN_ifr.");
}
return *this;
}
SocketCAN__ifr_template& SocketCAN__ifr_template::operator=(const SocketCAN__ifr_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean SocketCAN__ifr_template::match(const SocketCAN__ifr& 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.if__name().is_bound()) return FALSE;
if((other_value.if__name().ispresent() ? !single_value->field_if__name.match((const CHARSTRING&)other_value.if__name(), legacy) : !single_value->field_if__name.match_omit(legacy)))return FALSE;
if(!other_value.if__index().is_bound()) return FALSE;
if((other_value.if__index().ispresent() ? !single_value->field_if__index.match((const INTEGER&)other_value.if__index(), legacy) : !single_value->field_if__index.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching an uninitialized/unsupported template of type @SocketCAN_Types.SocketCAN_ifr.");
}
return FALSE;
}
boolean SocketCAN__ifr_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_if__name.is_omit() || single_value->field_if__name.is_bound())
||(single_value->field_if__index.is_omit() || single_value->field_if__index.is_bound())
;
}
boolean SocketCAN__ifr_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_if__name.is_omit() || single_value->field_if__name.is_value())
&&(single_value->field_if__index.is_omit() || single_value->field_if__index.is_value());
}
void SocketCAN__ifr_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;
}
SocketCAN__ifr SocketCAN__ifr_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 @SocketCAN_Types.SocketCAN_ifr.");
SocketCAN__ifr ret_val;
if (single_value->field_if__name.is_omit()) ret_val.if__name() = OMIT_VALUE;
else if (single_value->field_if__name.is_bound()) {
ret_val.if__name() = single_value->field_if__name.valueof();
}
if (single_value->field_if__index.is_omit()) ret_val.if__index() = OMIT_VALUE;
else if (single_value->field_if__index.is_bound()) {
ret_val.if__index() = single_value->field_if__index.valueof();
}
return ret_val;
}
void SocketCAN__ifr_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 @SocketCAN_Types.SocketCAN_ifr.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SocketCAN__ifr_template[list_length];
}
SocketCAN__ifr_template& SocketCAN__ifr_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 @SocketCAN_Types.SocketCAN_ifr.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @SocketCAN_Types.SocketCAN_ifr.");
return value_list.list_value[list_index];
}
CHARSTRING_template& SocketCAN__ifr_template::if__name()
{
set_specific();
return single_value->field_if__name;
}
const CHARSTRING_template& SocketCAN__ifr_template::if__name() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field if_name of a non-specific template of type @SocketCAN_Types.SocketCAN_ifr.");
return single_value->field_if__name;
}
INTEGER_template& SocketCAN__ifr_template::if__index()
{
set_specific();
return single_value->field_if__index;
}
const INTEGER_template& SocketCAN__ifr_template::if__index() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field if_index of a non-specific template of type @SocketCAN_Types.SocketCAN_ifr.");
return single_value->field_if__index;
}
int SocketCAN__ifr_template::size_of() const
{
if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_ifr which has an ifpresent attribute.");
switch (template_selection)
{
case SPECIFIC_VALUE:
{ int ret_val = 0;
if (single_value->field_if__name.is_present()) ret_val++;
if (single_value->field_if__index.is_present()) ret_val++;
return ret_val;
}
case VALUE_LIST:
{
if (value_list.n_values<1)
TTCN_error("Internal error: Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_ifr 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 @SocketCAN_Types.SocketCAN_ifr containing a value list with different sizes.");
}
return item_size;
}
case OMIT_VALUE:
TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_ifr containing omit value.");
case ANY_VALUE:
case ANY_OR_OMIT:
TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_ifr containing */? value.");
case COMPLEMENTED_LIST:
TTCN_error("Performing sizeof() operation on a template of type @SocketCAN_Types.SocketCAN_ifr containing complemented list.");
default:
TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @SocketCAN_Types.SocketCAN_ifr.");
}
return 0;
}
void SocketCAN__ifr_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ if_name := ");
single_value->field_if__name.log();
TTCN_Logger::log_event_str(", if_index := ");
single_value->field_if__index.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 SocketCAN__ifr_template::log_match(const SocketCAN__ifr& 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 (match_value.if__name().ispresent()){
if(!single_value->field_if__name.match(match_value.if__name(), legacy)){
TTCN_Logger::log_logmatch_info(".if_name");
single_value->field_if__name.log_match(match_value.if__name(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_if__name.match_omit(legacy)){
TTCN_Logger::log_logmatch_info(".if_name := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_if__name.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.if__index().ispresent()){
if(!single_value->field_if__index.match(match_value.if__index(), legacy)){
TTCN_Logger::log_logmatch_info(".if_index");
single_value->field_if__index.log_match(match_value.if__index(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_if__index.match_omit(legacy)){
TTCN_Logger::log_logmatch_info(".if_index := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_if__index.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ if_name := ");
if (match_value.if__name().ispresent()) single_value->field_if__name.log_match(match_value.if__name(), legacy);
else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_if__name.log();
if (single_value->field_if__name.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", if_index := ");
if (match_value.if__index().ispresent()) single_value->field_if__index.log_match(match_value.if__index(), legacy);
else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_if__index.log();
if (single_value->field_if__index.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}
void SocketCAN__ifr_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_if__name.encode_text(text_buf);
single_value->field_if__index.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 @SocketCAN_Types.SocketCAN_ifr.");
}
}
void SocketCAN__ifr_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_if__name.decode_text(text_buf);
single_value->field_if__index.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 SocketCAN__ifr_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 @SocketCAN_Types.SocketCAN_ifr.");
}
}
void SocketCAN__ifr_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: {
SocketCAN__ifr_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 @SocketCAN_Types.SocketCAN_ifr 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) if__name().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) if__index().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(), "if_name")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
if__name().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "if_index")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
if__index().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]) {