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

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

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

/* Including header files */

#include "OSMUX_Emulation.hh"

namespace OSMUX__Emulation {

/* Literal string constants */

const unsigned char bs_0_bits[] = { 0 },
bs_1_bits[] = { 1 };
extern const BITSTRING bs_0(1, bs_0_bits),
bs_1(1, bs_1_bits);
const unsigned char os_0_octets[] = { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 };
extern const OCTETSTRING os_1(0, NULL),
os_0(24, os_0_octets);
extern const CHARSTRING cs_8(9, "Connected"),
cs_7(59, "Could not connect to Osmux socket, check your configuration"),
cs_6(58, "Could not listen on Osmux socket, check your configuration"),
cs_0(20, "OSMUX_Emulation.ttcn"),
cs_3(44, "Osmux packet sequence number errors occurred"),
cs_4(44, "Osmux packets received while RX was disabled"),
cs_5(47, "Osmux packets with mismatching payload received"),
cs_9(39, "Received unexpected msg type from Osmux"),
cs_2(41, "no Osmux packet activity detected (bytes)"),
cs_1(43, "no Osmux packet activity detected (packets)");
const unsigned char module_checksum[] = { 0x02, 0xe0, 0xb0, 0xfb, 0xcd, 0x76, 0x3b, 0x4b, 0x02, 0x9e, 0x27, 0x78, 0x2a, 0x84, 0x88, 0x20 };

/* Global variable definitions */

const TTCN_Typedescriptor_t& OSMUX__Emulation__CT_descr_ = COMPONENT_descr_;
OSMUX__CodecPort::OSMUX__CODEC__PT OSMUX__Emulation__CT_component_OSMUX("OSMUX");
INTEGER OSMUX__Emulation__CT_component_g__osmux__conn__id;
OsmuxEM__CTRL__PT OSMUX__Emulation__CT_component_CTRL("CTRL");
OsmuxEM__DATA__PT OSMUX__Emulation__CT_component_DATA("DATA");
const XERdescriptor_t       OsmuxemConfig_batch__size_xer_ = { {"batch_size>\n", "batch_size>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxemConfig_batch__size_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxemConfig_batch__size_descr_ = { "@OSMUX_Emulation.OsmuxemConfig.batch_size", &INTEGER_ber_, &General__Types::INT3b_raw_, &INTEGER_text_, &OsmuxemConfig_batch__size_xer_, &INTEGER_json_, &OsmuxemConfig_batch__size_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxemConfig_batch__size_default_coding("RAW");
const XERdescriptor_t       OsmuxemConfig_tx__duration__ms_xer_ = { {"tx_duration_ms>\n", "tx_duration_ms>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemConfig_tx__duration__ms_descr_ = { "@OSMUX_Emulation.OsmuxemConfig.tx_duration_ms", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemConfig_tx__duration__ms_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for OsmuxemConfig
const TTCN_Typedescriptor_t OsmuxemConfig_descr_ = { "@OSMUX_Emulation.OsmuxemConfig", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemConfig_tx__fixed__payload_xer_ = { {"tx_fixed_payload>\n", "tx_fixed_payload>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int OsmuxemConfig_tx__fixed__payload_oer_ext_arr_[0] = {};
const int OsmuxemConfig_tx__fixed__payload_oer_p_[0] = {};
const TTCN_OERdescriptor_t OsmuxemConfig_tx__fixed__payload_oer_ = { -1, TRUE, -1, FALSE, 0, 0, OsmuxemConfig_tx__fixed__payload_oer_ext_arr_, 0, OsmuxemConfig_tx__fixed__payload_oer_p_};
const TTCN_Typedescriptor_t OsmuxemConfig_tx__fixed__payload_descr_ = { "@OSMUX_Emulation.OsmuxemConfig.tx_fixed_payload", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &OsmuxemConfig_tx__fixed__payload_xer_, &OCTETSTRING_json_, &OsmuxemConfig_tx__fixed__payload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemConfig_rx__fixed__payload_xer_ = { {"rx_fixed_payload>\n", "rx_fixed_payload>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int OsmuxemConfig_rx__fixed__payload_oer_ext_arr_[0] = {};
const int OsmuxemConfig_rx__fixed__payload_oer_p_[0] = {};
const TTCN_OERdescriptor_t OsmuxemConfig_rx__fixed__payload_oer_ = { -1, TRUE, -1, FALSE, 0, 0, OsmuxemConfig_rx__fixed__payload_oer_ext_arr_, 0, OsmuxemConfig_rx__fixed__payload_oer_p_};
const TTCN_Typedescriptor_t OsmuxemConfig_rx__fixed__payload_descr_ = { "@OSMUX_Emulation.OsmuxemConfig.rx_fixed_payload", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &OsmuxemConfig_rx__fixed__payload_xer_, &OCTETSTRING_json_, &OsmuxemConfig_rx__fixed__payload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
OsmuxemConfig OSMUX__Emulation__CT_component_g__cfg;
const XERdescriptor_t       OsmuxemStats_num__pkts__tx_xer_ = { {"num_pkts_tx>\n", "num_pkts_tx>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemStats_num__pkts__tx_descr_ = { "@OSMUX_Emulation.OsmuxemStats.num_pkts_tx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemStats_num__pkts__tx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemStats_bytes__payload__tx_xer_ = { {"bytes_payload_tx>\n", "bytes_payload_tx>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemStats_bytes__payload__tx_descr_ = { "@OSMUX_Emulation.OsmuxemStats.bytes_payload_tx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemStats_bytes__payload__tx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemStats_num__pkts__rx_xer_ = { {"num_pkts_rx>\n", "num_pkts_rx>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemStats_num__pkts__rx_descr_ = { "@OSMUX_Emulation.OsmuxemStats.num_pkts_rx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemStats_num__pkts__rx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemStats_bytes__payload__rx_xer_ = { {"bytes_payload_rx>\n", "bytes_payload_rx>\n"}, {18, 18}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemStats_bytes__payload__rx_descr_ = { "@OSMUX_Emulation.OsmuxemStats.bytes_payload_rx", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemStats_bytes__payload__rx_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemStats_num__pkts__rx__err__seq_xer_ = { {"num_pkts_rx_err_seq>\n", "num_pkts_rx_err_seq>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemStats_num__pkts__rx__err__seq_descr_ = { "@OSMUX_Emulation.OsmuxemStats.num_pkts_rx_err_seq", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemStats_num__pkts__rx__err__seq_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemStats_num__pkts__rx__err__disabled_xer_ = { {"num_pkts_rx_err_disabled>\n", "num_pkts_rx_err_disabled>\n"}, {26, 26}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemStats_num__pkts__rx__err__disabled_descr_ = { "@OSMUX_Emulation.OsmuxemStats.num_pkts_rx_err_disabled", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemStats_num__pkts__rx__err__disabled_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxemStats_num__pkts__rx__err__payload_xer_ = { {"num_pkts_rx_err_payload>\n", "num_pkts_rx_err_payload>\n"}, {25, 25}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t OsmuxemStats_num__pkts__rx__err__payload_descr_ = { "@OSMUX_Emulation.OsmuxemStats.num_pkts_rx_err_payload", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &OsmuxemStats_num__pkts__rx__err__payload_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for OsmuxemStats
const TTCN_Typedescriptor_t OsmuxemStats_descr_ = { "@OSMUX_Emulation.OsmuxemStats", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
OsmuxemStats OSMUX__Emulation__CT_component_g__stat;
CHARSTRING OSMUX__Emulation__CT_component_g__remote__host;
INTEGER OSMUX__Emulation__CT_component_g__remote__port;
CHARSTRING OSMUX__Emulation__CT_component_g__local__host;
INTEGER OSMUX__Emulation__CT_component_g__local__port;
BOOLEAN OSMUX__Emulation__CT_component_g__rx__enabled;
BOOLEAN OSMUX__Emulation__CT_component_g__tx__connected;
INTEGER OSMUX__Emulation__CT_component_g__rx__payload__type;
INTEGER OSMUX__Emulation__CT_component_g__rx__last__seq;
INTEGER OSMUX__Emulation__CT_component_g__rx__last__ts;
const XERdescriptor_t       RxHandleTableRec_cid_xer_ = { {"cid>\n", "cid>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RxHandleTableRec_cid_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RxHandleTableRec_cid_descr_ = { "@OSMUX_Emulation.RxHandleTableRec.cid", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &RxHandleTableRec_cid_xer_, &INTEGER_json_, &RxHandleTableRec_cid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RxHandleTableRec_cid_default_coding("RAW");
const XERdescriptor_t       OsmuxRxHandle_cid_xer_ = { {"cid>\n", "cid>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxRxHandle_cid_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxRxHandle_cid_descr_ = { "@OSMUX_Emulation.OsmuxRxHandle.cid", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &OsmuxRxHandle_cid_xer_, &INTEGER_json_, &OsmuxRxHandle_cid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxRxHandle_cid_default_coding("RAW");
const XERdescriptor_t       OsmuxRxHandle_first__seq__seen_xer_ = { {"first_seq_seen>\n", "first_seq_seen>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int OsmuxRxHandle_first__seq__seen_oer_ext_arr_[0] = {};
const int OsmuxRxHandle_first__seq__seen_oer_p_[0] = {};
const TTCN_OERdescriptor_t OsmuxRxHandle_first__seq__seen_oer_ = { -1, TRUE, -1, FALSE, 0, 0, OsmuxRxHandle_first__seq__seen_oer_ext_arr_, 0, OsmuxRxHandle_first__seq__seen_oer_p_};
const TTCN_Typedescriptor_t OsmuxRxHandle_first__seq__seen_descr_ = { "@OSMUX_Emulation.OsmuxRxHandle.first_seq_seen", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &OsmuxRxHandle_first__seq__seen_xer_, &BOOLEAN_json_, &OsmuxRxHandle_first__seq__seen_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       OsmuxRxHandle_last__seq__ack_xer_ = { {"last_seq_ack>\n", "last_seq_ack>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxRxHandle_last__seq__ack_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxRxHandle_last__seq__ack_descr_ = { "@OSMUX_Emulation.OsmuxRxHandle.last_seq_ack", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &OsmuxRxHandle_last__seq__ack_xer_, &INTEGER_json_, &OsmuxRxHandle_last__seq__ack_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxRxHandle_last__seq__ack_default_coding("RAW");
// No XER for OsmuxRxHandle
const TTCN_Typedescriptor_t OsmuxRxHandle_descr_ = { "@OSMUX_Emulation.OsmuxRxHandle", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for RxHandleTableRec
const TTCN_Typedescriptor_t RxHandleTableRec_descr_ = { "@OSMUX_Emulation.RxHandleTableRec", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
VALUE_ARRAY<RxHandleTableRec, 16, 0> OSMUX__Emulation__CT_component_RxHandleTable;
const XERdescriptor_t       OsmuxTxHandle_ft_xer_ = { {"ft>\n", "ft>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxTxHandle_ft_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxTxHandle_ft_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle.ft", &INTEGER_ber_, &General__Types::INT2b_raw_, &INTEGER_text_, &OsmuxTxHandle_ft_xer_, &INTEGER_json_, &OsmuxTxHandle_ft_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxTxHandle_ft_default_coding("RAW");
const XERdescriptor_t       OsmuxTxHandle_amr__f_xer_ = { {"amr_f>\n", "amr_f>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxTxHandle_amr__f_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxTxHandle_amr__f_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle.amr_f", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &OsmuxTxHandle_amr__f_xer_, &BITSTRING_json_, &OsmuxTxHandle_amr__f_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxTxHandle_amr__f_default_coding("RAW");
const XERdescriptor_t       OsmuxTxHandle_amr__q_xer_ = { {"amr_q>\n", "amr_q>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxTxHandle_amr__q_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxTxHandle_amr__q_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle.amr_q", &BITSTRING_ber_, &General__Types::BIT1_raw_, NULL, &OsmuxTxHandle_amr__q_xer_, &BITSTRING_json_, &OsmuxTxHandle_amr__q_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxTxHandle_amr__q_default_coding("RAW");
const XERdescriptor_t       OsmuxTxHandle_seq_xer_ = { {"seq>\n", "seq>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxTxHandle_seq_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxTxHandle_seq_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle.seq", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &OsmuxTxHandle_seq_xer_, &INTEGER_json_, &OsmuxTxHandle_seq_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxTxHandle_seq_default_coding("RAW");
const XERdescriptor_t       OsmuxTxHandle_cid_xer_ = { {"cid>\n", "cid>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxTxHandle_cid_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxTxHandle_cid_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle.cid", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &OsmuxTxHandle_cid_xer_, &INTEGER_json_, &OsmuxTxHandle_cid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxTxHandle_cid_default_coding("RAW");
const XERdescriptor_t       OsmuxTxHandle_amr__ft_xer_ = { {"amr_ft>\n", "amr_ft>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxTxHandle_amr__ft_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxTxHandle_amr__ft_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle.amr_ft", &INTEGER_ber_, &General__Types::INT4b_raw_, &INTEGER_text_, &OsmuxTxHandle_amr__ft_xer_, &INTEGER_json_, &OsmuxTxHandle_amr__ft_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxTxHandle_amr__ft_default_coding("RAW");
const XERdescriptor_t       OsmuxTxHandle_amr__cmr_xer_ = { {"amr_cmr>\n", "amr_cmr>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t OsmuxTxHandle_amr__cmr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t OsmuxTxHandle_amr__cmr_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle.amr_cmr", &INTEGER_ber_, &General__Types::INT4b_raw_, &INTEGER_text_, &OsmuxTxHandle_amr__cmr_xer_, &INTEGER_json_, &OsmuxTxHandle_amr__cmr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmuxTxHandle_amr__cmr_default_coding("RAW");
// No XER for OsmuxTxHandle
const TTCN_Typedescriptor_t OsmuxTxHandle_descr_ = { "@OSMUX_Emulation.OsmuxTxHandle", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
VALUE_ARRAY<OsmuxTxHandle, 16, 0> OSMUX__Emulation__CT_component_TxHandleList;
OsmuxRxHandle const_c__OsmuxemDefaultRxHandle;
const OsmuxRxHandle& c__OsmuxemDefaultRxHandle = const_c__OsmuxemDefaultRxHandle;
// No XER for OsmuxemMode
const TTCN_Typedescriptor_t OsmuxemMode_descr_ = { "@OSMUX_Emulation.OsmuxemMode", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
OsmuxemStats const_c__OsmuxemStatsReset;
const OsmuxemStats& c__OsmuxemStatsReset = const_c__OsmuxemStatsReset;
OsmuxemConfig const_c__OsmuxemDefaultCfg;
const OsmuxemConfig& c__OsmuxemDefaultCfg = const_c__OsmuxemDefaultCfg;
INTEGER const_f__osmuxem__stats__compare__value_tolerance_defval;
const INTEGER& f__osmuxem__stats__compare__value_tolerance_defval = const_f__osmuxem__stats__compare__value_tolerance_defval;
INTEGER const_f__osmuxem__stats__compare_tolerance_defval;
const INTEGER& f__osmuxem__stats__compare_tolerance_defval = const_f__osmuxem__stats__compare_tolerance_defval;
BITSTRING const_f__tx__osmux_marker_defval;
const BITSTRING& f__tx__osmux_marker_defval = const_f__tx__osmux_marker_defval;
BITSTRING const_f__tx__osmux__all__cid_marker_defval;
const BITSTRING& f__tx__osmux__all__cid_marker_defval = const_f__tx__osmux__all__cid_marker_defval;
TTCN_Module module_object("OSMUX_Emulation", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, init_system_port, start_ptc_function, NULL);

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

/* Member functions of C++ classes */

OsmuxemConfig::OsmuxemConfig()
{
}

OsmuxemConfig::OsmuxemConfig(const INTEGER& par_batch__size,
    const INTEGER& par_tx__duration__ms,
    const OPTIONAL< OCTETSTRING >& par_tx__fixed__payload,
    const OPTIONAL< OCTETSTRING >& par_rx__fixed__payload)
  :   field_batch__size(par_batch__size),
  field_tx__duration__ms(par_tx__duration__ms),
  field_tx__fixed__payload(par_tx__fixed__payload),
  field_rx__fixed__payload(par_rx__fixed__payload)
{
}

OsmuxemConfig::OsmuxemConfig(const OsmuxemConfig& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Emulation.OsmuxemConfig.");
if (other_value.batch__size().is_bound()) field_batch__size = other_value.batch__size();
else field_batch__size.clean_up();
if (other_value.tx__duration__ms().is_bound()) field_tx__duration__ms = other_value.tx__duration__ms();
else field_tx__duration__ms.clean_up();
if (other_value.tx__fixed__payload().is_bound()) field_tx__fixed__payload = other_value.tx__fixed__payload();
else field_tx__fixed__payload.clean_up();
if (other_value.rx__fixed__payload().is_bound()) field_rx__fixed__payload = other_value.rx__fixed__payload();
else field_rx__fixed__payload.clean_up();
}

void OsmuxemConfig::clean_up()
{
field_batch__size.clean_up();
field_tx__duration__ms.clean_up();
field_tx__fixed__payload.clean_up();
field_rx__fixed__payload.clean_up();
}

const TTCN_Typedescriptor_t* OsmuxemConfig::get_descriptor() const { return &OsmuxemConfig_descr_; }
OsmuxemConfig& OsmuxemConfig::operator=(const OsmuxemConfig& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Emulation.OsmuxemConfig.");
  if (other_value.batch__size().is_bound()) field_batch__size = other_value.batch__size();
  else field_batch__size.clean_up();
  if (other_value.tx__duration__ms().is_bound()) field_tx__duration__ms = other_value.tx__duration__ms();
  else field_tx__duration__ms.clean_up();
  if (other_value.tx__fixed__payload().is_bound()) field_tx__fixed__payload = other_value.tx__fixed__payload();
  else field_tx__fixed__payload.clean_up();
  if (other_value.rx__fixed__payload().is_bound()) field_rx__fixed__payload = other_value.rx__fixed__payload();
  else field_rx__fixed__payload.clean_up();
}
return *this;
}

boolean OsmuxemConfig::operator==(const OsmuxemConfig& other_value) const
{
return field_batch__size==other_value.field_batch__size
  && field_tx__duration__ms==other_value.field_tx__duration__ms
  && field_tx__fixed__payload==other_value.field_tx__fixed__payload
  && field_rx__fixed__payload==other_value.field_rx__fixed__payload;
}

boolean OsmuxemConfig::is_bound() const
{
return (field_batch__size.is_bound())
  || (field_tx__duration__ms.is_bound())
  || (OPTIONAL_OMIT == field_tx__fixed__payload.get_selection() || field_tx__fixed__payload.is_bound())
  || (OPTIONAL_OMIT == field_rx__fixed__payload.get_selection() || field_rx__fixed__payload.is_bound());
}
boolean OsmuxemConfig::is_value() const
{
return field_batch__size.is_value()
  && field_tx__duration__ms.is_value()
  && (OPTIONAL_OMIT == field_tx__fixed__payload.get_selection() || field_tx__fixed__payload.is_value())
  && (OPTIONAL_OMIT == field_rx__fixed__payload.get_selection() || field_rx__fixed__payload.is_value());
}
int OsmuxemConfig::size_of() const
{
  int ret_val = 2;
  if (field_tx__fixed__payload.ispresent()) ret_val++;
  if (field_rx__fixed__payload.ispresent()) ret_val++;
  return ret_val;
}

void OsmuxemConfig::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ batch_size := ");
field_batch__size.log();
TTCN_Logger::log_event_str(", tx_duration_ms := ");
field_tx__duration__ms.log();
TTCN_Logger::log_event_str(", tx_fixed_payload := ");
field_tx__fixed__payload.log();
TTCN_Logger::log_event_str(", rx_fixed_payload := ");
field_rx__fixed__payload.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxemConfig::set_implicit_omit()
{
if (batch__size().is_bound()) batch__size().set_implicit_omit();
if (tx__duration__ms().is_bound()) tx__duration__ms().set_implicit_omit();
if (!tx__fixed__payload().is_bound()) tx__fixed__payload() = OMIT_VALUE;
else tx__fixed__payload().set_implicit_omit();
if (!rx__fixed__payload().is_bound()) rx__fixed__payload() = OMIT_VALUE;
else rx__fixed__payload().set_implicit_omit();
}

void OsmuxemConfig::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @OSMUX_Emulation.OsmuxemConfig has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) batch__size().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__duration__ms().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tx__fixed__payload().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rx__fixed__payload().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "batch_size")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          batch__size().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tx_duration_ms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__duration__ms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tx_fixed_payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__fixed__payload().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(), "rx_fixed_payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rx__fixed__payload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @OSMUX_Emulation.OsmuxemConfig: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Emulation.OsmuxemConfig");
  }
}

void OsmuxemConfig::encode_text(Text_Buf& text_buf) const
{
field_batch__size.encode_text(text_buf);
field_tx__duration__ms.encode_text(text_buf);
field_tx__fixed__payload.encode_text(text_buf);
field_rx__fixed__payload.encode_text(text_buf);
}

void OsmuxemConfig::decode_text(Text_Buf& text_buf)
{
field_batch__size.decode_text(text_buf);
field_tx__duration__ms.decode_text(text_buf);
field_tx__fixed__payload.decode_text(text_buf);
field_rx__fixed__payload.decode_text(text_buf);
}

struct OsmuxemConfig_template::single_value_struct {
INTEGER_template field_batch__size;
INTEGER_template field_tx__duration__ms;
OCTETSTRING_template field_tx__fixed__payload;
OCTETSTRING_template field_rx__fixed__payload;
};

void OsmuxemConfig_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_batch__size = ANY_VALUE;
single_value->field_tx__duration__ms = ANY_VALUE;
single_value->field_tx__fixed__payload = ANY_OR_OMIT;
single_value->field_rx__fixed__payload = ANY_OR_OMIT;
}
}
}

void OsmuxemConfig_template::copy_value(const OsmuxemConfig& other_value)
{
single_value = new single_value_struct;
if (other_value.batch__size().is_bound()) {
  single_value->field_batch__size = other_value.batch__size();
} else {
  single_value->field_batch__size.clean_up();
}
if (other_value.tx__duration__ms().is_bound()) {
  single_value->field_tx__duration__ms = other_value.tx__duration__ms();
} else {
  single_value->field_tx__duration__ms.clean_up();
}
if (other_value.tx__fixed__payload().is_bound()) {
  if (other_value.tx__fixed__payload().ispresent()) single_value->field_tx__fixed__payload = other_value.tx__fixed__payload()();
  else single_value->field_tx__fixed__payload = OMIT_VALUE;
} else {
  single_value->field_tx__fixed__payload.clean_up();
}
if (other_value.rx__fixed__payload().is_bound()) {
  if (other_value.rx__fixed__payload().ispresent()) single_value->field_rx__fixed__payload = other_value.rx__fixed__payload()();
  else single_value->field_rx__fixed__payload = OMIT_VALUE;
} else {
  single_value->field_rx__fixed__payload.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void OsmuxemConfig_template::copy_template(const OsmuxemConfig_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.batch__size().get_selection()) {
single_value->field_batch__size = other_value.batch__size();
} else {
single_value->field_batch__size.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tx__duration__ms().get_selection()) {
single_value->field_tx__duration__ms = other_value.tx__duration__ms();
} else {
single_value->field_tx__duration__ms.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tx__fixed__payload().get_selection()) {
single_value->field_tx__fixed__payload = other_value.tx__fixed__payload();
} else {
single_value->field_tx__fixed__payload.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rx__fixed__payload().get_selection()) {
single_value->field_rx__fixed__payload = other_value.rx__fixed__payload();
} else {
single_value->field_rx__fixed__payload.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new OsmuxemConfig_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new OsmuxemConfig_template(*other_value.implication_.precondition);
implication_.implied_template = new OsmuxemConfig_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxemConfig.");
break;
}
set_selection(other_value);
}

OsmuxemConfig_template::OsmuxemConfig_template()
{
}

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

OsmuxemConfig_template::OsmuxemConfig_template(const OsmuxemConfig& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean OsmuxemConfig_template::match(const OsmuxemConfig& 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.batch__size().is_bound()) return FALSE;
if(!single_value->field_batch__size.match(other_value.batch__size(), legacy))return FALSE;
if(!other_value.tx__duration__ms().is_bound()) return FALSE;
if(!single_value->field_tx__duration__ms.match(other_value.tx__duration__ms(), legacy))return FALSE;
if(!other_value.tx__fixed__payload().is_bound()) return FALSE;
if((other_value.tx__fixed__payload().ispresent() ? !single_value->field_tx__fixed__payload.match((const OCTETSTRING&)other_value.tx__fixed__payload(), legacy) : !single_value->field_tx__fixed__payload.match_omit(legacy)))return FALSE;
if(!other_value.rx__fixed__payload().is_bound()) return FALSE;
if((other_value.rx__fixed__payload().ispresent() ? !single_value->field_rx__fixed__payload.match((const OCTETSTRING&)other_value.rx__fixed__payload(), legacy) : !single_value->field_rx__fixed__payload.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxemConfig.");
}
return FALSE;
}

boolean OsmuxemConfig_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_batch__size.is_bound()
 || single_value->field_tx__duration__ms.is_bound()
 || (single_value->field_tx__fixed__payload.is_omit() || single_value->field_tx__fixed__payload.is_bound())
 || (single_value->field_rx__fixed__payload.is_omit() || single_value->field_rx__fixed__payload.is_bound());
}

boolean OsmuxemConfig_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_batch__size.is_value()
 && single_value->field_tx__duration__ms.is_value()
 && (single_value->field_tx__fixed__payload.is_omit() || single_value->field_tx__fixed__payload.is_value())
 && (single_value->field_rx__fixed__payload.is_omit() || single_value->field_rx__fixed__payload.is_value());
}

void OsmuxemConfig_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

OsmuxemConfig OsmuxemConfig_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 @OSMUX_Emulation.OsmuxemConfig.");
OsmuxemConfig ret_val;
if (single_value->field_batch__size.is_bound()) {
ret_val.batch__size() = single_value->field_batch__size.valueof();
}
if (single_value->field_tx__duration__ms.is_bound()) {
ret_val.tx__duration__ms() = single_value->field_tx__duration__ms.valueof();
}
if (single_value->field_tx__fixed__payload.is_omit()) ret_val.tx__fixed__payload() = OMIT_VALUE;
else if (single_value->field_tx__fixed__payload.is_bound()) {
ret_val.tx__fixed__payload() = single_value->field_tx__fixed__payload.valueof();
}
if (single_value->field_rx__fixed__payload.is_omit()) ret_val.rx__fixed__payload() = OMIT_VALUE;
else if (single_value->field_rx__fixed__payload.is_bound()) {
ret_val.rx__fixed__payload() = single_value->field_rx__fixed__payload.valueof();
}
return ret_val;
}

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

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

INTEGER_template& OsmuxemConfig_template::batch__size()
{
set_specific();
return single_value->field_batch__size;
}

const INTEGER_template& OsmuxemConfig_template::batch__size() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field batch_size of a non-specific template of type @OSMUX_Emulation.OsmuxemConfig.");
return single_value->field_batch__size;
}

INTEGER_template& OsmuxemConfig_template::tx__duration__ms()
{
set_specific();
return single_value->field_tx__duration__ms;
}

const INTEGER_template& OsmuxemConfig_template::tx__duration__ms() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tx_duration_ms of a non-specific template of type @OSMUX_Emulation.OsmuxemConfig.");
return single_value->field_tx__duration__ms;
}

OCTETSTRING_template& OsmuxemConfig_template::tx__fixed__payload()
{
set_specific();
return single_value->field_tx__fixed__payload;
}

const OCTETSTRING_template& OsmuxemConfig_template::tx__fixed__payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tx_fixed_payload of a non-specific template of type @OSMUX_Emulation.OsmuxemConfig.");
return single_value->field_tx__fixed__payload;
}

OCTETSTRING_template& OsmuxemConfig_template::rx__fixed__payload()
{
set_specific();
return single_value->field_rx__fixed__payload;
}

const OCTETSTRING_template& OsmuxemConfig_template::rx__fixed__payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rx_fixed_payload of a non-specific template of type @OSMUX_Emulation.OsmuxemConfig.");
return single_value->field_rx__fixed__payload;
}

int OsmuxemConfig_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Emulation.OsmuxemConfig which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_tx__fixed__payload.is_present()) ret_val++;
      if (single_value->field_rx__fixed__payload.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 @OSMUX_Emulation.OsmuxemConfig 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 @OSMUX_Emulation.OsmuxemConfig containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Emulation.OsmuxemConfig containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Emulation.OsmuxemConfig containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Emulation.OsmuxemConfig containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Emulation.OsmuxemConfig containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Emulation.OsmuxemConfig containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @OSMUX_Emulation.OsmuxemConfig containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxemConfig.");
  }
  return 0;
}

void OsmuxemConfig_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ batch_size := ");
single_value->field_batch__size.log();
TTCN_Logger::log_event_str(", tx_duration_ms := ");
single_value->field_tx__duration__ms.log();
TTCN_Logger::log_event_str(", tx_fixed_payload := ");
single_value->field_tx__fixed__payload.log();
TTCN_Logger::log_event_str(", rx_fixed_payload := ");
single_value->field_rx__fixed__payload.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void OsmuxemConfig_template::log_match(const OsmuxemConfig& 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_batch__size.match(match_value.batch__size(), legacy)){
TTCN_Logger::log_logmatch_info(".batch_size");
single_value->field_batch__size.log_match(match_value.batch__size(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tx__duration__ms.match(match_value.tx__duration__ms(), legacy)){
TTCN_Logger::log_logmatch_info(".tx_duration_ms");
single_value->field_tx__duration__ms.log_match(match_value.tx__duration__ms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.tx__fixed__payload().ispresent()){
if(!single_value->field_tx__fixed__payload.match(match_value.tx__fixed__payload(), legacy)){
TTCN_Logger::log_logmatch_info(".tx_fixed_payload");
single_value->field_tx__fixed__payload.log_match(match_value.tx__fixed__payload(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tx__fixed__payload.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tx_fixed_payload := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tx__fixed__payload.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.rx__fixed__payload().ispresent()){
if(!single_value->field_rx__fixed__payload.match(match_value.rx__fixed__payload(), legacy)){
TTCN_Logger::log_logmatch_info(".rx_fixed_payload");
single_value->field_rx__fixed__payload.log_match(match_value.rx__fixed__payload(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rx__fixed__payload.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rx_fixed_payload := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rx__fixed__payload.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("{ batch_size := ");
single_value->field_batch__size.log_match(match_value.batch__size(), legacy);
TTCN_Logger::log_event_str(", tx_duration_ms := ");
single_value->field_tx__duration__ms.log_match(match_value.tx__duration__ms(), legacy);
TTCN_Logger::log_event_str(", tx_fixed_payload := ");
if (match_value.tx__fixed__payload().ispresent()) {
single_value->field_tx__fixed__payload.log_match(match_value.tx__fixed__payload(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tx__fixed__payload.log();
if (single_value->field_tx__fixed__payload.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", rx_fixed_payload := ");
if (match_value.rx__fixed__payload().ispresent()) {
single_value->field_rx__fixed__payload.log_match(match_value.rx__fixed__payload(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rx__fixed__payload.log();
if (single_value->field_rx__fixed__payload.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 OsmuxemConfig_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (batch__size().is_bound()) batch__size().set_implicit_omit();
if (tx__duration__ms().is_bound()) tx__duration__ms().set_implicit_omit();
if (!tx__fixed__payload().is_bound()) tx__fixed__payload() = OMIT_VALUE;
else tx__fixed__payload().set_implicit_omit();
if (!rx__fixed__payload().is_bound()) rx__fixed__payload() = OMIT_VALUE;
else rx__fixed__payload().set_implicit_omit();
}

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

void OsmuxemConfig_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_batch__size.decode_text(text_buf);
single_value->field_tx__duration__ms.decode_text(text_buf);
single_value->field_tx__fixed__payload.decode_text(text_buf);
single_value->field_rx__fixed__payload.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new OsmuxemConfig_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 @OSMUX_Emulation.OsmuxemConfig.");
}
}

void OsmuxemConfig_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    OsmuxemConfig_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @OSMUX_Emulation.OsmuxemConfig has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) batch__size().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__duration__ms().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) tx__fixed__payload().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) rx__fixed__payload().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "batch_size")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          batch__size().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tx_duration_ms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__duration__ms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tx_fixed_payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__fixed__payload().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(), "rx_fixed_payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rx__fixed__payload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @OSMUX_Emulation.OsmuxemConfig: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    OsmuxemConfig_template* precondition = new OsmuxemConfig_template;
    precondition->set_param(*param.get_elem(0));
    OsmuxemConfig_template* implied_template = new OsmuxemConfig_template;
    implied_template->set_param(*param.get_elem(1));
    *this = OsmuxemConfig_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Emulation.OsmuxemConfig");
  }
  is_ifpresent = param.get_ifpresent();
}

void OsmuxemConfig_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_batch__size.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemConfig");
single_value->field_tx__duration__ms.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemConfig");
single_value->field_tx__fixed__payload.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemConfig");
single_value->field_rx__fixed__payload.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemConfig");
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 : "@OSMUX_Emulation.OsmuxemConfig");
}

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

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

OsmuxemStats::OsmuxemStats()
{
}

OsmuxemStats::OsmuxemStats(const INTEGER& par_num__pkts__tx,
    const INTEGER& par_bytes__payload__tx,
    const INTEGER& par_num__pkts__rx,
    const INTEGER& par_bytes__payload__rx,
    const INTEGER& par_num__pkts__rx__err__seq,
    const INTEGER& par_num__pkts__rx__err__disabled,
    const INTEGER& par_num__pkts__rx__err__payload)
  :   field_num__pkts__tx(par_num__pkts__tx),
  field_bytes__payload__tx(par_bytes__payload__tx),
  field_num__pkts__rx(par_num__pkts__rx),
  field_bytes__payload__rx(par_bytes__payload__rx),
  field_num__pkts__rx__err__seq(par_num__pkts__rx__err__seq),
  field_num__pkts__rx__err__disabled(par_num__pkts__rx__err__disabled),
  field_num__pkts__rx__err__payload(par_num__pkts__rx__err__payload)
{
}

OsmuxemStats::OsmuxemStats(const OsmuxemStats& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Emulation.OsmuxemStats.");
if (other_value.num__pkts__tx().is_bound()) field_num__pkts__tx = other_value.num__pkts__tx();
else field_num__pkts__tx.clean_up();
if (other_value.bytes__payload__tx().is_bound()) field_bytes__payload__tx = other_value.bytes__payload__tx();
else field_bytes__payload__tx.clean_up();
if (other_value.num__pkts__rx().is_bound()) field_num__pkts__rx = other_value.num__pkts__rx();
else field_num__pkts__rx.clean_up();
if (other_value.bytes__payload__rx().is_bound()) field_bytes__payload__rx = other_value.bytes__payload__rx();
else field_bytes__payload__rx.clean_up();
if (other_value.num__pkts__rx__err__seq().is_bound()) field_num__pkts__rx__err__seq = other_value.num__pkts__rx__err__seq();
else field_num__pkts__rx__err__seq.clean_up();
if (other_value.num__pkts__rx__err__disabled().is_bound()) field_num__pkts__rx__err__disabled = other_value.num__pkts__rx__err__disabled();
else field_num__pkts__rx__err__disabled.clean_up();
if (other_value.num__pkts__rx__err__payload().is_bound()) field_num__pkts__rx__err__payload = other_value.num__pkts__rx__err__payload();
else field_num__pkts__rx__err__payload.clean_up();
}

void OsmuxemStats::clean_up()
{
field_num__pkts__tx.clean_up();
field_bytes__payload__tx.clean_up();
field_num__pkts__rx.clean_up();
field_bytes__payload__rx.clean_up();
field_num__pkts__rx__err__seq.clean_up();
field_num__pkts__rx__err__disabled.clean_up();
field_num__pkts__rx__err__payload.clean_up();
}

const TTCN_Typedescriptor_t* OsmuxemStats::get_descriptor() const { return &OsmuxemStats_descr_; }
OsmuxemStats& OsmuxemStats::operator=(const OsmuxemStats& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Emulation.OsmuxemStats.");
  if (other_value.num__pkts__tx().is_bound()) field_num__pkts__tx = other_value.num__pkts__tx();
  else field_num__pkts__tx.clean_up();
  if (other_value.bytes__payload__tx().is_bound()) field_bytes__payload__tx = other_value.bytes__payload__tx();
  else field_bytes__payload__tx.clean_up();
  if (other_value.num__pkts__rx().is_bound()) field_num__pkts__rx = other_value.num__pkts__rx();
  else field_num__pkts__rx.clean_up();
  if (other_value.bytes__payload__rx().is_bound()) field_bytes__payload__rx = other_value.bytes__payload__rx();
  else field_bytes__payload__rx.clean_up();
  if (other_value.num__pkts__rx__err__seq().is_bound()) field_num__pkts__rx__err__seq = other_value.num__pkts__rx__err__seq();
  else field_num__pkts__rx__err__seq.clean_up();
  if (other_value.num__pkts__rx__err__disabled().is_bound()) field_num__pkts__rx__err__disabled = other_value.num__pkts__rx__err__disabled();
  else field_num__pkts__rx__err__disabled.clean_up();
  if (other_value.num__pkts__rx__err__payload().is_bound()) field_num__pkts__rx__err__payload = other_value.num__pkts__rx__err__payload();
  else field_num__pkts__rx__err__payload.clean_up();
}
return *this;
}

boolean OsmuxemStats::operator==(const OsmuxemStats& other_value) const
{
return field_num__pkts__tx==other_value.field_num__pkts__tx
  && field_bytes__payload__tx==other_value.field_bytes__payload__tx
  && field_num__pkts__rx==other_value.field_num__pkts__rx
  && field_bytes__payload__rx==other_value.field_bytes__payload__rx
  && field_num__pkts__rx__err__seq==other_value.field_num__pkts__rx__err__seq
  && field_num__pkts__rx__err__disabled==other_value.field_num__pkts__rx__err__disabled
  && field_num__pkts__rx__err__payload==other_value.field_num__pkts__rx__err__payload;
}

boolean OsmuxemStats::is_bound() const
{
return (field_num__pkts__tx.is_bound())
  || (field_bytes__payload__tx.is_bound())
  || (field_num__pkts__rx.is_bound())
  || (field_bytes__payload__rx.is_bound())
  || (field_num__pkts__rx__err__seq.is_bound())
  || (field_num__pkts__rx__err__disabled.is_bound())
  || (field_num__pkts__rx__err__payload.is_bound());
}
boolean OsmuxemStats::is_value() const
{
return field_num__pkts__tx.is_value()
  && field_bytes__payload__tx.is_value()
  && field_num__pkts__rx.is_value()
  && field_bytes__payload__rx.is_value()
  && field_num__pkts__rx__err__seq.is_value()
  && field_num__pkts__rx__err__disabled.is_value()
  && field_num__pkts__rx__err__payload.is_value();
}
void OsmuxemStats::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ num_pkts_tx := ");
field_num__pkts__tx.log();
TTCN_Logger::log_event_str(", bytes_payload_tx := ");
field_bytes__payload__tx.log();
TTCN_Logger::log_event_str(", num_pkts_rx := ");
field_num__pkts__rx.log();
TTCN_Logger::log_event_str(", bytes_payload_rx := ");
field_bytes__payload__rx.log();
TTCN_Logger::log_event_str(", num_pkts_rx_err_seq := ");
field_num__pkts__rx__err__seq.log();
TTCN_Logger::log_event_str(", num_pkts_rx_err_disabled := ");
field_num__pkts__rx__err__disabled.log();
TTCN_Logger::log_event_str(", num_pkts_rx_err_payload := ");
field_num__pkts__rx__err__payload.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxemStats::set_implicit_omit()
{
if (num__pkts__tx().is_bound()) num__pkts__tx().set_implicit_omit();
if (bytes__payload__tx().is_bound()) bytes__payload__tx().set_implicit_omit();
if (num__pkts__rx().is_bound()) num__pkts__rx().set_implicit_omit();
if (bytes__payload__rx().is_bound()) bytes__payload__rx().set_implicit_omit();
if (num__pkts__rx__err__seq().is_bound()) num__pkts__rx__err__seq().set_implicit_omit();
if (num__pkts__rx__err__disabled().is_bound()) num__pkts__rx__err__disabled().set_implicit_omit();
if (num__pkts__rx__err__payload().is_bound()) num__pkts__rx__err__payload().set_implicit_omit();
}

void OsmuxemStats::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @OSMUX_Emulation.OsmuxemStats has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) num__pkts__tx().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__tx().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__rx().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__seq().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__disabled().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__payload().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_tx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__tx().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(), "bytes_payload_tx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bytes__payload__tx().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx().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(), "bytes_payload_rx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bytes__payload__rx().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx_err_seq")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx__err__seq().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx_err_disabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx__err__disabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx_err_payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx__err__payload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @OSMUX_Emulation.OsmuxemStats: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Emulation.OsmuxemStats");
  }
}

void OsmuxemStats::encode_text(Text_Buf& text_buf) const
{
field_num__pkts__tx.encode_text(text_buf);
field_bytes__payload__tx.encode_text(text_buf);
field_num__pkts__rx.encode_text(text_buf);
field_bytes__payload__rx.encode_text(text_buf);
field_num__pkts__rx__err__seq.encode_text(text_buf);
field_num__pkts__rx__err__disabled.encode_text(text_buf);
field_num__pkts__rx__err__payload.encode_text(text_buf);
}

void OsmuxemStats::decode_text(Text_Buf& text_buf)
{
field_num__pkts__tx.decode_text(text_buf);
field_bytes__payload__tx.decode_text(text_buf);
field_num__pkts__rx.decode_text(text_buf);
field_bytes__payload__rx.decode_text(text_buf);
field_num__pkts__rx__err__seq.decode_text(text_buf);
field_num__pkts__rx__err__disabled.decode_text(text_buf);
field_num__pkts__rx__err__payload.decode_text(text_buf);
}

struct OsmuxemStats_template::single_value_struct {
INTEGER_template field_num__pkts__tx;
INTEGER_template field_bytes__payload__tx;
INTEGER_template field_num__pkts__rx;
INTEGER_template field_bytes__payload__rx;
INTEGER_template field_num__pkts__rx__err__seq;
INTEGER_template field_num__pkts__rx__err__disabled;
INTEGER_template field_num__pkts__rx__err__payload;
};

void OsmuxemStats_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_num__pkts__tx = ANY_VALUE;
single_value->field_bytes__payload__tx = ANY_VALUE;
single_value->field_num__pkts__rx = ANY_VALUE;
single_value->field_bytes__payload__rx = ANY_VALUE;
single_value->field_num__pkts__rx__err__seq = ANY_VALUE;
single_value->field_num__pkts__rx__err__disabled = ANY_VALUE;
single_value->field_num__pkts__rx__err__payload = ANY_VALUE;
}
}
}

void OsmuxemStats_template::copy_value(const OsmuxemStats& other_value)
{
single_value = new single_value_struct;
if (other_value.num__pkts__tx().is_bound()) {
  single_value->field_num__pkts__tx = other_value.num__pkts__tx();
} else {
  single_value->field_num__pkts__tx.clean_up();
}
if (other_value.bytes__payload__tx().is_bound()) {
  single_value->field_bytes__payload__tx = other_value.bytes__payload__tx();
} else {
  single_value->field_bytes__payload__tx.clean_up();
}
if (other_value.num__pkts__rx().is_bound()) {
  single_value->field_num__pkts__rx = other_value.num__pkts__rx();
} else {
  single_value->field_num__pkts__rx.clean_up();
}
if (other_value.bytes__payload__rx().is_bound()) {
  single_value->field_bytes__payload__rx = other_value.bytes__payload__rx();
} else {
  single_value->field_bytes__payload__rx.clean_up();
}
if (other_value.num__pkts__rx__err__seq().is_bound()) {
  single_value->field_num__pkts__rx__err__seq = other_value.num__pkts__rx__err__seq();
} else {
  single_value->field_num__pkts__rx__err__seq.clean_up();
}
if (other_value.num__pkts__rx__err__disabled().is_bound()) {
  single_value->field_num__pkts__rx__err__disabled = other_value.num__pkts__rx__err__disabled();
} else {
  single_value->field_num__pkts__rx__err__disabled.clean_up();
}
if (other_value.num__pkts__rx__err__payload().is_bound()) {
  single_value->field_num__pkts__rx__err__payload = other_value.num__pkts__rx__err__payload();
} else {
  single_value->field_num__pkts__rx__err__payload.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void OsmuxemStats_template::copy_template(const OsmuxemStats_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__tx().get_selection()) {
single_value->field_num__pkts__tx = other_value.num__pkts__tx();
} else {
single_value->field_num__pkts__tx.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bytes__payload__tx().get_selection()) {
single_value->field_bytes__payload__tx = other_value.bytes__payload__tx();
} else {
single_value->field_bytes__payload__tx.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx().get_selection()) {
single_value->field_num__pkts__rx = other_value.num__pkts__rx();
} else {
single_value->field_num__pkts__rx.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bytes__payload__rx().get_selection()) {
single_value->field_bytes__payload__rx = other_value.bytes__payload__rx();
} else {
single_value->field_bytes__payload__rx.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__seq().get_selection()) {
single_value->field_num__pkts__rx__err__seq = other_value.num__pkts__rx__err__seq();
} else {
single_value->field_num__pkts__rx__err__seq.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__disabled().get_selection()) {
single_value->field_num__pkts__rx__err__disabled = other_value.num__pkts__rx__err__disabled();
} else {
single_value->field_num__pkts__rx__err__disabled.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__pkts__rx__err__payload().get_selection()) {
single_value->field_num__pkts__rx__err__payload = other_value.num__pkts__rx__err__payload();
} else {
single_value->field_num__pkts__rx__err__payload.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new OsmuxemStats_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new OsmuxemStats_template(*other_value.implication_.precondition);
implication_.implied_template = new OsmuxemStats_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxemStats.");
break;
}
set_selection(other_value);
}

OsmuxemStats_template::OsmuxemStats_template()
{
}

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

OsmuxemStats_template::OsmuxemStats_template(const OsmuxemStats& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean OsmuxemStats_template::match(const OsmuxemStats& 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.num__pkts__tx().is_bound()) return FALSE;
if(!single_value->field_num__pkts__tx.match(other_value.num__pkts__tx(), legacy))return FALSE;
if(!other_value.bytes__payload__tx().is_bound()) return FALSE;
if(!single_value->field_bytes__payload__tx.match(other_value.bytes__payload__tx(), legacy))return FALSE;
if(!other_value.num__pkts__rx().is_bound()) return FALSE;
if(!single_value->field_num__pkts__rx.match(other_value.num__pkts__rx(), legacy))return FALSE;
if(!other_value.bytes__payload__rx().is_bound()) return FALSE;
if(!single_value->field_bytes__payload__rx.match(other_value.bytes__payload__rx(), legacy))return FALSE;
if(!other_value.num__pkts__rx__err__seq().is_bound()) return FALSE;
if(!single_value->field_num__pkts__rx__err__seq.match(other_value.num__pkts__rx__err__seq(), legacy))return FALSE;
if(!other_value.num__pkts__rx__err__disabled().is_bound()) return FALSE;
if(!single_value->field_num__pkts__rx__err__disabled.match(other_value.num__pkts__rx__err__disabled(), legacy))return FALSE;
if(!other_value.num__pkts__rx__err__payload().is_bound()) return FALSE;
if(!single_value->field_num__pkts__rx__err__payload.match(other_value.num__pkts__rx__err__payload(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxemStats.");
}
return FALSE;
}

boolean OsmuxemStats_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_num__pkts__tx.is_bound()
 || single_value->field_bytes__payload__tx.is_bound()
 || single_value->field_num__pkts__rx.is_bound()
 || single_value->field_bytes__payload__rx.is_bound()
 || single_value->field_num__pkts__rx__err__seq.is_bound()
 || single_value->field_num__pkts__rx__err__disabled.is_bound()
 || single_value->field_num__pkts__rx__err__payload.is_bound();
}

boolean OsmuxemStats_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_num__pkts__tx.is_value()
 && single_value->field_bytes__payload__tx.is_value()
 && single_value->field_num__pkts__rx.is_value()
 && single_value->field_bytes__payload__rx.is_value()
 && single_value->field_num__pkts__rx__err__seq.is_value()
 && single_value->field_num__pkts__rx__err__disabled.is_value()
 && single_value->field_num__pkts__rx__err__payload.is_value();
}

void OsmuxemStats_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

OsmuxemStats OsmuxemStats_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 @OSMUX_Emulation.OsmuxemStats.");
OsmuxemStats ret_val;
if (single_value->field_num__pkts__tx.is_bound()) {
ret_val.num__pkts__tx() = single_value->field_num__pkts__tx.valueof();
}
if (single_value->field_bytes__payload__tx.is_bound()) {
ret_val.bytes__payload__tx() = single_value->field_bytes__payload__tx.valueof();
}
if (single_value->field_num__pkts__rx.is_bound()) {
ret_val.num__pkts__rx() = single_value->field_num__pkts__rx.valueof();
}
if (single_value->field_bytes__payload__rx.is_bound()) {
ret_val.bytes__payload__rx() = single_value->field_bytes__payload__rx.valueof();
}
if (single_value->field_num__pkts__rx__err__seq.is_bound()) {
ret_val.num__pkts__rx__err__seq() = single_value->field_num__pkts__rx__err__seq.valueof();
}
if (single_value->field_num__pkts__rx__err__disabled.is_bound()) {
ret_val.num__pkts__rx__err__disabled() = single_value->field_num__pkts__rx__err__disabled.valueof();
}
if (single_value->field_num__pkts__rx__err__payload.is_bound()) {
ret_val.num__pkts__rx__err__payload() = single_value->field_num__pkts__rx__err__payload.valueof();
}
return ret_val;
}

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

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

INTEGER_template& OsmuxemStats_template::num__pkts__tx()
{
set_specific();
return single_value->field_num__pkts__tx;
}

const INTEGER_template& OsmuxemStats_template::num__pkts__tx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_pkts_tx of a non-specific template of type @OSMUX_Emulation.OsmuxemStats.");
return single_value->field_num__pkts__tx;
}

INTEGER_template& OsmuxemStats_template::bytes__payload__tx()
{
set_specific();
return single_value->field_bytes__payload__tx;
}

const INTEGER_template& OsmuxemStats_template::bytes__payload__tx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bytes_payload_tx of a non-specific template of type @OSMUX_Emulation.OsmuxemStats.");
return single_value->field_bytes__payload__tx;
}

INTEGER_template& OsmuxemStats_template::num__pkts__rx()
{
set_specific();
return single_value->field_num__pkts__rx;
}

const INTEGER_template& OsmuxemStats_template::num__pkts__rx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_pkts_rx of a non-specific template of type @OSMUX_Emulation.OsmuxemStats.");
return single_value->field_num__pkts__rx;
}

INTEGER_template& OsmuxemStats_template::bytes__payload__rx()
{
set_specific();
return single_value->field_bytes__payload__rx;
}

const INTEGER_template& OsmuxemStats_template::bytes__payload__rx() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bytes_payload_rx of a non-specific template of type @OSMUX_Emulation.OsmuxemStats.");
return single_value->field_bytes__payload__rx;
}

INTEGER_template& OsmuxemStats_template::num__pkts__rx__err__seq()
{
set_specific();
return single_value->field_num__pkts__rx__err__seq;
}

const INTEGER_template& OsmuxemStats_template::num__pkts__rx__err__seq() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_pkts_rx_err_seq of a non-specific template of type @OSMUX_Emulation.OsmuxemStats.");
return single_value->field_num__pkts__rx__err__seq;
}

INTEGER_template& OsmuxemStats_template::num__pkts__rx__err__disabled()
{
set_specific();
return single_value->field_num__pkts__rx__err__disabled;
}

const INTEGER_template& OsmuxemStats_template::num__pkts__rx__err__disabled() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_pkts_rx_err_disabled of a non-specific template of type @OSMUX_Emulation.OsmuxemStats.");
return single_value->field_num__pkts__rx__err__disabled;
}

INTEGER_template& OsmuxemStats_template::num__pkts__rx__err__payload()
{
set_specific();
return single_value->field_num__pkts__rx__err__payload;
}

const INTEGER_template& OsmuxemStats_template::num__pkts__rx__err__payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_pkts_rx_err_payload of a non-specific template of type @OSMUX_Emulation.OsmuxemStats.");
return single_value->field_num__pkts__rx__err__payload;
}

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

void OsmuxemStats_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ num_pkts_tx := ");
single_value->field_num__pkts__tx.log();
TTCN_Logger::log_event_str(", bytes_payload_tx := ");
single_value->field_bytes__payload__tx.log();
TTCN_Logger::log_event_str(", num_pkts_rx := ");
single_value->field_num__pkts__rx.log();
TTCN_Logger::log_event_str(", bytes_payload_rx := ");
single_value->field_bytes__payload__rx.log();
TTCN_Logger::log_event_str(", num_pkts_rx_err_seq := ");
single_value->field_num__pkts__rx__err__seq.log();
TTCN_Logger::log_event_str(", num_pkts_rx_err_disabled := ");
single_value->field_num__pkts__rx__err__disabled.log();
TTCN_Logger::log_event_str(", num_pkts_rx_err_payload := ");
single_value->field_num__pkts__rx__err__payload.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void OsmuxemStats_template::log_match(const OsmuxemStats& 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_num__pkts__tx.match(match_value.num__pkts__tx(), legacy)){
TTCN_Logger::log_logmatch_info(".num_pkts_tx");
single_value->field_num__pkts__tx.log_match(match_value.num__pkts__tx(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bytes__payload__tx.match(match_value.bytes__payload__tx(), legacy)){
TTCN_Logger::log_logmatch_info(".bytes_payload_tx");
single_value->field_bytes__payload__tx.log_match(match_value.bytes__payload__tx(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__pkts__rx.match(match_value.num__pkts__rx(), legacy)){
TTCN_Logger::log_logmatch_info(".num_pkts_rx");
single_value->field_num__pkts__rx.log_match(match_value.num__pkts__rx(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bytes__payload__rx.match(match_value.bytes__payload__rx(), legacy)){
TTCN_Logger::log_logmatch_info(".bytes_payload_rx");
single_value->field_bytes__payload__rx.log_match(match_value.bytes__payload__rx(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__pkts__rx__err__seq.match(match_value.num__pkts__rx__err__seq(), legacy)){
TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_seq");
single_value->field_num__pkts__rx__err__seq.log_match(match_value.num__pkts__rx__err__seq(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__pkts__rx__err__disabled.match(match_value.num__pkts__rx__err__disabled(), legacy)){
TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_disabled");
single_value->field_num__pkts__rx__err__disabled.log_match(match_value.num__pkts__rx__err__disabled(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__pkts__rx__err__payload.match(match_value.num__pkts__rx__err__payload(), legacy)){
TTCN_Logger::log_logmatch_info(".num_pkts_rx_err_payload");
single_value->field_num__pkts__rx__err__payload.log_match(match_value.num__pkts__rx__err__payload(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ num_pkts_tx := ");
single_value->field_num__pkts__tx.log_match(match_value.num__pkts__tx(), legacy);
TTCN_Logger::log_event_str(", bytes_payload_tx := ");
single_value->field_bytes__payload__tx.log_match(match_value.bytes__payload__tx(), legacy);
TTCN_Logger::log_event_str(", num_pkts_rx := ");
single_value->field_num__pkts__rx.log_match(match_value.num__pkts__rx(), legacy);
TTCN_Logger::log_event_str(", bytes_payload_rx := ");
single_value->field_bytes__payload__rx.log_match(match_value.bytes__payload__rx(), legacy);
TTCN_Logger::log_event_str(", num_pkts_rx_err_seq := ");
single_value->field_num__pkts__rx__err__seq.log_match(match_value.num__pkts__rx__err__seq(), legacy);
TTCN_Logger::log_event_str(", num_pkts_rx_err_disabled := ");
single_value->field_num__pkts__rx__err__disabled.log_match(match_value.num__pkts__rx__err__disabled(), legacy);
TTCN_Logger::log_event_str(", num_pkts_rx_err_payload := ");
single_value->field_num__pkts__rx__err__payload.log_match(match_value.num__pkts__rx__err__payload(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void OsmuxemStats_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (num__pkts__tx().is_bound()) num__pkts__tx().set_implicit_omit();
if (bytes__payload__tx().is_bound()) bytes__payload__tx().set_implicit_omit();
if (num__pkts__rx().is_bound()) num__pkts__rx().set_implicit_omit();
if (bytes__payload__rx().is_bound()) bytes__payload__rx().set_implicit_omit();
if (num__pkts__rx__err__seq().is_bound()) num__pkts__rx__err__seq().set_implicit_omit();
if (num__pkts__rx__err__disabled().is_bound()) num__pkts__rx__err__disabled().set_implicit_omit();
if (num__pkts__rx__err__payload().is_bound()) num__pkts__rx__err__payload().set_implicit_omit();
}

void OsmuxemStats_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_num__pkts__tx.encode_text(text_buf);
single_value->field_bytes__payload__tx.encode_text(text_buf);
single_value->field_num__pkts__rx.encode_text(text_buf);
single_value->field_bytes__payload__rx.encode_text(text_buf);
single_value->field_num__pkts__rx__err__seq.encode_text(text_buf);
single_value->field_num__pkts__rx__err__disabled.encode_text(text_buf);
single_value->field_num__pkts__rx__err__payload.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxemStats.");
}
}

void OsmuxemStats_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_num__pkts__tx.decode_text(text_buf);
single_value->field_bytes__payload__tx.decode_text(text_buf);
single_value->field_num__pkts__rx.decode_text(text_buf);
single_value->field_bytes__payload__rx.decode_text(text_buf);
single_value->field_num__pkts__rx__err__seq.decode_text(text_buf);
single_value->field_num__pkts__rx__err__disabled.decode_text(text_buf);
single_value->field_num__pkts__rx__err__payload.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new OsmuxemStats_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 @OSMUX_Emulation.OsmuxemStats.");
}
}

void OsmuxemStats_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    OsmuxemStats_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @OSMUX_Emulation.OsmuxemStats has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) num__pkts__tx().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__tx().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bytes__payload__rx().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__seq().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__disabled().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) num__pkts__rx__err__payload().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_tx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__tx().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(), "bytes_payload_tx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bytes__payload__tx().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx().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(), "bytes_payload_rx")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bytes__payload__rx().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx_err_seq")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx__err__seq().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx_err_disabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx__err__disabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_pkts_rx_err_payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__pkts__rx__err__payload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @OSMUX_Emulation.OsmuxemStats: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    OsmuxemStats_template* precondition = new OsmuxemStats_template;
    precondition->set_param(*param.get_elem(0));
    OsmuxemStats_template* implied_template = new OsmuxemStats_template;
    implied_template->set_param(*param.get_elem(1));
    *this = OsmuxemStats_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Emulation.OsmuxemStats");
  }
  is_ifpresent = param.get_ifpresent();
}

void OsmuxemStats_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_num__pkts__tx.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemStats");
single_value->field_bytes__payload__tx.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemStats");
single_value->field_num__pkts__rx.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemStats");
single_value->field_bytes__payload__rx.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemStats");
single_value->field_num__pkts__rx__err__seq.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemStats");
single_value->field_num__pkts__rx__err__disabled.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemStats");
single_value->field_num__pkts__rx__err__payload.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxemStats");
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 : "@OSMUX_Emulation.OsmuxemStats");
}

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

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

OsmuxRxHandle::OsmuxRxHandle()
{
}

OsmuxRxHandle::OsmuxRxHandle(const INTEGER& par_cid,
    const BOOLEAN& par_first__seq__seen,
    const INTEGER& par_last__seq__ack)
  :   field_cid(par_cid),
  field_first__seq__seen(par_first__seq__seen),
  field_last__seq__ack(par_last__seq__ack)
{
}

OsmuxRxHandle::OsmuxRxHandle(const OsmuxRxHandle& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Emulation.OsmuxRxHandle.");
if (other_value.cid().is_bound()) field_cid = other_value.cid();
else field_cid.clean_up();
if (other_value.first__seq__seen().is_bound()) field_first__seq__seen = other_value.first__seq__seen();
else field_first__seq__seen.clean_up();
if (other_value.last__seq__ack().is_bound()) field_last__seq__ack = other_value.last__seq__ack();
else field_last__seq__ack.clean_up();
}

void OsmuxRxHandle::clean_up()
{
field_cid.clean_up();
field_first__seq__seen.clean_up();
field_last__seq__ack.clean_up();
}

const TTCN_Typedescriptor_t* OsmuxRxHandle::get_descriptor() const { return &OsmuxRxHandle_descr_; }
OsmuxRxHandle& OsmuxRxHandle::operator=(const OsmuxRxHandle& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Emulation.OsmuxRxHandle.");
  if (other_value.cid().is_bound()) field_cid = other_value.cid();
  else field_cid.clean_up();
  if (other_value.first__seq__seen().is_bound()) field_first__seq__seen = other_value.first__seq__seen();
  else field_first__seq__seen.clean_up();
  if (other_value.last__seq__ack().is_bound()) field_last__seq__ack = other_value.last__seq__ack();
  else field_last__seq__ack.clean_up();
}
return *this;
}

boolean OsmuxRxHandle::operator==(const OsmuxRxHandle& other_value) const
{
return field_cid==other_value.field_cid
  && field_first__seq__seen==other_value.field_first__seq__seen
  && field_last__seq__ack==other_value.field_last__seq__ack;
}

boolean OsmuxRxHandle::is_bound() const
{
return (field_cid.is_bound())
  || (field_first__seq__seen.is_bound())
  || (field_last__seq__ack.is_bound());
}
boolean OsmuxRxHandle::is_value() const
{
return field_cid.is_value()
  && field_first__seq__seen.is_value()
  && field_last__seq__ack.is_value();
}
void OsmuxRxHandle::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cid := ");
field_cid.log();
TTCN_Logger::log_event_str(", first_seq_seen := ");
field_first__seq__seen.log();
TTCN_Logger::log_event_str(", last_seq_ack := ");
field_last__seq__ack.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxRxHandle::set_implicit_omit()
{
if (cid().is_bound()) cid().set_implicit_omit();
if (first__seq__seen().is_bound()) first__seq__seen().set_implicit_omit();
if (last__seq__ack().is_bound()) last__seq__ack().set_implicit_omit();
}

void OsmuxRxHandle::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @OSMUX_Emulation.OsmuxRxHandle has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cid().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) first__seq__seen().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) last__seq__ack().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "first_seq_seen")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          first__seq__seen().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(), "last_seq_ack")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          last__seq__ack().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 @OSMUX_Emulation.OsmuxRxHandle: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Emulation.OsmuxRxHandle");
  }
}

void OsmuxRxHandle::encode_text(Text_Buf& text_buf) const
{
field_cid.encode_text(text_buf);
field_first__seq__seen.encode_text(text_buf);
field_last__seq__ack.encode_text(text_buf);
}

void OsmuxRxHandle::decode_text(Text_Buf& text_buf)
{
field_cid.decode_text(text_buf);
field_first__seq__seen.decode_text(text_buf);
field_last__seq__ack.decode_text(text_buf);
}

struct OsmuxRxHandle_template::single_value_struct {
INTEGER_template field_cid;
BOOLEAN_template field_first__seq__seen;
INTEGER_template field_last__seq__ack;
};

void OsmuxRxHandle_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_cid = ANY_VALUE;
single_value->field_first__seq__seen = ANY_VALUE;
single_value->field_last__seq__ack = ANY_VALUE;
}
}
}

void OsmuxRxHandle_template::copy_value(const OsmuxRxHandle& other_value)
{
single_value = new single_value_struct;
if (other_value.cid().is_bound()) {
  single_value->field_cid = other_value.cid();
} else {
  single_value->field_cid.clean_up();
}
if (other_value.first__seq__seen().is_bound()) {
  single_value->field_first__seq__seen = other_value.first__seq__seen();
} else {
  single_value->field_first__seq__seen.clean_up();
}
if (other_value.last__seq__ack().is_bound()) {
  single_value->field_last__seq__ack = other_value.last__seq__ack();
} else {
  single_value->field_last__seq__ack.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void OsmuxRxHandle_template::copy_template(const OsmuxRxHandle_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cid().get_selection()) {
single_value->field_cid = other_value.cid();
} else {
single_value->field_cid.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.first__seq__seen().get_selection()) {
single_value->field_first__seq__seen = other_value.first__seq__seen();
} else {
single_value->field_first__seq__seen.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.last__seq__ack().get_selection()) {
single_value->field_last__seq__ack = other_value.last__seq__ack();
} else {
single_value->field_last__seq__ack.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new OsmuxRxHandle_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new OsmuxRxHandle_template(*other_value.implication_.precondition);
implication_.implied_template = new OsmuxRxHandle_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxRxHandle.");
break;
}
set_selection(other_value);
}

OsmuxRxHandle_template::OsmuxRxHandle_template()
{
}

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

OsmuxRxHandle_template::OsmuxRxHandle_template(const OsmuxRxHandle& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

boolean OsmuxRxHandle_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cid.is_bound()
 || single_value->field_first__seq__seen.is_bound()
 || single_value->field_last__seq__ack.is_bound();
}

boolean OsmuxRxHandle_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cid.is_value()
 && single_value->field_first__seq__seen.is_value()
 && single_value->field_last__seq__ack.is_value();
}

void OsmuxRxHandle_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

OsmuxRxHandle OsmuxRxHandle_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 @OSMUX_Emulation.OsmuxRxHandle.");
OsmuxRxHandle ret_val;
if (single_value->field_cid.is_bound()) {
ret_val.cid() = single_value->field_cid.valueof();
}
if (single_value->field_first__seq__seen.is_bound()) {
ret_val.first__seq__seen() = single_value->field_first__seq__seen.valueof();
}
if (single_value->field_last__seq__ack.is_bound()) {
ret_val.last__seq__ack() = single_value->field_last__seq__ack.valueof();
}
return ret_val;
}

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

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

INTEGER_template& OsmuxRxHandle_template::cid()
{
set_specific();
return single_value->field_cid;
}

const INTEGER_template& OsmuxRxHandle_template::cid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cid of a non-specific template of type @OSMUX_Emulation.OsmuxRxHandle.");
return single_value->field_cid;
}

BOOLEAN_template& OsmuxRxHandle_template::first__seq__seen()
{
set_specific();
return single_value->field_first__seq__seen;
}

const BOOLEAN_template& OsmuxRxHandle_template::first__seq__seen() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field first_seq_seen of a non-specific template of type @OSMUX_Emulation.OsmuxRxHandle.");
return single_value->field_first__seq__seen;
}

INTEGER_template& OsmuxRxHandle_template::last__seq__ack()
{
set_specific();
return single_value->field_last__seq__ack;
}

const INTEGER_template& OsmuxRxHandle_template::last__seq__ack() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field last_seq_ack of a non-specific template of type @OSMUX_Emulation.OsmuxRxHandle.");
return single_value->field_last__seq__ack;
}

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

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

void OsmuxRxHandle_template::log_match(const OsmuxRxHandle& 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_cid.match(match_value.cid(), legacy)){
TTCN_Logger::log_logmatch_info(".cid");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_first__seq__seen.match(match_value.first__seq__seen(), legacy)){
TTCN_Logger::log_logmatch_info(".first_seq_seen");
single_value->field_first__seq__seen.log_match(match_value.first__seq__seen(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_last__seq__ack.match(match_value.last__seq__ack(), legacy)){
TTCN_Logger::log_logmatch_info(".last_seq_ack");
single_value->field_last__seq__ack.log_match(match_value.last__seq__ack(), 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("{ cid := ");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::log_event_str(", first_seq_seen := ");
single_value->field_first__seq__seen.log_match(match_value.first__seq__seen(), legacy);
TTCN_Logger::log_event_str(", last_seq_ack := ");
single_value->field_last__seq__ack.log_match(match_value.last__seq__ack(), 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 OsmuxRxHandle_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cid().is_bound()) cid().set_implicit_omit();
if (first__seq__seen().is_bound()) first__seq__seen().set_implicit_omit();
if (last__seq__ack().is_bound()) last__seq__ack().set_implicit_omit();
}

void OsmuxRxHandle_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cid.encode_text(text_buf);
single_value->field_first__seq__seen.encode_text(text_buf);
single_value->field_last__seq__ack.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 @OSMUX_Emulation.OsmuxRxHandle.");
}
}

void OsmuxRxHandle_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_cid.decode_text(text_buf);
single_value->field_first__seq__seen.decode_text(text_buf);
single_value->field_last__seq__ack.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 OsmuxRxHandle_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 @OSMUX_Emulation.OsmuxRxHandle.");
}
}

void OsmuxRxHandle_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    OsmuxRxHandle_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @OSMUX_Emulation.OsmuxRxHandle has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cid().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) first__seq__seen().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) last__seq__ack().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "first_seq_seen")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          first__seq__seen().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(), "last_seq_ack")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          last__seq__ack().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 @OSMUX_Emulation.OsmuxRxHandle: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    OsmuxRxHandle_template* precondition = new OsmuxRxHandle_template;
    precondition->set_param(*param.get_elem(0));
    OsmuxRxHandle_template* implied_template = new OsmuxRxHandle_template;
    implied_template->set_param(*param.get_elem(1));
    *this = OsmuxRxHandle_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Emulation.OsmuxRxHandle");
  }
  is_ifpresent = param.get_ifpresent();
}

void OsmuxRxHandle_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_cid.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxRxHandle");
single_value->field_first__seq__seen.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxRxHandle");
single_value->field_last__seq__ack.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxRxHandle");
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 : "@OSMUX_Emulation.OsmuxRxHandle");
}

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

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

RxHandleTableRec::RxHandleTableRec()
{
}

RxHandleTableRec::RxHandleTableRec(const INTEGER& par_cid,
    const OsmuxRxHandle& par_vc__conn)
  :   field_cid(par_cid),
  field_vc__conn(par_vc__conn)
{
}

RxHandleTableRec::RxHandleTableRec(const RxHandleTableRec& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Emulation.RxHandleTableRec.");
if (other_value.cid().is_bound()) field_cid = other_value.cid();
else field_cid.clean_up();
if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
else field_vc__conn.clean_up();
}

void RxHandleTableRec::clean_up()
{
field_cid.clean_up();
field_vc__conn.clean_up();
}

const TTCN_Typedescriptor_t* RxHandleTableRec::get_descriptor() const { return &RxHandleTableRec_descr_; }
RxHandleTableRec& RxHandleTableRec::operator=(const RxHandleTableRec& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Emulation.RxHandleTableRec.");
  if (other_value.cid().is_bound()) field_cid = other_value.cid();
  else field_cid.clean_up();
  if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
  else field_vc__conn.clean_up();
}
return *this;
}

boolean RxHandleTableRec::operator==(const RxHandleTableRec& other_value) const
{
return field_cid==other_value.field_cid
  && field_vc__conn==other_value.field_vc__conn;
}

boolean RxHandleTableRec::is_bound() const
{
return (field_cid.is_bound())
  || (field_vc__conn.is_bound());
}
boolean RxHandleTableRec::is_value() const
{
return field_cid.is_value()
  && field_vc__conn.is_value();
}
void RxHandleTableRec::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cid := ");
field_cid.log();
TTCN_Logger::log_event_str(", vc_conn := ");
field_vc__conn.log();
TTCN_Logger::log_event_str(" }");
}

void RxHandleTableRec::set_implicit_omit()
{
if (cid().is_bound()) cid().set_implicit_omit();
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
}

void RxHandleTableRec::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 @OSMUX_Emulation.RxHandleTableRec 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) cid().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) vc__conn().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(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "vc_conn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vc__conn().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 @OSMUX_Emulation.RxHandleTableRec: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Emulation.RxHandleTableRec");
  }
}

void RxHandleTableRec::encode_text(Text_Buf& text_buf) const
{
field_cid.encode_text(text_buf);
field_vc__conn.encode_text(text_buf);
}

void RxHandleTableRec::decode_text(Text_Buf& text_buf)
{
field_cid.decode_text(text_buf);
field_vc__conn.decode_text(text_buf);
}

struct RxHandleTableRec_template::single_value_struct {
INTEGER_template field_cid;
OsmuxRxHandle_template field_vc__conn;
};

void RxHandleTableRec_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_cid = ANY_VALUE;
single_value->field_vc__conn = ANY_VALUE;
}
}
}

void RxHandleTableRec_template::copy_value(const RxHandleTableRec& other_value)
{
single_value = new single_value_struct;
if (other_value.cid().is_bound()) {
  single_value->field_cid = other_value.cid();
} else {
  single_value->field_cid.clean_up();
}
if (other_value.vc__conn().is_bound()) {
  single_value->field_vc__conn = other_value.vc__conn();
} else {
  single_value->field_vc__conn.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RxHandleTableRec_template::copy_template(const RxHandleTableRec_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cid().get_selection()) {
single_value->field_cid = other_value.cid();
} else {
single_value->field_cid.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.vc__conn().get_selection()) {
single_value->field_vc__conn = other_value.vc__conn();
} else {
single_value->field_vc__conn.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RxHandleTableRec_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RxHandleTableRec_template(*other_value.implication_.precondition);
implication_.implied_template = new RxHandleTableRec_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @OSMUX_Emulation.RxHandleTableRec.");
break;
}
set_selection(other_value);
}

RxHandleTableRec_template::RxHandleTableRec_template()
{
}

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

RxHandleTableRec_template::RxHandleTableRec_template(const RxHandleTableRec& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

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

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

boolean RxHandleTableRec_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cid.is_value()
 && single_value->field_vc__conn.is_value();
}

void RxHandleTableRec_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RxHandleTableRec RxHandleTableRec_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 @OSMUX_Emulation.RxHandleTableRec.");
RxHandleTableRec ret_val;
if (single_value->field_cid.is_bound()) {
ret_val.cid() = single_value->field_cid.valueof();
}
if (single_value->field_vc__conn.is_bound()) {
ret_val.vc__conn() = single_value->field_vc__conn.valueof();
}
return ret_val;
}

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

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

INTEGER_template& RxHandleTableRec_template::cid()
{
set_specific();
return single_value->field_cid;
}

const INTEGER_template& RxHandleTableRec_template::cid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cid of a non-specific template of type @OSMUX_Emulation.RxHandleTableRec.");
return single_value->field_cid;
}

OsmuxRxHandle_template& RxHandleTableRec_template::vc__conn()
{
set_specific();
return single_value->field_vc__conn;
}

const OsmuxRxHandle_template& RxHandleTableRec_template::vc__conn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field vc_conn of a non-specific template of type @OSMUX_Emulation.RxHandleTableRec.");
return single_value->field_vc__conn;
}

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

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

void RxHandleTableRec_template::log_match(const RxHandleTableRec& 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_cid.match(match_value.cid(), legacy)){
TTCN_Logger::log_logmatch_info(".cid");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_vc__conn.match(match_value.vc__conn(), legacy)){
TTCN_Logger::log_logmatch_info(".vc_conn");
single_value->field_vc__conn.log_match(match_value.vc__conn(), 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("{ cid := ");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::log_event_str(", vc_conn := ");
single_value->field_vc__conn.log_match(match_value.vc__conn(), 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 RxHandleTableRec_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cid().is_bound()) cid().set_implicit_omit();
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
}

void RxHandleTableRec_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cid.encode_text(text_buf);
single_value->field_vc__conn.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 @OSMUX_Emulation.RxHandleTableRec.");
}
}

void RxHandleTableRec_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_cid.decode_text(text_buf);
single_value->field_vc__conn.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 RxHandleTableRec_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 @OSMUX_Emulation.RxHandleTableRec.");
}
}

void RxHandleTableRec_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RxHandleTableRec_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @OSMUX_Emulation.RxHandleTableRec 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) cid().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) vc__conn().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(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "vc_conn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          vc__conn().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 @OSMUX_Emulation.RxHandleTableRec: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RxHandleTableRec_template* precondition = new RxHandleTableRec_template;
    precondition->set_param(*param.get_elem(0));
    RxHandleTableRec_template* implied_template = new RxHandleTableRec_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RxHandleTableRec_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Emulation.RxHandleTableRec");
  }
  is_ifpresent = param.get_ifpresent();
}

void RxHandleTableRec_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_cid.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.RxHandleTableRec");
single_value->field_vc__conn.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.RxHandleTableRec");
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 : "@OSMUX_Emulation.RxHandleTableRec");
}

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

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

OsmuxTxHandle::OsmuxTxHandle()
{
}

OsmuxTxHandle::OsmuxTxHandle(const INTEGER& par_ft,
    const BITSTRING& par_amr__f,
    const BITSTRING& par_amr__q,
    const INTEGER& par_seq,
    const INTEGER& par_cid,
    const INTEGER& par_amr__ft,
    const INTEGER& par_amr__cmr)
  :   field_ft(par_ft),
  field_amr__f(par_amr__f),
  field_amr__q(par_amr__q),
  field_seq(par_seq),
  field_cid(par_cid),
  field_amr__ft(par_amr__ft),
  field_amr__cmr(par_amr__cmr)
{
}

OsmuxTxHandle::OsmuxTxHandle(const OsmuxTxHandle& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @OSMUX_Emulation.OsmuxTxHandle.");
if (other_value.ft().is_bound()) field_ft = other_value.ft();
else field_ft.clean_up();
if (other_value.amr__f().is_bound()) field_amr__f = other_value.amr__f();
else field_amr__f.clean_up();
if (other_value.amr__q().is_bound()) field_amr__q = other_value.amr__q();
else field_amr__q.clean_up();
if (other_value.seq().is_bound()) field_seq = other_value.seq();
else field_seq.clean_up();
if (other_value.cid().is_bound()) field_cid = other_value.cid();
else field_cid.clean_up();
if (other_value.amr__ft().is_bound()) field_amr__ft = other_value.amr__ft();
else field_amr__ft.clean_up();
if (other_value.amr__cmr().is_bound()) field_amr__cmr = other_value.amr__cmr();
else field_amr__cmr.clean_up();
}

void OsmuxTxHandle::clean_up()
{
field_ft.clean_up();
field_amr__f.clean_up();
field_amr__q.clean_up();
field_seq.clean_up();
field_cid.clean_up();
field_amr__ft.clean_up();
field_amr__cmr.clean_up();
}

const TTCN_Typedescriptor_t* OsmuxTxHandle::get_descriptor() const { return &OsmuxTxHandle_descr_; }
OsmuxTxHandle& OsmuxTxHandle::operator=(const OsmuxTxHandle& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @OSMUX_Emulation.OsmuxTxHandle.");
  if (other_value.ft().is_bound()) field_ft = other_value.ft();
  else field_ft.clean_up();
  if (other_value.amr__f().is_bound()) field_amr__f = other_value.amr__f();
  else field_amr__f.clean_up();
  if (other_value.amr__q().is_bound()) field_amr__q = other_value.amr__q();
  else field_amr__q.clean_up();
  if (other_value.seq().is_bound()) field_seq = other_value.seq();
  else field_seq.clean_up();
  if (other_value.cid().is_bound()) field_cid = other_value.cid();
  else field_cid.clean_up();
  if (other_value.amr__ft().is_bound()) field_amr__ft = other_value.amr__ft();
  else field_amr__ft.clean_up();
  if (other_value.amr__cmr().is_bound()) field_amr__cmr = other_value.amr__cmr();
  else field_amr__cmr.clean_up();
}
return *this;
}

boolean OsmuxTxHandle::operator==(const OsmuxTxHandle& other_value) const
{
return field_ft==other_value.field_ft
  && field_amr__f==other_value.field_amr__f
  && field_amr__q==other_value.field_amr__q
  && field_seq==other_value.field_seq
  && field_cid==other_value.field_cid
  && field_amr__ft==other_value.field_amr__ft
  && field_amr__cmr==other_value.field_amr__cmr;
}

boolean OsmuxTxHandle::is_bound() const
{
return (field_ft.is_bound())
  || (field_amr__f.is_bound())
  || (field_amr__q.is_bound())
  || (field_seq.is_bound())
  || (field_cid.is_bound())
  || (field_amr__ft.is_bound())
  || (field_amr__cmr.is_bound());
}
boolean OsmuxTxHandle::is_value() const
{
return field_ft.is_value()
  && field_amr__f.is_value()
  && field_amr__q.is_value()
  && field_seq.is_value()
  && field_cid.is_value()
  && field_amr__ft.is_value()
  && field_amr__cmr.is_value();
}
void OsmuxTxHandle::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ft := ");
field_ft.log();
TTCN_Logger::log_event_str(", amr_f := ");
field_amr__f.log();
TTCN_Logger::log_event_str(", amr_q := ");
field_amr__q.log();
TTCN_Logger::log_event_str(", seq := ");
field_seq.log();
TTCN_Logger::log_event_str(", cid := ");
field_cid.log();
TTCN_Logger::log_event_str(", amr_ft := ");
field_amr__ft.log();
TTCN_Logger::log_event_str(", amr_cmr := ");
field_amr__cmr.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxTxHandle::set_implicit_omit()
{
if (ft().is_bound()) ft().set_implicit_omit();
if (amr__f().is_bound()) amr__f().set_implicit_omit();
if (amr__q().is_bound()) amr__q().set_implicit_omit();
if (seq().is_bound()) seq().set_implicit_omit();
if (cid().is_bound()) cid().set_implicit_omit();
if (amr__ft().is_bound()) amr__ft().set_implicit_omit();
if (amr__cmr().is_bound()) amr__cmr().set_implicit_omit();
}

void OsmuxTxHandle::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record value of type @OSMUX_Emulation.OsmuxTxHandle has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ft().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) amr__f().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) amr__q().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) seq().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cid().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) amr__ft().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) amr__cmr().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ft().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(), "amr_f")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__f().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(), "amr_q")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__q().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(), "seq")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seq().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(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "amr_ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__ft().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(), "amr_cmr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__cmr().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 @OSMUX_Emulation.OsmuxTxHandle: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@OSMUX_Emulation.OsmuxTxHandle");
  }
}

void OsmuxTxHandle::encode_text(Text_Buf& text_buf) const
{
field_ft.encode_text(text_buf);
field_amr__f.encode_text(text_buf);
field_amr__q.encode_text(text_buf);
field_seq.encode_text(text_buf);
field_cid.encode_text(text_buf);
field_amr__ft.encode_text(text_buf);
field_amr__cmr.encode_text(text_buf);
}

void OsmuxTxHandle::decode_text(Text_Buf& text_buf)
{
field_ft.decode_text(text_buf);
field_amr__f.decode_text(text_buf);
field_amr__q.decode_text(text_buf);
field_seq.decode_text(text_buf);
field_cid.decode_text(text_buf);
field_amr__ft.decode_text(text_buf);
field_amr__cmr.decode_text(text_buf);
}

struct OsmuxTxHandle_template::single_value_struct {
INTEGER_template field_ft;
BITSTRING_template field_amr__f;
BITSTRING_template field_amr__q;
INTEGER_template field_seq;
INTEGER_template field_cid;
INTEGER_template field_amr__ft;
INTEGER_template field_amr__cmr;
};

void OsmuxTxHandle_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_ft = ANY_VALUE;
single_value->field_amr__f = ANY_VALUE;
single_value->field_amr__q = ANY_VALUE;
single_value->field_seq = ANY_VALUE;
single_value->field_cid = ANY_VALUE;
single_value->field_amr__ft = ANY_VALUE;
single_value->field_amr__cmr = ANY_VALUE;
}
}
}

void OsmuxTxHandle_template::copy_value(const OsmuxTxHandle& other_value)
{
single_value = new single_value_struct;
if (other_value.ft().is_bound()) {
  single_value->field_ft = other_value.ft();
} else {
  single_value->field_ft.clean_up();
}
if (other_value.amr__f().is_bound()) {
  single_value->field_amr__f = other_value.amr__f();
} else {
  single_value->field_amr__f.clean_up();
}
if (other_value.amr__q().is_bound()) {
  single_value->field_amr__q = other_value.amr__q();
} else {
  single_value->field_amr__q.clean_up();
}
if (other_value.seq().is_bound()) {
  single_value->field_seq = other_value.seq();
} else {
  single_value->field_seq.clean_up();
}
if (other_value.cid().is_bound()) {
  single_value->field_cid = other_value.cid();
} else {
  single_value->field_cid.clean_up();
}
if (other_value.amr__ft().is_bound()) {
  single_value->field_amr__ft = other_value.amr__ft();
} else {
  single_value->field_amr__ft.clean_up();
}
if (other_value.amr__cmr().is_bound()) {
  single_value->field_amr__cmr = other_value.amr__cmr();
} else {
  single_value->field_amr__cmr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void OsmuxTxHandle_template::copy_template(const OsmuxTxHandle_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ft().get_selection()) {
single_value->field_ft = other_value.ft();
} else {
single_value->field_ft.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__f().get_selection()) {
single_value->field_amr__f = other_value.amr__f();
} else {
single_value->field_amr__f.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__q().get_selection()) {
single_value->field_amr__q = other_value.amr__q();
} else {
single_value->field_amr__q.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.seq().get_selection()) {
single_value->field_seq = other_value.seq();
} else {
single_value->field_seq.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cid().get_selection()) {
single_value->field_cid = other_value.cid();
} else {
single_value->field_cid.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__ft().get_selection()) {
single_value->field_amr__ft = other_value.amr__ft();
} else {
single_value->field_amr__ft.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.amr__cmr().get_selection()) {
single_value->field_amr__cmr = other_value.amr__cmr();
} else {
single_value->field_amr__cmr.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new OsmuxTxHandle_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new OsmuxTxHandle_template(*other_value.implication_.precondition);
implication_.implied_template = new OsmuxTxHandle_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxTxHandle.");
break;
}
set_selection(other_value);
}

OsmuxTxHandle_template::OsmuxTxHandle_template()
{
}

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

OsmuxTxHandle_template::OsmuxTxHandle_template(const OsmuxTxHandle& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean OsmuxTxHandle_template::match(const OsmuxTxHandle& 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.ft().is_bound()) return FALSE;
if(!single_value->field_ft.match(other_value.ft(), legacy))return FALSE;
if(!other_value.amr__f().is_bound()) return FALSE;
if(!single_value->field_amr__f.match(other_value.amr__f(), legacy))return FALSE;
if(!other_value.amr__q().is_bound()) return FALSE;
if(!single_value->field_amr__q.match(other_value.amr__q(), legacy))return FALSE;
if(!other_value.seq().is_bound()) return FALSE;
if(!single_value->field_seq.match(other_value.seq(), legacy))return FALSE;
if(!other_value.cid().is_bound()) return FALSE;
if(!single_value->field_cid.match(other_value.cid(), legacy))return FALSE;
if(!other_value.amr__ft().is_bound()) return FALSE;
if(!single_value->field_amr__ft.match(other_value.amr__ft(), legacy))return FALSE;
if(!other_value.amr__cmr().is_bound()) return FALSE;
if(!single_value->field_amr__cmr.match(other_value.amr__cmr(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @OSMUX_Emulation.OsmuxTxHandle.");
}
return FALSE;
}

boolean OsmuxTxHandle_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_ft.is_bound()
 || single_value->field_amr__f.is_bound()
 || single_value->field_amr__q.is_bound()
 || single_value->field_seq.is_bound()
 || single_value->field_cid.is_bound()
 || single_value->field_amr__ft.is_bound()
 || single_value->field_amr__cmr.is_bound();
}

boolean OsmuxTxHandle_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ft.is_value()
 && single_value->field_amr__f.is_value()
 && single_value->field_amr__q.is_value()
 && single_value->field_seq.is_value()
 && single_value->field_cid.is_value()
 && single_value->field_amr__ft.is_value()
 && single_value->field_amr__cmr.is_value();
}

void OsmuxTxHandle_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

OsmuxTxHandle OsmuxTxHandle_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 @OSMUX_Emulation.OsmuxTxHandle.");
OsmuxTxHandle ret_val;
if (single_value->field_ft.is_bound()) {
ret_val.ft() = single_value->field_ft.valueof();
}
if (single_value->field_amr__f.is_bound()) {
ret_val.amr__f() = single_value->field_amr__f.valueof();
}
if (single_value->field_amr__q.is_bound()) {
ret_val.amr__q() = single_value->field_amr__q.valueof();
}
if (single_value->field_seq.is_bound()) {
ret_val.seq() = single_value->field_seq.valueof();
}
if (single_value->field_cid.is_bound()) {
ret_val.cid() = single_value->field_cid.valueof();
}
if (single_value->field_amr__ft.is_bound()) {
ret_val.amr__ft() = single_value->field_amr__ft.valueof();
}
if (single_value->field_amr__cmr.is_bound()) {
ret_val.amr__cmr() = single_value->field_amr__cmr.valueof();
}
return ret_val;
}

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

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

INTEGER_template& OsmuxTxHandle_template::ft()
{
set_specific();
return single_value->field_ft;
}

const INTEGER_template& OsmuxTxHandle_template::ft() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ft of a non-specific template of type @OSMUX_Emulation.OsmuxTxHandle.");
return single_value->field_ft;
}

BITSTRING_template& OsmuxTxHandle_template::amr__f()
{
set_specific();
return single_value->field_amr__f;
}

const BITSTRING_template& OsmuxTxHandle_template::amr__f() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_f of a non-specific template of type @OSMUX_Emulation.OsmuxTxHandle.");
return single_value->field_amr__f;
}

BITSTRING_template& OsmuxTxHandle_template::amr__q()
{
set_specific();
return single_value->field_amr__q;
}

const BITSTRING_template& OsmuxTxHandle_template::amr__q() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_q of a non-specific template of type @OSMUX_Emulation.OsmuxTxHandle.");
return single_value->field_amr__q;
}

INTEGER_template& OsmuxTxHandle_template::seq()
{
set_specific();
return single_value->field_seq;
}

const INTEGER_template& OsmuxTxHandle_template::seq() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field seq of a non-specific template of type @OSMUX_Emulation.OsmuxTxHandle.");
return single_value->field_seq;
}

INTEGER_template& OsmuxTxHandle_template::cid()
{
set_specific();
return single_value->field_cid;
}

const INTEGER_template& OsmuxTxHandle_template::cid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cid of a non-specific template of type @OSMUX_Emulation.OsmuxTxHandle.");
return single_value->field_cid;
}

INTEGER_template& OsmuxTxHandle_template::amr__ft()
{
set_specific();
return single_value->field_amr__ft;
}

const INTEGER_template& OsmuxTxHandle_template::amr__ft() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_ft of a non-specific template of type @OSMUX_Emulation.OsmuxTxHandle.");
return single_value->field_amr__ft;
}

INTEGER_template& OsmuxTxHandle_template::amr__cmr()
{
set_specific();
return single_value->field_amr__cmr;
}

const INTEGER_template& OsmuxTxHandle_template::amr__cmr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field amr_cmr of a non-specific template of type @OSMUX_Emulation.OsmuxTxHandle.");
return single_value->field_amr__cmr;
}

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

void OsmuxTxHandle_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ft := ");
single_value->field_ft.log();
TTCN_Logger::log_event_str(", amr_f := ");
single_value->field_amr__f.log();
TTCN_Logger::log_event_str(", amr_q := ");
single_value->field_amr__q.log();
TTCN_Logger::log_event_str(", seq := ");
single_value->field_seq.log();
TTCN_Logger::log_event_str(", cid := ");
single_value->field_cid.log();
TTCN_Logger::log_event_str(", amr_ft := ");
single_value->field_amr__ft.log();
TTCN_Logger::log_event_str(", amr_cmr := ");
single_value->field_amr__cmr.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void OsmuxTxHandle_template::log_match(const OsmuxTxHandle& 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_ft.match(match_value.ft(), legacy)){
TTCN_Logger::log_logmatch_info(".ft");
single_value->field_ft.log_match(match_value.ft(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__f.match(match_value.amr__f(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_f");
single_value->field_amr__f.log_match(match_value.amr__f(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__q.match(match_value.amr__q(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_q");
single_value->field_amr__q.log_match(match_value.amr__q(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_seq.match(match_value.seq(), legacy)){
TTCN_Logger::log_logmatch_info(".seq");
single_value->field_seq.log_match(match_value.seq(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cid.match(match_value.cid(), legacy)){
TTCN_Logger::log_logmatch_info(".cid");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__ft.match(match_value.amr__ft(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_ft");
single_value->field_amr__ft.log_match(match_value.amr__ft(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_amr__cmr.match(match_value.amr__cmr(), legacy)){
TTCN_Logger::log_logmatch_info(".amr_cmr");
single_value->field_amr__cmr.log_match(match_value.amr__cmr(), 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("{ ft := ");
single_value->field_ft.log_match(match_value.ft(), legacy);
TTCN_Logger::log_event_str(", amr_f := ");
single_value->field_amr__f.log_match(match_value.amr__f(), legacy);
TTCN_Logger::log_event_str(", amr_q := ");
single_value->field_amr__q.log_match(match_value.amr__q(), legacy);
TTCN_Logger::log_event_str(", seq := ");
single_value->field_seq.log_match(match_value.seq(), legacy);
TTCN_Logger::log_event_str(", cid := ");
single_value->field_cid.log_match(match_value.cid(), legacy);
TTCN_Logger::log_event_str(", amr_ft := ");
single_value->field_amr__ft.log_match(match_value.amr__ft(), legacy);
TTCN_Logger::log_event_str(", amr_cmr := ");
single_value->field_amr__cmr.log_match(match_value.amr__cmr(), 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 OsmuxTxHandle_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (ft().is_bound()) ft().set_implicit_omit();
if (amr__f().is_bound()) amr__f().set_implicit_omit();
if (amr__q().is_bound()) amr__q().set_implicit_omit();
if (seq().is_bound()) seq().set_implicit_omit();
if (cid().is_bound()) cid().set_implicit_omit();
if (amr__ft().is_bound()) amr__ft().set_implicit_omit();
if (amr__cmr().is_bound()) amr__cmr().set_implicit_omit();
}

void OsmuxTxHandle_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ft.encode_text(text_buf);
single_value->field_amr__f.encode_text(text_buf);
single_value->field_amr__q.encode_text(text_buf);
single_value->field_seq.encode_text(text_buf);
single_value->field_cid.encode_text(text_buf);
single_value->field_amr__ft.encode_text(text_buf);
single_value->field_amr__cmr.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 @OSMUX_Emulation.OsmuxTxHandle.");
}
}

void OsmuxTxHandle_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_ft.decode_text(text_buf);
single_value->field_amr__f.decode_text(text_buf);
single_value->field_amr__q.decode_text(text_buf);
single_value->field_seq.decode_text(text_buf);
single_value->field_cid.decode_text(text_buf);
single_value->field_amr__ft.decode_text(text_buf);
single_value->field_amr__cmr.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 OsmuxTxHandle_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 @OSMUX_Emulation.OsmuxTxHandle.");
}
}

void OsmuxTxHandle_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    OsmuxTxHandle_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (7<param.get_size()) {
      param.error("record template of type @OSMUX_Emulation.OsmuxTxHandle has 7 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ft().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) amr__f().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) amr__q().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) seq().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cid().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) amr__ft().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) amr__cmr().set_param(*param.get_elem(6));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ft().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(), "amr_f")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__f().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(), "amr_q")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__q().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(), "seq")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seq().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(), "cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cid().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(), "amr_ft")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__ft().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(), "amr_cmr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          amr__cmr().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 @OSMUX_Emulation.OsmuxTxHandle: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    OsmuxTxHandle_template* precondition = new OsmuxTxHandle_template;
    precondition->set_param(*param.get_elem(0));
    OsmuxTxHandle_template* implied_template = new OsmuxTxHandle_template;
    implied_template->set_param(*param.get_elem(1));
    *this = OsmuxTxHandle_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@OSMUX_Emulation.OsmuxTxHandle");
  }
  is_ifpresent = param.get_ifpresent();
}

void OsmuxTxHandle_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_ft.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxTxHandle");
single_value->field_amr__f.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxTxHandle");
single_value->field_amr__q.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxTxHandle");
single_value->field_seq.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxTxHandle");
single_value->field_cid.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxTxHandle");
single_value->field_amr__ft.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxTxHandle");
single_value->field_amr__cmr.check_restriction(t_res, t_name ? t_name : "@OSMUX_Emulation.OsmuxTxHandle");
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 : "@OSMUX_Emulation.OsmuxTxHandle");
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const char *OsmuxemMode::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case OSMUXEM__MODE__NONE: return "OSMUXEM_MODE_NONE";
case OSMUXEM__MODE__TXONLY: return "OSMUXEM_MODE_TXONLY";
case OSMUXEM__MODE__RXONLY: return "OSMUXEM_MODE_RXONLY";
case OSMUXEM__MODE__BIDIR: return "OSMUXEM_MODE_BIDIR";
default:
return "<unknown>";
}
}

OsmuxemMode::enum_type OsmuxemMode::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "OSMUXEM_MODE_NONE")) return OSMUXEM__MODE__NONE;
if (!strcmp(str_par, "OSMUXEM_MODE_TXONLY")) return OSMUXEM__MODE__TXONLY;
if (!strcmp(str_par, "OSMUXEM_MODE_RXONLY")) return OSMUXEM__MODE__RXONLY;
if (!strcmp(str_par, "OSMUXEM_MODE_BIDIR")) return OSMUXEM__MODE__BIDIR;
}
return UNKNOWN_VALUE;
}

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

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

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

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

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

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

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

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

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

void OsmuxemMode_template::copy_template(const OsmuxemMode_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new OsmuxemMode_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new OsmuxemMode_template(*other_value.implication_.precondition);
implication_.implied_template = new OsmuxemMode_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @OSMUX_Emulation.OsmuxemMode.");
}
}

OsmuxemMode_template::OsmuxemMode_template()
{
}

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

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

OsmuxemMode_template::OsmuxemMode_template(OsmuxemMode::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

void OsmuxemMode_template::clean_up()
{
switch (template_selection) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

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

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

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

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

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

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

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

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

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

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

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

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

void OsmuxemMode_template::log_match(const OsmuxemMode& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

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

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

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

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

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

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

void OsmuxEM__bind_call::encode_text(Text_Buf& text_buf) const
{
param_local__host.encode_text(text_buf);
param_local__port.encode_text(text_buf);
}

void OsmuxEM__bind_call::decode_text(Text_Buf& text_buf)
{
param_local__host.decode_text(text_buf);
param_local__port.decode_text(text_buf);
}

void OsmuxEM__bind_call::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_bind : { ");
TTCN_Logger::log_event_str("local_host := ");
param_local__host.log();
TTCN_Logger::log_event_str(", local_port := ");
param_local__port.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__bind_call_redirect::set_parameters(const OsmuxEM__bind_call& call_par) const
{
if (ptr_local__host != NULL) *ptr_local__host = call_par.local__host();
if (ptr_local__port != NULL) *ptr_local__port = call_par.local__port();
}

void OsmuxEM__bind_reply::encode_text(Text_Buf& text_buf) const
{
param_local__port.encode_text(text_buf);
}

void OsmuxEM__bind_reply::decode_text(Text_Buf& text_buf)
{
param_local__port.decode_text(text_buf);
}

void OsmuxEM__bind_reply::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_bind : { ");
TTCN_Logger::log_event_str("local_port := ");
param_local__port.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__bind_reply_redirect::set_parameters(const OsmuxEM__bind_reply& reply_par) const
{
if (ptr_local__port != NULL) *ptr_local__port = reply_par.local__port();
}

OsmuxEM__bind_template::OsmuxEM__bind_template()
 : param_local__host(ANY_VALUE), param_local__port(ANY_VALUE)
{
}

OsmuxEM__bind_call OsmuxEM__bind_template::create_call() const
{
OsmuxEM__bind_call ret_val;
ret_val.local__host() = param_local__host.valueof();
ret_val.local__port() = param_local__port.valueof();
return ret_val;
}

OsmuxEM__bind_reply OsmuxEM__bind_template::create_reply() const
{
OsmuxEM__bind_reply ret_val;
ret_val.local__port() = param_local__port.valueof();
return ret_val;
}

boolean OsmuxEM__bind_template::match_call(const OsmuxEM__bind_call& match_value, boolean legacy) const
{
return param_local__host.match(match_value.local__host(), legacy) &&
param_local__port.match(match_value.local__port(), legacy);
}

boolean OsmuxEM__bind_template::match_reply(const OsmuxEM__bind_reply& match_value, boolean legacy) const
{
return param_local__port.match(match_value.local__port(), legacy);
}

void OsmuxEM__bind_template::log() const
{
TTCN_Logger::log_event_str("{ local_host := ");
param_local__host.log();
TTCN_Logger::log_event_str(", local_port := ");
param_local__port.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__bind_template::log_match_call(const OsmuxEM__bind_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ local_host := ");
param_local__host.log_match(match_value.local__host(), legacy);
TTCN_Logger::log_event_str(", local_port := ");
param_local__port.log_match(match_value.local__port(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__bind_template::log_match_reply(const OsmuxEM__bind_reply& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ local_port := ");
param_local__port.log_match(match_value.local__port(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__bind_template::encode_text(Text_Buf& text_buf) const
{
param_local__host.encode_text(text_buf);
param_local__port.encode_text(text_buf);
}

void OsmuxEM__bind_template::decode_text(Text_Buf& text_buf)
{
param_local__host.decode_text(text_buf);
param_local__port.decode_text(text_buf);
}

void OsmuxEM__connect_call::encode_text(Text_Buf& text_buf) const
{
param_remote__host.encode_text(text_buf);
param_remote__port.encode_text(text_buf);
}

void OsmuxEM__connect_call::decode_text(Text_Buf& text_buf)
{
param_remote__host.decode_text(text_buf);
param_remote__port.decode_text(text_buf);
}

void OsmuxEM__connect_call::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_connect : { ");
TTCN_Logger::log_event_str("remote_host := ");
param_remote__host.log();
TTCN_Logger::log_event_str(", remote_port := ");
param_remote__port.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__connect_call_redirect::set_parameters(const OsmuxEM__connect_call& call_par) const
{
if (ptr_remote__host != NULL) *ptr_remote__host = call_par.remote__host();
if (ptr_remote__port != NULL) *ptr_remote__port = call_par.remote__port();
}

void OsmuxEM__connect_reply::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_connect : { }");
}

OsmuxEM__connect_template::OsmuxEM__connect_template()
 : param_remote__host(ANY_VALUE), param_remote__port(ANY_VALUE)
{
}

OsmuxEM__connect_call OsmuxEM__connect_template::create_call() const
{
OsmuxEM__connect_call ret_val;
ret_val.remote__host() = param_remote__host.valueof();
ret_val.remote__port() = param_remote__port.valueof();
return ret_val;
}

boolean OsmuxEM__connect_template::match_call(const OsmuxEM__connect_call& match_value, boolean legacy) const
{
return param_remote__host.match(match_value.remote__host(), legacy) &&
param_remote__port.match(match_value.remote__port(), legacy);
}

void OsmuxEM__connect_template::log() const
{
TTCN_Logger::log_event_str("{ remote_host := ");
param_remote__host.log();
TTCN_Logger::log_event_str(", remote_port := ");
param_remote__port.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__connect_template::log_match_call(const OsmuxEM__connect_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ remote_host := ");
param_remote__host.log_match(match_value.remote__host(), legacy);
TTCN_Logger::log_event_str(", remote_port := ");
param_remote__port.log_match(match_value.remote__port(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__connect_template::log_match_reply(const OsmuxEM__connect_reply& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void OsmuxEM__connect_template::encode_text(Text_Buf& text_buf) const
{
param_remote__host.encode_text(text_buf);
param_remote__port.encode_text(text_buf);
}

void OsmuxEM__connect_template::decode_text(Text_Buf& text_buf)
{
param_remote__host.decode_text(text_buf);
param_remote__port.decode_text(text_buf);
}

void OsmuxEM__mode_call::encode_text(Text_Buf& text_buf) const
{
param_mode.encode_text(text_buf);
}

void OsmuxEM__mode_call::decode_text(Text_Buf& text_buf)
{
param_mode.decode_text(text_buf);
}

void OsmuxEM__mode_call::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_mode : { ");
TTCN_Logger::log_event_str("mode := ");
param_mode.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__mode_call_redirect::set_parameters(const OsmuxEM__mode_call& call_par) const
{
if (ptr_mode != NULL) *ptr_mode = call_par.mode();
}

void OsmuxEM__mode_reply::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_mode : { }");
}

OsmuxEM__mode_template::OsmuxEM__mode_template()
 : param_mode(ANY_VALUE)
{
}

OsmuxEM__mode_call OsmuxEM__mode_template::create_call() const
{
OsmuxEM__mode_call ret_val;
ret_val.mode() = param_mode.valueof();
return ret_val;
}

boolean OsmuxEM__mode_template::match_call(const OsmuxEM__mode_call& match_value, boolean legacy) const
{
return param_mode.match(match_value.mode(), legacy);
}

void OsmuxEM__mode_template::log() const
{
TTCN_Logger::log_event_str("{ mode := ");
param_mode.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__mode_template::log_match_call(const OsmuxEM__mode_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ mode := ");
param_mode.log_match(match_value.mode(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__mode_template::log_match_reply(const OsmuxEM__mode_reply& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void OsmuxEM__mode_template::encode_text(Text_Buf& text_buf) const
{
param_mode.encode_text(text_buf);
}

void OsmuxEM__mode_template::decode_text(Text_Buf& text_buf)
{
param_mode.decode_text(text_buf);
}

void OsmuxEM__configure_call::encode_text(Text_Buf& text_buf) const
{
param_cfg.encode_text(text_buf);
}

void OsmuxEM__configure_call::decode_text(Text_Buf& text_buf)
{
param_cfg.decode_text(text_buf);
}

void OsmuxEM__configure_call::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_configure : { ");
TTCN_Logger::log_event_str("cfg := ");
param_cfg.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__configure_call_redirect::set_parameters(const OsmuxEM__configure_call& call_par) const
{
if (ptr_cfg != NULL) *ptr_cfg = call_par.cfg();
}

void OsmuxEM__configure_reply::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_configure : { }");
}

OsmuxEM__configure_template::OsmuxEM__configure_template()
 : param_cfg(ANY_VALUE)
{
}

OsmuxEM__configure_call OsmuxEM__configure_template::create_call() const
{
OsmuxEM__configure_call ret_val;
ret_val.cfg() = param_cfg.valueof();
return ret_val;
}

boolean OsmuxEM__configure_template::match_call(const OsmuxEM__configure_call& match_value, boolean legacy) const
{
return param_cfg.match(match_value.cfg(), legacy);
}

void OsmuxEM__configure_template::log() const
{
TTCN_Logger::log_event_str("{ cfg := ");
param_cfg.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__configure_template::log_match_call(const OsmuxEM__configure_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ cfg := ");
param_cfg.log_match(match_value.cfg(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__configure_template::log_match_reply(const OsmuxEM__configure_reply& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void OsmuxEM__configure_template::encode_text(Text_Buf& text_buf) const
{
param_cfg.encode_text(text_buf);
}

void OsmuxEM__configure_template::decode_text(Text_Buf& text_buf)
{
param_cfg.decode_text(text_buf);
}

void OsmuxEM__stats__get_call::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_stats_get : { }");
}

void OsmuxEM__stats__get_reply::encode_text(Text_Buf& text_buf) const
{
param_stats.encode_text(text_buf);
}

void OsmuxEM__stats__get_reply::decode_text(Text_Buf& text_buf)
{
param_stats.decode_text(text_buf);
}

void OsmuxEM__stats__get_reply::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_stats_get : { ");
TTCN_Logger::log_event_str("stats := ");
param_stats.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__stats__get_reply_redirect::set_parameters(const OsmuxEM__stats__get_reply& reply_par) const
{
if (ptr_stats != NULL) *ptr_stats = reply_par.stats();
}

OsmuxEM__stats__get_template::OsmuxEM__stats__get_template()
 : param_stats(ANY_VALUE)
{
}

OsmuxEM__stats__get_reply OsmuxEM__stats__get_template::create_reply() const
{
OsmuxEM__stats__get_reply ret_val;
ret_val.stats() = param_stats.valueof();
return ret_val;
}

boolean OsmuxEM__stats__get_template::match_reply(const OsmuxEM__stats__get_reply& match_value, boolean legacy) const
{
return param_stats.match(match_value.stats(), legacy);
}

void OsmuxEM__stats__get_template::log() const
{
TTCN_Logger::log_event_str("{ stats := ");
param_stats.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__stats__get_template::log_match_call(const OsmuxEM__stats__get_call& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void OsmuxEM__stats__get_template::log_match_reply(const OsmuxEM__stats__get_reply& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ stats := ");
param_stats.log_match(match_value.stats(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__stats__get_template::encode_text(Text_Buf& text_buf) const
{
param_stats.encode_text(text_buf);
}

void OsmuxEM__stats__get_template::decode_text(Text_Buf& text_buf)
{
param_stats.decode_text(text_buf);
}

void OsmuxEM__register__rxhandle_call::encode_text(Text_Buf& text_buf) const
{
param_hdl.encode_text(text_buf);
}

void OsmuxEM__register__rxhandle_call::decode_text(Text_Buf& text_buf)
{
param_hdl.decode_text(text_buf);
}

void OsmuxEM__register__rxhandle_call::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_register_rxhandle : { ");
TTCN_Logger::log_event_str("hdl := ");
param_hdl.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__register__rxhandle_call_redirect::set_parameters(const OsmuxEM__register__rxhandle_call& call_par) const
{
if (ptr_hdl != NULL) *ptr_hdl = call_par.hdl();
}

void OsmuxEM__register__rxhandle_reply::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_register_rxhandle : { }");
}

OsmuxEM__register__rxhandle_template::OsmuxEM__register__rxhandle_template()
 : param_hdl(ANY_VALUE)
{
}

OsmuxEM__register__rxhandle_call OsmuxEM__register__rxhandle_template::create_call() const
{
OsmuxEM__register__rxhandle_call ret_val;
ret_val.hdl() = param_hdl.valueof();
return ret_val;
}

boolean OsmuxEM__register__rxhandle_template::match_call(const OsmuxEM__register__rxhandle_call& match_value, boolean legacy) const
{
return param_hdl.match(match_value.hdl(), legacy);
}

void OsmuxEM__register__rxhandle_template::log() const
{
TTCN_Logger::log_event_str("{ hdl := ");
param_hdl.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__register__rxhandle_template::log_match_call(const OsmuxEM__register__rxhandle_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ hdl := ");
param_hdl.log_match(match_value.hdl(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__register__rxhandle_template::log_match_reply(const OsmuxEM__register__rxhandle_reply& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void OsmuxEM__register__rxhandle_template::encode_text(Text_Buf& text_buf) const
{
param_hdl.encode_text(text_buf);
}

void OsmuxEM__register__rxhandle_template::decode_text(Text_Buf& text_buf)
{
param_hdl.decode_text(text_buf);
}

void OsmuxEM__register__txhandle_call::encode_text(Text_Buf& text_buf) const
{
param_hdl.encode_text(text_buf);
}

void OsmuxEM__register__txhandle_call::decode_text(Text_Buf& text_buf)
{
param_hdl.decode_text(text_buf);
}

void OsmuxEM__register__txhandle_call::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_register_txhandle : { ");
TTCN_Logger::log_event_str("hdl := ");
param_hdl.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__register__txhandle_call_redirect::set_parameters(const OsmuxEM__register__txhandle_call& call_par) const
{
if (ptr_hdl != NULL) *ptr_hdl = call_par.hdl();
}

void OsmuxEM__register__txhandle_reply::log() const
{
TTCN_Logger::log_event_str("@OSMUX_Emulation.OsmuxEM_register_txhandle : { }");
}

OsmuxEM__register__txhandle_template::OsmuxEM__register__txhandle_template()
 : param_hdl(ANY_VALUE)
{
}

OsmuxEM__register__txhandle_call OsmuxEM__register__txhandle_template::create_call() const
{
OsmuxEM__register__txhandle_call ret_val;
ret_val.hdl() = param_hdl.valueof();
return ret_val;
}

boolean OsmuxEM__register__txhandle_template::match_call(const OsmuxEM__register__txhandle_call& match_value, boolean legacy) const
{
return param_hdl.match(match_value.hdl(), legacy);
}

void OsmuxEM__register__txhandle_template::log() const
{
TTCN_Logger::log_event_str("{ hdl := ");
param_hdl.log();
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__register__txhandle_template::log_match_call(const OsmuxEM__register__txhandle_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ hdl := ");
param_hdl.log_match(match_value.hdl(), legacy);
TTCN_Logger::log_event_str(" }");
}

void OsmuxEM__register__txhandle_template::log_match_reply(const OsmuxEM__register__txhandle_reply& , boolean) const
{
TTCN_Logger::log_event_str("{ } with { } matched");
}

void OsmuxEM__register__txhandle_template::encode_text(Text_Buf& text_buf) const
{
param_hdl.encode_text(text_buf);
}

void OsmuxEM__register__txhandle_template::decode_text(Text_Buf& text_buf)
{
param_hdl.decode_text(text_buf);
}

void OsmuxEM__CTRL__PT::append_to_proc_queue(proc_queue_item *new_item)
{
new_item->next_item = NULL;
if (proc_queue_tail != NULL) proc_queue_tail->next_item = new_item;
else proc_queue_head = new_item;
proc_queue_tail = new_item;
}

void OsmuxEM__CTRL__PT::remove_proc_queue_head()
{
switch (proc_queue_head->item_selection) {
case CALL_0:
delete proc_queue_head->call_0;
break;
case CALL_1:
delete proc_queue_head->call_1;
break;
case CALL_2:
delete proc_queue_head->call_2;
break;
case CALL_3:
delete proc_queue_head->call_3;
break;
case CALL_4:
delete proc_queue_head->call_4;
break;
case CALL_5:
delete proc_queue_head->call_5;
break;
case CALL_6:
delete proc_queue_head->call_6;
break;
case REPLY_0:
delete proc_queue_head->reply_0;
break;
case REPLY_1:
delete proc_queue_head->reply_1;
break;
case REPLY_2:
delete proc_queue_head->reply_2;
break;
case REPLY_3:
delete proc_queue_head->reply_3;
break;
case REPLY_4:
delete proc_queue_head->reply_4;
break;
case REPLY_5:
delete proc_queue_head->reply_5;
break;
case REPLY_6:
delete proc_queue_head->reply_6;
break;
default:
TTCN_error("Internal error: Invalid signature selector in the queue of port %s.", port_name);
}
proc_queue_item *next_item = proc_queue_head->next_item;
delete proc_queue_head;
proc_queue_head = next_item;
if (next_item == NULL) proc_queue_tail = NULL;
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__op, port_name, 0, ++proc_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));}

void OsmuxEM__CTRL__PT::clear_queue()
{
while (proc_queue_head != NULL) remove_proc_queue_head();
}

OsmuxEM__CTRL__PT::OsmuxEM__CTRL__PT(const char *par_port_name)
 : PORT(par_port_name)
{
proc_queue_head = NULL;
proc_queue_tail = NULL;
}

OsmuxEM__CTRL__PT::~OsmuxEM__CTRL__PT()
{
clear_queue();
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__bind_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const OsmuxEM__bind_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_bind");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__bind_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__bind_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_bind");
const OsmuxEM__bind_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__connect_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const OsmuxEM__connect_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_connect");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__connect_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__connect_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_connect");
const OsmuxEM__connect_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__mode_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const OsmuxEM__mode_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_mode");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__mode_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__mode_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_mode");
const OsmuxEM__mode_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__configure_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const OsmuxEM__configure_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_configure");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__configure_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__configure_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_configure");
const OsmuxEM__configure_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__stats__get_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const OsmuxEM__stats__get_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_stats_get");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__stats__get_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__stats__get_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_stats_get");
const OsmuxEM__stats__get_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__register__rxhandle_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const OsmuxEM__register__rxhandle_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_register_rxhandle");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__register__rxhandle_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__register__rxhandle_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_register_rxhandle");
const OsmuxEM__register__rxhandle_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__register__txhandle_template& call_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of call operation.");
const OsmuxEM__register__txhandle_call& call_tmp = call_template.create_call();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name,TitanLoggerApiSimple::Port__oper::call__op, destination_component,
CHARSTRING(0,NULL),(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send call to system.", port_name);
else {
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_register_txhandle");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__register__txhandle_template& call_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) call(call_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::call(const OsmuxEM__register__txhandle_template& call_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Calling a signature on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_call(text_buf, "@OSMUX_Emulation.OsmuxEM_register_txhandle");
const OsmuxEM__register__txhandle_call& call_tmp = call_template.create_call();
call_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_CALL, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
call_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else call(call_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__bind_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const OsmuxEM__bind_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_bind");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__bind_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__bind_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_bind");
const OsmuxEM__bind_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__connect_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const OsmuxEM__connect_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_connect");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__connect_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__connect_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_connect");
const OsmuxEM__connect_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__mode_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const OsmuxEM__mode_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_mode");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__mode_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__mode_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_mode");
const OsmuxEM__mode_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__configure_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const OsmuxEM__configure_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_configure");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__configure_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__configure_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_configure");
const OsmuxEM__configure_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__stats__get_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const OsmuxEM__stats__get_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_stats_get");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__stats__get_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__stats__get_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_stats_get");
const OsmuxEM__stats__get_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__register__rxhandle_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const OsmuxEM__register__rxhandle_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_register_rxhandle");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__register__rxhandle_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__register__rxhandle_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_register_rxhandle");
const OsmuxEM__register__rxhandle_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__register__txhandle_template& reply_template, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Replying to a signature on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of reply operation.");
const OsmuxEM__register__txhandle_reply& reply_tmp = reply_template.create_reply();
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMOUT:TTCN_Logger::PORTEVENT_PCOUT;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_send(port_name, TitanLoggerApiSimple::Port__oper::reply__op, destination_component,
 CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PMOUT, TRUE), reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Internal port %s cannot send reply to system.", port_name);
else {
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_register_txhandle");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__register__txhandle_template& reply_template, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) reply(reply_template, destination_components[i], timestamp_redirect);
}

void OsmuxEM__CTRL__PT::reply(const OsmuxEM__register__txhandle_template& reply_template, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Replying to a call on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_reply(text_buf, "@OSMUX_Emulation.OsmuxEM_register_txhandle");
const OsmuxEM__register__txhandle_reply& reply_tmp = reply_template.create_reply();
reply_tmp.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_REPLY, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PCOUT, TRUE), 
reply_tmp.log(), TTCN_Logger::end_event_log2str()));
}
else reply(reply_template, COMPONENT(get_default_destination()), timestamp_redirect);
}

alt_status OsmuxEM__CTRL__PT::getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case CALL_0:
case CALL_1:
case CALL_2:
case CALL_3:
case CALL_4:
case CALL_5:
case CALL_6:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component,
FALSE, CHARSTRING(0, NULL), msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a call.", port_name);
return ALT_NO;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case CALL_0:
case CALL_1:
case CALL_2:
case CALL_3:
case CALL_4:
case CALL_5:
case CALL_6:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component,
TRUE, CHARSTRING(0, NULL), msg_head_count+1);
}
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a call.", port_name);
return ALT_NO;
}
}

alt_status OsmuxEM__CTRL__PT::getcall(const OsmuxEM__bind_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__bind_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_bind.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const OsmuxEM__bind_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__bind_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_bind.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getcall(const OsmuxEM__connect_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__connect_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_connect.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const OsmuxEM__connect_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__connect_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_connect.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getcall(const OsmuxEM__mode_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__mode_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_2) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_mode.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_2)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_2), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_2);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_2);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_2->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const OsmuxEM__mode_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__mode_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_2) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_mode.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_2)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_2), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_2);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_2);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_2->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getcall(const OsmuxEM__configure_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__configure_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_3) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_configure.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_3)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_3), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_3);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_3);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_3->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const OsmuxEM__configure_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__configure_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_3) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_configure.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_3)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_3), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_3);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_3);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_3->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getcall(const OsmuxEM__stats__get_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__stats__get_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_4) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_stats_get.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_4)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_4), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_4);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_4);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_4->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const OsmuxEM__stats__get_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__stats__get_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_4) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_stats_get.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_4)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_4), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_4);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_4);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_4->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getcall(const OsmuxEM__register__rxhandle_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__register__rxhandle_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_5) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_register_rxhandle.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_5)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_5), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_5);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_5);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_5->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const OsmuxEM__register__rxhandle_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__register__rxhandle_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_5) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_register_rxhandle.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_5)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_5), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_5);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_5);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_5->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getcall(const OsmuxEM__register__txhandle_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__register__txhandle_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_6) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_register_txhandle.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_6)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_6), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_6);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_6);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_6->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getcall(const OsmuxEM__register__txhandle_template& getcall_template, const COMPONENT_template& sender_template, const OsmuxEM__register__txhandle_call_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::sender__does__not__match__from__clause,
(TTCN_Logger::begin_event(log_sev, TRUE), sender_template.log_match(proc_queue_head->sender_component),  TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else if (proc_queue_head->item_selection != CALL_6) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a call for signature @OSMUX_Emulation.OsmuxEM_register_txhandle.", port_name);
return ALT_NO;
} else if (!getcall_template.match_call(*proc_queue_head->call_6)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__call__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getcall_template.log_match_call(*proc_queue_head->call_6), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->call_6);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getcall_template.log_match_call(*proc_queue_head->call_6);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::call__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->call_6->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case REPLY_0:
case REPLY_1:
case REPLY_2:
case REPLY_3:
case REPLY_4:
case REPLY_5:
case REPLY_6:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component,
FALSE, CHARSTRING(0, NULL), msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a reply.", port_name);
return ALT_NO;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else switch (proc_queue_head->item_selection) {
case REPLY_0:
case REPLY_1:
case REPLY_2:
case REPLY_3:
case REPLY_4:
case REPLY_5:
case REPLY_6:
{
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component,
TRUE, CHARSTRING(0, NULL), msg_head_count+1);
}
return ALT_YES;
}
default:
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: First entity in the queue is not a reply.", port_name);
return ALT_NO;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const OsmuxEM__bind_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__bind_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_bind.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const OsmuxEM__bind_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__bind_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_0) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_bind.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_0)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_0), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_0);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_0);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const OsmuxEM__connect_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__connect_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_connect.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const OsmuxEM__connect_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__connect_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_1) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_connect.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_1)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_1), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_1);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_1);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const OsmuxEM__mode_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__mode_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_2) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_mode.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_2)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_2), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_2);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_2);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_2->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const OsmuxEM__mode_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__mode_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_2) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_mode.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_2)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_2), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_2);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_2);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_2->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const OsmuxEM__configure_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__configure_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_3) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_configure.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_3)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_3), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_3);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_3);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_3->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const OsmuxEM__configure_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__configure_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_3) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_configure.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_3)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_3), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_3);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_3);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_3->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const OsmuxEM__stats__get_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__stats__get_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_4) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_stats_get.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_4)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_4), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_4);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_4);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_4->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const OsmuxEM__stats__get_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__stats__get_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_4) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_stats_get.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_4)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_4), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_4);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_4);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_4->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const OsmuxEM__register__rxhandle_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__register__rxhandle_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_5) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_register_rxhandle.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_5)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_5), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_5);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_5);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_5->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const OsmuxEM__register__rxhandle_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__register__rxhandle_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_5) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_register_rxhandle.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_5)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_5), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_5);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_5);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_5->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::getreply(const OsmuxEM__register__txhandle_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__register__txhandle_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_6) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_register_txhandle.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_6)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_6), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_6);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_6);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, FALSE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_6->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_proc_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__CTRL__PT::check_getreply(const OsmuxEM__register__txhandle_template& getreply_template, const COMPONENT_template& sender_template, const OsmuxEM__register__txhandle_reply_redirect& param_ref, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (proc_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(proc_queue_head->sender_component)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first entity in the queue does not match the from clause: ", port_name);
sender_template.log_match(proc_queue_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (proc_queue_head->item_selection != REPLY_6) {
TTCN_Logger::log(proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMUNSUCC:TTCN_Logger::MATCHING_PCUNSUCC, "Matching on port %s failed: The first entity in the queue is not a reply for signature @OSMUX_Emulation.OsmuxEM_register_txhandle.", port_name);
return ALT_NO;
} else if (!getreply_template.match_reply(*proc_queue_head->reply_6)) {
const TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_PMUNSUCC : TTCN_Logger::MATCHING_PCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::procedure__,
port_name, proc_queue_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::parameters__of__reply__do__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), getreply_template.log_match_reply(*proc_queue_head->reply_6), TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
param_ref.set_parameters(*proc_queue_head->reply_6);
if (sender_ptr != NULL) *sender_ptr = proc_queue_head->sender_component;
TTCN_Logger::Severity log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_PMSUCCESS:TTCN_Logger::MATCHING_PCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s succeeded: ", port_name);
getreply_template.log_match_reply(*proc_queue_head->reply_6);
TTCN_Logger::end_event();
}
log_sev = proc_queue_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_PMIN:TTCN_Logger::PORTEVENT_PCIN;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_procport_recv(port_name, TitanLoggerApiSimple::Port__oper::reply__op, proc_queue_head->sender_component, TRUE,
(TTCN_Logger::begin_event(log_sev, TRUE), proc_queue_head->reply_6->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

void OsmuxEM__CTRL__PT::incoming_call(const OsmuxEM__bind_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_0;
new_item->call_0 = new OsmuxEM__bind_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_call(const OsmuxEM__connect_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_1;
new_item->call_1 = new OsmuxEM__connect_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_call(const OsmuxEM__mode_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_2;
new_item->call_2 = new OsmuxEM__mode_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_call(const OsmuxEM__configure_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_3;
new_item->call_3 = new OsmuxEM__configure_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_call(const OsmuxEM__stats__get_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_4;
new_item->call_4 = new OsmuxEM__stats__get_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_call(const OsmuxEM__register__rxhandle_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_5;
new_item->call_5 = new OsmuxEM__register__rxhandle_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_call(const OsmuxEM__register__txhandle_call& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A call that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a call has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__call, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = CALL_6;
new_item->call_6 = new OsmuxEM__register__txhandle_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_reply(const OsmuxEM__bind_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_0;
new_item->reply_0 = new OsmuxEM__bind_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_reply(const OsmuxEM__connect_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_1;
new_item->reply_1 = new OsmuxEM__connect_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_reply(const OsmuxEM__mode_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_2;
new_item->reply_2 = new OsmuxEM__mode_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_reply(const OsmuxEM__configure_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_3;
new_item->reply_3 = new OsmuxEM__configure_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_reply(const OsmuxEM__stats__get_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_4;
new_item->reply_4 = new OsmuxEM__stats__get_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_reply(const OsmuxEM__register__rxhandle_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_5;
new_item->reply_5 = new OsmuxEM__register__rxhandle_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void OsmuxEM__CTRL__PT::incoming_reply(const OsmuxEM__register__txhandle_reply& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A reply that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a reply has arrived on it.", port_name);
}
}
proc_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_PQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__reply, port_name, sender_component, proc_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_PQUEUE, TRUE), TTCN_Logger::log_char(' '), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
proc_queue_item *new_item = new proc_queue_item;
new_item->item_selection = REPLY_6;
new_item->reply_6 = new OsmuxEM__register__txhandle_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

boolean OsmuxEM__CTRL__PT::process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_bind")) {
OsmuxEM__bind_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_connect")) {
OsmuxEM__connect_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_mode")) {
OsmuxEM__mode_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_configure")) {
OsmuxEM__configure_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_stats_get")) {
OsmuxEM__stats__get_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_register_rxhandle")) {
OsmuxEM__register__rxhandle_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_register_txhandle")) {
OsmuxEM__register__txhandle_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

boolean OsmuxEM__CTRL__PT::process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_bind")) {
OsmuxEM__bind_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_connect")) {
OsmuxEM__connect_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_mode")) {
OsmuxEM__mode_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_configure")) {
OsmuxEM__configure_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_stats_get")) {
OsmuxEM__stats__get_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_register_rxhandle")) {
OsmuxEM__register__rxhandle_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@OSMUX_Emulation.OsmuxEM_register_txhandle")) {
OsmuxEM__register__txhandle_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

void OsmuxEM__DATA__PT::remove_msg_queue_head()
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
switch (my_head->item_selection) {
case MESSAGE_0:
delete (my_head)->message_0;
break;
default:
TTCN_error("Internal error: Invalid message selector in the queue of port %s.", port_name);
}
msg_queue_item_base *next_item = msg_queue_head->next_item;
delete (msg_queue_item*)msg_queue_head;
msg_queue_head = next_item;
if (next_item == NULL) msg_queue_tail = NULL;
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::extract__msg, port_name, 0, ++msg_head_count, CHARSTRING(0,NULL), CHARSTRING(0,NULL));}

void OsmuxEM__DATA__PT::clear_queue()
{
while (msg_queue_head != NULL) remove_msg_queue_head();
}

OsmuxEM__DATA__PT::OsmuxEM__DATA__PT(const char *par_port_name)
 : PORT(par_port_name)
{
msg_queue_head = NULL;
msg_queue_tail = NULL;
}

OsmuxEM__DATA__PT::~OsmuxEM__DATA__PT()
{
clear_queue();
}

void OsmuxEM__DATA__PT::send(const OSMUX__Types::OSMUX__PDU& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
if (!destination_component.is_bound()) TTCN_error("Unbound component reference in the to clause of send operation.");
const TTCN_Logger::Severity log_sev = destination_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMSEND:TTCN_Logger::PORTEVENT_MCSEND;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_send(port_name, destination_component,
(TTCN_Logger::begin_event(log_sev, TRUE), TTCN_Logger::log_event_str(" @OSMUX_Types.OSMUX_PDU : "),
send_par.log(), TTCN_Logger::end_event_log2str()));
}
if (destination_component == SYSTEM_COMPREF) TTCN_error("Message cannot be sent to system on internal port %s.", port_name);
else {
Text_Buf text_buf;
prepare_message(text_buf, "@OSMUX_Types.OSMUX_PDU");
send_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void OsmuxEM__DATA__PT::send(const OSMUX__Types::OSMUX__PDU& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
for (size_t i = 0; i < nof_components; ++i) send(send_par, destination_components[i], timestamp_redirect);
}

void OsmuxEM__DATA__PT::send(const OSMUX__Types::OSMUX__PDU& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
if (broadcast) {
if (!is_started) TTCN_error("Sending a message on port %s, which is not started.", port_name);
Text_Buf text_buf;
prepare_message(text_buf, "@OSMUX_Types.OSMUX_PDU");
send_par.encode_text(text_buf);
send_data_broadcast(text_buf, PORT::OMT_SEND, (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MCSEND, TRUE),
TTCN_Logger::log_event_str(" @OSMUX_Types.OSMUX_PDU : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void OsmuxEM__DATA__PT::send(const OSMUX__Types::OSMUX__PDU_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const OSMUX__Types::OSMUX__PDU& send_par_value = OSMUX__Types::OSMUX__PDU(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void OsmuxEM__DATA__PT::send(const OSMUX__Types::OSMUX__PDU_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const OSMUX__Types::OSMUX__PDU& send_par_value = OSMUX__Types::OSMUX__PDU(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void OsmuxEM__DATA__PT::send(const OSMUX__Types::OSMUX__PDU_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const OSMUX__Types::OSMUX__PDU& send_par_value = OSMUX__Types::OSMUX__PDU(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

alt_status OsmuxEM__DATA__PT::receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @OSMUX_Types.OSMUX_PDU: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__DATA__PT::check_receive(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @OSMUX_Types.OSMUX_PDU: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
return ALT_YES;
}
}

alt_status OsmuxEM__DATA__PT::trigger(const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS, "Matching on port %s succeeded.", port_name);
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
switch (my_head->item_selection) {
case MESSAGE_0:
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @OSMUX_Types.OSMUX_PDU: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__DATA__PT::receive(const OSMUX__Types::OSMUX__PDU_template& value_template, OSMUX__Types::OSMUX__PDU *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @OSMUX_Types.OSMUX_PDU.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @OSMUX_Types.OSMUX_PDU : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status OsmuxEM__DATA__PT::check_receive(const OSMUX__Types::OSMUX__PDU_template& value_template, OSMUX__Types::OSMUX__PDU *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Check-receive operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s failed: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
return ALT_NO;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s failed: Type of the first message in the queue is not @OSMUX_Types.OSMUX_PDU.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::check__receive__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @OSMUX_Types.OSMUX_PDU : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status OsmuxEM__DATA__PT::trigger(const OSMUX__Types::OSMUX__PDU_template& value_template, OSMUX__Types::OSMUX__PDU *value_redirect, const COMPONENT_template& sender_template, COMPONENT *sender_ptr, FLOAT* timestamp_redirect, Index_Redirect*)
{
if (value_template.get_selection() == ANY_OR_OMIT) TTCN_error("Trigger operation using '*' as matching template");
msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;
if (msg_queue_head == NULL) {
if (is_started) return ALT_MAYBE;
else {
TTCN_Logger::log(TTCN_Logger::MATCHING_PROBLEM, "Matching on port %s failed: Port is not started and the queue is empty.", port_name);
return ALT_NO;
}
} else if (!sender_template.match(my_head->sender_component)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::begin_event(log_sev);
TTCN_Logger::log_event("Matching on port %s will drop a message: Sender of the first message in the queue does not match the from clause: ", port_name);
sender_template.log_match(my_head->sender_component);
TTCN_Logger::end_event();
}
remove_msg_queue_head();
return ALT_REPEAT;
} else if (my_head->item_selection != MESSAGE_0) {
TTCN_Logger::log(my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMUNSUCC:TTCN_Logger::MATCHING_MCUNSUCC, "Matching on port %s will drop a message: Type of the first message in the queue is not @OSMUX_Types.OSMUX_PDU.", port_name);
remove_msg_queue_head();
return ALT_REPEAT;
} else if (!value_template.match(*my_head->message_0)) {
const TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF ? TTCN_Logger::MATCHING_MMUNSUCC : TTCN_Logger::MATCHING_MCUNSUCC;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_failure(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
TitanLoggerApiSimple::MatchingFailureType_reason::message__does__not__match__template,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_0;
}
if (sender_ptr != NULL) *sender_ptr = my_head->sender_component;
TTCN_Logger::Severity log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::MATCHING_MMSUCCESS:TTCN_Logger::MATCHING_MCSUCCESS;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_matching_success(TitanLoggerApiSimple::PortType::message__,
port_name, my_head->sender_component,
(TTCN_Logger::begin_event(log_sev, TRUE), value_template.log_match(*my_head->message_0),
 TTCN_Logger::end_event_log2str()));
}
log_sev = my_head->sender_component==SYSTEM_COMPREF?TTCN_Logger::PORTEVENT_MMRECV:TTCN_Logger::PORTEVENT_MCRECV;
if (TTCN_Logger::log_this_event(log_sev)) {
TTCN_Logger::log_msgport_recv(port_name, TitanLoggerApiSimple::Msg__port__recv_operation::trigger__op,
my_head->sender_component, CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(log_sev,TRUE), TTCN_Logger::log_event_str(": @OSMUX_Types.OSMUX_PDU : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

void OsmuxEM__DATA__PT::incoming_message(const OSMUX__Types::OSMUX__PDU& incoming_par, component sender_component)
{
if (!is_started) {
if (is_halted) {
TTCN_warning("A message that arrived on port %s has been discarded, because the port is not started.", port_name);
return;
}
else {
TTCN_error("Port %s is not started but a message has arrived on it.", port_name);
}
}
msg_tail_count++;
if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_MQUEUE)) {
TTCN_Logger::log_port_queue(TitanLoggerApiSimple::Port__Queue_operation::enqueue__msg, port_name, sender_component, msg_tail_count,
CHARSTRING(0, NULL),
(TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @OSMUX_Types.OSMUX_PDU : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_0;
new_item->message_0 = new OSMUX__Types::OSMUX__PDU(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

boolean OsmuxEM__DATA__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@OSMUX_Types.OSMUX_PDU")) {
OSMUX__Types::OSMUX__PDU incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}


/* Bodies of functions, altsteps and testcases */

OsmuxTxHandle_template t__TxHandleAMR590(const INTEGER& cid)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 123, TTCN_Location::LOCATION_TEMPLATE, "t_TxHandleAMR590");
OsmuxTxHandle_template ret_val;
ret_val.ft() = 1;
ret_val.amr__f() = bs_0;
ret_val.amr__q() = bs_1;
ret_val.seq() = 12;
ret_val.cid() = cid;
ret_val.amr__ft() = 2;
ret_val.amr__cmr() = 0;
return ret_val;
}

void f__osmuxem__bind(OsmuxEM__CTRL__PT& pt, const CHARSTRING& local__host, INTEGER& local__port)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 199, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_bind");
current_location.update_lineno(200);
/* OSMUX_Emulation.ttcn, line 200 */
{
OsmuxEM__bind_template tmp_0;
tmp_0.local__host() = local__host;
tmp_0.local__port() = local__port;
pt.call(tmp_0, FALSE, NULL);
}
{
alt_status tmp_1_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(200);
/* OSMUX_Emulation.ttcn, line 200 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_1_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(201);
/* OSMUX_Emulation.ttcn, line 201 */
{
OsmuxEM__bind_template tmp_2;
tmp_2.local__host() = local__host;
tmp_2.local__port() = ANY_VALUE;
tmp_1_alt_flag_0 = pt.getreply(tmp_2, any_compref, OsmuxEM__bind_reply_redirect(&(local__port)), NULL, NULL, NULL);
}
if (tmp_1_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(200);
/* OSMUX_Emulation.ttcn, line 200 */
if (tmp_1_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file OSMUX_Emulation.ttcn between lines 200 and 202.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void f__osmuxem__connect(OsmuxEM__CTRL__PT& pt, const CHARSTRING& remote__host, const INTEGER& remote__port)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 204, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_connect");
current_location.update_lineno(205);
/* OSMUX_Emulation.ttcn, line 205 */
{
OsmuxEM__connect_template tmp_3;
tmp_3.remote__host() = remote__host;
tmp_3.remote__port() = remote__port;
pt.call(tmp_3, FALSE, NULL);
}
{
alt_status tmp_4_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(205);
/* OSMUX_Emulation.ttcn, line 205 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_4_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(206);
/* OSMUX_Emulation.ttcn, line 206 */
{
OsmuxEM__connect_template tmp_5;
tmp_5.remote__host() = remote__host;
tmp_5.remote__port() = remote__port;
tmp_4_alt_flag_0 = pt.getreply(tmp_5, any_compref, OsmuxEM__connect_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_4_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(205);
/* OSMUX_Emulation.ttcn, line 205 */
if (tmp_4_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file OSMUX_Emulation.ttcn between lines 205 and 207.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void f__osmuxem__mode(OsmuxEM__CTRL__PT& pt, const OsmuxemMode& mode)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 209, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_mode");
current_location.update_lineno(210);
/* OSMUX_Emulation.ttcn, line 210 */
{
OsmuxEM__mode_template tmp_6;
tmp_6.mode() = mode;
pt.call(tmp_6, FALSE, NULL);
}
{
alt_status tmp_7_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(210);
/* OSMUX_Emulation.ttcn, line 210 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_7_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(211);
/* OSMUX_Emulation.ttcn, line 211 */
{
OsmuxEM__mode_template tmp_8;
tmp_8.mode() = mode;
tmp_7_alt_flag_0 = pt.getreply(tmp_8, any_compref, OsmuxEM__mode_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_7_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(210);
/* OSMUX_Emulation.ttcn, line 210 */
if (tmp_7_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file OSMUX_Emulation.ttcn between lines 210 and 212.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void f__osmuxem__configure(OsmuxEM__CTRL__PT& pt, const OsmuxemConfig& cfg)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 214, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_configure");
current_location.update_lineno(215);
/* OSMUX_Emulation.ttcn, line 215 */
{
OsmuxEM__configure_template tmp_9;
tmp_9.cfg() = cfg;
pt.call(tmp_9, FALSE, NULL);
}
{
alt_status tmp_10_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(215);
/* OSMUX_Emulation.ttcn, line 215 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_10_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(216);
/* OSMUX_Emulation.ttcn, line 216 */
{
OsmuxEM__configure_template tmp_11;
tmp_11.cfg() = cfg;
tmp_10_alt_flag_0 = pt.getreply(tmp_11, any_compref, OsmuxEM__configure_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_10_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(215);
/* OSMUX_Emulation.ttcn, line 215 */
if (tmp_10_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file OSMUX_Emulation.ttcn between lines 215 and 217.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

OsmuxemStats f__osmuxem__stats__get(OsmuxEM__CTRL__PT& pt)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 219, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_stats_get");
current_location.update_lineno(220);
/* OSMUX_Emulation.ttcn, line 220 */
OsmuxemStats stats;
current_location.update_lineno(221);
/* OSMUX_Emulation.ttcn, line 221 */
{
OsmuxEM__stats__get_template tmp_12;
pt.call(tmp_12, FALSE, NULL);
}
{
alt_status tmp_13_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(221);
/* OSMUX_Emulation.ttcn, line 221 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_13_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(222);
/* OSMUX_Emulation.ttcn, line 222 */
{
OsmuxEM__stats__get_template tmp_14;
tmp_14.stats() = ANY_VALUE;
tmp_13_alt_flag_0 = pt.getreply(tmp_14, any_compref, OsmuxEM__stats__get_reply_redirect(&(stats)), NULL, NULL, NULL);
}
if (tmp_13_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(221);
/* OSMUX_Emulation.ttcn, line 221 */
if (tmp_13_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file OSMUX_Emulation.ttcn between lines 221 and 223.");
TTCN_Snapshot::take_new(TRUE);
}
}
current_location.update_lineno(224);
/* OSMUX_Emulation.ttcn, line 224 */
return stats;
}

void f__osmuxem__register__rxhandle(OsmuxEM__CTRL__PT& pt, const OsmuxRxHandle& hdl)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 227, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_register_rxhandle");
current_location.update_lineno(228);
/* OSMUX_Emulation.ttcn, line 228 */
{
OsmuxEM__register__rxhandle_template tmp_15;
tmp_15.hdl() = hdl;
pt.call(tmp_15, FALSE, NULL);
}
{
alt_status tmp_16_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(228);
/* OSMUX_Emulation.ttcn, line 228 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_16_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(229);
/* OSMUX_Emulation.ttcn, line 229 */
{
OsmuxEM__register__rxhandle_template tmp_17;
tmp_17.hdl() = hdl;
tmp_16_alt_flag_0 = pt.getreply(tmp_17, any_compref, OsmuxEM__register__rxhandle_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_16_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(228);
/* OSMUX_Emulation.ttcn, line 228 */
if (tmp_16_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file OSMUX_Emulation.ttcn between lines 228 and 230.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void f__osmuxem__register__txhandle(OsmuxEM__CTRL__PT& pt, const OsmuxTxHandle& hdl)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 233, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_register_txhandle");
current_location.update_lineno(234);
/* OSMUX_Emulation.ttcn, line 234 */
{
OsmuxEM__register__txhandle_template tmp_18;
tmp_18.hdl() = hdl;
pt.call(tmp_18, FALSE, NULL);
}
{
alt_status tmp_19_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(234);
/* OSMUX_Emulation.ttcn, line 234 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_19_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(235);
/* OSMUX_Emulation.ttcn, line 235 */
{
OsmuxEM__register__txhandle_template tmp_20;
tmp_20.hdl() = hdl;
tmp_19_alt_flag_0 = pt.getreply(tmp_20, any_compref, OsmuxEM__register__txhandle_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_19_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(234);
/* OSMUX_Emulation.ttcn, line 234 */
if (tmp_19_alt_flag_0 == ALT_NO) TTCN_error("None of the branches can be chosen in the response and exception handling part of call statement in file OSMUX_Emulation.ttcn between lines 234 and 236.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

BOOLEAN f__osmuxem__stats__compare__value(const INTEGER& a, const INTEGER& b, const INTEGER& tolerance)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 240, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_stats_compare_value");
current_location.update_lineno(241);
/* OSMUX_Emulation.ttcn, line 241 */
INTEGER temp;
current_location.update_lineno(243);
/* OSMUX_Emulation.ttcn, line 243 */
temp = (a - b);
current_location.update_lineno(244);
/* OSMUX_Emulation.ttcn, line 244 */
if ((temp < 0)) {
current_location.update_lineno(245);
/* OSMUX_Emulation.ttcn, line 245 */
{
INTEGER tmp_22;
tmp_22 = (-(temp));
temp = tmp_22;
}
}
current_location.update_lineno(248);
/* OSMUX_Emulation.ttcn, line 248 */
if ((temp > tolerance)) {
current_location.update_lineno(249);
/* OSMUX_Emulation.ttcn, line 249 */
return FALSE;
}
current_location.update_lineno(252);
/* OSMUX_Emulation.ttcn, line 252 */
return TRUE;
}

BOOLEAN f__osmuxem__stats__compare(const OsmuxemStats& a, const OsmuxemStats& b, const INTEGER& tolerance)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 259, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_stats_compare");
current_location.update_lineno(260);
/* OSMUX_Emulation.ttcn, line 260 */
INTEGER plen;
current_location.update_lineno(262);
/* OSMUX_Emulation.ttcn, line 262 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("stats A: ");
a.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(263);
/* OSMUX_Emulation.ttcn, line 263 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("stats B: ");
b.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(264);
/* OSMUX_Emulation.ttcn, line 264 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("tolerance: ");
tolerance.log();
TTCN_Logger::log_event_str(" packets");
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(266);
/* OSMUX_Emulation.ttcn, line 266 */
if ((f__osmuxem__stats__compare__value(const_cast< const OsmuxemStats&>(a).num__pkts__tx(), const_cast< const OsmuxemStats&>(b).num__pkts__rx(), tolerance) == FALSE)) {
current_location.update_lineno(267);
/* OSMUX_Emulation.ttcn, line 267 */
return FALSE;
}
current_location.update_lineno(270);
/* OSMUX_Emulation.ttcn, line 270 */
if ((f__osmuxem__stats__compare__value(const_cast< const OsmuxemStats&>(a).num__pkts__rx(), const_cast< const OsmuxemStats&>(b).num__pkts__tx(), tolerance) == FALSE)) {
current_location.update_lineno(271);
/* OSMUX_Emulation.ttcn, line 271 */
return FALSE;
}
current_location.update_lineno(274);
/* OSMUX_Emulation.ttcn, line 274 */
if ((const_cast< const OsmuxemStats&>(a).num__pkts__tx() > 0)) {
current_location.update_lineno(275);
/* OSMUX_Emulation.ttcn, line 275 */
plen = (const_cast< const OsmuxemStats&>(a).bytes__payload__tx() / const_cast< const OsmuxemStats&>(a).num__pkts__tx());
}
else {
current_location.update_lineno(277);
/* OSMUX_Emulation.ttcn, line 277 */
plen = 0;
}
current_location.update_lineno(280);
/* OSMUX_Emulation.ttcn, line 280 */
if ((f__osmuxem__stats__compare__value(const_cast< const OsmuxemStats&>(a).bytes__payload__tx(), const_cast< const OsmuxemStats&>(b).bytes__payload__rx(), (tolerance * plen)) == FALSE)) {
current_location.update_lineno(281);
/* OSMUX_Emulation.ttcn, line 281 */
return FALSE;
}
current_location.update_lineno(284);
/* OSMUX_Emulation.ttcn, line 284 */
if ((f__osmuxem__stats__compare__value(const_cast< const OsmuxemStats&>(a).bytes__payload__rx(), const_cast< const OsmuxemStats&>(b).bytes__payload__tx(), (tolerance * plen)) == FALSE)) {
current_location.update_lineno(285);
/* OSMUX_Emulation.ttcn, line 285 */
return FALSE;
}
current_location.update_lineno(288);
/* OSMUX_Emulation.ttcn, line 288 */
return TRUE;
}

void f__osmuxem__stats__err__check(const OsmuxemStats& s)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 294, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_stats_err_check");
current_location.update_lineno(295);
/* OSMUX_Emulation.ttcn, line 295 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("stats: ");
s.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(299);
/* OSMUX_Emulation.ttcn, line 299 */
{
boolean tmp_25;
tmp_25 = (const_cast< const OsmuxemStats&>(s).num__pkts__tx() < 1);
if (tmp_25) tmp_25 = (const_cast< const OsmuxemStats&>(s).num__pkts__rx() < 1);
if (tmp_25) {
current_location.update_lineno(300);
/* OSMUX_Emulation.ttcn, line 300 */
Misc__Helpers::f__shutdown(cs_0, 300, FAIL, cs_1);
}
}
current_location.update_lineno(303);
/* OSMUX_Emulation.ttcn, line 303 */
{
boolean tmp_26;
tmp_26 = (const_cast< const OsmuxemStats&>(s).bytes__payload__tx() < 1);
if (tmp_26) tmp_26 = (const_cast< const OsmuxemStats&>(s).bytes__payload__rx() < 1);
if (tmp_26) {
current_location.update_lineno(304);
/* OSMUX_Emulation.ttcn, line 304 */
Misc__Helpers::f__shutdown(cs_0, 304, FAIL, cs_2);
}
}
current_location.update_lineno(309);
/* OSMUX_Emulation.ttcn, line 309 */
if ((const_cast< const OsmuxemStats&>(s).num__pkts__rx__err__seq() != 0)) {
current_location.update_lineno(310);
/* OSMUX_Emulation.ttcn, line 310 */
Misc__Helpers::f__shutdown(cs_0, 310, FAIL, cs_3);
}
current_location.update_lineno(313);
/* OSMUX_Emulation.ttcn, line 313 */
if ((const_cast< const OsmuxemStats&>(s).num__pkts__rx__err__disabled() != 0)) {
current_location.update_lineno(314);
/* OSMUX_Emulation.ttcn, line 314 */
Misc__Helpers::f__shutdown(cs_0, 314, FAIL, cs_4);
}
current_location.update_lineno(317);
/* OSMUX_Emulation.ttcn, line 317 */
if ((const_cast< const OsmuxemStats&>(s).num__pkts__rx__err__payload() != 0)) {
current_location.update_lineno(318);
/* OSMUX_Emulation.ttcn, line 318 */
Misc__Helpers::f__shutdown(cs_0, 318, FAIL, cs_5);
}
}

OSMUX__Types::PDU__Osmux__AMR_template ts__OsmuxAMR(const BITSTRING& marker, const INTEGER& ctr, const BITSTRING& amr__f, const BITSTRING& amr__q, const INTEGER& seq, const INTEGER& cid, const INTEGER& amr__ft, const INTEGER& amr__cmr, const OCTETSTRING& payload)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 323, TTCN_Location::LOCATION_TEMPLATE, "ts_OsmuxAMR");
OSMUX__Types::PDU__Osmux__AMR_template ret_val;
{
OSMUX__Types::Osmux__AMR__header_template& tmp_27 = ret_val.header();
tmp_27.marker() = marker;
tmp_27.ft() = 1;
tmp_27.ctr() = ctr;
tmp_27.amr__f() = amr__f;
tmp_27.amr__q() = amr__q;
tmp_27.seq() = seq;
tmp_27.cid() = cid;
tmp_27.amr__ft() = amr__ft;
tmp_27.amr__cmr() = amr__cmr;
}
ret_val.data() = payload;
return ret_val;
}

OsmuxRxHandle f__rxhandle__get__by__cid(const INTEGER& cid)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 340, TTCN_Location::LOCATION_FUNCTION, "f_rxhandle_get_by_cid");
current_location.update_lineno(341);
/* OSMUX_Emulation.ttcn, line 341 */
INTEGER i;
current_location.update_lineno(342);
/* OSMUX_Emulation.ttcn, line 342 */
i = 0;
current_location.update_lineno(342);
/* OSMUX_Emulation.ttcn, line 342 */
for ( ; ; ) {
current_location.update_lineno(342);
/* OSMUX_Emulation.ttcn, line 342 */
if (!(i < 16)) break;
current_location.update_lineno(343);
/* OSMUX_Emulation.ttcn, line 343 */
{
boolean tmp_29;
{
boolean tmp_30 = OSMUX__Emulation__CT_component_RxHandleTable.is_bound();
if(tmp_30) {
const int tmp_31 = i;
tmp_30 = (tmp_31 >= 0) && (OSMUX__Emulation__CT_component_RxHandleTable.size_of() > tmp_31);
if(tmp_30) {
const RxHandleTableRec& tmp_32 = OSMUX__Emulation__CT_component_RxHandleTable[tmp_31];
tmp_30 = tmp_32.is_bound();
if(tmp_30) {
const RxHandleTableRec& tmp_33 = tmp_32;
const INTEGER& tmp_34 = tmp_33.cid();
tmp_30 = tmp_34.is_bound();
}
}
}
tmp_29 = tmp_30;
}
if (tmp_29) tmp_29 = (const_cast< const VALUE_ARRAY<RxHandleTableRec, 16, 0>&>(OSMUX__Emulation__CT_component_RxHandleTable)[i].cid() == cid);
if (tmp_29) {
current_location.update_lineno(344);
/* OSMUX_Emulation.ttcn, line 344 */
return const_cast< const VALUE_ARRAY<RxHandleTableRec, 16, 0>&>(OSMUX__Emulation__CT_component_RxHandleTable)[i].vc__conn();
}
}
current_location.update_lineno(342);
/* OSMUX_Emulation.ttcn, line 342 */
{
INTEGER tmp_35;
++i;
}
}
current_location.update_lineno(347);
/* OSMUX_Emulation.ttcn, line 347 */
Misc__Helpers::f__shutdown(cs_0, 347, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No Component for CID "),cid.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(349);
/* OSMUX_Emulation.ttcn, line 349 */
return const_cast< const VALUE_ARRAY<RxHandleTableRec, 16, 0>&>(OSMUX__Emulation__CT_component_RxHandleTable)[0].vc__conn();
}

void start_f__rxhandle__get__by__cid(const COMPONENT& component_reference, const INTEGER& cid)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rxhandle_get_by_cid(");
cid.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "OSMUX_Emulation", "f_rxhandle_get_by_cid", text_buf);
cid.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__rxhandle__cid__add(const OsmuxRxHandle& hdl)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 352, TTCN_Location::LOCATION_FUNCTION, "f_rxhandle_cid_add");
current_location.update_lineno(353);
/* OSMUX_Emulation.ttcn, line 353 */
INTEGER i;
current_location.update_lineno(354);
/* OSMUX_Emulation.ttcn, line 354 */
i = 0;
current_location.update_lineno(354);
/* OSMUX_Emulation.ttcn, line 354 */
for ( ; ; ) {
current_location.update_lineno(354);
/* OSMUX_Emulation.ttcn, line 354 */
if (!(i < 16)) break;
current_location.update_lineno(355);
/* OSMUX_Emulation.ttcn, line 355 */
{
boolean tmp_42;
{
boolean tmp_37 = OSMUX__Emulation__CT_component_RxHandleTable.is_bound();
if(tmp_37) {
const int tmp_38 = i;
tmp_37 = (tmp_38 >= 0) && (OSMUX__Emulation__CT_component_RxHandleTable.size_of() > tmp_38);
if(tmp_37) {
const RxHandleTableRec& tmp_39 = OSMUX__Emulation__CT_component_RxHandleTable[tmp_38];
tmp_37 = tmp_39.is_bound();
if(tmp_37) {
const RxHandleTableRec& tmp_40 = tmp_39;
const INTEGER& tmp_41 = tmp_40.cid();
tmp_37 = tmp_41.is_bound();
}
}
}
tmp_42 = (!(tmp_37));
}
if (tmp_42) {
current_location.update_lineno(356);
/* OSMUX_Emulation.ttcn, line 356 */
OSMUX__Emulation__CT_component_RxHandleTable[i].cid() = const_cast< const OsmuxRxHandle&>(hdl).cid();
current_location.update_lineno(357);
/* OSMUX_Emulation.ttcn, line 357 */
OSMUX__Emulation__CT_component_RxHandleTable[i].vc__conn() = hdl;
current_location.update_lineno(358);
/* OSMUX_Emulation.ttcn, line 358 */
return;
}
}
current_location.update_lineno(354);
/* OSMUX_Emulation.ttcn, line 354 */
{
INTEGER tmp_45;
++i;
}
}
current_location.update_lineno(361);
/* OSMUX_Emulation.ttcn, line 361 */
Misc__Helpers::f__shutdown(cs_0, 361, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No Space in RxHandleTable for "),const_cast< const OsmuxRxHandle&>(hdl).cid().log(),TTCN_Logger::end_event_log2str()));
}

void start_f__rxhandle__cid__add(const COMPONENT& component_reference, const OsmuxRxHandle& hdl)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rxhandle_cid_add(");
hdl.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "OSMUX_Emulation", "f_rxhandle_cid_add", text_buf);
hdl.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__txhandle__cid__add(const OsmuxTxHandle& hdl)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 365, TTCN_Location::LOCATION_FUNCTION, "f_txhandle_cid_add");
current_location.update_lineno(366);
/* OSMUX_Emulation.ttcn, line 366 */
INTEGER i;
current_location.update_lineno(367);
/* OSMUX_Emulation.ttcn, line 367 */
i = 0;
current_location.update_lineno(367);
/* OSMUX_Emulation.ttcn, line 367 */
for ( ; ; ) {
current_location.update_lineno(367);
/* OSMUX_Emulation.ttcn, line 367 */
if (!(i < 16)) break;
current_location.update_lineno(368);
/* OSMUX_Emulation.ttcn, line 368 */
{
boolean tmp_50;
{
boolean tmp_47 = OSMUX__Emulation__CT_component_TxHandleList.is_bound();
if(tmp_47) {
const int tmp_48 = i;
tmp_47 = (tmp_48 >= 0) && (OSMUX__Emulation__CT_component_TxHandleList.size_of() > tmp_48);
if(tmp_47) {
const OsmuxTxHandle& tmp_49 = OSMUX__Emulation__CT_component_TxHandleList[tmp_48];
tmp_47 = tmp_49.is_bound();
}
}
tmp_50 = (!(tmp_47));
}
if (tmp_50) {
current_location.update_lineno(369);
/* OSMUX_Emulation.ttcn, line 369 */
OSMUX__Emulation__CT_component_TxHandleList[i] = hdl;
current_location.update_lineno(370);
/* OSMUX_Emulation.ttcn, line 370 */
return;
}
}
current_location.update_lineno(367);
/* OSMUX_Emulation.ttcn, line 367 */
{
INTEGER tmp_52;
++i;
}
}
current_location.update_lineno(373);
/* OSMUX_Emulation.ttcn, line 373 */
Misc__Helpers::f__shutdown(cs_0, 373, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No Space in TxHandleList for "),const_cast< const OsmuxTxHandle&>(hdl).cid().log(),TTCN_Logger::end_event_log2str()));
}

void start_f__txhandle__cid__add(const COMPONENT& component_reference, const OsmuxTxHandle& hdl)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_txhandle_cid_add(");
hdl.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "OSMUX_Emulation", "f_txhandle_cid_add", text_buf);
hdl.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

OCTETSTRING f__osmux__gen__expected__rx__rtp__payload(const INTEGER& amr__ft, const OCTETSTRING& tx__fixed__payload)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 378, TTCN_Location::LOCATION_FUNCTION, "f_osmux_gen_expected_rx_rtp_payload");
current_location.update_lineno(379);
/* OSMUX_Emulation.ttcn, line 379 */
INTEGER payload__len__bits;
current_location.update_lineno(380);
/* OSMUX_Emulation.ttcn, line 380 */
INTEGER payload__len;
current_location.update_lineno(381);
/* OSMUX_Emulation.ttcn, line 381 */
BITSTRING payload__truncated__bits;
current_location.update_lineno(382);
/* OSMUX_Emulation.ttcn, line 382 */
OCTETSTRING payload__truncated;
current_location.update_lineno(385);
/* OSMUX_Emulation.ttcn, line 385 */
payload__len__bits = AMR__Types::f__amrft__payload__bits__len(amr__ft);
current_location.update_lineno(386);
/* OSMUX_Emulation.ttcn, line 386 */
payload__truncated__bits = substr(oct2bit(tx__fixed__payload), 0, payload__len__bits);
current_location.update_lineno(389);
/* OSMUX_Emulation.ttcn, line 389 */
payload__len = AMR__Types::f__amrft__payload__len(amr__ft);
current_location.update_lineno(390);
/* OSMUX_Emulation.ttcn, line 390 */
payload__truncated = bit2oct(Osmocom__Types::f__pad__bit(payload__truncated__bits, (payload__len * 8), bs_0));
current_location.update_lineno(391);
/* OSMUX_Emulation.ttcn, line 391 */
return payload__truncated;
}

OCTETSTRING f__osmux__gen__payload(const INTEGER& ctr, const INTEGER& amr__ft)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 394, TTCN_Location::LOCATION_FUNCTION, "f_osmux_gen_payload");
current_location.update_lineno(395);
/* OSMUX_Emulation.ttcn, line 395 */
OCTETSTRING payload__truncated(os_1);
current_location.update_lineno(396);
/* OSMUX_Emulation.ttcn, line 396 */
INTEGER i;
current_location.update_lineno(398);
/* OSMUX_Emulation.ttcn, line 398 */
i = 0;
current_location.update_lineno(398);
/* OSMUX_Emulation.ttcn, line 398 */
for ( ; ; ) {
current_location.update_lineno(398);
/* OSMUX_Emulation.ttcn, line 398 */
if (!(i < (ctr + 1))) break;
current_location.update_lineno(399);
/* OSMUX_Emulation.ttcn, line 399 */
{
OCTETSTRING tmp_58;
tmp_58 = (payload__truncated + f__osmux__gen__expected__rx__rtp__payload(amr__ft, const_cast< const OsmuxemConfig&>(OSMUX__Emulation__CT_component_g__cfg).tx__fixed__payload()));
payload__truncated = tmp_58;
}
current_location.update_lineno(398);
/* OSMUX_Emulation.ttcn, line 398 */
{
INTEGER tmp_59;
++i;
}
}
current_location.update_lineno(401);
/* OSMUX_Emulation.ttcn, line 401 */
return payload__truncated;
}

void start_f__osmux__gen__payload(const COMPONENT& component_reference, const INTEGER& ctr, const INTEGER& amr__ft)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_osmux_gen_payload(");
ctr.log();
TTCN_Logger::log_event_str(", ");
amr__ft.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "OSMUX_Emulation", "f_osmux_gen_payload", text_buf);
ctr.encode_text(text_buf);
amr__ft.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__tx__osmux(const INTEGER& i, const INTEGER& ctr, const OCTETSTRING& payload, const BITSTRING& marker)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 404, TTCN_Location::LOCATION_FUNCTION, "f_tx_osmux");
current_location.update_lineno(405);
/* OSMUX_Emulation.ttcn, line 405 */
OsmuxTxHandle hdl(const_cast< const VALUE_ARRAY<OsmuxTxHandle, 16, 0>&>(OSMUX__Emulation__CT_component_TxHandleList)[i]);
current_location.update_lineno(406);
/* OSMUX_Emulation.ttcn, line 406 */
OSMUX__Types::PDU__Osmux__AMR osmux__amr(ts__OsmuxAMR(marker, ctr, const_cast< const OsmuxTxHandle&>(hdl).amr__f(), const_cast< const OsmuxTxHandle&>(hdl).amr__q(), const_cast< const OsmuxTxHandle&>(hdl).seq(), const_cast< const OsmuxTxHandle&>(hdl).cid(), const_cast< const OsmuxTxHandle&>(hdl).amr__ft(), const_cast< const OsmuxTxHandle&>(hdl).amr__cmr(), payload).valueof());
current_location.update_lineno(409);
/* OSMUX_Emulation.ttcn, line 409 */
{
OSMUX__Types::OSMUX__PDU_template tmp_60;
tmp_60.osmux__amr() = osmux__amr;
OSMUX__Emulation__CT_component_OSMUX.send(OSMUX__CodecPort::t__Osmux__Send(INTEGER_template(OSMUX__Emulation__CT_component_g__osmux__conn__id), tmp_60), FALSE, NULL);
}
current_location.update_lineno(411);
/* OSMUX_Emulation.ttcn, line 411 */
{
INTEGER tmp_61;
tmp_61 = (const_cast< const VALUE_ARRAY<OsmuxTxHandle, 16, 0>&>(OSMUX__Emulation__CT_component_TxHandleList)[i].seq() + 1);
OSMUX__Emulation__CT_component_TxHandleList[i].seq() = tmp_61;
}
current_location.update_lineno(414);
/* OSMUX_Emulation.ttcn, line 414 */
{
INTEGER tmp_62;
tmp_62 = (const_cast< const OsmuxemStats&>(OSMUX__Emulation__CT_component_g__stat).num__pkts__tx() + 1);
OSMUX__Emulation__CT_component_g__stat.num__pkts__tx() = tmp_62;
}
current_location.update_lineno(415);
/* OSMUX_Emulation.ttcn, line 415 */
{
INTEGER tmp_63;
tmp_63 = (const_cast< const OsmuxemStats&>(OSMUX__Emulation__CT_component_g__stat).bytes__payload__tx() + payload.lengthof());
OSMUX__Emulation__CT_component_g__stat.bytes__payload__tx() = tmp_63;
}
}

void start_f__tx__osmux(const COMPONENT& component_reference, const INTEGER& i, const INTEGER& ctr, const OCTETSTRING& payload, const BITSTRING& marker)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tx_osmux(");
i.log();
TTCN_Logger::log_event_str(", ");
ctr.log();
TTCN_Logger::log_event_str(", ");
payload.log();
TTCN_Logger::log_event_str(", ");
marker.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "OSMUX_Emulation", "f_tx_osmux", text_buf);
i.encode_text(text_buf);
ctr.encode_text(text_buf);
payload.encode_text(text_buf);
marker.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__tx__osmux__all__cid(const BITSTRING& marker)
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 419, TTCN_Location::LOCATION_FUNCTION, "f_tx_osmux_all_cid");
current_location.update_lineno(421);
/* OSMUX_Emulation.ttcn, line 421 */
INTEGER i;
current_location.update_lineno(422);
/* OSMUX_Emulation.ttcn, line 422 */
OCTETSTRING payload__truncated;
current_location.update_lineno(423);
/* OSMUX_Emulation.ttcn, line 423 */
INTEGER ctr((const_cast< const OsmuxemConfig&>(OSMUX__Emulation__CT_component_g__cfg).batch__size() - 1));
current_location.update_lineno(425);
/* OSMUX_Emulation.ttcn, line 425 */
i = 0;
current_location.update_lineno(425);
/* OSMUX_Emulation.ttcn, line 425 */
for ( ; ; ) {
current_location.update_lineno(425);
/* OSMUX_Emulation.ttcn, line 425 */
if (!(i < 16)) break;
current_location.update_lineno(426);
/* OSMUX_Emulation.ttcn, line 426 */
{
boolean tmp_68;
{
boolean tmp_65 = OSMUX__Emulation__CT_component_TxHandleList.is_bound();
if(tmp_65) {
const int tmp_66 = i;
tmp_65 = (tmp_66 >= 0) && (OSMUX__Emulation__CT_component_TxHandleList.size_of() > tmp_66);
if(tmp_65) {
const OsmuxTxHandle& tmp_67 = OSMUX__Emulation__CT_component_TxHandleList[tmp_66];
tmp_65 = tmp_67.is_bound();
}
}
tmp_68 = tmp_65;
}
if (tmp_68) {
current_location.update_lineno(427);
/* OSMUX_Emulation.ttcn, line 427 */
payload__truncated = f__osmux__gen__payload(ctr, INTEGER(const_cast< const VALUE_ARRAY<OsmuxTxHandle, 16, 0>&>(OSMUX__Emulation__CT_component_TxHandleList)[i].amr__ft()));
current_location.update_lineno(428);
/* OSMUX_Emulation.ttcn, line 428 */
f__tx__osmux(i, ctr, payload__truncated, marker);
}
}
current_location.update_lineno(425);
/* OSMUX_Emulation.ttcn, line 425 */
{
INTEGER tmp_70;
++i;
}
}
}

void start_f__tx__osmux__all__cid(const COMPONENT& component_reference, const BITSTRING& marker)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tx_osmux_all_cid(");
marker.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "OSMUX_Emulation", "f_tx_osmux_all_cid", text_buf);
marker.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__main()
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 434, TTCN_Location::LOCATION_FUNCTION, "f_main");
current_location.update_lineno(436);
/* OSMUX_Emulation.ttcn, line 436 */
Socket__API__Definitions::Result res;
current_location.update_lineno(437);
/* OSMUX_Emulation.ttcn, line 437 */
OsmuxRxHandle rx__hdl;
current_location.update_lineno(438);
/* OSMUX_Emulation.ttcn, line 438 */
OsmuxTxHandle tx__hdl;
current_location.update_lineno(439);
/* OSMUX_Emulation.ttcn, line 439 */
OCTETSTRING payload__truncated;
current_location.update_lineno(440);
/* OSMUX_Emulation.ttcn, line 440 */
Socket__API__Definitions::PortEvent port__event;
current_location.update_lineno(441);
/* OSMUX_Emulation.ttcn, line 441 */
TIMER T__transmit("T_transmit", (int2float(const_cast< const OsmuxemConfig&>(OSMUX__Emulation__CT_component_g__cfg).tx__duration__ms()) / 1.0e3));
current_location.update_lineno(442);
/* OSMUX_Emulation.ttcn, line 442 */
OSMUX__CodecPort::Osmux__RecvFrom rx__osmux;
current_location.update_lineno(443);
/* OSMUX_Emulation.ttcn, line 443 */
OSMUX__Types::PDU__Osmux__AMR rx__amr;
current_location.update_lineno(444);
/* OSMUX_Emulation.ttcn, line 444 */
OSMUX__Types::PDU__Osmux__DUMMY osmux__dummy;
current_location.update_lineno(445);
/* OSMUX_Emulation.ttcn, line 445 */
OsmuxemConfig cfg;
current_location.update_lineno(446);
/* OSMUX_Emulation.ttcn, line 446 */
OSMUX__CodecPort::Osmux__RecvFrom_template tr__osmux__amr;
tr__osmux__amr.connId() = ANY_VALUE;
tr__osmux__amr.remName() = ANY_VALUE;
tr__osmux__amr.remPort() = ANY_VALUE;
tr__osmux__amr.locName() = ANY_VALUE;
tr__osmux__amr.locPort() = ANY_VALUE;
tr__osmux__amr.msg() = ANY_VALUE;
current_location.update_lineno(454);
/* OSMUX_Emulation.ttcn, line 454 */
{
OSMUX__Types::OSMUX__PDU_template& tmp_72 = tr__osmux__amr.msg();
tmp_72.osmux__amr() = ANY_VALUE;
}
current_location.update_lineno(455);
/* OSMUX_Emulation.ttcn, line 455 */
OSMUX__CodecPort::Osmux__RecvFrom_template tr__osmux__dummy;
tr__osmux__dummy.connId() = ANY_VALUE;
tr__osmux__dummy.remName() = ANY_VALUE;
tr__osmux__dummy.remPort() = ANY_VALUE;
tr__osmux__dummy.locName() = ANY_VALUE;
tr__osmux__dummy.locPort() = ANY_VALUE;
tr__osmux__dummy.msg() = ANY_VALUE;
current_location.update_lineno(463);
/* OSMUX_Emulation.ttcn, line 463 */
{
OSMUX__Types::OSMUX__PDU_template& tmp_74 = tr__osmux__dummy.msg();
tmp_74.osmux__dummy() = ANY_VALUE;
}
for ( ; ; ) {
current_location.update_lineno(466);
/* OSMUX_Emulation.ttcn, line 466 */
{
tmp_75:
alt_status tmp_75_alt_flag_0 = ALT_MAYBE;
alt_status tmp_75_alt_flag_1 = ALT_MAYBE;
alt_status tmp_75_alt_flag_2 = ALT_MAYBE;
alt_status tmp_75_alt_flag_3 = ALT_MAYBE;
alt_status tmp_75_alt_flag_4 = ALT_MAYBE;
alt_status tmp_75_alt_flag_5 = ALT_MAYBE;
alt_status tmp_75_alt_flag_6 = ALT_MAYBE;
alt_status tmp_75_alt_flag_7 = ALT_MAYBE;
alt_status tmp_75_alt_flag_8 = ALT_MAYBE;
alt_status tmp_75_alt_flag_9 = ALT_MAYBE;
alt_status tmp_75_alt_flag_10 = ALT_UNCHECKED;
alt_status tmp_75_alt_flag_11 = ALT_UNCHECKED;
alt_status tmp_75_alt_flag_12 = ALT_UNCHECKED;
alt_status tmp_75_alt_flag_13 = ALT_UNCHECKED;
alt_status tmp_75_alt_flag_14 = ALT_UNCHECKED;
alt_status tmp_75_alt_flag_15 = ALT_MAYBE;
alt_status tmp_75_alt_flag_16 = ALT_MAYBE;
alt_status tmp_75_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_75_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(468);
/* OSMUX_Emulation.ttcn, line 468 */
{
OsmuxEM__bind_template tmp_76;
tmp_76.local__host() = ANY_VALUE;
tmp_76.local__port() = ANY_VALUE;
tmp_75_alt_flag_0 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_76, any_compref, OsmuxEM__bind_call_redirect(&(OSMUX__Emulation__CT_component_g__local__host), &(OSMUX__Emulation__CT_component_g__local__port)), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_0 == ALT_YES) {
current_location.update_lineno(470);
/* OSMUX_Emulation.ttcn, line 470 */
OSMUX__Emulation__CT_component_g__tx__connected = FALSE;
current_location.update_lineno(472);
/* OSMUX_Emulation.ttcn, line 472 */
if ((OSMUX__Emulation__CT_component_g__osmux__conn__id != -1)) {
current_location.update_lineno(473);
/* OSMUX_Emulation.ttcn, line 473 */
Socket__API__Definitions::ProtoTuple tmp_79;
tmp_79.udp() = NULL_VALUE;
res = OSMUX__CodecPort__CtrlFunct::f__IPL4__close(OSMUX__Emulation__CT_component_OSMUX, OSMUX__Emulation__CT_component_g__osmux__conn__id, tmp_79);
current_location.update_lineno(474);
/* OSMUX_Emulation.ttcn, line 474 */
OSMUX__Emulation__CT_component_g__osmux__conn__id = -1;
}
current_location.update_lineno(476);
/* OSMUX_Emulation.ttcn, line 476 */
Socket__API__Definitions::ProtoTuple tmp_82;
tmp_82.udp() = NULL_VALUE;
res = OSMUX__CodecPort__CtrlFunct::f__IPL4__listen(OSMUX__Emulation__CT_component_OSMUX, OSMUX__Emulation__CT_component_g__local__host, OSMUX__Emulation__CT_component_g__local__port, tmp_82, OSMUX__CodecPort__CtrlFunct::f__IPL4__listen_options_defval);
current_location.update_lineno(478);
/* OSMUX_Emulation.ttcn, line 478 */
{
boolean tmp_86;
{
boolean tmp_83 = res.is_bound();
if(tmp_83) {
const OPTIONAL< INTEGER >& tmp_84 = res.connId();
switch (tmp_84.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_83 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_83 = FALSE;
break;
default:
{
const INTEGER& tmp_85 = (const INTEGER&) tmp_84;
tmp_83 = tmp_85.is_present();
break;}
}
}
tmp_86 = (!(tmp_83));
}
if (tmp_86) {
current_location.update_lineno(479);
/* OSMUX_Emulation.ttcn, line 479 */
Misc__Helpers::f__shutdown(cs_0, 479, FAIL, cs_6);
}
}
current_location.update_lineno(482);
/* OSMUX_Emulation.ttcn, line 482 */
OSMUX__Emulation__CT_component_g__osmux__conn__id = const_cast< const Socket__API__Definitions::Result&>(res).connId();
current_location.update_lineno(483);
/* OSMUX_Emulation.ttcn, line 483 */
tr__osmux__amr.connId() = OSMUX__Emulation__CT_component_g__osmux__conn__id;
current_location.update_lineno(484);
/* OSMUX_Emulation.ttcn, line 484 */
tr__osmux__dummy.connId() = OSMUX__Emulation__CT_component_g__osmux__conn__id;
current_location.update_lineno(486);
/* OSMUX_Emulation.ttcn, line 486 */
{
OsmuxEM__bind_template tmp_90;
tmp_90.local__host() = OSMUX__Emulation__CT_component_g__local__host;
tmp_90.local__port() = OSMUX__Emulation__CT_component_g__local__port;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_90, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(488);
/* OSMUX_Emulation.ttcn, line 488 */
{
OsmuxEM__connect_template tmp_91;
tmp_91.remote__host() = ANY_VALUE;
tmp_91.remote__port() = ANY_VALUE;
tmp_75_alt_flag_1 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_91, any_compref, OsmuxEM__connect_call_redirect(&(OSMUX__Emulation__CT_component_g__remote__host), &(OSMUX__Emulation__CT_component_g__remote__port)), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_1 == ALT_YES) {
current_location.update_lineno(489);
/* OSMUX_Emulation.ttcn, line 489 */
Socket__API__Definitions::ProtoTuple tmp_93;
tmp_93.udp() = NULL_VALUE;
res = OSMUX__CodecPort__CtrlFunct::f__IPL4__connect(OSMUX__Emulation__CT_component_OSMUX, OSMUX__Emulation__CT_component_g__remote__host, OSMUX__Emulation__CT_component_g__remote__port, OSMUX__Emulation__CT_component_g__local__host, OSMUX__Emulation__CT_component_g__local__port, OSMUX__Emulation__CT_component_g__osmux__conn__id, tmp_93, OSMUX__CodecPort__CtrlFunct::f__IPL4__connect_options_defval);
current_location.update_lineno(493);
/* OSMUX_Emulation.ttcn, line 493 */
{
boolean tmp_97;
{
boolean tmp_94 = res.is_bound();
if(tmp_94) {
const OPTIONAL< INTEGER >& tmp_95 = res.connId();
switch (tmp_95.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_94 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_94 = FALSE;
break;
default:
{
const INTEGER& tmp_96 = (const INTEGER&) tmp_95;
tmp_94 = tmp_96.is_present();
break;}
}
}
tmp_97 = (!(tmp_94));
}
if (tmp_97) {
current_location.update_lineno(494);
/* OSMUX_Emulation.ttcn, line 494 */
Misc__Helpers::f__shutdown(cs_0, 494, FAIL, cs_7);
}
}
current_location.update_lineno(497);
/* OSMUX_Emulation.ttcn, line 497 */
OSMUX__Emulation__CT_component_g__tx__connected = TRUE;
current_location.update_lineno(498);
/* OSMUX_Emulation.ttcn, line 498 */
{
OsmuxEM__connect_template tmp_99;
tmp_99.remote__host() = OSMUX__Emulation__CT_component_g__remote__host;
tmp_99.remote__port() = OSMUX__Emulation__CT_component_g__remote__port;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_99, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(500);
/* OSMUX_Emulation.ttcn, line 500 */
{
OsmuxEM__mode_template tmp_100;
tmp_100.mode() = OsmuxemMode::OSMUXEM__MODE__NONE;
tmp_75_alt_flag_2 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_100, any_compref, OsmuxEM__mode_call_redirect(), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_2 == ALT_YES) {
current_location.update_lineno(501);
/* OSMUX_Emulation.ttcn, line 501 */
T__transmit.stop();
current_location.update_lineno(502);
/* OSMUX_Emulation.ttcn, line 502 */
OSMUX__Emulation__CT_component_g__rx__enabled = FALSE;
current_location.update_lineno(503);
/* OSMUX_Emulation.ttcn, line 503 */
{
OsmuxEM__mode_template tmp_102;
tmp_102.mode() = OsmuxemMode::OSMUXEM__MODE__NONE;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_102, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(505);
/* OSMUX_Emulation.ttcn, line 505 */
{
OsmuxEM__mode_template tmp_103;
tmp_103.mode() = OsmuxemMode::OSMUXEM__MODE__TXONLY;
tmp_75_alt_flag_3 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_103, any_compref, OsmuxEM__mode_call_redirect(), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_3 == ALT_YES) {
current_location.update_lineno(507);
/* OSMUX_Emulation.ttcn, line 507 */
T__transmit.start();
current_location.update_lineno(508);
/* OSMUX_Emulation.ttcn, line 508 */
OSMUX__Emulation__CT_component_g__rx__enabled = FALSE;
current_location.update_lineno(509);
/* OSMUX_Emulation.ttcn, line 509 */
{
OsmuxEM__mode_template tmp_105;
tmp_105.mode() = OsmuxemMode::OSMUXEM__MODE__TXONLY;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_105, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(511);
/* OSMUX_Emulation.ttcn, line 511 */
{
OsmuxEM__mode_template tmp_106;
tmp_106.mode() = OsmuxemMode::OSMUXEM__MODE__RXONLY;
tmp_75_alt_flag_4 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_106, any_compref, OsmuxEM__mode_call_redirect(), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_4 == ALT_YES) {
current_location.update_lineno(513);
/* OSMUX_Emulation.ttcn, line 513 */
T__transmit.stop();
current_location.update_lineno(514);
/* OSMUX_Emulation.ttcn, line 514 */
if ((OSMUX__Emulation__CT_component_g__rx__enabled == FALSE)) {
current_location.update_lineno(516);
/* OSMUX_Emulation.ttcn, line 516 */
OSMUX__Emulation__CT_component_OSMUX.clear();
current_location.update_lineno(517);
/* OSMUX_Emulation.ttcn, line 517 */
OSMUX__Emulation__CT_component_g__rx__enabled = TRUE;
}
current_location.update_lineno(519);
/* OSMUX_Emulation.ttcn, line 519 */
{
OsmuxEM__mode_template tmp_108;
tmp_108.mode() = OsmuxemMode::OSMUXEM__MODE__RXONLY;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_108, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(521);
/* OSMUX_Emulation.ttcn, line 521 */
{
OsmuxEM__mode_template tmp_109;
tmp_109.mode() = OsmuxemMode::OSMUXEM__MODE__BIDIR;
tmp_75_alt_flag_5 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_109, any_compref, OsmuxEM__mode_call_redirect(), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_5 == ALT_YES) {
current_location.update_lineno(522);
/* OSMUX_Emulation.ttcn, line 522 */
T__transmit.start();
current_location.update_lineno(523);
/* OSMUX_Emulation.ttcn, line 523 */
if ((OSMUX__Emulation__CT_component_g__rx__enabled == FALSE)) {
current_location.update_lineno(525);
/* OSMUX_Emulation.ttcn, line 525 */
OSMUX__Emulation__CT_component_OSMUX.clear();
current_location.update_lineno(526);
/* OSMUX_Emulation.ttcn, line 526 */
OSMUX__Emulation__CT_component_g__rx__enabled = TRUE;
}
current_location.update_lineno(528);
/* OSMUX_Emulation.ttcn, line 528 */
{
OsmuxEM__mode_template tmp_111;
tmp_111.mode() = OsmuxemMode::OSMUXEM__MODE__BIDIR;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_111, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_6 == ALT_MAYBE) {
current_location.update_lineno(530);
/* OSMUX_Emulation.ttcn, line 530 */
{
OsmuxEM__configure_template tmp_112;
tmp_112.cfg() = ANY_VALUE;
tmp_75_alt_flag_6 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_112, any_compref, OsmuxEM__configure_call_redirect(&(cfg)), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_6 == ALT_YES) {
current_location.update_lineno(531);
/* OSMUX_Emulation.ttcn, line 531 */
OSMUX__Emulation__CT_component_g__cfg = cfg;
current_location.update_lineno(532);
/* OSMUX_Emulation.ttcn, line 532 */
{
OsmuxEM__configure_template tmp_114;
tmp_114.cfg() = cfg;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_114, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_7 == ALT_MAYBE) {
current_location.update_lineno(534);
/* OSMUX_Emulation.ttcn, line 534 */
{
OsmuxEM__register__txhandle_template tmp_115;
tmp_115.hdl() = ANY_VALUE;
tmp_75_alt_flag_7 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_115, any_compref, OsmuxEM__register__txhandle_call_redirect(&(tx__hdl)), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_7 == ALT_YES) {
current_location.update_lineno(535);
/* OSMUX_Emulation.ttcn, line 535 */
f__txhandle__cid__add(tx__hdl);
current_location.update_lineno(536);
/* OSMUX_Emulation.ttcn, line 536 */
{
OsmuxEM__register__txhandle_template tmp_116;
tmp_116.hdl() = tx__hdl;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_116, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_8 == ALT_MAYBE) {
current_location.update_lineno(538);
/* OSMUX_Emulation.ttcn, line 538 */
{
OsmuxEM__register__rxhandle_template tmp_117;
tmp_117.hdl() = ANY_VALUE;
tmp_75_alt_flag_8 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_117, any_compref, OsmuxEM__register__rxhandle_call_redirect(&(rx__hdl)), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_8 == ALT_YES) {
current_location.update_lineno(539);
/* OSMUX_Emulation.ttcn, line 539 */
f__rxhandle__cid__add(rx__hdl);
current_location.update_lineno(540);
/* OSMUX_Emulation.ttcn, line 540 */
{
OsmuxEM__register__rxhandle_template tmp_118;
tmp_118.hdl() = rx__hdl;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_118, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_9 == ALT_MAYBE) {
current_location.update_lineno(542);
/* OSMUX_Emulation.ttcn, line 542 */
{
OsmuxEM__stats__get_template tmp_119;
tmp_119.stats() = ANY_VALUE;
tmp_75_alt_flag_9 = OSMUX__Emulation__CT_component_CTRL.getcall(tmp_119, any_compref, OsmuxEM__stats__get_call_redirect(), NULL, NULL, NULL);
}
if (tmp_75_alt_flag_9 == ALT_YES) {
current_location.update_lineno(543);
/* OSMUX_Emulation.ttcn, line 543 */
{
OsmuxEM__stats__get_template tmp_120;
tmp_120.stats() = OSMUX__Emulation__CT_component_g__stat;
OSMUX__Emulation__CT_component_CTRL.reply(tmp_120, FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_10 == ALT_UNCHECKED) {
current_location.update_lineno(547);
/* OSMUX_Emulation.ttcn, line 547 */
if ((OSMUX__Emulation__CT_component_g__rx__enabled == FALSE)) tmp_75_alt_flag_10 = ALT_MAYBE;
else tmp_75_alt_flag_10 = ALT_NO;
}
if (tmp_75_alt_flag_10 == ALT_MAYBE) {
current_location.update_lineno(547);
/* OSMUX_Emulation.ttcn, line 547 */
tmp_75_alt_flag_10 = OSMUX__Emulation__CT_component_OSMUX.receive(tr__osmux__amr, NULL, any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_10 == ALT_YES) {
current_location.update_lineno(548);
/* OSMUX_Emulation.ttcn, line 548 */
{
INTEGER tmp_121;
tmp_121 = (const_cast< const OsmuxemStats&>(OSMUX__Emulation__CT_component_g__stat).num__pkts__rx__err__disabled() + 1);
OSMUX__Emulation__CT_component_g__stat.num__pkts__rx__err__disabled() = tmp_121;
}
break;
}
}
if (tmp_75_alt_flag_11 == ALT_UNCHECKED) {
current_location.update_lineno(551);
/* OSMUX_Emulation.ttcn, line 551 */
if ((OSMUX__Emulation__CT_component_g__rx__enabled == FALSE)) tmp_75_alt_flag_11 = ALT_MAYBE;
else tmp_75_alt_flag_11 = ALT_NO;
}
if (tmp_75_alt_flag_11 == ALT_MAYBE) {
current_location.update_lineno(551);
/* OSMUX_Emulation.ttcn, line 551 */
tmp_75_alt_flag_11 = OSMUX__Emulation__CT_component_OSMUX.receive(tr__osmux__dummy, &(rx__osmux), any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_11 == ALT_YES) {
current_location.update_lineno(552);
/* OSMUX_Emulation.ttcn, line 552 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Osmux Dummy received on CID ");
const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__dummy().header().cid().log();
TTCN_Logger::log_event_str(" (rx_disabled)");
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
break;
}
}
if (tmp_75_alt_flag_12 == ALT_UNCHECKED) {
current_location.update_lineno(556);
/* OSMUX_Emulation.ttcn, line 556 */
if (OSMUX__Emulation__CT_component_g__rx__enabled) tmp_75_alt_flag_12 = ALT_MAYBE;
else tmp_75_alt_flag_12 = ALT_NO;
}
if (tmp_75_alt_flag_12 == ALT_MAYBE) {
current_location.update_lineno(556);
/* OSMUX_Emulation.ttcn, line 556 */
tmp_75_alt_flag_12 = OSMUX__Emulation__CT_component_OSMUX.receive(tr__osmux__amr, &(rx__osmux), any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_12 == ALT_YES) {
current_location.update_lineno(558);
/* OSMUX_Emulation.ttcn, line 558 */
{
INTEGER tmp_122;
tmp_122 = (const_cast< const OsmuxemStats&>(OSMUX__Emulation__CT_component_g__stat).num__pkts__rx() + 1);
OSMUX__Emulation__CT_component_g__stat.num__pkts__rx() = tmp_122;
}
current_location.update_lineno(559);
/* OSMUX_Emulation.ttcn, line 559 */
{
INTEGER tmp_123;
tmp_123 = (const_cast< const OsmuxemStats&>(OSMUX__Emulation__CT_component_g__stat).bytes__payload__rx() + const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__amr().data().lengthof());
OSMUX__Emulation__CT_component_g__stat.bytes__payload__rx() = tmp_123;
}
current_location.update_lineno(561);
/* OSMUX_Emulation.ttcn, line 561 */
rx__hdl = f__rxhandle__get__by__cid(const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__amr().header().cid());
current_location.update_lineno(563);
/* OSMUX_Emulation.ttcn, line 563 */
{
boolean tmp_125;
tmp_125 = const_cast< const OsmuxRxHandle&>(rx__hdl).first__seq__seen();
if (tmp_125) tmp_125 = (const_cast< const OsmuxRxHandle&>(rx__hdl).last__seq__ack() != (const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__amr().header().seq() - 1));
if (tmp_125) {
current_location.update_lineno(564);
/* OSMUX_Emulation.ttcn, line 564 */
{
INTEGER tmp_126;
tmp_126 = (const_cast< const OsmuxemStats&>(OSMUX__Emulation__CT_component_g__stat).num__pkts__rx__err__seq() + 1);
OSMUX__Emulation__CT_component_g__stat.num__pkts__rx__err__seq() = tmp_126;
}
}
}
current_location.update_lineno(566);
/* OSMUX_Emulation.ttcn, line 566 */
rx__hdl.first__seq__seen() = TRUE;
current_location.update_lineno(567);
/* OSMUX_Emulation.ttcn, line 567 */
rx__hdl.last__seq__ack() = const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__amr().header().seq();
current_location.update_lineno(569);
/* OSMUX_Emulation.ttcn, line 569 */
payload__truncated = f__osmux__gen__payload(const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__amr().header().ctr(), const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__amr().header().amr__ft());
current_location.update_lineno(570);
/* OSMUX_Emulation.ttcn, line 570 */
{
boolean tmp_130;
{
boolean tmp_131 = OSMUX__Emulation__CT_component_g__cfg.is_bound();
if(tmp_131) {
const OPTIONAL< OCTETSTRING >& tmp_132 = OSMUX__Emulation__CT_component_g__cfg.rx__fixed__payload();
switch (tmp_132.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_131 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_131 = FALSE;
break;
default:
{
const OCTETSTRING& tmp_133 = (const OCTETSTRING&) tmp_132;
tmp_131 = tmp_133.is_present();
break;}
}
}
tmp_130 = tmp_131;
}
if (tmp_130) tmp_130 = (const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__amr().data() != payload__truncated);
if (tmp_130) {
current_location.update_lineno(571);
/* OSMUX_Emulation.ttcn, line 571 */
{
INTEGER tmp_134;
tmp_134 = (const_cast< const OsmuxemStats&>(OSMUX__Emulation__CT_component_g__stat).num__pkts__rx__err__payload() + 1);
OSMUX__Emulation__CT_component_g__stat.num__pkts__rx__err__payload() = tmp_134;
}
}
}
current_location.update_lineno(573);
/* OSMUX_Emulation.ttcn, line 573 */
if (OSMUX__Emulation__CT_component_DATA.check_port_state(cs_8)) {
current_location.update_lineno(574);
/* OSMUX_Emulation.ttcn, line 574 */
OSMUX__Emulation__CT_component_DATA.send(const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg(), FALSE, NULL);
}
break;
}
}
if (tmp_75_alt_flag_13 == ALT_UNCHECKED) {
current_location.update_lineno(578);
/* OSMUX_Emulation.ttcn, line 578 */
if (OSMUX__Emulation__CT_component_g__rx__enabled) tmp_75_alt_flag_13 = ALT_MAYBE;
else tmp_75_alt_flag_13 = ALT_NO;
}
if (tmp_75_alt_flag_13 == ALT_MAYBE) {
current_location.update_lineno(578);
/* OSMUX_Emulation.ttcn, line 578 */
tmp_75_alt_flag_13 = OSMUX__Emulation__CT_component_OSMUX.receive(tr__osmux__dummy, &(rx__osmux), any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_13 == ALT_YES) {
current_location.update_lineno(579);
/* OSMUX_Emulation.ttcn, line 579 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Osmux Dummy received on CID");
const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__dummy().header().cid().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(580);
/* OSMUX_Emulation.ttcn, line 580 */
rx__hdl = f__rxhandle__get__by__cid(const_cast< const OSMUX__CodecPort::Osmux__RecvFrom&>(rx__osmux).msg().osmux__dummy().header().cid());
break;
}
}
if (tmp_75_alt_flag_14 == ALT_UNCHECKED) {
current_location.update_lineno(584);
/* OSMUX_Emulation.ttcn, line 584 */
if (OSMUX__Emulation__CT_component_g__tx__connected) tmp_75_alt_flag_14 = ALT_MAYBE;
else tmp_75_alt_flag_14 = ALT_NO;
}
if (tmp_75_alt_flag_14 == ALT_MAYBE) {
current_location.update_lineno(584);
/* OSMUX_Emulation.ttcn, line 584 */
tmp_75_alt_flag_14 = T__transmit.timeout(NULL);
if (tmp_75_alt_flag_14 == ALT_YES) {
current_location.update_lineno(586);
/* OSMUX_Emulation.ttcn, line 586 */
f__tx__osmux__all__cid(f__tx__osmux__all__cid_marker_defval);
current_location.update_lineno(587);
/* OSMUX_Emulation.ttcn, line 587 */
T__transmit.start();
break;
}
}
if (tmp_75_alt_flag_15 == ALT_MAYBE) {
current_location.update_lineno(590);
/* OSMUX_Emulation.ttcn, line 590 */
tmp_75_alt_flag_15 = OSMUX__Emulation__CT_component_OSMUX.receive(Socket__API__Definitions::PortEvent_template(ANY_VALUE), &(port__event), any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_15 == ALT_YES) {
current_location.update_lineno(591);
/* OSMUX_Emulation.ttcn, line 591 */
Misc__Helpers::f__shutdown(cs_0, 591, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected port event from Osmux:"),port__event.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_75_alt_flag_16 == ALT_MAYBE) {
current_location.update_lineno(596);
/* OSMUX_Emulation.ttcn, line 596 */
tmp_75_alt_flag_16 = OSMUX__Emulation__CT_component_OSMUX.receive(any_compref, NULL, NULL, NULL);
if (tmp_75_alt_flag_16 == ALT_YES) {
current_location.update_lineno(597);
/* OSMUX_Emulation.ttcn, line 597 */
Misc__Helpers::f__shutdown(cs_0, 597, FAIL, cs_9);
break;
}
}
if (tmp_75_default_flag == ALT_MAYBE) {
tmp_75_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_75_default_flag == ALT_YES || tmp_75_default_flag == ALT_BREAK) break;
else if (tmp_75_default_flag == ALT_REPEAT) goto tmp_75;
}
current_location.update_lineno(466);
/* OSMUX_Emulation.ttcn, line 466 */
if (tmp_75_alt_flag_0 == ALT_NO && tmp_75_alt_flag_1 == ALT_NO && tmp_75_alt_flag_2 == ALT_NO && tmp_75_alt_flag_3 == ALT_NO && tmp_75_alt_flag_4 == ALT_NO && tmp_75_alt_flag_5 == ALT_NO && tmp_75_alt_flag_6 == ALT_NO && tmp_75_alt_flag_7 == ALT_NO && tmp_75_alt_flag_8 == ALT_NO && tmp_75_alt_flag_9 == ALT_NO && tmp_75_alt_flag_10 == ALT_NO && tmp_75_alt_flag_11 == ALT_NO && tmp_75_alt_flag_12 == ALT_NO && tmp_75_alt_flag_13 == ALT_NO && tmp_75_alt_flag_14 == ALT_NO && tmp_75_alt_flag_15 == ALT_NO && tmp_75_alt_flag_16 == ALT_NO && tmp_75_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file OSMUX_Emulation.ttcn between lines 466 and 600.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}
}

void start_f__main(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_main(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "OSMUX_Emulation", "f_main", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "OSMUX_Emulation");
OSMUX__CodecPort__CtrlFunct::module_object.pre_init_module();
current_location.update_lineno(107);
/* OSMUX_Emulation.ttcn, line 107 */
const_c__OsmuxemDefaultRxHandle.cid() = 0;
const_c__OsmuxemDefaultRxHandle.first__seq__seen() = FALSE;
const_c__OsmuxemDefaultRxHandle.last__seq__ack() = 0;
current_location.update_lineno(158);
/* OSMUX_Emulation.ttcn, line 158 */
const_c__OsmuxemStatsReset.num__pkts__tx() = 0;
const_c__OsmuxemStatsReset.bytes__payload__tx() = 0;
const_c__OsmuxemStatsReset.num__pkts__rx() = 0;
const_c__OsmuxemStatsReset.bytes__payload__rx() = 0;
const_c__OsmuxemStatsReset.num__pkts__rx__err__seq() = 0;
const_c__OsmuxemStatsReset.num__pkts__rx__err__disabled() = 0;
const_c__OsmuxemStatsReset.num__pkts__rx__err__payload() = 0;
current_location.update_lineno(175);
/* OSMUX_Emulation.ttcn, line 175 */
const_c__OsmuxemDefaultCfg.batch__size() = 4;
const_c__OsmuxemDefaultCfg.tx__duration__ms() = 80;
const_c__OsmuxemDefaultCfg.tx__fixed__payload() = os_0;
const_c__OsmuxemDefaultCfg.rx__fixed__payload() = os_0;
module_object.add_function("f_osmuxem_bind", (genericfunc_t)&f__osmuxem__bind, NULL);
module_object.add_function("f_osmuxem_connect", (genericfunc_t)&f__osmuxem__connect, NULL);
module_object.add_function("f_osmuxem_mode", (genericfunc_t)&f__osmuxem__mode, NULL);
module_object.add_function("f_osmuxem_configure", (genericfunc_t)&f__osmuxem__configure, NULL);
module_object.add_function("f_osmuxem_stats_get", (genericfunc_t)&f__osmuxem__stats__get, NULL);
module_object.add_function("f_osmuxem_register_rxhandle", (genericfunc_t)&f__osmuxem__register__rxhandle, NULL);
module_object.add_function("f_osmuxem_register_txhandle", (genericfunc_t)&f__osmuxem__register__txhandle, NULL);
module_object.add_function("f_osmuxem_stats_compare_value", (genericfunc_t)&f__osmuxem__stats__compare__value, NULL);
module_object.add_function("f_osmuxem_stats_compare", (genericfunc_t)&f__osmuxem__stats__compare, NULL);
module_object.add_function("f_osmuxem_stats_err_check", (genericfunc_t)&f__osmuxem__stats__err__check, NULL);
module_object.add_function("f_rxhandle_get_by_cid", (genericfunc_t)&f__rxhandle__get__by__cid, (genericfunc_t)&start_f__rxhandle__get__by__cid);
module_object.add_function("f_rxhandle_cid_add", (genericfunc_t)&f__rxhandle__cid__add, (genericfunc_t)&start_f__rxhandle__cid__add);
module_object.add_function("f_txhandle_cid_add", (genericfunc_t)&f__txhandle__cid__add, (genericfunc_t)&start_f__txhandle__cid__add);
module_object.add_function("f_osmux_gen_expected_rx_rtp_payload", (genericfunc_t)&f__osmux__gen__expected__rx__rtp__payload, NULL);
module_object.add_function("f_osmux_gen_payload", (genericfunc_t)&f__osmux__gen__payload, (genericfunc_t)&start_f__osmux__gen__payload);
module_object.add_function("f_tx_osmux", (genericfunc_t)&f__tx__osmux, (genericfunc_t)&start_f__tx__osmux);
module_object.add_function("f_tx_osmux_all_cid", (genericfunc_t)&f__tx__osmux__all__cid, (genericfunc_t)&start_f__tx__osmux__all__cid);
module_object.add_function("f_main", (genericfunc_t)&f__main, (genericfunc_t)&start_f__main);
}

void post_init_module()
{
TTCN_Location current_location("OSMUX_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "OSMUX_Emulation");
OSMUX__CodecPort__CtrlFunct::module_object.post_init_module();
current_location.update_lineno(240);
/* OSMUX_Emulation.ttcn, line 240 */
const_f__osmuxem__stats__compare__value_tolerance_defval = 0;
current_location.update_lineno(259);
/* OSMUX_Emulation.ttcn, line 259 */
const_f__osmuxem__stats__compare_tolerance_defval = 0;
current_location.update_lineno(404);
/* OSMUX_Emulation.ttcn, line 404 */
const_f__tx__osmux_marker_defval = bs_0;
current_location.update_lineno(419);
/* OSMUX_Emulation.ttcn, line 419 */
const_f__tx__osmux__all__cid_marker_defval = bs_0;
}

boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "OSMUX_Emulation_CT")) {
OSMUX__Emulation__CT_component_OSMUX.activate_port();
OSMUX__Emulation__CT_component_g__osmux__conn__id = -1;
OSMUX__Emulation__CT_component_CTRL.activate_port();
OSMUX__Emulation__CT_component_DATA.activate_port();
OSMUX__Emulation__CT_component_g__cfg = c__OsmuxemDefaultCfg;
OSMUX__Emulation__CT_component_g__stat = c__OsmuxemStatsReset;
OSMUX__Emulation__CT_component_g__remote__host.clean_up();
OSMUX__Emulation__CT_component_g__remote__port.clean_up();
OSMUX__Emulation__CT_component_g__local__host.clean_up();
OSMUX__Emulation__CT_component_g__local__port.clean_up();
OSMUX__Emulation__CT_component_g__rx__enabled = FALSE;
OSMUX__Emulation__CT_component_g__tx__connected = FALSE;
OSMUX__Emulation__CT_component_g__rx__payload__type = 0;
OSMUX__Emulation__CT_component_g__rx__last__seq.clean_up();
OSMUX__Emulation__CT_component_g__rx__last__ts.clean_up();
OSMUX__Emulation__CT_component_RxHandleTable.clean_up();
OSMUX__Emulation__CT_component_TxHandleList.clean_up();
return TRUE;
} else return FALSE;
}

boolean init_system_port(const char* component_type, const char* port_name)
{
if (!strcmp(component_type, "OSMUX_Emulation_CT")) {
if (!strcmp(port_name, "CTRL")) {
OSMUX__Emulation__CT_component_CTRL.safe_start();
return TRUE;
}
if (!strcmp(port_name, "DATA")) {
OSMUX__Emulation__CT_component_DATA.safe_start();
return TRUE;
}
if (!strcmp(port_name, "OSMUX")) {
OSMUX__Emulation__CT_component_OSMUX.safe_start();
return TRUE;
}
}
return FALSE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "f_rxhandle_get_by_cid")) {
INTEGER cid;
cid.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rxhandle_get_by_cid(");
cid.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__rxhandle__get__by__cid(cid);
TTCN_Runtime::function_finished("f_rxhandle_get_by_cid");
return TRUE;
} else if (!strcmp(function_name, "f_rxhandle_cid_add")) {
OsmuxRxHandle hdl;
hdl.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rxhandle_cid_add(");
hdl.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__rxhandle__cid__add(hdl);
TTCN_Runtime::function_finished("f_rxhandle_cid_add");
return TRUE;
} else if (!strcmp(function_name, "f_txhandle_cid_add")) {
OsmuxTxHandle hdl;
hdl.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_txhandle_cid_add(");
hdl.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__txhandle__cid__add(hdl);
TTCN_Runtime::function_finished("f_txhandle_cid_add");
return TRUE;
} else if (!strcmp(function_name, "f_osmux_gen_payload")) {
INTEGER ctr;
INTEGER amr__ft;
ctr.decode_text(function_arguments);
amr__ft.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_osmux_gen_payload(");
ctr.log();
TTCN_Logger::log_event_str(", ");
amr__ft.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__osmux__gen__payload(ctr, amr__ft);
TTCN_Runtime::function_finished("f_osmux_gen_payload");
return TRUE;
} else if (!strcmp(function_name, "f_tx_osmux")) {
INTEGER i;
INTEGER ctr;
OCTETSTRING payload;
BITSTRING marker;
i.decode_text(function_arguments);
ctr.decode_text(function_arguments);
payload.decode_text(function_arguments);
marker.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tx_osmux(");
i.log();
TTCN_Logger::log_event_str(", ");
ctr.log();
TTCN_Logger::log_event_str(", ");
payload.log();
TTCN_Logger::log_event_str(", ");
marker.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tx__osmux(i, ctr, payload, marker);
TTCN_Runtime::function_finished("f_tx_osmux");
return TRUE;
} else if (!strcmp(function_name, "f_tx_osmux_all_cid")) {
BITSTRING marker;
marker.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_tx_osmux_all_cid(");
marker.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__tx__osmux__all__cid(marker);
TTCN_Runtime::function_finished("f_tx_osmux_all_cid");
return TRUE;
} else if (!strcmp(function_name, "f_main")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_main().");
TTCN_Runtime::function_started(function_arguments);
f__main();
TTCN_Runtime::function_finished("f_main");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
