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

namespace FrameRelay__Emulation {

/* Literal string constants */

const unsigned char os_0_octets[] = { 3 };
extern const OCTETSTRING os_0(1, os_0_octets);
const unsigned short op_0_elements[] = { 3, 257 };
const OCTETSTRING_template op_0(2, op_0_elements);
const unsigned char module_checksum[] = { 0xa2, 0x92, 0x0f, 0x0c, 0x36, 0x79, 0x70, 0xe4, 0xf0, 0x40, 0x5c, 0x3f, 0xe6, 0x77, 0x17, 0xd3 };

/* Global variable definitions */

// No XER for FRemu__LinkStatus
const TTCN_Typedescriptor_t FRemu__LinkStatus_descr_ = { "@FrameRelay_Emulation.FRemu_LinkStatus", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       FRemu__PvcStatus_dlci_xer_ = { {"dlci>\n", "dlci>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t FRemu__PvcStatus_dlci_descr_ = { "@FrameRelay_Emulation.FRemu_PvcStatus.dlci", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &FRemu__PvcStatus_dlci_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       FRemu__PvcStatus_new__xer_ = { {"new>\n", "new>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int FRemu__PvcStatus_new__oer_ext_arr_[0] = {};
const int FRemu__PvcStatus_new__oer_p_[0] = {};
const TTCN_OERdescriptor_t FRemu__PvcStatus_new__oer_ = { -1, TRUE, -1, FALSE, 0, 0, FRemu__PvcStatus_new__oer_ext_arr_, 0, FRemu__PvcStatus_new__oer_p_};
const TTCN_Typedescriptor_t FRemu__PvcStatus_new__descr_ = { "@FrameRelay_Emulation.FRemu_PvcStatus.new", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &FRemu__PvcStatus_new__xer_, &BOOLEAN_json_, &FRemu__PvcStatus_new__oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       FRemu__PvcStatus_delete__xer_ = { {"delete>\n", "delete>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int FRemu__PvcStatus_delete__oer_ext_arr_[0] = {};
const int FRemu__PvcStatus_delete__oer_p_[0] = {};
const TTCN_OERdescriptor_t FRemu__PvcStatus_delete__oer_ = { -1, TRUE, -1, FALSE, 0, 0, FRemu__PvcStatus_delete__oer_ext_arr_, 0, FRemu__PvcStatus_delete__oer_p_};
const TTCN_Typedescriptor_t FRemu__PvcStatus_delete__descr_ = { "@FrameRelay_Emulation.FRemu_PvcStatus.delete", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &FRemu__PvcStatus_delete__xer_, &BOOLEAN_json_, &FRemu__PvcStatus_delete__oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       FRemu__PvcStatus_active_xer_ = { {"active>\n", "active>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int FRemu__PvcStatus_active_oer_ext_arr_[0] = {};
const int FRemu__PvcStatus_active_oer_p_[0] = {};
const TTCN_OERdescriptor_t FRemu__PvcStatus_active_oer_ = { -1, TRUE, -1, FALSE, 0, 0, FRemu__PvcStatus_active_oer_ext_arr_, 0, FRemu__PvcStatus_active_oer_p_};
const TTCN_Typedescriptor_t FRemu__PvcStatus_active_descr_ = { "@FrameRelay_Emulation.FRemu_PvcStatus.active", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &FRemu__PvcStatus_active_xer_, &BOOLEAN_json_, &FRemu__PvcStatus_active_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for FRemu__PvcStatus
const TTCN_Typedescriptor_t FRemu__PvcStatus_descr_ = { "@FrameRelay_Emulation.FRemu_PvcStatus", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for FRemu__Event
const TTCN_Typedescriptor_t FRemu__Event_descr_ = { "@FrameRelay_Emulation.FRemu_Event", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
BOOLEAN_template template_tr__FRemu__PvcStatusAct_active_defval;
const BOOLEAN_template& tr__FRemu__PvcStatusAct_active_defval = template_tr__FRemu__PvcStatusAct_active_defval;
const TTCN_Typedescriptor_t& FR__Emulation__CT_descr_ = COMPONENT_descr_;
FrameRelay__CodecPort::FR__CODEC__PT FR__Emulation__CT_component_FR("FR");
FRemu__asp__PT FR__Emulation__CT_component_CLIENT("CLIENT");
FRemu__PROC__PT FR__Emulation__CT_component_PROC("PROC");
const TTCN_Typedescriptor_t& FR__Client__CT_descr_ = COMPONENT_descr_;
// No XER for ConnectionData
const TTCN_Typedescriptor_t ConnectionData_descr_ = { "@FrameRelay_Emulation.ConnectionData", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
VALUE_ARRAY<ConnectionData, 1024, 0> FR__Emulation__CT_component_ConnectionTable;
const XERdescriptor_t       Q933em__Config_N391_xer_ = { {"N391>\n", "N391>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Q933em__Config_N391_descr_ = { "@FrameRelay_Emulation.Q933em_Config.N391", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &Q933em__Config_N391_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933em__Config_N391_default_coding("RAW");
const XERdescriptor_t       Q933em__Config_N392_xer_ = { {"N392>\n", "N392>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Q933em__Config_N392_descr_ = { "@FrameRelay_Emulation.Q933em_Config.N392", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Q933em__Config_N392_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__Config_N393_xer_ = { {"N393>\n", "N393>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Q933em__Config_N393_descr_ = { "@FrameRelay_Emulation.Q933em_Config.N393", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Q933em__Config_N393_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__Config_T391_xer_ = { {"T391>\n", "T391>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933em__Config_T391_oer_ext_arr_[0] = {};
const int Q933em__Config_T391_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933em__Config_T391_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933em__Config_T391_oer_ext_arr_, 0, Q933em__Config_T391_oer_p_};
const TTCN_Typedescriptor_t Q933em__Config_T391_descr_ = { "@FrameRelay_Emulation.Q933em_Config.T391", &FLOAT_ber_, &FLOAT_raw_, NULL, &Q933em__Config_T391_xer_, &FLOAT_json_, &Q933em__Config_T391_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__Config_T392_xer_ = { {"T392>\n", "T392>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933em__Config_T392_oer_ext_arr_[0] = {};
const int Q933em__Config_T392_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933em__Config_T392_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933em__Config_T392_oer_ext_arr_, 0, Q933em__Config_T392_oer_p_};
const TTCN_Typedescriptor_t Q933em__Config_T392_descr_ = { "@FrameRelay_Emulation.Q933em_Config.T392", &FLOAT_ber_, &FLOAT_raw_, NULL, &Q933em__Config_T392_xer_, &FLOAT_json_, &Q933em__Config_T392_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__Config_ats__is__user_xer_ = { {"ats_is_user>\n", "ats_is_user>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933em__Config_ats__is__user_oer_ext_arr_[0] = {};
const int Q933em__Config_ats__is__user_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933em__Config_ats__is__user_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933em__Config_ats__is__user_oer_ext_arr_, 0, Q933em__Config_ats__is__user_oer_p_};
const TTCN_Typedescriptor_t Q933em__Config_ats__is__user_descr_ = { "@FrameRelay_Emulation.Q933em_Config.ats_is_user", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &Q933em__Config_ats__is__user_xer_, &BOOLEAN_json_, &Q933em__Config_ats__is__user_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__Config_bidirectional_xer_ = { {"bidirectional>\n", "bidirectional>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933em__Config_bidirectional_oer_ext_arr_[0] = {};
const int Q933em__Config_bidirectional_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933em__Config_bidirectional_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933em__Config_bidirectional_oer_ext_arr_, 0, Q933em__Config_bidirectional_oer_p_};
const TTCN_Typedescriptor_t Q933em__Config_bidirectional_descr_ = { "@FrameRelay_Emulation.Q933em_Config.bidirectional", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &Q933em__Config_bidirectional_xer_, &BOOLEAN_json_, &Q933em__Config_bidirectional_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Q933em__Config
const TTCN_Typedescriptor_t Q933em__Config_descr_ = { "@FrameRelay_Emulation.Q933em_Config", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__State_tx__seq__nr_xer_ = { {"tx_seq_nr>\n", "tx_seq_nr>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933em__State_tx__seq__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933em__State_tx__seq__nr_descr_ = { "@FrameRelay_Emulation.Q933em_State.tx_seq_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &Q933em__State_tx__seq__nr_xer_, &INTEGER_json_, &Q933em__State_tx__seq__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933em__State_tx__seq__nr_default_coding("RAW");
const XERdescriptor_t       Q933em__State_last__rx__seq__nr_xer_ = { {"last_rx_seq_nr>\n", "last_rx_seq_nr>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Q933em__State_last__rx__seq__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Q933em__State_last__rx__seq__nr_descr_ = { "@FrameRelay_Emulation.Q933em_State.last_rx_seq_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &Q933em__State_last__rx__seq__nr_xer_, &INTEGER_json_, &Q933em__State_last__rx__seq__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Q933em__State_last__rx__seq__nr_default_coding("RAW");
// No XER for Q933em__State_err__buckets
const TTCN_Typedescriptor_t Q933em__State_err__buckets_descr_ = { "@FrameRelay_Emulation.Q933em_State.err_buckets", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__State_num__cycles_xer_ = { {"num_cycles>\n", "num_cycles>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t Q933em__State_num__cycles_descr_ = { "@FrameRelay_Emulation.Q933em_State.num_cycles", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &Q933em__State_num__cycles_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__State_service__affecting__condition_xer_ = { {"service_affecting_condition>\n", "service_affecting_condition>\n"}, {29, 29}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933em__State_service__affecting__condition_oer_ext_arr_[0] = {};
const int Q933em__State_service__affecting__condition_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933em__State_service__affecting__condition_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933em__State_service__affecting__condition_oer_ext_arr_, 0, Q933em__State_service__affecting__condition_oer_p_};
const TTCN_Typedescriptor_t Q933em__State_service__affecting__condition_descr_ = { "@FrameRelay_Emulation.Q933em_State.service_affecting_condition", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &Q933em__State_service__affecting__condition_xer_, &BOOLEAN_json_, &Q933em__State_service__affecting__condition_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       Q933em__State_rx__status__in__cycle_xer_ = { {"rx_status_in_cycle>\n", "rx_status_in_cycle>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int Q933em__State_rx__status__in__cycle_oer_ext_arr_[0] = {};
const int Q933em__State_rx__status__in__cycle_oer_p_[0] = {};
const TTCN_OERdescriptor_t Q933em__State_rx__status__in__cycle_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Q933em__State_rx__status__in__cycle_oer_ext_arr_, 0, Q933em__State_rx__status__in__cycle_oer_p_};
const TTCN_Typedescriptor_t Q933em__State_rx__status__in__cycle_descr_ = { "@FrameRelay_Emulation.Q933em_State.rx_status_in_cycle", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &Q933em__State_rx__status__in__cycle_xer_, &BOOLEAN_json_, &Q933em__State_rx__status__in__cycle_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for Q933em__State
const TTCN_Typedescriptor_t Q933em__State_descr_ = { "@FrameRelay_Emulation.Q933em_State", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
Q933em__State FR__Emulation__CT_component_q933em;
TIMER FR__Emulation__CT_component_T391("T391");
TIMER FR__Emulation__CT_component_T392("T392");
FRemu__PT FR__Client__CT_component_FR("FR");
FRemu__PROC__PT FR__Client__CT_component_FR__PROC("FR_PROC");
TTCN_Module module_object("FrameRelay_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 */

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

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

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

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

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

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

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

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

boolean FRemu__LinkStatus::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 @FrameRelay_Emulation.FRemu_LinkStatus.");
return enum_value == other_value;
}

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

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

boolean FRemu__LinkStatus::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 @FrameRelay_Emulation.FRemu_LinkStatus.");
return enum_value < other_value;
}

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

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

boolean FRemu__LinkStatus::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 @FrameRelay_Emulation.FRemu_LinkStatus.");
return enum_value > other_value;
}

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

const char *FRemu__LinkStatus::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case FR__LINK__STS__AVAILABLE: return "FR_LINK_STS_AVAILABLE";
case FR__LINK__STS__UNAVAILABLE: return "FR_LINK_STS_UNAVAILABLE";
default:
return "<unknown>";
}
}

FRemu__LinkStatus::enum_type FRemu__LinkStatus::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, "FR_LINK_STS_AVAILABLE")) return FR__LINK__STS__AVAILABLE;
if (!strcmp(str_par, "FR_LINK_STS_UNAVAILABLE")) return FR__LINK__STS__UNAVAILABLE;
}
return UNKNOWN_VALUE;
}

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

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

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

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

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

void FRemu__LinkStatus::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 FRemu__LinkStatus::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", "@FrameRelay_Emulation.FRemu_LinkStatus");
  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 @FrameRelay_Emulation.FRemu_LinkStatus.");
  }
}

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

void FRemu__LinkStatus::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 @FrameRelay_Emulation.FRemu_LinkStatus.", enum_value);
}

void FRemu__LinkStatus_template::copy_template(const FRemu__LinkStatus_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 FRemu__LinkStatus_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 FRemu__LinkStatus_template(*other_value.implication_.precondition);
implication_.implied_template = new FRemu__LinkStatus_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 @FrameRelay_Emulation.FRemu_LinkStatus.");
}
}

FRemu__LinkStatus_template::FRemu__LinkStatus_template()
{
}

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

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

FRemu__LinkStatus_template::FRemu__LinkStatus_template(FRemu__LinkStatus::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

boolean FRemu__LinkStatus_template::match(FRemu__LinkStatus::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 @FrameRelay_Emulation.FRemu_LinkStatus.");
}
return FALSE;
}

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

FRemu__LinkStatus::enum_type FRemu__LinkStatus_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 @FrameRelay_Emulation.FRemu_LinkStatus.");
return single_value;
}

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

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

void FRemu__LinkStatus_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(FRemu__LinkStatus::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 FRemu__LinkStatus_template::log_match(const FRemu__LinkStatus& 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 FRemu__LinkStatus_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 @FrameRelay_Emulation.FRemu_LinkStatus.");
}
}

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

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

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

void FRemu__LinkStatus_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 : "@FrameRelay_Emulation.FRemu_LinkStatus");
}

FRemu__PvcStatus::FRemu__PvcStatus()
{
}

FRemu__PvcStatus::FRemu__PvcStatus(const INTEGER& par_dlci,
    const BOOLEAN& par_new_,
    const BOOLEAN& par_delete_,
    const BOOLEAN& par_active)
  :   field_dlci(par_dlci),
  field_new_(par_new_),
  field_delete_(par_delete_),
  field_active(par_active)
{
}

FRemu__PvcStatus::FRemu__PvcStatus(const FRemu__PvcStatus& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @FrameRelay_Emulation.FRemu_PvcStatus.");
if (other_value.dlci().is_bound()) field_dlci = other_value.dlci();
else field_dlci.clean_up();
if (other_value.new_().is_bound()) field_new_ = other_value.new_();
else field_new_.clean_up();
if (other_value.delete_().is_bound()) field_delete_ = other_value.delete_();
else field_delete_.clean_up();
if (other_value.active().is_bound()) field_active = other_value.active();
else field_active.clean_up();
}

void FRemu__PvcStatus::clean_up()
{
field_dlci.clean_up();
field_new_.clean_up();
field_delete_.clean_up();
field_active.clean_up();
}

const TTCN_Typedescriptor_t* FRemu__PvcStatus::get_descriptor() const { return &FRemu__PvcStatus_descr_; }
FRemu__PvcStatus& FRemu__PvcStatus::operator=(const FRemu__PvcStatus& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @FrameRelay_Emulation.FRemu_PvcStatus.");
  if (other_value.dlci().is_bound()) field_dlci = other_value.dlci();
  else field_dlci.clean_up();
  if (other_value.new_().is_bound()) field_new_ = other_value.new_();
  else field_new_.clean_up();
  if (other_value.delete_().is_bound()) field_delete_ = other_value.delete_();
  else field_delete_.clean_up();
  if (other_value.active().is_bound()) field_active = other_value.active();
  else field_active.clean_up();
}
return *this;
}

boolean FRemu__PvcStatus::operator==(const FRemu__PvcStatus& other_value) const
{
return field_dlci==other_value.field_dlci
  && field_new_==other_value.field_new_
  && field_delete_==other_value.field_delete_
  && field_active==other_value.field_active;
}

boolean FRemu__PvcStatus::is_bound() const
{
return (field_dlci.is_bound())
  || (field_new_.is_bound())
  || (field_delete_.is_bound())
  || (field_active.is_bound());
}
boolean FRemu__PvcStatus::is_value() const
{
return field_dlci.is_value()
  && field_new_.is_value()
  && field_delete_.is_value()
  && field_active.is_value();
}
void FRemu__PvcStatus::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dlci := ");
field_dlci.log();
TTCN_Logger::log_event_str(", new := ");
field_new_.log();
TTCN_Logger::log_event_str(", delete := ");
field_delete_.log();
TTCN_Logger::log_event_str(", active := ");
field_active.log();
TTCN_Logger::log_event_str(" }");
}

void FRemu__PvcStatus::set_implicit_omit()
{
if (dlci().is_bound()) dlci().set_implicit_omit();
if (new_().is_bound()) new_().set_implicit_omit();
if (delete_().is_bound()) delete_().set_implicit_omit();
if (active().is_bound()) active().set_implicit_omit();
}

void FRemu__PvcStatus::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 @FrameRelay_Emulation.FRemu_PvcStatus 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) dlci().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) new_().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) delete_().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) active().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(), "dlci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dlci().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(), "new")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          new_().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(), "delete")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          delete_().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(), "active")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          active().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 @FrameRelay_Emulation.FRemu_PvcStatus: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@FrameRelay_Emulation.FRemu_PvcStatus");
  }
}

void FRemu__PvcStatus::encode_text(Text_Buf& text_buf) const
{
field_dlci.encode_text(text_buf);
field_new_.encode_text(text_buf);
field_delete_.encode_text(text_buf);
field_active.encode_text(text_buf);
}

void FRemu__PvcStatus::decode_text(Text_Buf& text_buf)
{
field_dlci.decode_text(text_buf);
field_new_.decode_text(text_buf);
field_delete_.decode_text(text_buf);
field_active.decode_text(text_buf);
}

struct FRemu__PvcStatus_template::single_value_struct {
INTEGER_template field_dlci;
BOOLEAN_template field_new_;
BOOLEAN_template field_delete_;
BOOLEAN_template field_active;
};

void FRemu__PvcStatus_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_dlci = ANY_VALUE;
single_value->field_new_ = ANY_VALUE;
single_value->field_delete_ = ANY_VALUE;
single_value->field_active = ANY_VALUE;
}
}
}

void FRemu__PvcStatus_template::copy_value(const FRemu__PvcStatus& other_value)
{
single_value = new single_value_struct;
if (other_value.dlci().is_bound()) {
  single_value->field_dlci = other_value.dlci();
} else {
  single_value->field_dlci.clean_up();
}
if (other_value.new_().is_bound()) {
  single_value->field_new_ = other_value.new_();
} else {
  single_value->field_new_.clean_up();
}
if (other_value.delete_().is_bound()) {
  single_value->field_delete_ = other_value.delete_();
} else {
  single_value->field_delete_.clean_up();
}
if (other_value.active().is_bound()) {
  single_value->field_active = other_value.active();
} else {
  single_value->field_active.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void FRemu__PvcStatus_template::copy_template(const FRemu__PvcStatus_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dlci().get_selection()) {
single_value->field_dlci = other_value.dlci();
} else {
single_value->field_dlci.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.new_().get_selection()) {
single_value->field_new_ = other_value.new_();
} else {
single_value->field_new_.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.delete_().get_selection()) {
single_value->field_delete_ = other_value.delete_();
} else {
single_value->field_delete_.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.active().get_selection()) {
single_value->field_active = other_value.active();
} else {
single_value->field_active.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 FRemu__PvcStatus_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 FRemu__PvcStatus_template(*other_value.implication_.precondition);
implication_.implied_template = new FRemu__PvcStatus_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 @FrameRelay_Emulation.FRemu_PvcStatus.");
break;
}
set_selection(other_value);
}

FRemu__PvcStatus_template::FRemu__PvcStatus_template()
{
}

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

FRemu__PvcStatus_template::FRemu__PvcStatus_template(const FRemu__PvcStatus& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean FRemu__PvcStatus_template::match(const FRemu__PvcStatus& 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.dlci().is_bound()) return FALSE;
if(!single_value->field_dlci.match(other_value.dlci(), legacy))return FALSE;
if(!other_value.new_().is_bound()) return FALSE;
if(!single_value->field_new_.match(other_value.new_(), legacy))return FALSE;
if(!other_value.delete_().is_bound()) return FALSE;
if(!single_value->field_delete_.match(other_value.delete_(), legacy))return FALSE;
if(!other_value.active().is_bound()) return FALSE;
if(!single_value->field_active.match(other_value.active(), 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 @FrameRelay_Emulation.FRemu_PvcStatus.");
}
return FALSE;
}

boolean FRemu__PvcStatus_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dlci.is_bound()
 || single_value->field_new_.is_bound()
 || single_value->field_delete_.is_bound()
 || single_value->field_active.is_bound();
}

boolean FRemu__PvcStatus_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dlci.is_value()
 && single_value->field_new_.is_value()
 && single_value->field_delete_.is_value()
 && single_value->field_active.is_value();
}

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

FRemu__PvcStatus FRemu__PvcStatus_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 @FrameRelay_Emulation.FRemu_PvcStatus.");
FRemu__PvcStatus ret_val;
if (single_value->field_dlci.is_bound()) {
ret_val.dlci() = single_value->field_dlci.valueof();
}
if (single_value->field_new_.is_bound()) {
ret_val.new_() = single_value->field_new_.valueof();
}
if (single_value->field_delete_.is_bound()) {
ret_val.delete_() = single_value->field_delete_.valueof();
}
if (single_value->field_active.is_bound()) {
ret_val.active() = single_value->field_active.valueof();
}
return ret_val;
}

void FRemu__PvcStatus_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 @FrameRelay_Emulation.FRemu_PvcStatus.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new FRemu__PvcStatus_template[list_length];
}

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

INTEGER_template& FRemu__PvcStatus_template::dlci()
{
set_specific();
return single_value->field_dlci;
}

const INTEGER_template& FRemu__PvcStatus_template::dlci() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dlci of a non-specific template of type @FrameRelay_Emulation.FRemu_PvcStatus.");
return single_value->field_dlci;
}

BOOLEAN_template& FRemu__PvcStatus_template::new_()
{
set_specific();
return single_value->field_new_;
}

const BOOLEAN_template& FRemu__PvcStatus_template::new_() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field new of a non-specific template of type @FrameRelay_Emulation.FRemu_PvcStatus.");
return single_value->field_new_;
}

BOOLEAN_template& FRemu__PvcStatus_template::delete_()
{
set_specific();
return single_value->field_delete_;
}

const BOOLEAN_template& FRemu__PvcStatus_template::delete_() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field delete of a non-specific template of type @FrameRelay_Emulation.FRemu_PvcStatus.");
return single_value->field_delete_;
}

BOOLEAN_template& FRemu__PvcStatus_template::active()
{
set_specific();
return single_value->field_active;
}

const BOOLEAN_template& FRemu__PvcStatus_template::active() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field active of a non-specific template of type @FrameRelay_Emulation.FRemu_PvcStatus.");
return single_value->field_active;
}

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

void FRemu__PvcStatus_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dlci := ");
single_value->field_dlci.log();
TTCN_Logger::log_event_str(", new := ");
single_value->field_new_.log();
TTCN_Logger::log_event_str(", delete := ");
single_value->field_delete_.log();
TTCN_Logger::log_event_str(", active := ");
single_value->field_active.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 FRemu__PvcStatus_template::log_match(const FRemu__PvcStatus& 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_dlci.match(match_value.dlci(), legacy)){
TTCN_Logger::log_logmatch_info(".dlci");
single_value->field_dlci.log_match(match_value.dlci(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_new_.match(match_value.new_(), legacy)){
TTCN_Logger::log_logmatch_info(".new");
single_value->field_new_.log_match(match_value.new_(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_delete_.match(match_value.delete_(), legacy)){
TTCN_Logger::log_logmatch_info(".delete");
single_value->field_delete_.log_match(match_value.delete_(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_active.match(match_value.active(), legacy)){
TTCN_Logger::log_logmatch_info(".active");
single_value->field_active.log_match(match_value.active(), 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("{ dlci := ");
single_value->field_dlci.log_match(match_value.dlci(), legacy);
TTCN_Logger::log_event_str(", new := ");
single_value->field_new_.log_match(match_value.new_(), legacy);
TTCN_Logger::log_event_str(", delete := ");
single_value->field_delete_.log_match(match_value.delete_(), legacy);
TTCN_Logger::log_event_str(", active := ");
single_value->field_active.log_match(match_value.active(), 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 FRemu__PvcStatus_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dlci().is_bound()) dlci().set_implicit_omit();
if (new_().is_bound()) new_().set_implicit_omit();
if (delete_().is_bound()) delete_().set_implicit_omit();
if (active().is_bound()) active().set_implicit_omit();
}

void FRemu__PvcStatus_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dlci.encode_text(text_buf);
single_value->field_new_.encode_text(text_buf);
single_value->field_delete_.encode_text(text_buf);
single_value->field_active.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 @FrameRelay_Emulation.FRemu_PvcStatus.");
}
}

void FRemu__PvcStatus_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_dlci.decode_text(text_buf);
single_value->field_new_.decode_text(text_buf);
single_value->field_delete_.decode_text(text_buf);
single_value->field_active.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 FRemu__PvcStatus_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 @FrameRelay_Emulation.FRemu_PvcStatus.");
}
}

void FRemu__PvcStatus_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: {
    FRemu__PvcStatus_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 @FrameRelay_Emulation.FRemu_PvcStatus 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) dlci().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) new_().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) delete_().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) active().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(), "dlci")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dlci().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(), "new")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          new_().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(), "delete")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          delete_().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(), "active")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          active().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 @FrameRelay_Emulation.FRemu_PvcStatus: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FRemu__PvcStatus_template* precondition = new FRemu__PvcStatus_template;
    precondition->set_param(*param.get_elem(0));
    FRemu__PvcStatus_template* implied_template = new FRemu__PvcStatus_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FRemu__PvcStatus_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@FrameRelay_Emulation.FRemu_PvcStatus");
  }
  is_ifpresent = param.get_ifpresent();
}

void FRemu__PvcStatus_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_dlci.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.FRemu_PvcStatus");
single_value->field_new_.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.FRemu_PvcStatus");
single_value->field_delete_.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.FRemu_PvcStatus");
single_value->field_active.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.FRemu_PvcStatus");
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 : "@FrameRelay_Emulation.FRemu_PvcStatus");
}

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

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

void FRemu__Event::copy_value(const FRemu__Event& other_value)
{
switch (other_value.union_selection) {
case ALT_link__status:
field_link__status = new FRemu__LinkStatus(*other_value.field_link__status);
break;
case ALT_pvc__status:
field_pvc__status = new FRemu__PvcStatus(*other_value.field_pvc__status);
break;
default:
TTCN_error("Assignment of an unbound union value of type @FrameRelay_Emulation.FRemu_Event.");
}
union_selection = other_value.union_selection;
}

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

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

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

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

boolean FRemu__Event::operator==(const FRemu__Event& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @FrameRelay_Emulation.FRemu_Event.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @FrameRelay_Emulation.FRemu_Event.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_link__status:
return *field_link__status == *other_value.field_link__status;
case ALT_pvc__status:
return *field_pvc__status == *other_value.field_pvc__status;
default:
return FALSE;
}
}

FRemu__LinkStatus& FRemu__Event::link__status()
{
if (union_selection != ALT_link__status) {
clean_up();
field_link__status = new FRemu__LinkStatus;
union_selection = ALT_link__status;
}
return *field_link__status;
}

const FRemu__LinkStatus& FRemu__Event::link__status() const
{
if (union_selection != ALT_link__status) TTCN_error("Using non-selected field link_status in a value of union type @FrameRelay_Emulation.FRemu_Event.");
return *field_link__status;
}

FRemu__PvcStatus& FRemu__Event::pvc__status()
{
if (union_selection != ALT_pvc__status) {
clean_up();
field_pvc__status = new FRemu__PvcStatus;
union_selection = ALT_pvc__status;
}
return *field_pvc__status;
}

const FRemu__PvcStatus& FRemu__Event::pvc__status() const
{
if (union_selection != ALT_pvc__status) TTCN_error("Using non-selected field pvc_status in a value of union type @FrameRelay_Emulation.FRemu_Event.");
return *field_pvc__status;
}

boolean FRemu__Event::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @FrameRelay_Emulation.FRemu_Event.");
return union_selection == checked_selection;
}

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

boolean FRemu__Event::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_link__status: return field_link__status->is_value();
case ALT_pvc__status: return field_pvc__status->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void FRemu__Event::clean_up()
{
switch (union_selection) {
case ALT_link__status:
  delete field_link__status;
  break;
case ALT_pvc__status:
  delete field_pvc__status;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void FRemu__Event::log() const
{
switch (union_selection) {
case ALT_link__status:
TTCN_Logger::log_event_str("{ link_status := ");
field_link__status->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_pvc__status:
TTCN_Logger::log_event_str("{ pvc_status := ");
field_pvc__status->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void FRemu__Event::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "link_status")) {
    link__status().set_param(*mp_last);
    if (!link__status().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "pvc_status")) {
    pvc__status().set_param(*mp_last);
    if (!pvc__status().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @FrameRelay_Emulation.FRemu_Event.", last_name);
}

void FRemu__Event::set_implicit_omit()
{
switch (union_selection) {
case ALT_link__status:
field_link__status->set_implicit_omit(); break;
case ALT_pvc__status:
field_pvc__status->set_implicit_omit(); break;
default: break;
}
}

void FRemu__Event::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_link__status:
field_link__status->encode_text(text_buf);
break;
case ALT_pvc__status:
field_pvc__status->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @FrameRelay_Emulation.FRemu_Event.");
}
}

void FRemu__Event::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_link__status:
link__status().decode_text(text_buf);
break;
case ALT_pvc__status:
pvc__status().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @FrameRelay_Emulation.FRemu_Event.");
}
}

void FRemu__Event_template::copy_value(const FRemu__Event& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
single_value.field_link__status = new FRemu__LinkStatus_template(other_value.link__status());
break;
case FRemu__Event::ALT_pvc__status:
single_value.field_pvc__status = new FRemu__PvcStatus_template(other_value.pvc__status());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @FrameRelay_Emulation.FRemu_Event.");
}
set_selection(SPECIFIC_VALUE);
}

void FRemu__Event_template::copy_template(const FRemu__Event_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
single_value.field_link__status = new FRemu__LinkStatus_template(*other_value.single_value.field_link__status);
break;
case FRemu__Event::ALT_pvc__status:
single_value.field_pvc__status = new FRemu__PvcStatus_template(*other_value.single_value.field_pvc__status);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @FrameRelay_Emulation.FRemu_Event.");
}
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 FRemu__Event_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 FRemu__Event_template(*other_value.implication_.precondition);
implication_.implied_template = new FRemu__Event_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @FrameRelay_Emulation.FRemu_Event.");
}
set_selection(other_value);
}

FRemu__Event_template::FRemu__Event_template()
{
}

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

FRemu__Event_template::FRemu__Event_template(const FRemu__Event& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

FRemu__Event_template& FRemu__Event_template::operator=(const OPTIONAL<FRemu__Event>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FRemu__Event&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @FrameRelay_Emulation.FRemu_Event.");
}
return *this;
}

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

boolean FRemu__Event_template::match(const FRemu__Event& 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:
{
FRemu__Event::union_selection_type value_selection = other_value.get_selection();
if (value_selection == FRemu__Event::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case FRemu__Event::ALT_link__status:
return single_value.field_link__status->match(other_value.link__status(), legacy);
case FRemu__Event::ALT_pvc__status:
return single_value.field_pvc__status->match(other_value.pvc__status(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @FrameRelay_Emulation.FRemu_Event.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @FrameRelay_Emulation.FRemu_Event.");
}
return FALSE;
}

boolean FRemu__Event_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
return single_value.field_link__status->is_value();
case FRemu__Event::ALT_pvc__status:
return single_value.field_pvc__status->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @FrameRelay_Emulation.FRemu_Event.");
}
}

FRemu__Event FRemu__Event_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @FrameRelay_Emulation.FRemu_Event.");
FRemu__Event ret_val;
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
ret_val.link__status() = single_value.field_link__status->valueof();
break;
case FRemu__Event::ALT_pvc__status:
ret_val.pvc__status() = single_value.field_pvc__status->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @FrameRelay_Emulation.FRemu_Event.");
}
return ret_val;
}

FRemu__Event_template& FRemu__Event_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @FrameRelay_Emulation.FRemu_Event.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @FrameRelay_Emulation.FRemu_Event.");
return value_list.list_value[list_index];
}
void FRemu__Event_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @FrameRelay_Emulation.FRemu_Event.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new FRemu__Event_template[list_length];
}

FRemu__LinkStatus_template& FRemu__Event_template::link__status()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != FRemu__Event::ALT_link__status) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_link__status = new FRemu__LinkStatus_template(ANY_VALUE);
else single_value.field_link__status = new FRemu__LinkStatus_template;
single_value.union_selection = FRemu__Event::ALT_link__status;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_link__status;
}

const FRemu__LinkStatus_template& FRemu__Event_template::link__status() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field link_status in a non-specific template of union type @FrameRelay_Emulation.FRemu_Event.");
if (single_value.union_selection != FRemu__Event::ALT_link__status) TTCN_error("Accessing non-selected field link_status in a template of union type @FrameRelay_Emulation.FRemu_Event.");
return *single_value.field_link__status;
}

FRemu__PvcStatus_template& FRemu__Event_template::pvc__status()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != FRemu__Event::ALT_pvc__status) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pvc__status = new FRemu__PvcStatus_template(ANY_VALUE);
else single_value.field_pvc__status = new FRemu__PvcStatus_template;
single_value.union_selection = FRemu__Event::ALT_pvc__status;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_pvc__status;
}

const FRemu__PvcStatus_template& FRemu__Event_template::pvc__status() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pvc_status in a non-specific template of union type @FrameRelay_Emulation.FRemu_Event.");
if (single_value.union_selection != FRemu__Event::ALT_pvc__status) TTCN_error("Accessing non-selected field pvc_status in a template of union type @FrameRelay_Emulation.FRemu_Event.");
return *single_value.field_pvc__status;
}

boolean FRemu__Event_template::ischosen(FRemu__Event::union_selection_type checked_selection) const
{
if (checked_selection == FRemu__Event::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @FrameRelay_Emulation.FRemu_Event.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == FRemu__Event::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @FrameRelay_Emulation.FRemu_Event.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @FrameRelay_Emulation.FRemu_Event containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void FRemu__Event_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
TTCN_Logger::log_event_str("{ link_status := ");
single_value.field_link__status->log();
TTCN_Logger::log_event_str(" }");
break;
case FRemu__Event::ALT_pvc__status:
TTCN_Logger::log_event_str("{ pvc_status := ");
single_value.field_pvc__status->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void FRemu__Event_template::log_match(const FRemu__Event& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".link_status");
single_value.field_link__status->log_match(match_value.link__status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ link_status := ");
single_value.field_link__status->log_match(match_value.link__status(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case FRemu__Event::ALT_pvc__status:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".pvc_status");
single_value.field_pvc__status->log_match(match_value.pvc__status(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ pvc_status := ");
single_value.field_pvc__status->log_match(match_value.pvc__status(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void FRemu__Event_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
single_value.field_link__status->set_implicit_omit(); break;
case FRemu__Event::ALT_pvc__status:
single_value.field_pvc__status->set_implicit_omit(); break;
default: break;
}
}

void FRemu__Event_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
single_value.field_link__status->encode_text(text_buf);
break;
case FRemu__Event::ALT_pvc__status:
single_value.field_pvc__status->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @FrameRelay_Emulation.FRemu_Event.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @FrameRelay_Emulation.FRemu_Event.");
}
}

void FRemu__Event_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = FRemu__Event::UNBOUND_VALUE;
FRemu__Event::union_selection_type new_selection = (FRemu__Event::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case FRemu__Event::ALT_link__status:
single_value.field_link__status = new FRemu__LinkStatus_template;
single_value.field_link__status->decode_text(text_buf);
break;
case FRemu__Event::ALT_pvc__status:
single_value.field_pvc__status = new FRemu__PvcStatus_template;
single_value.field_pvc__status->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @FrameRelay_Emulation.FRemu_Event.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new FRemu__Event_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @FrameRelay_Emulation.FRemu_Event.");
}
}

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

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

void FRemu__Event_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@FrameRelay_Emulation.FRemu_Event'");
    }
    if (strcmp("link_status", param_field) == 0) {
      link__status().set_param(param);
      return;
    } else if (strcmp("pvc_status", param_field) == 0) {
      pvc__status().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@FrameRelay_Emulation.FRemu_Event'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    FRemu__Event_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@FrameRelay_Emulation.FRemu_Event");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "link_status")) {
      link__status().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "pvc_status")) {
      pvc__status().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @FrameRelay_Emulation.FRemu_Event.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    FRemu__Event_template* precondition = new FRemu__Event_template;
    precondition->set_param(*m_p->get_elem(0));
    FRemu__Event_template* implied_template = new FRemu__Event_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = FRemu__Event_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@FrameRelay_Emulation.FRemu_Event");
  }
  is_ifpresent = param.get_ifpresent();
}

void FRemu__Event_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case FRemu__Event::ALT_link__status:
single_value.field_link__status->check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.FRemu_Event");
return;
case FRemu__Event::ALT_pvc__status:
single_value.field_pvc__status->check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.FRemu_Event");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @FrameRelay_Emulation.FRemu_Event.");
}
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 : "@FrameRelay_Emulation.FRemu_Event");
}

void FRemu__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;
case MESSAGE_1:
delete (my_head)->message_1;
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 FRemu__PT::clear_queue()
{
while (msg_queue_head != NULL) remove_msg_queue_head();
}

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

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

void FRemu__PT::send(const FrameRelay__Types::FrameRelayFrame& 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(" @FrameRelay_Types.FrameRelayFrame : "),
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, "@FrameRelay_Types.FrameRelayFrame");
send_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void FRemu__PT::send(const FrameRelay__Types::FrameRelayFrame& 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 FRemu__PT::send(const FrameRelay__Types::FrameRelayFrame& 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, "@FrameRelay_Types.FrameRelayFrame");
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(" @FrameRelay_Types.FrameRelayFrame : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void FRemu__PT::send(const FrameRelay__Types::FrameRelayFrame_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const FrameRelay__Types::FrameRelayFrame& send_par_value = FrameRelay__Types::FrameRelayFrame(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void FRemu__PT::send(const FrameRelay__Types::FrameRelayFrame_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const FrameRelay__Types::FrameRelayFrame& send_par_value = FrameRelay__Types::FrameRelayFrame(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void FRemu__PT::send(const FrameRelay__Types::FrameRelayFrame_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const FrameRelay__Types::FrameRelayFrame& send_par_value = FrameRelay__Types::FrameRelayFrame(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

alt_status FRemu__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(": @FrameRelay_Emulation.FRemu_Event: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
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(": @FrameRelay_Types.FrameRelayFrame: "),
my_head->message_1->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 FRemu__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(": @FrameRelay_Emulation.FRemu_Event: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
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(": @FrameRelay_Types.FrameRelayFrame: "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
default:
TTCN_error("Internal error: unknown message");
}
}
return ALT_YES;
}
}

alt_status FRemu__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(": @FrameRelay_Emulation.FRemu_Event: "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1);
break;
case MESSAGE_1:
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(": @FrameRelay_Types.FrameRelayFrame: "),
my_head->message_1->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 FRemu__PT::receive(const FRemu__Event_template& value_template, FRemu__Event *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 @FrameRelay_Emulation.FRemu_Event.", 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(": @FrameRelay_Emulation.FRemu_Event : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status FRemu__PT::check_receive(const FRemu__Event_template& value_template, FRemu__Event *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 @FrameRelay_Emulation.FRemu_Event.", 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(": @FrameRelay_Emulation.FRemu_Event : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status FRemu__PT::trigger(const FRemu__Event_template& value_template, FRemu__Event *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 @FrameRelay_Emulation.FRemu_Event.", 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(": @FrameRelay_Emulation.FRemu_Event : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status FRemu__PT::receive(const FrameRelay__Types::FrameRelayFrame_template& value_template, FrameRelay__Types::FrameRelayFrame *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_1) {
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 @FrameRelay_Types.FrameRelayFrame.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_1)) {
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_1),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_1;
}
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_1),
 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(": @FrameRelay_Types.FrameRelayFrame : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status FRemu__PT::check_receive(const FrameRelay__Types::FrameRelayFrame_template& value_template, FrameRelay__Types::FrameRelayFrame *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_1) {
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 @FrameRelay_Types.FrameRelayFrame.", port_name);
return ALT_NO;
} else if (!value_template.match(*my_head->message_1)) {
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_1),
 TTCN_Logger::end_event_log2str()));
}
return ALT_NO;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_1;
}
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_1),
 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(": @FrameRelay_Types.FrameRelayFrame : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status FRemu__PT::trigger(const FrameRelay__Types::FrameRelayFrame_template& value_template, FrameRelay__Types::FrameRelayFrame *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_1) {
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 @FrameRelay_Types.FrameRelayFrame.", port_name);
remove_msg_queue_head();
return ALT_REPEAT;
} else if (!value_template.match(*my_head->message_1)) {
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_1),
 TTCN_Logger::end_event_log2str()));
}
remove_msg_queue_head();
return ALT_REPEAT;
} else {
if (value_redirect != NULL) {
*value_redirect = *my_head->message_1;
}
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_1),
 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(": @FrameRelay_Types.FrameRelayFrame : "),
my_head->message_1->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

void FRemu__PT::incoming_message(const FRemu__Event& 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(" @FrameRelay_Emulation.FRemu_Event : "), 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 FRemu__Event(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

void FRemu__PT::incoming_message(const FrameRelay__Types::FrameRelayFrame& 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(" @FrameRelay_Types.FrameRelayFrame : "), incoming_par.log(), TTCN_Logger::end_event_log2str()));
}
msg_queue_item *new_item = new msg_queue_item;
new_item->item_selection = MESSAGE_1;
new_item->message_1 = new FrameRelay__Types::FrameRelayFrame(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

boolean FRemu__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@FrameRelay_Emulation.FRemu_Event")) {
FRemu__Event incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(message_type, "@FrameRelay_Types.FrameRelayFrame")) {
FrameRelay__Types::FrameRelayFrame incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

void FRemu__asp__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 FRemu__asp__PT::clear_queue()
{
while (msg_queue_head != NULL) remove_msg_queue_head();
}

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

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

void FRemu__asp__PT::send(const FRemu__Event& 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(" @FrameRelay_Emulation.FRemu_Event : "),
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, "@FrameRelay_Emulation.FRemu_Event");
send_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void FRemu__asp__PT::send(const FRemu__Event& 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 FRemu__asp__PT::send(const FRemu__Event& 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, "@FrameRelay_Emulation.FRemu_Event");
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(" @FrameRelay_Emulation.FRemu_Event : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void FRemu__asp__PT::send(const FRemu__Event_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const FRemu__Event& send_par_value = FRemu__Event(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void FRemu__asp__PT::send(const FRemu__Event_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const FRemu__Event& send_par_value = FRemu__Event(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void FRemu__asp__PT::send(const FRemu__Event_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const FRemu__Event& send_par_value = FRemu__Event(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

void FRemu__asp__PT::send(const FrameRelay__Types::FrameRelayFrame& 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(" @FrameRelay_Types.FrameRelayFrame : "),
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, "@FrameRelay_Types.FrameRelayFrame");
send_par.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void FRemu__asp__PT::send(const FrameRelay__Types::FrameRelayFrame& 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 FRemu__asp__PT::send(const FrameRelay__Types::FrameRelayFrame& 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, "@FrameRelay_Types.FrameRelayFrame");
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(" @FrameRelay_Types.FrameRelayFrame : "), send_par.log(), TTCN_Logger::end_event_log2str()));
}
else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect);
}

void FRemu__asp__PT::send(const FrameRelay__Types::FrameRelayFrame_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect)
{
const FrameRelay__Types::FrameRelayFrame& send_par_value = FrameRelay__Types::FrameRelayFrame(send_par.valueof());
send(send_par_value, destination_component, timestamp_redirect);
}

void FRemu__asp__PT::send(const FrameRelay__Types::FrameRelayFrame_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect)
{
const FrameRelay__Types::FrameRelayFrame& send_par_value = FrameRelay__Types::FrameRelayFrame(send_par.valueof());
send(send_par_value, nof_components, destination_components, timestamp_redirect);
}

void FRemu__asp__PT::send(const FrameRelay__Types::FrameRelayFrame_template& send_par, boolean broadcast, FLOAT* timestamp_redirect)
{
const FrameRelay__Types::FrameRelayFrame& send_par_value = FrameRelay__Types::FrameRelayFrame(send_par.valueof());
send(send_par_value, broadcast, timestamp_redirect);
}

alt_status FRemu__asp__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(": @FrameRelay_Types.FrameRelayFrame: "),
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 FRemu__asp__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(": @FrameRelay_Types.FrameRelayFrame: "),
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 FRemu__asp__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(": @FrameRelay_Types.FrameRelayFrame: "),
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 FRemu__asp__PT::receive(const FrameRelay__Types::FrameRelayFrame_template& value_template, FrameRelay__Types::FrameRelayFrame *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 @FrameRelay_Types.FrameRelayFrame.", 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(": @FrameRelay_Types.FrameRelayFrame : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

alt_status FRemu__asp__PT::check_receive(const FrameRelay__Types::FrameRelayFrame_template& value_template, FrameRelay__Types::FrameRelayFrame *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 @FrameRelay_Types.FrameRelayFrame.", 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(": @FrameRelay_Types.FrameRelayFrame : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
return ALT_YES;
}
}

alt_status FRemu__asp__PT::trigger(const FrameRelay__Types::FrameRelayFrame_template& value_template, FrameRelay__Types::FrameRelayFrame *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 @FrameRelay_Types.FrameRelayFrame.", 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(": @FrameRelay_Types.FrameRelayFrame : "),
my_head->message_0->log(), TTCN_Logger::end_event_log2str()),
msg_head_count+1);
}
remove_msg_queue_head();
return ALT_YES;
}
}

void FRemu__asp__PT::incoming_message(const FrameRelay__Types::FrameRelayFrame& 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(" @FrameRelay_Types.FrameRelayFrame : "), 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 FrameRelay__Types::FrameRelayFrame(incoming_par);
new_item->sender_component = sender_component;
append_to_msg_queue(new_item);
}

boolean FRemu__asp__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&)
{
if (!strcmp(message_type, "@FrameRelay_Types.FrameRelayFrame")) {
FrameRelay__Types::FrameRelayFrame incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_message(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

void FRemu__PROC__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 FRemu__PROC__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 REPLY_0:
delete proc_queue_head->reply_0;
break;
case REPLY_1:
delete proc_queue_head->reply_1;
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 FRemu__PROC__PT::clear_queue()
{
while (proc_queue_head != NULL) remove_proc_queue_head();
}

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

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

void FRemu__PROC__PT::call(const FRemu__register_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 FRemu__register_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, "@FrameRelay_Emulation.FRemu_register");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void FRemu__PROC__PT::call(const FRemu__register_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 FRemu__PROC__PT::call(const FRemu__register_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, "@FrameRelay_Emulation.FRemu_register");
const FRemu__register_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 FRemu__PROC__PT::call(const FRemu__unregister_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 FRemu__unregister_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, "@FrameRelay_Emulation.FRemu_unregister");
call_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void FRemu__PROC__PT::call(const FRemu__unregister_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 FRemu__PROC__PT::call(const FRemu__unregister_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, "@FrameRelay_Emulation.FRemu_unregister");
const FRemu__unregister_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 FRemu__PROC__PT::reply(const FRemu__register_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 FRemu__register_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, "@FrameRelay_Emulation.FRemu_register");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void FRemu__PROC__PT::reply(const FRemu__register_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 FRemu__PROC__PT::reply(const FRemu__register_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, "@FrameRelay_Emulation.FRemu_register");
const FRemu__register_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 FRemu__PROC__PT::reply(const FRemu__unregister_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 FRemu__unregister_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, "@FrameRelay_Emulation.FRemu_unregister");
reply_tmp.encode_text(text_buf);
send_data(text_buf, destination_component);
}
}

void FRemu__PROC__PT::reply(const FRemu__unregister_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 FRemu__PROC__PT::reply(const FRemu__unregister_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, "@FrameRelay_Emulation.FRemu_unregister");
const FRemu__unregister_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 FRemu__PROC__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:
{
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 FRemu__PROC__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:
{
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 FRemu__PROC__PT::getcall(const FRemu__register_template& getcall_template, const COMPONENT_template& sender_template, const FRemu__register_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 @FrameRelay_Emulation.FRemu_register.", 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 FRemu__PROC__PT::check_getcall(const FRemu__register_template& getcall_template, const COMPONENT_template& sender_template, const FRemu__register_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 @FrameRelay_Emulation.FRemu_register.", 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 FRemu__PROC__PT::getcall(const FRemu__unregister_template& getcall_template, const COMPONENT_template& sender_template, const FRemu__unregister_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 @FrameRelay_Emulation.FRemu_unregister.", 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 FRemu__PROC__PT::check_getcall(const FRemu__unregister_template& getcall_template, const COMPONENT_template& sender_template, const FRemu__unregister_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 @FrameRelay_Emulation.FRemu_unregister.", 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 FRemu__PROC__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:
{
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 FRemu__PROC__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:
{
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 FRemu__PROC__PT::getreply(const FRemu__register_template& getreply_template, const COMPONENT_template& sender_template, const FRemu__register_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 @FrameRelay_Emulation.FRemu_register.", 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 FRemu__PROC__PT::check_getreply(const FRemu__register_template& getreply_template, const COMPONENT_template& sender_template, const FRemu__register_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 @FrameRelay_Emulation.FRemu_register.", 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 FRemu__PROC__PT::getreply(const FRemu__unregister_template& getreply_template, const COMPONENT_template& sender_template, const FRemu__unregister_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 @FrameRelay_Emulation.FRemu_unregister.", 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 FRemu__PROC__PT::check_getreply(const FRemu__unregister_template& getreply_template, const COMPONENT_template& sender_template, const FRemu__unregister_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 @FrameRelay_Emulation.FRemu_unregister.", 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;
}
}

void FRemu__PROC__PT::incoming_call(const FRemu__register_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 FRemu__register_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void FRemu__PROC__PT::incoming_call(const FRemu__unregister_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 FRemu__unregister_call(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void FRemu__PROC__PT::incoming_reply(const FRemu__register_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 FRemu__register_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

void FRemu__PROC__PT::incoming_reply(const FRemu__unregister_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 FRemu__unregister_reply(incoming_par);
new_item->sender_component = sender_component;
append_to_proc_queue(new_item);
}

boolean FRemu__PROC__PT::process_call(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@FrameRelay_Emulation.FRemu_register")) {
FRemu__register_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@FrameRelay_Emulation.FRemu_unregister")) {
FRemu__unregister_call incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_call(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

boolean FRemu__PROC__PT::process_reply(const char *signature_name, Text_Buf& incoming_buf, component sender_component)
{
if (!strcmp(signature_name, "@FrameRelay_Emulation.FRemu_register")) {
FRemu__register_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else if (!strcmp(signature_name, "@FrameRelay_Emulation.FRemu_unregister")) {
FRemu__unregister_reply incoming_par;
incoming_par.decode_text(incoming_buf);
incoming_reply(incoming_par, sender_component);
return TRUE;
} else return FALSE;
}

void FRemu__register_call::encode_text(Text_Buf& text_buf) const
{
param_dlci.encode_text(text_buf);
}

void FRemu__register_call::decode_text(Text_Buf& text_buf)
{
param_dlci.decode_text(text_buf);
}

void FRemu__register_call::log() const
{
TTCN_Logger::log_event_str("@FrameRelay_Emulation.FRemu_register : { ");
TTCN_Logger::log_event_str("dlci := ");
param_dlci.log();
TTCN_Logger::log_event_str(" }");
}

void FRemu__register_call_redirect::set_parameters(const FRemu__register_call& call_par) const
{
if (ptr_dlci != NULL) *ptr_dlci = call_par.dlci();
}

void FRemu__register_reply::log() const
{
TTCN_Logger::log_event_str("@FrameRelay_Emulation.FRemu_register : { }");
}

FRemu__register_template::FRemu__register_template()
 : param_dlci(ANY_VALUE)
{
}

FRemu__register_call FRemu__register_template::create_call() const
{
FRemu__register_call ret_val;
ret_val.dlci() = param_dlci.valueof();
return ret_val;
}

boolean FRemu__register_template::match_call(const FRemu__register_call& match_value, boolean legacy) const
{
return param_dlci.match(match_value.dlci(), legacy);
}

void FRemu__register_template::log() const
{
TTCN_Logger::log_event_str("{ dlci := ");
param_dlci.log();
TTCN_Logger::log_event_str(" }");
}

void FRemu__register_template::log_match_call(const FRemu__register_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ dlci := ");
param_dlci.log_match(match_value.dlci(), legacy);
TTCN_Logger::log_event_str(" }");
}

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

void FRemu__register_template::encode_text(Text_Buf& text_buf) const
{
param_dlci.encode_text(text_buf);
}

void FRemu__register_template::decode_text(Text_Buf& text_buf)
{
param_dlci.decode_text(text_buf);
}

void FRemu__unregister_call::encode_text(Text_Buf& text_buf) const
{
param_dlci.encode_text(text_buf);
}

void FRemu__unregister_call::decode_text(Text_Buf& text_buf)
{
param_dlci.decode_text(text_buf);
}

void FRemu__unregister_call::log() const
{
TTCN_Logger::log_event_str("@FrameRelay_Emulation.FRemu_unregister : { ");
TTCN_Logger::log_event_str("dlci := ");
param_dlci.log();
TTCN_Logger::log_event_str(" }");
}

void FRemu__unregister_call_redirect::set_parameters(const FRemu__unregister_call& call_par) const
{
if (ptr_dlci != NULL) *ptr_dlci = call_par.dlci();
}

void FRemu__unregister_reply::log() const
{
TTCN_Logger::log_event_str("@FrameRelay_Emulation.FRemu_unregister : { }");
}

FRemu__unregister_template::FRemu__unregister_template()
 : param_dlci(ANY_VALUE)
{
}

FRemu__unregister_call FRemu__unregister_template::create_call() const
{
FRemu__unregister_call ret_val;
ret_val.dlci() = param_dlci.valueof();
return ret_val;
}

boolean FRemu__unregister_template::match_call(const FRemu__unregister_call& match_value, boolean legacy) const
{
return param_dlci.match(match_value.dlci(), legacy);
}

void FRemu__unregister_template::log() const
{
TTCN_Logger::log_event_str("{ dlci := ");
param_dlci.log();
TTCN_Logger::log_event_str(" }");
}

void FRemu__unregister_template::log_match_call(const FRemu__unregister_call& match_value, boolean legacy) const
{
TTCN_Logger::log_event_str("{ dlci := ");
param_dlci.log_match(match_value.dlci(), legacy);
TTCN_Logger::log_event_str(" }");
}

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

void FRemu__unregister_template::encode_text(Text_Buf& text_buf) const
{
param_dlci.encode_text(text_buf);
}

void FRemu__unregister_template::decode_text(Text_Buf& text_buf)
{
param_dlci.decode_text(text_buf);
}

ConnectionData::ConnectionData()
{
}

ConnectionData::ConnectionData(const COMPONENT& par_vc__conn,
    const FRemu__PvcStatus& par_q933__status)
  :   field_vc__conn(par_vc__conn),
  field_q933__status(par_q933__status)
{
}

ConnectionData::ConnectionData(const ConnectionData& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @FrameRelay_Emulation.ConnectionData.");
if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
else field_vc__conn.clean_up();
if (other_value.q933__status().is_bound()) field_q933__status = other_value.q933__status();
else field_q933__status.clean_up();
}

void ConnectionData::clean_up()
{
field_vc__conn.clean_up();
field_q933__status.clean_up();
}

const TTCN_Typedescriptor_t* ConnectionData::get_descriptor() const { return &ConnectionData_descr_; }
ConnectionData& ConnectionData::operator=(const ConnectionData& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @FrameRelay_Emulation.ConnectionData.");
  if (other_value.vc__conn().is_bound()) field_vc__conn = other_value.vc__conn();
  else field_vc__conn.clean_up();
  if (other_value.q933__status().is_bound()) field_q933__status = other_value.q933__status();
  else field_q933__status.clean_up();
}
return *this;
}

boolean ConnectionData::operator==(const ConnectionData& other_value) const
{
return field_vc__conn==other_value.field_vc__conn
  && field_q933__status==other_value.field_q933__status;
}

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

void ConnectionData::set_implicit_omit()
{
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
if (q933__status().is_bound()) q933__status().set_implicit_omit();
}

void ConnectionData::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 @FrameRelay_Emulation.ConnectionData 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) vc__conn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) q933__status().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(), "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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "q933_status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          q933__status().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 @FrameRelay_Emulation.ConnectionData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@FrameRelay_Emulation.ConnectionData");
  }
}

void ConnectionData::encode_text(Text_Buf& text_buf) const
{
field_vc__conn.encode_text(text_buf);
field_q933__status.encode_text(text_buf);
}

void ConnectionData::decode_text(Text_Buf& text_buf)
{
field_vc__conn.decode_text(text_buf);
field_q933__status.decode_text(text_buf);
}

struct ConnectionData_template::single_value_struct {
COMPONENT_template field_vc__conn;
FRemu__PvcStatus_template field_q933__status;
};

void ConnectionData_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_vc__conn = ANY_VALUE;
single_value->field_q933__status = ANY_VALUE;
}
}
}

void ConnectionData_template::copy_value(const ConnectionData& other_value)
{
single_value = new single_value_struct;
if (other_value.vc__conn().is_bound()) {
  single_value->field_vc__conn = other_value.vc__conn();
} else {
  single_value->field_vc__conn.clean_up();
}
if (other_value.q933__status().is_bound()) {
  single_value->field_q933__status = other_value.q933__status();
} else {
  single_value->field_q933__status.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ConnectionData_template::copy_template(const ConnectionData_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
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();
}
if (UNINITIALIZED_TEMPLATE != other_value.q933__status().get_selection()) {
single_value->field_q933__status = other_value.q933__status();
} else {
single_value->field_q933__status.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 ConnectionData_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 ConnectionData_template(*other_value.implication_.precondition);
implication_.implied_template = new ConnectionData_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 @FrameRelay_Emulation.ConnectionData.");
break;
}
set_selection(other_value);
}

ConnectionData_template::ConnectionData_template()
{
}

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

ConnectionData_template::ConnectionData_template(const ConnectionData& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean ConnectionData_template::match(const ConnectionData& 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.vc__conn().is_bound()) return FALSE;
if(!single_value->field_vc__conn.match(other_value.vc__conn(), legacy))return FALSE;
if(!other_value.q933__status().is_bound()) return FALSE;
if(!single_value->field_q933__status.match(other_value.q933__status(), 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 @FrameRelay_Emulation.ConnectionData.");
}
return FALSE;
}

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

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

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

ConnectionData ConnectionData_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 @FrameRelay_Emulation.ConnectionData.");
ConnectionData ret_val;
if (single_value->field_vc__conn.is_bound()) {
ret_val.vc__conn() = single_value->field_vc__conn.valueof();
}
if (single_value->field_q933__status.is_bound()) {
ret_val.q933__status() = single_value->field_q933__status.valueof();
}
return ret_val;
}

void ConnectionData_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 @FrameRelay_Emulation.ConnectionData.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ConnectionData_template[list_length];
}

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

COMPONENT_template& ConnectionData_template::vc__conn()
{
set_specific();
return single_value->field_vc__conn;
}

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

FRemu__PvcStatus_template& ConnectionData_template::q933__status()
{
set_specific();
return single_value->field_q933__status;
}

const FRemu__PvcStatus_template& ConnectionData_template::q933__status() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field q933_status of a non-specific template of type @FrameRelay_Emulation.ConnectionData.");
return single_value->field_q933__status;
}

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

void ConnectionData_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ vc_conn := ");
single_value->field_vc__conn.log();
TTCN_Logger::log_event_str(", q933_status := ");
single_value->field_q933__status.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 ConnectionData_template::log_match(const ConnectionData& 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_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);
}
if(!single_value->field_q933__status.match(match_value.q933__status(), legacy)){
TTCN_Logger::log_logmatch_info(".q933_status");
single_value->field_q933__status.log_match(match_value.q933__status(), 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("{ vc_conn := ");
single_value->field_vc__conn.log_match(match_value.vc__conn(), legacy);
TTCN_Logger::log_event_str(", q933_status := ");
single_value->field_q933__status.log_match(match_value.q933__status(), 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 ConnectionData_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (vc__conn().is_bound()) vc__conn().set_implicit_omit();
if (q933__status().is_bound()) q933__status().set_implicit_omit();
}

void ConnectionData_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_vc__conn.encode_text(text_buf);
single_value->field_q933__status.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 @FrameRelay_Emulation.ConnectionData.");
}
}

void ConnectionData_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_vc__conn.decode_text(text_buf);
single_value->field_q933__status.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 ConnectionData_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 @FrameRelay_Emulation.ConnectionData.");
}
}

void ConnectionData_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: {
    ConnectionData_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 @FrameRelay_Emulation.ConnectionData 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) vc__conn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) q933__status().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(), "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++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "q933_status")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          q933__status().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 @FrameRelay_Emulation.ConnectionData: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ConnectionData_template* precondition = new ConnectionData_template;
    precondition->set_param(*param.get_elem(0));
    ConnectionData_template* implied_template = new ConnectionData_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ConnectionData_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@FrameRelay_Emulation.ConnectionData");
  }
  is_ifpresent = param.get_ifpresent();
}

void ConnectionData_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_vc__conn.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.ConnectionData");
single_value->field_q933__status.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.ConnectionData");
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 : "@FrameRelay_Emulation.ConnectionData");
}

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

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

Q933em__Config::Q933em__Config()
{
}

Q933em__Config::Q933em__Config(const INTEGER& par_N391,
    const INTEGER& par_N392,
    const INTEGER& par_N393,
    const FLOAT& par_T391,
    const FLOAT& par_T392,
    const BOOLEAN& par_ats__is__user,
    const BOOLEAN& par_bidirectional)
  :   field_N391(par_N391),
  field_N392(par_N392),
  field_N393(par_N393),
  field_T391(par_T391),
  field_T392(par_T392),
  field_ats__is__user(par_ats__is__user),
  field_bidirectional(par_bidirectional)
{
}

Q933em__Config::Q933em__Config(const Q933em__Config& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @FrameRelay_Emulation.Q933em_Config.");
if (other_value.N391().is_bound()) field_N391 = other_value.N391();
else field_N391.clean_up();
if (other_value.N392().is_bound()) field_N392 = other_value.N392();
else field_N392.clean_up();
if (other_value.N393().is_bound()) field_N393 = other_value.N393();
else field_N393.clean_up();
if (other_value.T391().is_bound()) field_T391 = other_value.T391();
else field_T391.clean_up();
if (other_value.T392().is_bound()) field_T392 = other_value.T392();
else field_T392.clean_up();
if (other_value.ats__is__user().is_bound()) field_ats__is__user = other_value.ats__is__user();
else field_ats__is__user.clean_up();
if (other_value.bidirectional().is_bound()) field_bidirectional = other_value.bidirectional();
else field_bidirectional.clean_up();
}

void Q933em__Config::clean_up()
{
field_N391.clean_up();
field_N392.clean_up();
field_N393.clean_up();
field_T391.clean_up();
field_T392.clean_up();
field_ats__is__user.clean_up();
field_bidirectional.clean_up();
}

const TTCN_Typedescriptor_t* Q933em__Config::get_descriptor() const { return &Q933em__Config_descr_; }
Q933em__Config& Q933em__Config::operator=(const Q933em__Config& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @FrameRelay_Emulation.Q933em_Config.");
  if (other_value.N391().is_bound()) field_N391 = other_value.N391();
  else field_N391.clean_up();
  if (other_value.N392().is_bound()) field_N392 = other_value.N392();
  else field_N392.clean_up();
  if (other_value.N393().is_bound()) field_N393 = other_value.N393();
  else field_N393.clean_up();
  if (other_value.T391().is_bound()) field_T391 = other_value.T391();
  else field_T391.clean_up();
  if (other_value.T392().is_bound()) field_T392 = other_value.T392();
  else field_T392.clean_up();
  if (other_value.ats__is__user().is_bound()) field_ats__is__user = other_value.ats__is__user();
  else field_ats__is__user.clean_up();
  if (other_value.bidirectional().is_bound()) field_bidirectional = other_value.bidirectional();
  else field_bidirectional.clean_up();
}
return *this;
}

boolean Q933em__Config::operator==(const Q933em__Config& other_value) const
{
return field_N391==other_value.field_N391
  && field_N392==other_value.field_N392
  && field_N393==other_value.field_N393
  && field_T391==other_value.field_T391
  && field_T392==other_value.field_T392
  && field_ats__is__user==other_value.field_ats__is__user
  && field_bidirectional==other_value.field_bidirectional;
}

boolean Q933em__Config::is_bound() const
{
return (field_N391.is_bound())
  || (field_N392.is_bound())
  || (field_N393.is_bound())
  || (field_T391.is_bound())
  || (field_T392.is_bound())
  || (field_ats__is__user.is_bound())
  || (field_bidirectional.is_bound());
}
boolean Q933em__Config::is_value() const
{
return field_N391.is_value()
  && field_N392.is_value()
  && field_N393.is_value()
  && field_T391.is_value()
  && field_T392.is_value()
  && field_ats__is__user.is_value()
  && field_bidirectional.is_value();
}
void Q933em__Config::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ N391 := ");
field_N391.log();
TTCN_Logger::log_event_str(", N392 := ");
field_N392.log();
TTCN_Logger::log_event_str(", N393 := ");
field_N393.log();
TTCN_Logger::log_event_str(", T391 := ");
field_T391.log();
TTCN_Logger::log_event_str(", T392 := ");
field_T392.log();
TTCN_Logger::log_event_str(", ats_is_user := ");
field_ats__is__user.log();
TTCN_Logger::log_event_str(", bidirectional := ");
field_bidirectional.log();
TTCN_Logger::log_event_str(" }");
}

void Q933em__Config::set_implicit_omit()
{
if (N391().is_bound()) N391().set_implicit_omit();
if (N392().is_bound()) N392().set_implicit_omit();
if (N393().is_bound()) N393().set_implicit_omit();
if (T391().is_bound()) T391().set_implicit_omit();
if (T392().is_bound()) T392().set_implicit_omit();
if (ats__is__user().is_bound()) ats__is__user().set_implicit_omit();
if (bidirectional().is_bound()) bidirectional().set_implicit_omit();
}

void Q933em__Config::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 @FrameRelay_Emulation.Q933em_Config 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) N391().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) N392().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) N393().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) T391().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) T392().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ats__is__user().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) bidirectional().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(), "N391")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          N391().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(), "N392")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          N392().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(), "N393")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          N393().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(), "T391")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          T391().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(), "T392")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          T392().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(), "ats_is_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ats__is__user().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(), "bidirectional")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bidirectional().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 @FrameRelay_Emulation.Q933em_Config: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@FrameRelay_Emulation.Q933em_Config");
  }
}

void Q933em__Config::encode_text(Text_Buf& text_buf) const
{
field_N391.encode_text(text_buf);
field_N392.encode_text(text_buf);
field_N393.encode_text(text_buf);
field_T391.encode_text(text_buf);
field_T392.encode_text(text_buf);
field_ats__is__user.encode_text(text_buf);
field_bidirectional.encode_text(text_buf);
}

void Q933em__Config::decode_text(Text_Buf& text_buf)
{
field_N391.decode_text(text_buf);
field_N392.decode_text(text_buf);
field_N393.decode_text(text_buf);
field_T391.decode_text(text_buf);
field_T392.decode_text(text_buf);
field_ats__is__user.decode_text(text_buf);
field_bidirectional.decode_text(text_buf);
}

struct Q933em__Config_template::single_value_struct {
INTEGER_template field_N391;
INTEGER_template field_N392;
INTEGER_template field_N393;
FLOAT_template field_T391;
FLOAT_template field_T392;
BOOLEAN_template field_ats__is__user;
BOOLEAN_template field_bidirectional;
};

void Q933em__Config_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_N391 = ANY_VALUE;
single_value->field_N392 = ANY_VALUE;
single_value->field_N393 = ANY_VALUE;
single_value->field_T391 = ANY_VALUE;
single_value->field_T392 = ANY_VALUE;
single_value->field_ats__is__user = ANY_VALUE;
single_value->field_bidirectional = ANY_VALUE;
}
}
}

void Q933em__Config_template::copy_value(const Q933em__Config& other_value)
{
single_value = new single_value_struct;
if (other_value.N391().is_bound()) {
  single_value->field_N391 = other_value.N391();
} else {
  single_value->field_N391.clean_up();
}
if (other_value.N392().is_bound()) {
  single_value->field_N392 = other_value.N392();
} else {
  single_value->field_N392.clean_up();
}
if (other_value.N393().is_bound()) {
  single_value->field_N393 = other_value.N393();
} else {
  single_value->field_N393.clean_up();
}
if (other_value.T391().is_bound()) {
  single_value->field_T391 = other_value.T391();
} else {
  single_value->field_T391.clean_up();
}
if (other_value.T392().is_bound()) {
  single_value->field_T392 = other_value.T392();
} else {
  single_value->field_T392.clean_up();
}
if (other_value.ats__is__user().is_bound()) {
  single_value->field_ats__is__user = other_value.ats__is__user();
} else {
  single_value->field_ats__is__user.clean_up();
}
if (other_value.bidirectional().is_bound()) {
  single_value->field_bidirectional = other_value.bidirectional();
} else {
  single_value->field_bidirectional.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933em__Config_template::copy_template(const Q933em__Config_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.N391().get_selection()) {
single_value->field_N391 = other_value.N391();
} else {
single_value->field_N391.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.N392().get_selection()) {
single_value->field_N392 = other_value.N392();
} else {
single_value->field_N392.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.N393().get_selection()) {
single_value->field_N393 = other_value.N393();
} else {
single_value->field_N393.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.T391().get_selection()) {
single_value->field_T391 = other_value.T391();
} else {
single_value->field_T391.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.T392().get_selection()) {
single_value->field_T392 = other_value.T392();
} else {
single_value->field_T392.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ats__is__user().get_selection()) {
single_value->field_ats__is__user = other_value.ats__is__user();
} else {
single_value->field_ats__is__user.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bidirectional().get_selection()) {
single_value->field_bidirectional = other_value.bidirectional();
} else {
single_value->field_bidirectional.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 Q933em__Config_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 Q933em__Config_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933em__Config_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 @FrameRelay_Emulation.Q933em_Config.");
break;
}
set_selection(other_value);
}

Q933em__Config_template::Q933em__Config_template()
{
}

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

Q933em__Config_template::Q933em__Config_template(const Q933em__Config& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933em__Config_template::match(const Q933em__Config& 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.N391().is_bound()) return FALSE;
if(!single_value->field_N391.match(other_value.N391(), legacy))return FALSE;
if(!other_value.N392().is_bound()) return FALSE;
if(!single_value->field_N392.match(other_value.N392(), legacy))return FALSE;
if(!other_value.N393().is_bound()) return FALSE;
if(!single_value->field_N393.match(other_value.N393(), legacy))return FALSE;
if(!other_value.T391().is_bound()) return FALSE;
if(!single_value->field_T391.match(other_value.T391(), legacy))return FALSE;
if(!other_value.T392().is_bound()) return FALSE;
if(!single_value->field_T392.match(other_value.T392(), legacy))return FALSE;
if(!other_value.ats__is__user().is_bound()) return FALSE;
if(!single_value->field_ats__is__user.match(other_value.ats__is__user(), legacy))return FALSE;
if(!other_value.bidirectional().is_bound()) return FALSE;
if(!single_value->field_bidirectional.match(other_value.bidirectional(), 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 @FrameRelay_Emulation.Q933em_Config.");
}
return FALSE;
}

boolean Q933em__Config_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_N391.is_bound()
 || single_value->field_N392.is_bound()
 || single_value->field_N393.is_bound()
 || single_value->field_T391.is_bound()
 || single_value->field_T392.is_bound()
 || single_value->field_ats__is__user.is_bound()
 || single_value->field_bidirectional.is_bound();
}

boolean Q933em__Config_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_N391.is_value()
 && single_value->field_N392.is_value()
 && single_value->field_N393.is_value()
 && single_value->field_T391.is_value()
 && single_value->field_T392.is_value()
 && single_value->field_ats__is__user.is_value()
 && single_value->field_bidirectional.is_value();
}

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

Q933em__Config Q933em__Config_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 @FrameRelay_Emulation.Q933em_Config.");
Q933em__Config ret_val;
if (single_value->field_N391.is_bound()) {
ret_val.N391() = single_value->field_N391.valueof();
}
if (single_value->field_N392.is_bound()) {
ret_val.N392() = single_value->field_N392.valueof();
}
if (single_value->field_N393.is_bound()) {
ret_val.N393() = single_value->field_N393.valueof();
}
if (single_value->field_T391.is_bound()) {
ret_val.T391() = single_value->field_T391.valueof();
}
if (single_value->field_T392.is_bound()) {
ret_val.T392() = single_value->field_T392.valueof();
}
if (single_value->field_ats__is__user.is_bound()) {
ret_val.ats__is__user() = single_value->field_ats__is__user.valueof();
}
if (single_value->field_bidirectional.is_bound()) {
ret_val.bidirectional() = single_value->field_bidirectional.valueof();
}
return ret_val;
}

void Q933em__Config_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 @FrameRelay_Emulation.Q933em_Config.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933em__Config_template[list_length];
}

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

INTEGER_template& Q933em__Config_template::N391()
{
set_specific();
return single_value->field_N391;
}

const INTEGER_template& Q933em__Config_template::N391() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field N391 of a non-specific template of type @FrameRelay_Emulation.Q933em_Config.");
return single_value->field_N391;
}

INTEGER_template& Q933em__Config_template::N392()
{
set_specific();
return single_value->field_N392;
}

const INTEGER_template& Q933em__Config_template::N392() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field N392 of a non-specific template of type @FrameRelay_Emulation.Q933em_Config.");
return single_value->field_N392;
}

INTEGER_template& Q933em__Config_template::N393()
{
set_specific();
return single_value->field_N393;
}

const INTEGER_template& Q933em__Config_template::N393() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field N393 of a non-specific template of type @FrameRelay_Emulation.Q933em_Config.");
return single_value->field_N393;
}

FLOAT_template& Q933em__Config_template::T391()
{
set_specific();
return single_value->field_T391;
}

const FLOAT_template& Q933em__Config_template::T391() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field T391 of a non-specific template of type @FrameRelay_Emulation.Q933em_Config.");
return single_value->field_T391;
}

FLOAT_template& Q933em__Config_template::T392()
{
set_specific();
return single_value->field_T392;
}

const FLOAT_template& Q933em__Config_template::T392() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field T392 of a non-specific template of type @FrameRelay_Emulation.Q933em_Config.");
return single_value->field_T392;
}

BOOLEAN_template& Q933em__Config_template::ats__is__user()
{
set_specific();
return single_value->field_ats__is__user;
}

const BOOLEAN_template& Q933em__Config_template::ats__is__user() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ats_is_user of a non-specific template of type @FrameRelay_Emulation.Q933em_Config.");
return single_value->field_ats__is__user;
}

BOOLEAN_template& Q933em__Config_template::bidirectional()
{
set_specific();
return single_value->field_bidirectional;
}

const BOOLEAN_template& Q933em__Config_template::bidirectional() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bidirectional of a non-specific template of type @FrameRelay_Emulation.Q933em_Config.");
return single_value->field_bidirectional;
}

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

void Q933em__Config_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ N391 := ");
single_value->field_N391.log();
TTCN_Logger::log_event_str(", N392 := ");
single_value->field_N392.log();
TTCN_Logger::log_event_str(", N393 := ");
single_value->field_N393.log();
TTCN_Logger::log_event_str(", T391 := ");
single_value->field_T391.log();
TTCN_Logger::log_event_str(", T392 := ");
single_value->field_T392.log();
TTCN_Logger::log_event_str(", ats_is_user := ");
single_value->field_ats__is__user.log();
TTCN_Logger::log_event_str(", bidirectional := ");
single_value->field_bidirectional.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 Q933em__Config_template::log_match(const Q933em__Config& 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_N391.match(match_value.N391(), legacy)){
TTCN_Logger::log_logmatch_info(".N391");
single_value->field_N391.log_match(match_value.N391(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_N392.match(match_value.N392(), legacy)){
TTCN_Logger::log_logmatch_info(".N392");
single_value->field_N392.log_match(match_value.N392(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_N393.match(match_value.N393(), legacy)){
TTCN_Logger::log_logmatch_info(".N393");
single_value->field_N393.log_match(match_value.N393(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_T391.match(match_value.T391(), legacy)){
TTCN_Logger::log_logmatch_info(".T391");
single_value->field_T391.log_match(match_value.T391(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_T392.match(match_value.T392(), legacy)){
TTCN_Logger::log_logmatch_info(".T392");
single_value->field_T392.log_match(match_value.T392(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ats__is__user.match(match_value.ats__is__user(), legacy)){
TTCN_Logger::log_logmatch_info(".ats_is_user");
single_value->field_ats__is__user.log_match(match_value.ats__is__user(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bidirectional.match(match_value.bidirectional(), legacy)){
TTCN_Logger::log_logmatch_info(".bidirectional");
single_value->field_bidirectional.log_match(match_value.bidirectional(), 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("{ N391 := ");
single_value->field_N391.log_match(match_value.N391(), legacy);
TTCN_Logger::log_event_str(", N392 := ");
single_value->field_N392.log_match(match_value.N392(), legacy);
TTCN_Logger::log_event_str(", N393 := ");
single_value->field_N393.log_match(match_value.N393(), legacy);
TTCN_Logger::log_event_str(", T391 := ");
single_value->field_T391.log_match(match_value.T391(), legacy);
TTCN_Logger::log_event_str(", T392 := ");
single_value->field_T392.log_match(match_value.T392(), legacy);
TTCN_Logger::log_event_str(", ats_is_user := ");
single_value->field_ats__is__user.log_match(match_value.ats__is__user(), legacy);
TTCN_Logger::log_event_str(", bidirectional := ");
single_value->field_bidirectional.log_match(match_value.bidirectional(), 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 Q933em__Config_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (N391().is_bound()) N391().set_implicit_omit();
if (N392().is_bound()) N392().set_implicit_omit();
if (N393().is_bound()) N393().set_implicit_omit();
if (T391().is_bound()) T391().set_implicit_omit();
if (T392().is_bound()) T392().set_implicit_omit();
if (ats__is__user().is_bound()) ats__is__user().set_implicit_omit();
if (bidirectional().is_bound()) bidirectional().set_implicit_omit();
}

void Q933em__Config_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_N391.encode_text(text_buf);
single_value->field_N392.encode_text(text_buf);
single_value->field_N393.encode_text(text_buf);
single_value->field_T391.encode_text(text_buf);
single_value->field_T392.encode_text(text_buf);
single_value->field_ats__is__user.encode_text(text_buf);
single_value->field_bidirectional.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 @FrameRelay_Emulation.Q933em_Config.");
}
}

void Q933em__Config_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_N391.decode_text(text_buf);
single_value->field_N392.decode_text(text_buf);
single_value->field_N393.decode_text(text_buf);
single_value->field_T391.decode_text(text_buf);
single_value->field_T392.decode_text(text_buf);
single_value->field_ats__is__user.decode_text(text_buf);
single_value->field_bidirectional.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 Q933em__Config_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 @FrameRelay_Emulation.Q933em_Config.");
}
}

void Q933em__Config_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: {
    Q933em__Config_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 @FrameRelay_Emulation.Q933em_Config 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) N391().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) N392().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) N393().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) T391().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) T392().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ats__is__user().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) bidirectional().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(), "N391")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          N391().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(), "N392")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          N392().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(), "N393")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          N393().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(), "T391")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          T391().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(), "T392")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          T392().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(), "ats_is_user")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ats__is__user().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(), "bidirectional")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bidirectional().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 @FrameRelay_Emulation.Q933em_Config: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933em__Config_template* precondition = new Q933em__Config_template;
    precondition->set_param(*param.get_elem(0));
    Q933em__Config_template* implied_template = new Q933em__Config_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Q933em__Config_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@FrameRelay_Emulation.Q933em_Config");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933em__Config_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_N391.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_Config");
single_value->field_N392.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_Config");
single_value->field_N393.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_Config");
single_value->field_T391.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_Config");
single_value->field_T392.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_Config");
single_value->field_ats__is__user.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_Config");
single_value->field_bidirectional.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_Config");
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 : "@FrameRelay_Emulation.Q933em_Config");
}

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

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

Q933em__State::Q933em__State()
{
}

Q933em__State::Q933em__State(const Q933em__Config& par_cfg,
    const INTEGER& par_tx__seq__nr,
    const INTEGER& par_last__rx__seq__nr,
    const Q933em__State_err__buckets& par_err__buckets,
    const INTEGER& par_num__cycles,
    const BOOLEAN& par_service__affecting__condition,
    const BOOLEAN& par_rx__status__in__cycle)
  :   field_cfg(par_cfg),
  field_tx__seq__nr(par_tx__seq__nr),
  field_last__rx__seq__nr(par_last__rx__seq__nr),
  field_err__buckets(par_err__buckets),
  field_num__cycles(par_num__cycles),
  field_service__affecting__condition(par_service__affecting__condition),
  field_rx__status__in__cycle(par_rx__status__in__cycle)
{
}

Q933em__State::Q933em__State(const Q933em__State& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @FrameRelay_Emulation.Q933em_State.");
if (other_value.cfg().is_bound()) field_cfg = other_value.cfg();
else field_cfg.clean_up();
if (other_value.tx__seq__nr().is_bound()) field_tx__seq__nr = other_value.tx__seq__nr();
else field_tx__seq__nr.clean_up();
if (other_value.last__rx__seq__nr().is_bound()) field_last__rx__seq__nr = other_value.last__rx__seq__nr();
else field_last__rx__seq__nr.clean_up();
if (other_value.err__buckets().is_bound()) field_err__buckets = other_value.err__buckets();
else field_err__buckets.clean_up();
if (other_value.num__cycles().is_bound()) field_num__cycles = other_value.num__cycles();
else field_num__cycles.clean_up();
if (other_value.service__affecting__condition().is_bound()) field_service__affecting__condition = other_value.service__affecting__condition();
else field_service__affecting__condition.clean_up();
if (other_value.rx__status__in__cycle().is_bound()) field_rx__status__in__cycle = other_value.rx__status__in__cycle();
else field_rx__status__in__cycle.clean_up();
}

void Q933em__State::clean_up()
{
field_cfg.clean_up();
field_tx__seq__nr.clean_up();
field_last__rx__seq__nr.clean_up();
field_err__buckets.clean_up();
field_num__cycles.clean_up();
field_service__affecting__condition.clean_up();
field_rx__status__in__cycle.clean_up();
}

const TTCN_Typedescriptor_t* Q933em__State::get_descriptor() const { return &Q933em__State_descr_; }
Q933em__State& Q933em__State::operator=(const Q933em__State& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @FrameRelay_Emulation.Q933em_State.");
  if (other_value.cfg().is_bound()) field_cfg = other_value.cfg();
  else field_cfg.clean_up();
  if (other_value.tx__seq__nr().is_bound()) field_tx__seq__nr = other_value.tx__seq__nr();
  else field_tx__seq__nr.clean_up();
  if (other_value.last__rx__seq__nr().is_bound()) field_last__rx__seq__nr = other_value.last__rx__seq__nr();
  else field_last__rx__seq__nr.clean_up();
  if (other_value.err__buckets().is_bound()) field_err__buckets = other_value.err__buckets();
  else field_err__buckets.clean_up();
  if (other_value.num__cycles().is_bound()) field_num__cycles = other_value.num__cycles();
  else field_num__cycles.clean_up();
  if (other_value.service__affecting__condition().is_bound()) field_service__affecting__condition = other_value.service__affecting__condition();
  else field_service__affecting__condition.clean_up();
  if (other_value.rx__status__in__cycle().is_bound()) field_rx__status__in__cycle = other_value.rx__status__in__cycle();
  else field_rx__status__in__cycle.clean_up();
}
return *this;
}

boolean Q933em__State::operator==(const Q933em__State& other_value) const
{
return field_cfg==other_value.field_cfg
  && field_tx__seq__nr==other_value.field_tx__seq__nr
  && field_last__rx__seq__nr==other_value.field_last__rx__seq__nr
  && field_err__buckets==other_value.field_err__buckets
  && field_num__cycles==other_value.field_num__cycles
  && field_service__affecting__condition==other_value.field_service__affecting__condition
  && field_rx__status__in__cycle==other_value.field_rx__status__in__cycle;
}

boolean Q933em__State::is_bound() const
{
return (field_cfg.is_bound())
  || (field_tx__seq__nr.is_bound())
  || (field_last__rx__seq__nr.is_bound())
  || (field_err__buckets.is_bound())
  || (field_num__cycles.is_bound())
  || (field_service__affecting__condition.is_bound())
  || (field_rx__status__in__cycle.is_bound());
}
boolean Q933em__State::is_value() const
{
return field_cfg.is_value()
  && field_tx__seq__nr.is_value()
  && field_last__rx__seq__nr.is_value()
  && field_err__buckets.is_value()
  && field_num__cycles.is_value()
  && field_service__affecting__condition.is_value()
  && field_rx__status__in__cycle.is_value();
}
void Q933em__State::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ cfg := ");
field_cfg.log();
TTCN_Logger::log_event_str(", tx_seq_nr := ");
field_tx__seq__nr.log();
TTCN_Logger::log_event_str(", last_rx_seq_nr := ");
field_last__rx__seq__nr.log();
TTCN_Logger::log_event_str(", err_buckets := ");
field_err__buckets.log();
TTCN_Logger::log_event_str(", num_cycles := ");
field_num__cycles.log();
TTCN_Logger::log_event_str(", service_affecting_condition := ");
field_service__affecting__condition.log();
TTCN_Logger::log_event_str(", rx_status_in_cycle := ");
field_rx__status__in__cycle.log();
TTCN_Logger::log_event_str(" }");
}

void Q933em__State::set_implicit_omit()
{
if (cfg().is_bound()) cfg().set_implicit_omit();
if (tx__seq__nr().is_bound()) tx__seq__nr().set_implicit_omit();
if (last__rx__seq__nr().is_bound()) last__rx__seq__nr().set_implicit_omit();
if (err__buckets().is_bound()) err__buckets().set_implicit_omit();
if (num__cycles().is_bound()) num__cycles().set_implicit_omit();
if (service__affecting__condition().is_bound()) service__affecting__condition().set_implicit_omit();
if (rx__status__in__cycle().is_bound()) rx__status__in__cycle().set_implicit_omit();
}

void Q933em__State::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 @FrameRelay_Emulation.Q933em_State 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) cfg().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__seq__nr().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) last__rx__seq__nr().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) err__buckets().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) num__cycles().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) service__affecting__condition().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rx__status__in__cycle().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(), "cfg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cfg().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_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "last_rx_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          last__rx__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "err_buckets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          err__buckets().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_cycles")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__cycles().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(), "service_affecting_condition")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__affecting__condition().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_status_in_cycle")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rx__status__in__cycle().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 @FrameRelay_Emulation.Q933em_State: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@FrameRelay_Emulation.Q933em_State");
  }
}

void Q933em__State::encode_text(Text_Buf& text_buf) const
{
field_cfg.encode_text(text_buf);
field_tx__seq__nr.encode_text(text_buf);
field_last__rx__seq__nr.encode_text(text_buf);
field_err__buckets.encode_text(text_buf);
field_num__cycles.encode_text(text_buf);
field_service__affecting__condition.encode_text(text_buf);
field_rx__status__in__cycle.encode_text(text_buf);
}

void Q933em__State::decode_text(Text_Buf& text_buf)
{
field_cfg.decode_text(text_buf);
field_tx__seq__nr.decode_text(text_buf);
field_last__rx__seq__nr.decode_text(text_buf);
field_err__buckets.decode_text(text_buf);
field_num__cycles.decode_text(text_buf);
field_service__affecting__condition.decode_text(text_buf);
field_rx__status__in__cycle.decode_text(text_buf);
}

struct Q933em__State_template::single_value_struct {
Q933em__Config_template field_cfg;
INTEGER_template field_tx__seq__nr;
INTEGER_template field_last__rx__seq__nr;
Q933em__State_err__buckets_template field_err__buckets;
INTEGER_template field_num__cycles;
BOOLEAN_template field_service__affecting__condition;
BOOLEAN_template field_rx__status__in__cycle;
};

void Q933em__State_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_cfg = ANY_VALUE;
single_value->field_tx__seq__nr = ANY_VALUE;
single_value->field_last__rx__seq__nr = ANY_VALUE;
single_value->field_err__buckets = ANY_VALUE;
single_value->field_num__cycles = ANY_VALUE;
single_value->field_service__affecting__condition = ANY_VALUE;
single_value->field_rx__status__in__cycle = ANY_VALUE;
}
}
}

void Q933em__State_template::copy_value(const Q933em__State& other_value)
{
single_value = new single_value_struct;
if (other_value.cfg().is_bound()) {
  single_value->field_cfg = other_value.cfg();
} else {
  single_value->field_cfg.clean_up();
}
if (other_value.tx__seq__nr().is_bound()) {
  single_value->field_tx__seq__nr = other_value.tx__seq__nr();
} else {
  single_value->field_tx__seq__nr.clean_up();
}
if (other_value.last__rx__seq__nr().is_bound()) {
  single_value->field_last__rx__seq__nr = other_value.last__rx__seq__nr();
} else {
  single_value->field_last__rx__seq__nr.clean_up();
}
if (other_value.err__buckets().is_bound()) {
  single_value->field_err__buckets = other_value.err__buckets();
} else {
  single_value->field_err__buckets.clean_up();
}
if (other_value.num__cycles().is_bound()) {
  single_value->field_num__cycles = other_value.num__cycles();
} else {
  single_value->field_num__cycles.clean_up();
}
if (other_value.service__affecting__condition().is_bound()) {
  single_value->field_service__affecting__condition = other_value.service__affecting__condition();
} else {
  single_value->field_service__affecting__condition.clean_up();
}
if (other_value.rx__status__in__cycle().is_bound()) {
  single_value->field_rx__status__in__cycle = other_value.rx__status__in__cycle();
} else {
  single_value->field_rx__status__in__cycle.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void Q933em__State_template::copy_template(const Q933em__State_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.cfg().get_selection()) {
single_value->field_cfg = other_value.cfg();
} else {
single_value->field_cfg.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tx__seq__nr().get_selection()) {
single_value->field_tx__seq__nr = other_value.tx__seq__nr();
} else {
single_value->field_tx__seq__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.last__rx__seq__nr().get_selection()) {
single_value->field_last__rx__seq__nr = other_value.last__rx__seq__nr();
} else {
single_value->field_last__rx__seq__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.err__buckets().get_selection()) {
single_value->field_err__buckets = other_value.err__buckets();
} else {
single_value->field_err__buckets.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__cycles().get_selection()) {
single_value->field_num__cycles = other_value.num__cycles();
} else {
single_value->field_num__cycles.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.service__affecting__condition().get_selection()) {
single_value->field_service__affecting__condition = other_value.service__affecting__condition();
} else {
single_value->field_service__affecting__condition.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rx__status__in__cycle().get_selection()) {
single_value->field_rx__status__in__cycle = other_value.rx__status__in__cycle();
} else {
single_value->field_rx__status__in__cycle.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 Q933em__State_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 Q933em__State_template(*other_value.implication_.precondition);
implication_.implied_template = new Q933em__State_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 @FrameRelay_Emulation.Q933em_State.");
break;
}
set_selection(other_value);
}

Q933em__State_template::Q933em__State_template()
{
}

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

Q933em__State_template::Q933em__State_template(const Q933em__State& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean Q933em__State_template::match(const Q933em__State& 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.cfg().is_bound()) return FALSE;
if(!single_value->field_cfg.match(other_value.cfg(), legacy))return FALSE;
if(!other_value.tx__seq__nr().is_bound()) return FALSE;
if(!single_value->field_tx__seq__nr.match(other_value.tx__seq__nr(), legacy))return FALSE;
if(!other_value.last__rx__seq__nr().is_bound()) return FALSE;
if(!single_value->field_last__rx__seq__nr.match(other_value.last__rx__seq__nr(), legacy))return FALSE;
if(!other_value.err__buckets().is_bound()) return FALSE;
if(!single_value->field_err__buckets.match(other_value.err__buckets(), legacy))return FALSE;
if(!other_value.num__cycles().is_bound()) return FALSE;
if(!single_value->field_num__cycles.match(other_value.num__cycles(), legacy))return FALSE;
if(!other_value.service__affecting__condition().is_bound()) return FALSE;
if(!single_value->field_service__affecting__condition.match(other_value.service__affecting__condition(), legacy))return FALSE;
if(!other_value.rx__status__in__cycle().is_bound()) return FALSE;
if(!single_value->field_rx__status__in__cycle.match(other_value.rx__status__in__cycle(), 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 @FrameRelay_Emulation.Q933em_State.");
}
return FALSE;
}

boolean Q933em__State_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_cfg.is_bound()
 || single_value->field_tx__seq__nr.is_bound()
 || single_value->field_last__rx__seq__nr.is_bound()
 || single_value->field_err__buckets.is_bound()
 || single_value->field_num__cycles.is_bound()
 || single_value->field_service__affecting__condition.is_bound()
 || single_value->field_rx__status__in__cycle.is_bound();
}

boolean Q933em__State_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_cfg.is_value()
 && single_value->field_tx__seq__nr.is_value()
 && single_value->field_last__rx__seq__nr.is_value()
 && single_value->field_err__buckets.is_value()
 && single_value->field_num__cycles.is_value()
 && single_value->field_service__affecting__condition.is_value()
 && single_value->field_rx__status__in__cycle.is_value();
}

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

Q933em__State Q933em__State_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 @FrameRelay_Emulation.Q933em_State.");
Q933em__State ret_val;
if (single_value->field_cfg.is_bound()) {
ret_val.cfg() = single_value->field_cfg.valueof();
}
if (single_value->field_tx__seq__nr.is_bound()) {
ret_val.tx__seq__nr() = single_value->field_tx__seq__nr.valueof();
}
if (single_value->field_last__rx__seq__nr.is_bound()) {
ret_val.last__rx__seq__nr() = single_value->field_last__rx__seq__nr.valueof();
}
if (single_value->field_err__buckets.is_bound()) {
ret_val.err__buckets() = single_value->field_err__buckets.valueof();
}
if (single_value->field_num__cycles.is_bound()) {
ret_val.num__cycles() = single_value->field_num__cycles.valueof();
}
if (single_value->field_service__affecting__condition.is_bound()) {
ret_val.service__affecting__condition() = single_value->field_service__affecting__condition.valueof();
}
if (single_value->field_rx__status__in__cycle.is_bound()) {
ret_val.rx__status__in__cycle() = single_value->field_rx__status__in__cycle.valueof();
}
return ret_val;
}

void Q933em__State_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 @FrameRelay_Emulation.Q933em_State.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new Q933em__State_template[list_length];
}

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

Q933em__Config_template& Q933em__State_template::cfg()
{
set_specific();
return single_value->field_cfg;
}

const Q933em__Config_template& Q933em__State_template::cfg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cfg of a non-specific template of type @FrameRelay_Emulation.Q933em_State.");
return single_value->field_cfg;
}

INTEGER_template& Q933em__State_template::tx__seq__nr()
{
set_specific();
return single_value->field_tx__seq__nr;
}

const INTEGER_template& Q933em__State_template::tx__seq__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tx_seq_nr of a non-specific template of type @FrameRelay_Emulation.Q933em_State.");
return single_value->field_tx__seq__nr;
}

INTEGER_template& Q933em__State_template::last__rx__seq__nr()
{
set_specific();
return single_value->field_last__rx__seq__nr;
}

const INTEGER_template& Q933em__State_template::last__rx__seq__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field last_rx_seq_nr of a non-specific template of type @FrameRelay_Emulation.Q933em_State.");
return single_value->field_last__rx__seq__nr;
}

Q933em__State_err__buckets_template& Q933em__State_template::err__buckets()
{
set_specific();
return single_value->field_err__buckets;
}

const Q933em__State_err__buckets_template& Q933em__State_template::err__buckets() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field err_buckets of a non-specific template of type @FrameRelay_Emulation.Q933em_State.");
return single_value->field_err__buckets;
}

INTEGER_template& Q933em__State_template::num__cycles()
{
set_specific();
return single_value->field_num__cycles;
}

const INTEGER_template& Q933em__State_template::num__cycles() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_cycles of a non-specific template of type @FrameRelay_Emulation.Q933em_State.");
return single_value->field_num__cycles;
}

BOOLEAN_template& Q933em__State_template::service__affecting__condition()
{
set_specific();
return single_value->field_service__affecting__condition;
}

const BOOLEAN_template& Q933em__State_template::service__affecting__condition() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field service_affecting_condition of a non-specific template of type @FrameRelay_Emulation.Q933em_State.");
return single_value->field_service__affecting__condition;
}

BOOLEAN_template& Q933em__State_template::rx__status__in__cycle()
{
set_specific();
return single_value->field_rx__status__in__cycle;
}

const BOOLEAN_template& Q933em__State_template::rx__status__in__cycle() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rx_status_in_cycle of a non-specific template of type @FrameRelay_Emulation.Q933em_State.");
return single_value->field_rx__status__in__cycle;
}

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

void Q933em__State_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ cfg := ");
single_value->field_cfg.log();
TTCN_Logger::log_event_str(", tx_seq_nr := ");
single_value->field_tx__seq__nr.log();
TTCN_Logger::log_event_str(", last_rx_seq_nr := ");
single_value->field_last__rx__seq__nr.log();
TTCN_Logger::log_event_str(", err_buckets := ");
single_value->field_err__buckets.log();
TTCN_Logger::log_event_str(", num_cycles := ");
single_value->field_num__cycles.log();
TTCN_Logger::log_event_str(", service_affecting_condition := ");
single_value->field_service__affecting__condition.log();
TTCN_Logger::log_event_str(", rx_status_in_cycle := ");
single_value->field_rx__status__in__cycle.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 Q933em__State_template::log_match(const Q933em__State& 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_cfg.match(match_value.cfg(), legacy)){
TTCN_Logger::log_logmatch_info(".cfg");
single_value->field_cfg.log_match(match_value.cfg(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tx__seq__nr.match(match_value.tx__seq__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".tx_seq_nr");
single_value->field_tx__seq__nr.log_match(match_value.tx__seq__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_last__rx__seq__nr.match(match_value.last__rx__seq__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".last_rx_seq_nr");
single_value->field_last__rx__seq__nr.log_match(match_value.last__rx__seq__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_err__buckets.match(match_value.err__buckets(), legacy)){
TTCN_Logger::log_logmatch_info(".err_buckets");
single_value->field_err__buckets.log_match(match_value.err__buckets(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__cycles.match(match_value.num__cycles(), legacy)){
TTCN_Logger::log_logmatch_info(".num_cycles");
single_value->field_num__cycles.log_match(match_value.num__cycles(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_service__affecting__condition.match(match_value.service__affecting__condition(), legacy)){
TTCN_Logger::log_logmatch_info(".service_affecting_condition");
single_value->field_service__affecting__condition.log_match(match_value.service__affecting__condition(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rx__status__in__cycle.match(match_value.rx__status__in__cycle(), legacy)){
TTCN_Logger::log_logmatch_info(".rx_status_in_cycle");
single_value->field_rx__status__in__cycle.log_match(match_value.rx__status__in__cycle(), 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("{ cfg := ");
single_value->field_cfg.log_match(match_value.cfg(), legacy);
TTCN_Logger::log_event_str(", tx_seq_nr := ");
single_value->field_tx__seq__nr.log_match(match_value.tx__seq__nr(), legacy);
TTCN_Logger::log_event_str(", last_rx_seq_nr := ");
single_value->field_last__rx__seq__nr.log_match(match_value.last__rx__seq__nr(), legacy);
TTCN_Logger::log_event_str(", err_buckets := ");
single_value->field_err__buckets.log_match(match_value.err__buckets(), legacy);
TTCN_Logger::log_event_str(", num_cycles := ");
single_value->field_num__cycles.log_match(match_value.num__cycles(), legacy);
TTCN_Logger::log_event_str(", service_affecting_condition := ");
single_value->field_service__affecting__condition.log_match(match_value.service__affecting__condition(), legacy);
TTCN_Logger::log_event_str(", rx_status_in_cycle := ");
single_value->field_rx__status__in__cycle.log_match(match_value.rx__status__in__cycle(), 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 Q933em__State_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (cfg().is_bound()) cfg().set_implicit_omit();
if (tx__seq__nr().is_bound()) tx__seq__nr().set_implicit_omit();
if (last__rx__seq__nr().is_bound()) last__rx__seq__nr().set_implicit_omit();
if (err__buckets().is_bound()) err__buckets().set_implicit_omit();
if (num__cycles().is_bound()) num__cycles().set_implicit_omit();
if (service__affecting__condition().is_bound()) service__affecting__condition().set_implicit_omit();
if (rx__status__in__cycle().is_bound()) rx__status__in__cycle().set_implicit_omit();
}

void Q933em__State_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_cfg.encode_text(text_buf);
single_value->field_tx__seq__nr.encode_text(text_buf);
single_value->field_last__rx__seq__nr.encode_text(text_buf);
single_value->field_err__buckets.encode_text(text_buf);
single_value->field_num__cycles.encode_text(text_buf);
single_value->field_service__affecting__condition.encode_text(text_buf);
single_value->field_rx__status__in__cycle.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 @FrameRelay_Emulation.Q933em_State.");
}
}

void Q933em__State_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_cfg.decode_text(text_buf);
single_value->field_tx__seq__nr.decode_text(text_buf);
single_value->field_last__rx__seq__nr.decode_text(text_buf);
single_value->field_err__buckets.decode_text(text_buf);
single_value->field_num__cycles.decode_text(text_buf);
single_value->field_service__affecting__condition.decode_text(text_buf);
single_value->field_rx__status__in__cycle.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 Q933em__State_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 @FrameRelay_Emulation.Q933em_State.");
}
}

void Q933em__State_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: {
    Q933em__State_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 @FrameRelay_Emulation.Q933em_State 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) cfg().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tx__seq__nr().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) last__rx__seq__nr().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) err__buckets().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) num__cycles().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) service__affecting__condition().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) rx__status__in__cycle().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(), "cfg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cfg().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_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tx__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "last_rx_seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          last__rx__seq__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "err_buckets")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          err__buckets().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_cycles")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__cycles().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(), "service_affecting_condition")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          service__affecting__condition().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_status_in_cycle")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rx__status__in__cycle().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 @FrameRelay_Emulation.Q933em_State: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    Q933em__State_template* precondition = new Q933em__State_template;
    precondition->set_param(*param.get_elem(0));
    Q933em__State_template* implied_template = new Q933em__State_template;
    implied_template->set_param(*param.get_elem(1));
    *this = Q933em__State_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@FrameRelay_Emulation.Q933em_State");
  }
  is_ifpresent = param.get_ifpresent();
}

void Q933em__State_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_cfg.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_State");
single_value->field_tx__seq__nr.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_State");
single_value->field_last__rx__seq__nr.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_State");
single_value->field_err__buckets.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_State");
single_value->field_num__cycles.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_State");
single_value->field_service__affecting__condition.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_State");
single_value->field_rx__status__in__cycle.check_restriction(t_res, t_name ? t_name : "@FrameRelay_Emulation.Q933em_State");
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 : "@FrameRelay_Emulation.Q933em_State");
}

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

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


/* Bodies of functions, altsteps and testcases */

FRemu__Event_template tr__FRemu__PvcStatusAct(const INTEGER_template& dlci, const BOOLEAN_template& active)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 37, TTCN_Location::LOCATION_TEMPLATE, "tr_FRemu_PvcStatusAct");
FRemu__Event_template ret_val;
{
FRemu__PvcStatus_template& tmp_0 = ret_val.pvc__status();
tmp_0.dlci() = dlci;
tmp_0.new_() = ANY_VALUE;
tmp_0.delete_() = FALSE;
tmp_0.active() = active;
}
return ret_val;
}

Q933em__Config_template ts__Q933em__Config(const BOOLEAN& ats__is__user, const BOOLEAN& bidirectional)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 136, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933em_Config");
Q933em__Config_template ret_val;
ret_val.N391() = 6;
ret_val.N392() = 4;
ret_val.N393() = 10;
ret_val.T391() = 1.0e1;
ret_val.T392() = 1.5e1;
ret_val.ats__is__user() = ats__is__user;
ret_val.bidirectional() = bidirectional;
return ret_val;
}

Q933em__State_template ts__Q933em__State(const Q933em__Config& cfg)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 146, TTCN_Location::LOCATION_TEMPLATE, "ts_Q933em_State");
Q933em__State_template ret_val;
ret_val.cfg() = cfg;
ret_val.tx__seq__nr() = 0;
ret_val.last__rx__seq__nr() = 0;
{
Q933em__State_err__buckets_template& tmp_1 = ret_val.err__buckets();
tmp_1.set_size(10);
tmp_1[0] = TRUE;
tmp_1[1] = TRUE;
tmp_1[2] = TRUE;
tmp_1[3] = TRUE;
tmp_1[4] = TRUE;
tmp_1[5] = TRUE;
tmp_1[6] = TRUE;
tmp_1[7] = TRUE;
tmp_1[8] = TRUE;
tmp_1[9] = TRUE;
}
ret_val.num__cycles() = 0;
ret_val.service__affecting__condition() = TRUE;
ret_val.rx__status__in__cycle() = FALSE;
return ret_val;
}

INTEGER q933__next__seq(const INTEGER& cur__seq)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 157, TTCN_Location::LOCATION_FUNCTION, "q933_next_seq");
current_location.update_lineno(159);
/* FrameRelay_Emulation.ttcn, line 159 */
if ((cur__seq >= 255)) {
current_location.update_lineno(160);
/* FrameRelay_Emulation.ttcn, line 160 */
return 1;
}
else {
current_location.update_lineno(162);
/* FrameRelay_Emulation.ttcn, line 162 */
return (cur__seq + 1);
}
}

void fill__err__bucket(const BOOLEAN& has__error)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 166, TTCN_Location::LOCATION_FUNCTION, "fill_err_bucket");
current_location.update_lineno(167);
/* FrameRelay_Emulation.ttcn, line 167 */
INTEGER i;
current_location.update_lineno(167);
/* FrameRelay_Emulation.ttcn, line 167 */
INTEGER n__errors(0);
current_location.update_lineno(168);
/* FrameRelay_Emulation.ttcn, line 168 */
INTEGER err__bucket__idx(mod(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).num__cycles(), const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N393()));
current_location.update_lineno(171);
/* FrameRelay_Emulation.ttcn, line 171 */
FR__Emulation__CT_component_q933em.err__buckets()[err__bucket__idx] = has__error;
current_location.update_lineno(174);
/* FrameRelay_Emulation.ttcn, line 174 */
if ((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).service__affecting__condition()))) {
current_location.update_lineno(175);
/* FrameRelay_Emulation.ttcn, line 175 */
if ((const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).num__cycles() >= const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N393())) {
current_location.update_lineno(176);
/* FrameRelay_Emulation.ttcn, line 176 */
i = 0;
current_location.update_lineno(176);
/* FrameRelay_Emulation.ttcn, line 176 */
for ( ; ; ) {
current_location.update_lineno(176);
/* FrameRelay_Emulation.ttcn, line 176 */
if (!(i < const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N393())) break;
current_location.update_lineno(177);
/* FrameRelay_Emulation.ttcn, line 177 */
if (const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).err__buckets()[i]) {
current_location.update_lineno(178);
/* FrameRelay_Emulation.ttcn, line 178 */
{
INTEGER tmp_4;
++n__errors;
}
}
current_location.update_lineno(176);
/* FrameRelay_Emulation.ttcn, line 176 */
{
INTEGER tmp_5;
++i;
}
}
current_location.update_lineno(181);
/* FrameRelay_Emulation.ttcn, line 181 */
if ((n__errors >= const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N392())) {
current_location.update_lineno(182);
/* FrameRelay_Emulation.ttcn, line 182 */
FR__Emulation__CT_component_q933em.service__affecting__condition() = TRUE;
current_location.update_lineno(183);
/* FrameRelay_Emulation.ttcn, line 183 */
TTCN_Logger::log_str(TTCN_USER, "Detecting service affecting condition after N392 errors during last N393 cycles");
current_location.update_lineno(184);
/* FrameRelay_Emulation.ttcn, line 184 */
{
FRemu__Event_template tmp_7;
tmp_7.link__status() = FRemu__LinkStatus::FR__LINK__STS__UNAVAILABLE;
notify__all__clients(tmp_7);
}
current_location.update_lineno(185);
/* FrameRelay_Emulation.ttcn, line 185 */
FR__Emulation__CT_component_T392.stop();
}
}
}
else {
current_location.update_lineno(190);
/* FrameRelay_Emulation.ttcn, line 190 */
INTEGER start__idx(mod((((err__bucket__idx + 1) + const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N393()) - const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N392()), const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N393()));
current_location.update_lineno(191);
/* FrameRelay_Emulation.ttcn, line 191 */
INTEGER consecutive__good(0);
current_location.update_lineno(192);
/* FrameRelay_Emulation.ttcn, line 192 */
i = 0;
current_location.update_lineno(192);
/* FrameRelay_Emulation.ttcn, line 192 */
for ( ; ; ) {
current_location.update_lineno(192);
/* FrameRelay_Emulation.ttcn, line 192 */
if (!(i < const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N392())) break;
current_location.update_lineno(193);
/* FrameRelay_Emulation.ttcn, line 193 */
if ((const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).err__buckets()[mod((start__idx + i), const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N393())] == FALSE)) {
current_location.update_lineno(194);
/* FrameRelay_Emulation.ttcn, line 194 */
{
INTEGER tmp_9;
++consecutive__good;
}
}
current_location.update_lineno(192);
/* FrameRelay_Emulation.ttcn, line 192 */
{
INTEGER tmp_10;
++i;
}
}
current_location.update_lineno(197);
/* FrameRelay_Emulation.ttcn, line 197 */
if ((consecutive__good == const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N392())) {
current_location.update_lineno(198);
/* FrameRelay_Emulation.ttcn, line 198 */
FR__Emulation__CT_component_q933em.service__affecting__condition() = FALSE;
current_location.update_lineno(199);
/* FrameRelay_Emulation.ttcn, line 199 */
TTCN_Logger::log_str(TTCN_USER, "Detecting no more service affecting condition after N392 consecutive good cycles");
current_location.update_lineno(200);
/* FrameRelay_Emulation.ttcn, line 200 */
{
FRemu__Event_template tmp_12;
tmp_12.link__status() = FRemu__LinkStatus::FR__LINK__STS__AVAILABLE;
notify__all__clients(tmp_12);
}
current_location.update_lineno(201);
/* FrameRelay_Emulation.ttcn, line 201 */
if ((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().ats__is__user()))) {
current_location.update_lineno(203);
/* FrameRelay_Emulation.ttcn, line 203 */
notify__all__clients__pvc__state();
}
}
}
current_location.update_lineno(209);
/* FrameRelay_Emulation.ttcn, line 209 */
{
INTEGER tmp_13;
tmp_13 = (const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).num__cycles() + 1);
FR__Emulation__CT_component_q933em.num__cycles() = tmp_13;
}
}

void start_fill__err__bucket(const COMPONENT& component_reference, const BOOLEAN& has__error)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function fill_err_bucket(");
has__error.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, "FrameRelay_Emulation", "fill_err_bucket", text_buf);
has__error.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void q933__handle__rx__link__int(const Q933__Types::Q933__LinkIntegrityIE& link__int)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 213, TTCN_Location::LOCATION_FUNCTION, "q933_handle_rx_link_int");
current_location.update_lineno(214);
/* FrameRelay_Emulation.ttcn, line 214 */
if ((const_cast< const Q933__Types::Q933__LinkIntegrityIE&>(link__int).recv__seq__nr() == 0)) {
current_location.update_lineno(218);
/* FrameRelay_Emulation.ttcn, line 218 */
FR__Emulation__CT_component_q933em.service__affecting__condition() = TRUE;
current_location.update_lineno(219);
/* FrameRelay_Emulation.ttcn, line 219 */
TTCN_Logger::log_str(TTCN_USER, "Detecting service affecting condition after zero receive sequence number");
current_location.update_lineno(220);
/* FrameRelay_Emulation.ttcn, line 220 */
{
FRemu__Event_template tmp_15;
tmp_15.link__status() = FRemu__LinkStatus::FR__LINK__STS__UNAVAILABLE;
notify__all__clients(tmp_15);
}
current_location.update_lineno(221);
/* FrameRelay_Emulation.ttcn, line 221 */
FR__Emulation__CT_component_q933em.num__cycles() = 0;
current_location.update_lineno(222);
/* FrameRelay_Emulation.ttcn, line 222 */
FR__Emulation__CT_component_T392.stop();
}
else {
current_location.update_lineno(223);
/* FrameRelay_Emulation.ttcn, line 223 */
if ((const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).tx__seq__nr() != const_cast< const Q933__Types::Q933__LinkIntegrityIE&>(link__int).recv__seq__nr())) {
current_location.update_lineno(224);
/* FrameRelay_Emulation.ttcn, line 224 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Link Integrity IE with discontiguous sequence numbers: expected=");
const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).tx__seq__nr().log();
TTCN_Logger::log_event_str(" received=");
const_cast< const Q933__Types::Q933__LinkIntegrityIE&>(link__int).recv__seq__nr().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(226);
/* FrameRelay_Emulation.ttcn, line 226 */
fill__err__bucket(TRUE);
}
else {
current_location.update_lineno(229);
/* FrameRelay_Emulation.ttcn, line 229 */
fill__err__bucket(FALSE);
}
}
current_location.update_lineno(231);
/* FrameRelay_Emulation.ttcn, line 231 */
FR__Emulation__CT_component_q933em.last__rx__seq__nr() = const_cast< const Q933__Types::Q933__LinkIntegrityIE&>(link__int).send__seq__nr();
}

void start_q933__handle__rx__link__int(const COMPONENT& component_reference, const Q933__Types::Q933__LinkIntegrityIE& link__int)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_handle_rx_link_int(");
link__int.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, "FrameRelay_Emulation", "q933_handle_rx_link_int", text_buf);
link__int.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

Q933__Types::Q933__LinkIntegrityIE q933__gen__tx__link__int()
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 235, TTCN_Location::LOCATION_FUNCTION, "q933_gen_tx_link_int");
current_location.update_lineno(236);
/* FrameRelay_Emulation.ttcn, line 236 */
FR__Emulation__CT_component_q933em.tx__seq__nr() = q933__next__seq(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).tx__seq__nr());
current_location.update_lineno(237);
/* FrameRelay_Emulation.ttcn, line 237 */
return Q933__Types::ts__Q933__LinkIntIE(INTEGER_template(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).tx__seq__nr()), INTEGER_template(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).last__rx__seq__nr())).valueof();
}

void start_q933__gen__tx__link__int(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_gen_tx_link_int(");
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, "FrameRelay_Emulation", "q933_gen_tx_link_int", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

Q933__Types::Q933__PvcStatusRec q933__gen__pvc__status__rec()
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 240, TTCN_Location::LOCATION_FUNCTION, "q933_gen_pvc_status_rec");
current_location.update_lineno(241);
/* FrameRelay_Emulation.ttcn, line 241 */
Q933__Types::Q933__PvcStatusRec ret(NULL_VALUE);
current_location.update_lineno(242);
/* FrameRelay_Emulation.ttcn, line 242 */
INTEGER i;
current_location.update_lineno(243);
/* FrameRelay_Emulation.ttcn, line 243 */
i = 0;
current_location.update_lineno(243);
/* FrameRelay_Emulation.ttcn, line 243 */
for ( ; ; ) {
current_location.update_lineno(243);
/* FrameRelay_Emulation.ttcn, line 243 */
if (!(i < FR__Emulation__CT_component_ConnectionTable.lengthof())) break;
{
current_location.update_lineno(244);
/* FrameRelay_Emulation.ttcn, line 244 */
if ((const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[i].vc__conn() == NULL_COMPREF)) {
current_location.update_lineno(245);
/* FrameRelay_Emulation.ttcn, line 245 */
goto tmp_20;
}
current_location.update_lineno(247);
/* FrameRelay_Emulation.ttcn, line 247 */
BOOLEAN active((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).service__affecting__condition())));
current_location.update_lineno(249);
/* FrameRelay_Emulation.ttcn, line 249 */
{
Q933__Types::Q933__PvcStatusRec tmp_21;
{
Q933__Types::Q933__PvcStatusRec tmp_22;
tmp_22.set_size(1);
tmp_22[0] = Q933__Types::ts__Q933__PvcStatus(i, FALSE, FALSE, active).valueof();
tmp_21 = (ret + tmp_22);
}
ret = tmp_21;
}
}
tmp_20:
current_location.update_lineno(243);
/* FrameRelay_Emulation.ttcn, line 243 */
{
INTEGER tmp_23;
++i;
}
}
current_location.update_lineno(251);
/* FrameRelay_Emulation.ttcn, line 251 */
return ret;
}

void start_q933__gen__pvc__status__rec(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_gen_pvc_status_rec(");
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, "FrameRelay_Emulation", "q933_gen_pvc_status_rec", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void q933__tx__status__enq()
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 255, TTCN_Location::LOCATION_FUNCTION, "q933_tx_status_enq");
current_location.update_lineno(256);
/* FrameRelay_Emulation.ttcn, line 256 */
Q933__Types::Q933__TypeOfReport rep__type(Q933__Types::Q933__TypeOfReport::Q933__REP__T__LINK__INTEG__VF__ONLY);
current_location.update_lineno(257);
/* FrameRelay_Emulation.ttcn, line 257 */
Q933__Types::Q933__LinkIntegrityIE link__int(q933__gen__tx__link__int());
current_location.update_lineno(260);
/* FrameRelay_Emulation.ttcn, line 260 */
if ((mod(const_cast< const Q933__Types::Q933__LinkIntegrityIE&>(link__int).send__seq__nr(), const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().N391()) == 0)) {
current_location.update_lineno(261);
/* FrameRelay_Emulation.ttcn, line 261 */
rep__type = Q933__Types::Q933__TypeOfReport::Q993__REP__T__FULL__STATUS;
}
current_location.update_lineno(264);
/* FrameRelay_Emulation.ttcn, line 264 */
q933__tx(Q933__Types::ts__Q933__STATUS__ENQ(Q933__Types::Q933__TypeOfReport_template(rep__type), Q933__Types::Q933__LinkIntegrityIE_template(link__int)));
current_location.update_lineno(266);
/* FrameRelay_Emulation.ttcn, line 266 */
FR__Emulation__CT_component_q933em.rx__status__in__cycle() = FALSE;
current_location.update_lineno(267);
/* FrameRelay_Emulation.ttcn, line 267 */
FR__Emulation__CT_component_T391.start(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().T391());
}

void start_q933__tx__status__enq(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_tx_status_enq(");
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, "FrameRelay_Emulation", "q933_tx_status_enq", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void handle__rx__q933(const Q933__Types::Q933__PDU& rx__pdu)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 271, TTCN_Location::LOCATION_FUNCTION, "handle_rx_q933");
current_location.update_lineno(272);
/* FrameRelay_Emulation.ttcn, line 272 */
if (((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().ats__is__user())) || const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().bidirectional())) {
{
const Q933__Types::Q933__PDU &tmp_27 = rx__pdu;
current_location.update_lineno(275);
/* FrameRelay_Emulation.ttcn, line 275 */
if(Q933__Types::tr__Q933__STATUS__ENQ(Q933__Types::Q933__TypeOfReport_template(Q933__Types::Q933__TypeOfReport::Q933__REP__T__LINK__INTEG__VF__ONLY)).match(tmp_27)) goto tmp_26_0;
current_location.update_lineno(282);
/* FrameRelay_Emulation.ttcn, line 282 */
if(Q933__Types::tr__Q933__STATUS__ENQ(Q933__Types::Q933__TypeOfReport_template(Q933__Types::Q933__TypeOfReport::Q993__REP__T__FULL__STATUS)).match(tmp_27)) goto tmp_26_1;
goto tmp_26_end;
tmp_26_0:
{
current_location.update_lineno(276);
/* FrameRelay_Emulation.ttcn, line 276 */
FR__Emulation__CT_component_T392.stop();
current_location.update_lineno(277);
/* FrameRelay_Emulation.ttcn, line 277 */
q933__handle__rx__link__int(const_cast< const Q933__Types::Q933__PDU&>(rx__pdu).body().status__enq().link__int());
current_location.update_lineno(278);
/* FrameRelay_Emulation.ttcn, line 278 */
q933__tx(Q933__Types::ts__Q933__STATUS(Q933__Types::Q933__TypeOfReport_template(Q933__Types::Q933__TypeOfReport::Q933__REP__T__LINK__INTEG__VF__ONLY), Q933__Types::Q933__LinkIntegrityIE_template(q933__gen__tx__link__int()), Q933__Types::ts__Q933__STATUS_pvc__sts_defval));
current_location.update_lineno(279);
/* FrameRelay_Emulation.ttcn, line 279 */
FR__Emulation__CT_component_T392.start(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().T392());
current_location.update_lineno(280);
/* FrameRelay_Emulation.ttcn, line 280 */
return;
}
tmp_26_1:
{
current_location.update_lineno(283);
/* FrameRelay_Emulation.ttcn, line 283 */
FR__Emulation__CT_component_T392.stop();
current_location.update_lineno(284);
/* FrameRelay_Emulation.ttcn, line 284 */
q933__handle__rx__link__int(const_cast< const Q933__Types::Q933__PDU&>(rx__pdu).body().status__enq().link__int());
current_location.update_lineno(286);
/* FrameRelay_Emulation.ttcn, line 286 */
Q933__Types::Q933__PvcStatusRec pvc__status__rec(q933__gen__pvc__status__rec());
current_location.update_lineno(287);
/* FrameRelay_Emulation.ttcn, line 287 */
q933__tx(Q933__Types::ts__Q933__STATUS(Q933__Types::Q933__TypeOfReport_template(Q933__Types::Q933__TypeOfReport::Q993__REP__T__FULL__STATUS), Q933__Types::Q933__LinkIntegrityIE_template(q933__gen__tx__link__int()), Q933__Types::ts__Q933__PvcStatusIE(Q933__Types::Q933__PvcStatusRec_template(pvc__status__rec))));
current_location.update_lineno(288);
/* FrameRelay_Emulation.ttcn, line 288 */
FR__Emulation__CT_component_T392.start(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().T392());
current_location.update_lineno(289);
/* FrameRelay_Emulation.ttcn, line 289 */
return;
}
tmp_26_end: /* empty */;
}
}
else {
current_location.update_lineno(292);
/* FrameRelay_Emulation.ttcn, line 292 */
if ((const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().ats__is__user() || const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().bidirectional())) {
{
const Q933__Types::Q933__PDU &tmp_29 = rx__pdu;
current_location.update_lineno(294);
/* FrameRelay_Emulation.ttcn, line 294 */
if(Q933__Types::tr__Q933__STATUS(Q933__Types::Q933__TypeOfReport_template(Q933__Types::Q933__TypeOfReport::Q933__REP__T__LINK__INTEG__VF__ONLY), Q933__Types::tr__Q933__STATUS_link__int_defval, Q933__Types::tr__Q933__STATUS_pvc__sts_defval).match(tmp_29)) goto tmp_28_0;
current_location.update_lineno(299);
/* FrameRelay_Emulation.ttcn, line 299 */
if(Q933__Types::tr__Q933__STATUS(Q933__Types::Q933__TypeOfReport_template(Q933__Types::Q933__TypeOfReport::Q993__REP__T__FULL__STATUS), Q933__Types::tr__Q933__STATUS_link__int_defval, Q933__Types::tr__Q933__STATUS_pvc__sts_defval).match(tmp_29)) goto tmp_28_1;
goto tmp_28_end;
tmp_28_0:
{
current_location.update_lineno(295);
/* FrameRelay_Emulation.ttcn, line 295 */
q933__handle__rx__link__int(const_cast< const Q933__Types::Q933__PDU&>(rx__pdu).body().status().link__int());
current_location.update_lineno(296);
/* FrameRelay_Emulation.ttcn, line 296 */
FR__Emulation__CT_component_q933em.rx__status__in__cycle() = TRUE;
current_location.update_lineno(297);
/* FrameRelay_Emulation.ttcn, line 297 */
return;
}
tmp_28_1:
{
current_location.update_lineno(300);
/* FrameRelay_Emulation.ttcn, line 300 */
q933__handle__rx__link__int(const_cast< const Q933__Types::Q933__PDU&>(rx__pdu).body().status().link__int());
current_location.update_lineno(301);
/* FrameRelay_Emulation.ttcn, line 301 */
FR__Emulation__CT_component_q933em.rx__status__in__cycle() = TRUE;
current_location.update_lineno(303);
/* FrameRelay_Emulation.ttcn, line 303 */
q933__handle__rx__pvc__status(const_cast< const Q933__Types::Q933__PDU&>(rx__pdu).body().status().pvc__status()().pvc__status());
current_location.update_lineno(304);
/* FrameRelay_Emulation.ttcn, line 304 */
return;
}
tmp_28_end: /* empty */;
}
}
}
current_location.update_lineno(309);
/* FrameRelay_Emulation.ttcn, line 309 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected Q933 received: "),rx__pdu.log(),TTCN_Logger::end_event_log2str()));
}

void start_handle__rx__q933(const COMPONENT& component_reference, const Q933__Types::Q933__PDU& rx__pdu)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function handle_rx_q933(");
rx__pdu.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, "FrameRelay_Emulation", "handle_rx_q933", text_buf);
rx__pdu.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

FRemu__PvcStatus status__pvc2fremu(const Q933__Types::Q933__PvcStatus& inp)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 312, TTCN_Location::LOCATION_FUNCTION, "status_pvc2fremu");
current_location.update_lineno(313);
/* FrameRelay_Emulation.ttcn, line 313 */
FRemu__PvcStatus ps;
ps.dlci() = bit2int((const_cast< const Q933__Types::Q933__PvcStatus&>(inp).dlci__high() + const_cast< const Q933__Types::Q933__PvcStatus&>(inp).dlci__low()));
ps.new_() = const_cast< const Q933__Types::Q933__PvcStatus&>(inp).new_();
ps.delete_() = const_cast< const Q933__Types::Q933__PvcStatus&>(inp).delete_();
ps.active() = const_cast< const Q933__Types::Q933__PvcStatus&>(inp).active();
current_location.update_lineno(319);
/* FrameRelay_Emulation.ttcn, line 319 */
return ps;
}

void q933__handle__rx__pvc__status(const Q933__Types::Q933__PvcStatusRec& pvc__str)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 322, TTCN_Location::LOCATION_FUNCTION, "q933_handle_rx_pvc_status");
{
current_location.update_lineno(323);
/* FrameRelay_Emulation.ttcn, line 323 */
INTEGER i(0);
current_location.update_lineno(323);
/* FrameRelay_Emulation.ttcn, line 323 */
for ( ; ; ) {
current_location.update_lineno(323);
/* FrameRelay_Emulation.ttcn, line 323 */
if (!(i < pvc__str.size_of())) break;
current_location.update_lineno(324);
/* FrameRelay_Emulation.ttcn, line 324 */
Q933__Types::Q933__PvcStatus pvc__st(const_cast< const Q933__Types::Q933__PvcStatusRec&>(pvc__str)[i]);
current_location.update_lineno(325);
/* FrameRelay_Emulation.ttcn, line 325 */
FRemu__PvcStatus frps(status__pvc2fremu(pvc__st));
current_location.update_lineno(326);
/* FrameRelay_Emulation.ttcn, line 326 */
COMPONENT vc__conn(const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[const_cast< const FRemu__PvcStatus&>(frps).dlci()].vc__conn());
current_location.update_lineno(327);
/* FrameRelay_Emulation.ttcn, line 327 */
if ((vc__conn != NULL_COMPREF)) {
current_location.update_lineno(328);
/* FrameRelay_Emulation.ttcn, line 328 */
if ((const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[const_cast< const FRemu__PvcStatus&>(frps).dlci()].q933__status() != frps)) {
current_location.update_lineno(329);
/* FrameRelay_Emulation.ttcn, line 329 */
{
FRemu__Event_template tmp_32;
tmp_32.pvc__status() = frps;
FR__Emulation__CT_component_CLIENT.send(tmp_32, COMPONENT(vc__conn), NULL);
}
current_location.update_lineno(330);
/* FrameRelay_Emulation.ttcn, line 330 */
FR__Emulation__CT_component_ConnectionTable[const_cast< const FRemu__PvcStatus&>(frps).dlci()].q933__status() = frps;
}
}
current_location.update_lineno(323);
/* FrameRelay_Emulation.ttcn, line 323 */
{
INTEGER tmp_34;
++i;
}
}
}
}

void start_q933__handle__rx__pvc__status(const COMPONENT& component_reference, const Q933__Types::Q933__PvcStatusRec& pvc__str)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_handle_rx_pvc_status(");
pvc__str.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, "FrameRelay_Emulation", "q933_handle_rx_pvc_status", text_buf);
pvc__str.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void q933__tx(const Q933__Types::Q933__PDU_template& tx)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 337, TTCN_Location::LOCATION_FUNCTION, "q933_tx");
current_location.update_lineno(338);
/* FrameRelay_Emulation.ttcn, line 338 */
OCTETSTRING q933__bin(Q933__Types::enc__Q933__PDU(tx.valueof()));
current_location.update_lineno(340);
/* FrameRelay_Emulation.ttcn, line 340 */
FR__Emulation__CT_component_FR.send(FrameRelay__Types::ts__FR(0, (os_0 + q933__bin), FALSE, FrameRelay__Types::ts__FR_fecn_defval, FrameRelay__Types::ts__FR_becn_defval, FrameRelay__Types::ts__FR_de_defval), FALSE, NULL);
}

void start_q933__tx(const COMPONENT& component_reference, const Q933__Types::Q933__PDU_template& tx)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_tx(");
tx.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, "FrameRelay_Emulation", "q933_tx", text_buf);
tx.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void notify__client(const COMPONENT& vc__conn, const FRemu__Event_template& evt)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 347, TTCN_Location::LOCATION_FUNCTION, "notify_client");
current_location.update_lineno(349);
/* FrameRelay_Emulation.ttcn, line 349 */
FR__Emulation__CT_component_CLIENT.send(evt, COMPONENT(vc__conn), NULL);
}

void start_notify__client(const COMPONENT& component_reference, const COMPONENT& vc__conn, const FRemu__Event_template& evt)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function notify_client(");
vc__conn.log();
TTCN_Logger::log_event_str(", ");
evt.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, "FrameRelay_Emulation", "notify_client", text_buf);
vc__conn.encode_text(text_buf);
evt.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void notify__all__clients(const FRemu__Event_template& evt)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 352, TTCN_Location::LOCATION_FUNCTION, "notify_all_clients");
{
current_location.update_lineno(354);
/* FrameRelay_Emulation.ttcn, line 354 */
INTEGER i(0);
current_location.update_lineno(354);
/* FrameRelay_Emulation.ttcn, line 354 */
for ( ; ; ) {
current_location.update_lineno(354);
/* FrameRelay_Emulation.ttcn, line 354 */
if (!(i < 1024)) break;
current_location.update_lineno(355);
/* FrameRelay_Emulation.ttcn, line 355 */
if ((const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[i].vc__conn() != NULL_COMPREF)) {
current_location.update_lineno(356);
/* FrameRelay_Emulation.ttcn, line 356 */
notify__client(COMPONENT(const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[i].vc__conn()), evt);
}
current_location.update_lineno(354);
/* FrameRelay_Emulation.ttcn, line 354 */
{
INTEGER tmp_35;
++i;
}
}
}
}

void start_notify__all__clients(const COMPONENT& component_reference, const FRemu__Event_template& evt)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function notify_all_clients(");
evt.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, "FrameRelay_Emulation", "notify_all_clients", text_buf);
evt.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void notify__all__clients__pvc__state()
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 361, TTCN_Location::LOCATION_FUNCTION, "notify_all_clients_pvc_state");
{
current_location.update_lineno(363);
/* FrameRelay_Emulation.ttcn, line 363 */
INTEGER i(0);
current_location.update_lineno(363);
/* FrameRelay_Emulation.ttcn, line 363 */
for ( ; ; ) {
current_location.update_lineno(363);
/* FrameRelay_Emulation.ttcn, line 363 */
if (!(i < 1024)) break;
current_location.update_lineno(364);
/* FrameRelay_Emulation.ttcn, line 364 */
if ((const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[i].vc__conn() != NULL_COMPREF)) {
current_location.update_lineno(365);
/* FrameRelay_Emulation.ttcn, line 365 */
{
FRemu__Event_template tmp_36;
tmp_36.pvc__status() = const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[i].q933__status();
notify__client(COMPONENT(const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[i].vc__conn()), tmp_36);
}
}
current_location.update_lineno(363);
/* FrameRelay_Emulation.ttcn, line 363 */
{
INTEGER tmp_37;
++i;
}
}
}
}

void start_notify__all__clients__pvc__state(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function notify_all_clients_pvc_state(");
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, "FrameRelay_Emulation", "notify_all_clients_pvc_state", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void main_(const Q933em__Config& q933__cfg)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 371, TTCN_Location::LOCATION_FUNCTION, "main");
current_location.update_lineno(372);
/* FrameRelay_Emulation.ttcn, line 372 */
FrameRelay__Types::FrameRelayFrame rx__fr;
current_location.update_lineno(373);
/* FrameRelay_Emulation.ttcn, line 373 */
INTEGER dlci;
current_location.update_lineno(374);
/* FrameRelay_Emulation.ttcn, line 374 */
COMPONENT vc__conn;
current_location.update_lineno(376);
/* FrameRelay_Emulation.ttcn, line 376 */
FR__Emulation__CT_component_q933em = ts__Q933em__State(q933__cfg).valueof();
current_location.update_lineno(378);
/* FrameRelay_Emulation.ttcn, line 378 */
if ((const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().ats__is__user() || const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().bidirectional())) {
current_location.update_lineno(379);
/* FrameRelay_Emulation.ttcn, line 379 */
q933__tx__status__enq();
}
{
current_location.update_lineno(382);
/* FrameRelay_Emulation.ttcn, line 382 */
INTEGER i(0);
current_location.update_lineno(382);
/* FrameRelay_Emulation.ttcn, line 382 */
for ( ; ; ) {
current_location.update_lineno(382);
/* FrameRelay_Emulation.ttcn, line 382 */
if (!(i < 1024)) break;
current_location.update_lineno(383);
/* FrameRelay_Emulation.ttcn, line 383 */
{
ConnectionData& tmp_40 = FR__Emulation__CT_component_ConnectionTable[i]; /* 7388 */
tmp_40.vc__conn() = NULL_COMPREF;
{
FRemu__PvcStatus& tmp_41 = tmp_40.q933__status();
tmp_41.dlci() = i;
tmp_41.new_() = FALSE;
tmp_41.delete_() = FALSE;
tmp_41.active() = FALSE;
}
}
current_location.update_lineno(382);
/* FrameRelay_Emulation.ttcn, line 382 */
{
INTEGER tmp_42;
++i;
}
}
}
for ( ; ; ) {
current_location.update_lineno(395);
/* FrameRelay_Emulation.ttcn, line 395 */
{
tmp_43:
alt_status tmp_43_alt_flag_0 = ALT_MAYBE;
alt_status tmp_43_alt_flag_1 = ALT_MAYBE;
alt_status tmp_43_alt_flag_2 = ALT_UNCHECKED;
alt_status tmp_43_alt_flag_3 = ALT_UNCHECKED;
alt_status tmp_43_alt_flag_4 = ALT_UNCHECKED;
alt_status tmp_43_alt_flag_5 = ALT_UNCHECKED;
alt_status tmp_43_alt_flag_6 = ALT_UNCHECKED;
alt_status tmp_43_alt_flag_7 = ALT_UNCHECKED;
alt_status tmp_43_alt_flag_8 = ALT_MAYBE;
alt_status tmp_43_alt_flag_9 = ALT_MAYBE;
alt_status tmp_43_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_43_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(399);
/* FrameRelay_Emulation.ttcn, line 399 */
tmp_43_alt_flag_0 = FR__Emulation__CT_component_FR.receive(FrameRelay__Types::tr__FR(INTEGER_template(0), op_0, FrameRelay__Types::tr__FR_c__r_defval, FrameRelay__Types::tr__FR_fecn_defval, FrameRelay__Types::tr__FR_becn_defval, FrameRelay__Types::tr__FR_de_defval), &(rx__fr), any_compref, NULL, NULL, NULL);
if (tmp_43_alt_flag_0 == ALT_YES) {
current_location.update_lineno(401);
/* FrameRelay_Emulation.ttcn, line 401 */
Q933__Types::Q933__PDU rx__q933(Q933__Types::dec__Q933__PDU(substr(const_cast< const FrameRelay__Types::FrameRelayFrame&>(rx__fr).payload(), 1, (const_cast< const FrameRelay__Types::FrameRelayFrame&>(rx__fr).payload().lengthof() - 1))));
current_location.update_lineno(402);
/* FrameRelay_Emulation.ttcn, line 402 */
handle__rx__q933(rx__q933);
break;
}
}
if (tmp_43_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(404);
/* FrameRelay_Emulation.ttcn, line 404 */
tmp_43_alt_flag_1 = FR__Emulation__CT_component_FR.receive(FrameRelay__Types::tr__FR(INTEGER_template(0), OCTETSTRING_template(ANY_VALUE), FrameRelay__Types::tr__FR_c__r_defval, FrameRelay__Types::tr__FR_fecn_defval, FrameRelay__Types::tr__FR_becn_defval, FrameRelay__Types::tr__FR_de_defval), &(rx__fr), any_compref, NULL, NULL, NULL);
if (tmp_43_alt_flag_1 == ALT_YES) {
current_location.update_lineno(405);
/* FrameRelay_Emulation.ttcn, line 405 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unsupported DLCI 0 frame received: "),rx__fr.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(406);
/* FrameRelay_Emulation.ttcn, line 406 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
if (tmp_43_alt_flag_2 == ALT_UNCHECKED) {
current_location.update_lineno(408);
/* FrameRelay_Emulation.ttcn, line 408 */
if ((const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().ats__is__user() || const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().bidirectional())) tmp_43_alt_flag_2 = ALT_MAYBE;
else tmp_43_alt_flag_2 = ALT_NO;
}
if (tmp_43_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(408);
/* FrameRelay_Emulation.ttcn, line 408 */
tmp_43_alt_flag_2 = FR__Emulation__CT_component_T391.timeout(NULL);
if (tmp_43_alt_flag_2 == ALT_YES) {
current_location.update_lineno(409);
/* FrameRelay_Emulation.ttcn, line 409 */
if ((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).rx__status__in__cycle()))) {
current_location.update_lineno(411);
/* FrameRelay_Emulation.ttcn, line 411 */
fill__err__bucket(TRUE);
}
current_location.update_lineno(414);
/* FrameRelay_Emulation.ttcn, line 414 */
q933__tx__status__enq();
break;
}
}
if (tmp_43_alt_flag_3 == ALT_UNCHECKED) {
current_location.update_lineno(416);
/* FrameRelay_Emulation.ttcn, line 416 */
if (((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().ats__is__user())) || const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().bidirectional())) tmp_43_alt_flag_3 = ALT_MAYBE;
else tmp_43_alt_flag_3 = ALT_NO;
}
if (tmp_43_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(416);
/* FrameRelay_Emulation.ttcn, line 416 */
tmp_43_alt_flag_3 = FR__Emulation__CT_component_T392.timeout(NULL);
if (tmp_43_alt_flag_3 == ALT_YES) {
current_location.update_lineno(418);
/* FrameRelay_Emulation.ttcn, line 418 */
fill__err__bucket(TRUE);
current_location.update_lineno(420);
/* FrameRelay_Emulation.ttcn, line 420 */
FR__Emulation__CT_component_T392.start(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().T392());
break;
}
}
if (tmp_43_alt_flag_4 == ALT_UNCHECKED) {
current_location.update_lineno(424);
/* FrameRelay_Emulation.ttcn, line 424 */
if ((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).service__affecting__condition()))) tmp_43_alt_flag_4 = ALT_MAYBE;
else tmp_43_alt_flag_4 = ALT_NO;
}
if (tmp_43_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(424);
/* FrameRelay_Emulation.ttcn, line 424 */
tmp_43_alt_flag_4 = FR__Emulation__CT_component_FR.receive(FrameRelay__Types::tr__FR(INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), FrameRelay__Types::tr__FR_c__r_defval, FrameRelay__Types::tr__FR_fecn_defval, FrameRelay__Types::tr__FR_becn_defval, FrameRelay__Types::tr__FR_de_defval), &(rx__fr), any_compref, NULL, NULL, NULL);
if (tmp_43_alt_flag_4 == ALT_YES) {
current_location.update_lineno(426);
/* FrameRelay_Emulation.ttcn, line 426 */
vc__conn = const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[const_cast< const FrameRelay__Types::FrameRelayFrame&>(rx__fr).hdr().dlci()].vc__conn();
current_location.update_lineno(427);
/* FrameRelay_Emulation.ttcn, line 427 */
if ((vc__conn == NULL_COMPREF)) {
current_location.update_lineno(428);
/* FrameRelay_Emulation.ttcn, line 428 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Dropping Rx FR for unequipped user DLCI ");
const_cast< const FrameRelay__Types::FrameRelayFrame&>(rx__fr).hdr().dlci().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(429);
/* FrameRelay_Emulation.ttcn, line 429 */
goto tmp_43;
}
current_location.update_lineno(431);
/* FrameRelay_Emulation.ttcn, line 431 */
FR__Emulation__CT_component_CLIENT.send(rx__fr, COMPONENT(vc__conn), NULL);
break;
}
}
if (tmp_43_alt_flag_5 == ALT_UNCHECKED) {
current_location.update_lineno(433);
/* FrameRelay_Emulation.ttcn, line 433 */
if (const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).service__affecting__condition()) tmp_43_alt_flag_5 = ALT_MAYBE;
else tmp_43_alt_flag_5 = ALT_NO;
}
if (tmp_43_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(433);
/* FrameRelay_Emulation.ttcn, line 433 */
tmp_43_alt_flag_5 = FR__Emulation__CT_component_FR.receive(FrameRelay__Types::tr__FR(INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), FrameRelay__Types::tr__FR_c__r_defval, FrameRelay__Types::tr__FR_fecn_defval, FrameRelay__Types::tr__FR_becn_defval, FrameRelay__Types::tr__FR_de_defval), &(rx__fr), any_compref, NULL, NULL, NULL);
if (tmp_43_alt_flag_5 == ALT_YES) {
current_location.update_lineno(434);
/* FrameRelay_Emulation.ttcn, line 434 */
TTCN_Logger::log_str(TTCN_USER, "Dropping Rx FR frame while service affecting condition exists");
break;
}
}
if (tmp_43_alt_flag_6 == ALT_UNCHECKED) {
current_location.update_lineno(439);
/* FrameRelay_Emulation.ttcn, line 439 */
if ((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).service__affecting__condition()))) tmp_43_alt_flag_6 = ALT_MAYBE;
else tmp_43_alt_flag_6 = ALT_NO;
}
if (tmp_43_alt_flag_6 == ALT_MAYBE) {
current_location.update_lineno(439);
/* FrameRelay_Emulation.ttcn, line 439 */
tmp_43_alt_flag_6 = FR__Emulation__CT_component_CLIENT.receive(FrameRelay__Types::tr__FR(INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), FrameRelay__Types::tr__FR_c__r_defval, FrameRelay__Types::tr__FR_fecn_defval, FrameRelay__Types::tr__FR_becn_defval, FrameRelay__Types::tr__FR_de_defval), &(rx__fr), any_compref, NULL, NULL, NULL);
if (tmp_43_alt_flag_6 == ALT_YES) {
current_location.update_lineno(440);
/* FrameRelay_Emulation.ttcn, line 440 */
FR__Emulation__CT_component_FR.send(rx__fr, FALSE, NULL);
break;
}
}
if (tmp_43_alt_flag_7 == ALT_UNCHECKED) {
current_location.update_lineno(442);
/* FrameRelay_Emulation.ttcn, line 442 */
if (const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).service__affecting__condition()) tmp_43_alt_flag_7 = ALT_MAYBE;
else tmp_43_alt_flag_7 = ALT_NO;
}
if (tmp_43_alt_flag_7 == ALT_MAYBE) {
current_location.update_lineno(442);
/* FrameRelay_Emulation.ttcn, line 442 */
tmp_43_alt_flag_7 = FR__Emulation__CT_component_CLIENT.receive(FrameRelay__Types::tr__FR(INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), FrameRelay__Types::tr__FR_c__r_defval, FrameRelay__Types::tr__FR_fecn_defval, FrameRelay__Types::tr__FR_becn_defval, FrameRelay__Types::tr__FR_de_defval), &(rx__fr), any_compref, NULL, NULL, NULL);
if (tmp_43_alt_flag_7 == ALT_YES) {
current_location.update_lineno(443);
/* FrameRelay_Emulation.ttcn, line 443 */
TTCN_Logger::log_str(TTCN_USER, "Dropping Tx FR frame while service affecting condition exists");
break;
}
}
if (tmp_43_alt_flag_8 == ALT_MAYBE) {
current_location.update_lineno(448);
/* FrameRelay_Emulation.ttcn, line 448 */
{
FRemu__register_template tmp_45;
tmp_45.dlci() = ANY_VALUE;
tmp_43_alt_flag_8 = FR__Emulation__CT_component_PROC.getcall(tmp_45, any_compref, FRemu__register_call_redirect(&(dlci)), &(vc__conn), NULL, NULL);
}
if (tmp_43_alt_flag_8 == ALT_YES) {
current_location.update_lineno(449);
/* FrameRelay_Emulation.ttcn, line 449 */
{
boolean tmp_46;
tmp_46 = (const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[dlci].vc__conn() != NULL_COMPREF);
if (tmp_46) tmp_46 = (const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[dlci].vc__conn() != vc__conn);
if (tmp_46) {
current_location.update_lineno(450);
/* FrameRelay_Emulation.ttcn, line 450 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("DLCI "),dlci.log(),TTCN_Logger::log_event_str(" already registred by "),const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[dlci].vc__conn().log(),TTCN_Logger::log_event_str(" when "),vc__conn.log(),TTCN_Logger::log_event_str(" tries to register for it"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(452);
/* FrameRelay_Emulation.ttcn, line 452 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
current_location.update_lineno(455);
/* FrameRelay_Emulation.ttcn, line 455 */
{
ConnectionData& tmp_48 = FR__Emulation__CT_component_ConnectionTable[dlci]; /* 7388 */
tmp_48.vc__conn() = vc__conn;
{
FRemu__PvcStatus& tmp_49 = tmp_48.q933__status();
tmp_49.dlci() = dlci;
tmp_49.new_() = TRUE;
tmp_49.delete_() = FALSE;
tmp_49.active() = TRUE;
}
}
current_location.update_lineno(464);
/* FrameRelay_Emulation.ttcn, line 464 */
{
FRemu__register_template tmp_50;
tmp_50.dlci() = dlci;
FR__Emulation__CT_component_PROC.reply(tmp_50, COMPONENT(vc__conn), NULL);
}
current_location.update_lineno(465);
/* FrameRelay_Emulation.ttcn, line 465 */
if ((!(const_cast< const Q933em__State&>(FR__Emulation__CT_component_q933em).cfg().ats__is__user()))) {
current_location.update_lineno(466);
/* FrameRelay_Emulation.ttcn, line 466 */
{
FRemu__Event_template tmp_51;
tmp_51.pvc__status() = const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[dlci].q933__status();
notify__client(vc__conn, tmp_51);
}
}
break;
}
}
if (tmp_43_alt_flag_9 == ALT_MAYBE) {
current_location.update_lineno(472);
/* FrameRelay_Emulation.ttcn, line 472 */
{
FRemu__unregister_template tmp_52;
tmp_52.dlci() = ANY_VALUE;
tmp_43_alt_flag_9 = FR__Emulation__CT_component_PROC.getcall(tmp_52, any_compref, FRemu__unregister_call_redirect(&(dlci)), &(vc__conn), NULL, NULL);
}
if (tmp_43_alt_flag_9 == ALT_YES) {
current_location.update_lineno(473);
/* FrameRelay_Emulation.ttcn, line 473 */
if ((const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[dlci].vc__conn() != vc__conn)) {
current_location.update_lineno(474);
/* FrameRelay_Emulation.ttcn, line 474 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Component "),vc__conn.log(),TTCN_Logger::log_event_str(" tries to unregister DLCI "),dlci.log(),TTCN_Logger::log_event_str(" registered by "),const_cast< const VALUE_ARRAY<ConnectionData, 1024, 0>&>(FR__Emulation__CT_component_ConnectionTable)[dlci].vc__conn().log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(476);
/* FrameRelay_Emulation.ttcn, line 476 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
current_location.update_lineno(478);
/* FrameRelay_Emulation.ttcn, line 478 */
FR__Emulation__CT_component_ConnectionTable[dlci].vc__conn() = NULL_COMPREF;
current_location.update_lineno(480);
/* FrameRelay_Emulation.ttcn, line 480 */
{
FRemu__unregister_template tmp_54;
tmp_54.dlci() = dlci;
FR__Emulation__CT_component_PROC.reply(tmp_54, COMPONENT(vc__conn), NULL);
}
break;
}
}
if (tmp_43_default_flag == ALT_MAYBE) {
tmp_43_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_43_default_flag == ALT_YES || tmp_43_default_flag == ALT_BREAK) break;
else if (tmp_43_default_flag == ALT_REPEAT) goto tmp_43;
}
current_location.update_lineno(395);
/* FrameRelay_Emulation.ttcn, line 395 */
if (tmp_43_alt_flag_0 == ALT_NO && tmp_43_alt_flag_1 == ALT_NO && tmp_43_alt_flag_2 == ALT_NO && tmp_43_alt_flag_3 == ALT_NO && tmp_43_alt_flag_4 == ALT_NO && tmp_43_alt_flag_5 == ALT_NO && tmp_43_alt_flag_6 == ALT_NO && tmp_43_alt_flag_7 == ALT_NO && tmp_43_alt_flag_8 == ALT_NO && tmp_43_alt_flag_9 == ALT_NO && tmp_43_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file FrameRelay_Emulation.ttcn between lines 395 and 482.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}
}

void start_main_(const COMPONENT& component_reference, const Q933em__Config& q933__cfg)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function main(");
q933__cfg.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, "FrameRelay_Emulation", "main", text_buf);
q933__cfg.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__fremu__register(const INTEGER& dlci)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 491, TTCN_Location::LOCATION_FUNCTION, "f_fremu_register");
current_location.update_lineno(492);
/* FrameRelay_Emulation.ttcn, line 492 */
{
FRemu__register_template tmp_55;
tmp_55.dlci() = dlci;
FR__Client__CT_component_FR__PROC.call(tmp_55, FALSE, NULL);
}
{
alt_status tmp_56_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(492);
/* FrameRelay_Emulation.ttcn, line 492 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_56_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(493);
/* FrameRelay_Emulation.ttcn, line 493 */
{
FRemu__register_template tmp_57;
tmp_57.dlci() = dlci;
tmp_56_alt_flag_0 = FR__Client__CT_component_FR__PROC.getreply(tmp_57, any_compref, FRemu__register_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_56_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(492);
/* FrameRelay_Emulation.ttcn, line 492 */
if (tmp_56_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 FrameRelay_Emulation.ttcn between lines 492 and 494.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__fremu__register(const COMPONENT& component_reference, const INTEGER& dlci)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_fremu_register(");
dlci.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, "FrameRelay_Emulation", "f_fremu_register", text_buf);
dlci.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__fremu__unregister(const INTEGER& dlci)
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 497, TTCN_Location::LOCATION_FUNCTION, "f_fremu_unregister");
current_location.update_lineno(498);
/* FrameRelay_Emulation.ttcn, line 498 */
{
FRemu__unregister_template tmp_58;
tmp_58.dlci() = dlci;
FR__Client__CT_component_FR__PROC.call(tmp_58, FALSE, NULL);
}
{
alt_status tmp_59_alt_flag_0 = ALT_MAYBE;
current_location.update_lineno(498);
/* FrameRelay_Emulation.ttcn, line 498 */
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_59_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(499);
/* FrameRelay_Emulation.ttcn, line 499 */
{
FRemu__unregister_template tmp_60;
tmp_60.dlci() = dlci;
tmp_59_alt_flag_0 = FR__Client__CT_component_FR__PROC.getreply(tmp_60, any_compref, FRemu__unregister_reply_redirect(), NULL, NULL, NULL);
}
if (tmp_59_alt_flag_0 == ALT_YES) break;
}
current_location.update_lineno(498);
/* FrameRelay_Emulation.ttcn, line 498 */
if (tmp_59_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 FrameRelay_Emulation.ttcn between lines 498 and 500.");
TTCN_Snapshot::take_new(TRUE);
}
}
}

void start_f__fremu__unregister(const COMPONENT& component_reference, const INTEGER& dlci)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_fremu_unregister(");
dlci.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, "FrameRelay_Emulation", "f_fremu_unregister", text_buf);
dlci.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "FrameRelay_Emulation");
FrameRelay__CodecPort::module_object.pre_init_module();
Q933__Types::module_object.pre_init_module();
module_object.add_function("q933_next_seq", (genericfunc_t)&q933__next__seq, NULL);
module_object.add_function("fill_err_bucket", (genericfunc_t)&fill__err__bucket, (genericfunc_t)&start_fill__err__bucket);
module_object.add_function("q933_handle_rx_link_int", (genericfunc_t)&q933__handle__rx__link__int, (genericfunc_t)&start_q933__handle__rx__link__int);
module_object.add_function("q933_gen_tx_link_int", (genericfunc_t)&q933__gen__tx__link__int, (genericfunc_t)&start_q933__gen__tx__link__int);
module_object.add_function("q933_gen_pvc_status_rec", (genericfunc_t)&q933__gen__pvc__status__rec, (genericfunc_t)&start_q933__gen__pvc__status__rec);
module_object.add_function("q933_tx_status_enq", (genericfunc_t)&q933__tx__status__enq, (genericfunc_t)&start_q933__tx__status__enq);
module_object.add_function("handle_rx_q933", (genericfunc_t)&handle__rx__q933, (genericfunc_t)&start_handle__rx__q933);
module_object.add_function("status_pvc2fremu", (genericfunc_t)&status__pvc2fremu, NULL);
module_object.add_function("q933_handle_rx_pvc_status", (genericfunc_t)&q933__handle__rx__pvc__status, (genericfunc_t)&start_q933__handle__rx__pvc__status);
module_object.add_function("q933_tx", (genericfunc_t)&q933__tx, (genericfunc_t)&start_q933__tx);
module_object.add_function("notify_client", (genericfunc_t)&notify__client, (genericfunc_t)&start_notify__client);
module_object.add_function("notify_all_clients", (genericfunc_t)&notify__all__clients, (genericfunc_t)&start_notify__all__clients);
module_object.add_function("notify_all_clients_pvc_state", (genericfunc_t)&notify__all__clients__pvc__state, (genericfunc_t)&start_notify__all__clients__pvc__state);
module_object.add_function("main", (genericfunc_t)&main_, (genericfunc_t)&start_main_);
module_object.add_function("f_fremu_register", (genericfunc_t)&f__fremu__register, (genericfunc_t)&start_f__fremu__register);
module_object.add_function("f_fremu_unregister", (genericfunc_t)&f__fremu__unregister, (genericfunc_t)&start_f__fremu__unregister);
}

void post_init_module()
{
TTCN_Location current_location("FrameRelay_Emulation.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "FrameRelay_Emulation");
FrameRelay__CodecPort::module_object.post_init_module();
Q933__Types::module_object.post_init_module();
current_location.update_lineno(38);
/* FrameRelay_Emulation.ttcn, line 38 */
template_tr__FRemu__PvcStatusAct_active_defval = ANY_VALUE;
}

boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "FR_Emulation_CT")) {
FR__Emulation__CT_component_FR.activate_port();
FR__Emulation__CT_component_CLIENT.activate_port();
FR__Emulation__CT_component_PROC.activate_port();
FR__Emulation__CT_component_ConnectionTable.clean_up();
FR__Emulation__CT_component_q933em.clean_up();
return TRUE;
} else if (!strcmp(component_type, "FR_Client_CT")) {
FR__Client__CT_component_FR.activate_port();
FR__Client__CT_component_FR__PROC.activate_port();
return TRUE;
} else return FALSE;
}

boolean init_system_port(const char* component_type, const char* port_name)
{
if (!strcmp(component_type, "FR_Emulation_CT")) {
if (!strcmp(port_name, "CLIENT")) {
FR__Emulation__CT_component_CLIENT.safe_start();
return TRUE;
}
if (!strcmp(port_name, "FR")) {
FR__Emulation__CT_component_FR.safe_start();
return TRUE;
}
if (!strcmp(port_name, "PROC")) {
FR__Emulation__CT_component_PROC.safe_start();
return TRUE;
}
}
else if (!strcmp(component_type, "FR_Client_CT")) {
if (!strcmp(port_name, "FR")) {
FR__Client__CT_component_FR.safe_start();
return TRUE;
}
if (!strcmp(port_name, "FR_PROC")) {
FR__Client__CT_component_FR__PROC.safe_start();
return TRUE;
}
}
return FALSE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "fill_err_bucket")) {
BOOLEAN has__error;
has__error.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function fill_err_bucket(");
has__error.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
fill__err__bucket(has__error);
TTCN_Runtime::function_finished("fill_err_bucket");
return TRUE;
} else if (!strcmp(function_name, "q933_handle_rx_link_int")) {
Q933__Types::Q933__LinkIntegrityIE link__int;
link__int.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_handle_rx_link_int(");
link__int.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
q933__handle__rx__link__int(link__int);
TTCN_Runtime::function_finished("q933_handle_rx_link_int");
return TRUE;
} else if (!strcmp(function_name, "q933_gen_tx_link_int")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function q933_gen_tx_link_int().");
TTCN_Runtime::function_started(function_arguments);
q933__gen__tx__link__int();
TTCN_Runtime::function_finished("q933_gen_tx_link_int");
return TRUE;
} else if (!strcmp(function_name, "q933_gen_pvc_status_rec")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function q933_gen_pvc_status_rec().");
TTCN_Runtime::function_started(function_arguments);
q933__gen__pvc__status__rec();
TTCN_Runtime::function_finished("q933_gen_pvc_status_rec");
return TRUE;
} else if (!strcmp(function_name, "q933_tx_status_enq")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function q933_tx_status_enq().");
TTCN_Runtime::function_started(function_arguments);
q933__tx__status__enq();
TTCN_Runtime::function_finished("q933_tx_status_enq");
return TRUE;
} else if (!strcmp(function_name, "handle_rx_q933")) {
Q933__Types::Q933__PDU rx__pdu;
rx__pdu.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function handle_rx_q933(");
rx__pdu.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
handle__rx__q933(rx__pdu);
TTCN_Runtime::function_finished("handle_rx_q933");
return TRUE;
} else if (!strcmp(function_name, "q933_handle_rx_pvc_status")) {
Q933__Types::Q933__PvcStatusRec pvc__str;
pvc__str.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_handle_rx_pvc_status(");
pvc__str.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
q933__handle__rx__pvc__status(pvc__str);
TTCN_Runtime::function_finished("q933_handle_rx_pvc_status");
return TRUE;
} else if (!strcmp(function_name, "q933_tx")) {
Q933__Types::Q933__PDU_template tx;
tx.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function q933_tx(");
tx.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
q933__tx(tx);
TTCN_Runtime::function_finished("q933_tx");
return TRUE;
} else if (!strcmp(function_name, "notify_client")) {
COMPONENT vc__conn;
FRemu__Event_template evt;
vc__conn.decode_text(function_arguments);
evt.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function notify_client(");
vc__conn.log();
TTCN_Logger::log_event_str(", ");
evt.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
notify__client(vc__conn, evt);
TTCN_Runtime::function_finished("notify_client");
return TRUE;
} else if (!strcmp(function_name, "notify_all_clients")) {
FRemu__Event_template evt;
evt.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function notify_all_clients(");
evt.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
notify__all__clients(evt);
TTCN_Runtime::function_finished("notify_all_clients");
return TRUE;
} else if (!strcmp(function_name, "notify_all_clients_pvc_state")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function notify_all_clients_pvc_state().");
TTCN_Runtime::function_started(function_arguments);
notify__all__clients__pvc__state();
TTCN_Runtime::function_finished("notify_all_clients_pvc_state");
return TRUE;
} else if (!strcmp(function_name, "main")) {
Q933em__Config q933__cfg;
q933__cfg.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function main(");
q933__cfg.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
main_(q933__cfg);
TTCN_Runtime::function_finished("main");
return TRUE;
} else if (!strcmp(function_name, "f_fremu_register")) {
INTEGER dlci;
dlci.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_fremu_register(");
dlci.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__fremu__register(dlci);
TTCN_Runtime::function_finished("f_fremu_register");
return TRUE;
} else if (!strcmp(function_name, "f_fremu_unregister")) {
INTEGER dlci;
dlci.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_fremu_unregister(");
dlci.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__fremu__unregister(dlci);
TTCN_Runtime::function_finished("f_fremu_unregister");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
