// 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 "TRXC_CodecPort.hh" namespace TRXC__CodecPort { /* Literal string constants */ extern const CHARSTRING cs_0('?'); const unsigned char module_checksum[] = { 0x8f, 0x6d, 0xa6, 0x6f, 0x33, 0xe0, 0x0c, 0x2a, 0xcb, 0x2b, 0x6d, 0x5d, 0x81, 0x32, 0x7a, 0x9a }; /* Global variable definitions */ const XERdescriptor_t TRXC__RecvFrom_connId_xer_ = { {"connId>\n", "connId>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TRXC__RecvFrom_connId_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TRXC__RecvFrom_connId_descr_ = { "@TRXC_CodecPort.TRXC_RecvFrom.connId", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TRXC__RecvFrom_connId_xer_, &INTEGER_json_, &TRXC__RecvFrom_connId_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TRXC__RecvFrom_remName_xer_ = { {"remName>\n", "remName>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TRXC__RecvFrom_remName_descr_ = { "@TRXC_CodecPort.TRXC_RecvFrom.remName", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &TRXC__RecvFrom_remName_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TRXC__RecvFrom_remPort_xer_ = { {"remPort>\n", "remPort>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TRXC__RecvFrom_remPort_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TRXC__RecvFrom_remPort_descr_ = { "@TRXC_CodecPort.TRXC_RecvFrom.remPort", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TRXC__RecvFrom_remPort_xer_, &INTEGER_json_, &TRXC__RecvFrom_remPort_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TRXC__RecvFrom_locName_xer_ = { {"locName>\n", "locName>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t TRXC__RecvFrom_locName_descr_ = { "@TRXC_CodecPort.TRXC_RecvFrom.locName", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &TRXC__RecvFrom_locName_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TRXC__RecvFrom_locPort_xer_ = { {"locPort>\n", "locPort>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TRXC__RecvFrom_locPort_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TRXC__RecvFrom_locPort_descr_ = { "@TRXC_CodecPort.TRXC_RecvFrom.locPort", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TRXC__RecvFrom_locPort_xer_, &INTEGER_json_, &TRXC__RecvFrom_locPort_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TRXC__RecvFrom_msg_default_coding("TEXT"); // No XER for TRXC__RecvFrom const TTCN_Typedescriptor_t TRXC__RecvFrom_descr_ = { "@TRXC_CodecPort.TRXC_RecvFrom", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; const XERdescriptor_t TRXC__Send_connId_xer_ = { {"connId>\n", "connId>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_OERdescriptor_t TRXC__Send_connId_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t TRXC__Send_connId_descr_ = { "@TRXC_CodecPort.TRXC_Send.connId", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &TRXC__Send_connId_xer_, &INTEGER_json_, &TRXC__Send_connId_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TRXC__Send_msg_default_coding("TEXT"); // No XER for TRXC__Send const TTCN_Typedescriptor_t TRXC__Send_descr_ = { "@TRXC_CodecPort.TRXC_Send", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; TRXC__Types::TrxcMessage_template template_f__TRXC__transceive_tr_defval; const TRXC__Types::TrxcMessage_template& f__TRXC__transceive_tr_defval = template_f__TRXC__transceive_tr_defval; TTCN_Module module_object("TRXC_CodecPort", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL); const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_11, current_runtime_version.requires_minor_version_1, current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1); /* Member functions of C++ classes */ TRXC__RecvFrom::TRXC__RecvFrom() { } TRXC__RecvFrom::TRXC__RecvFrom(const INTEGER& par_connId, const CHARSTRING& par_remName, const INTEGER& par_remPort, const CHARSTRING& par_locName, const INTEGER& par_locPort, const TRXC__Types::TrxcMessage& par_msg) : field_connId(par_connId), field_remName(par_remName), field_remPort(par_remPort), field_locName(par_locName), field_locPort(par_locPort), field_msg(par_msg) { } TRXC__RecvFrom::TRXC__RecvFrom(const TRXC__RecvFrom& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @TRXC_CodecPort.TRXC_RecvFrom."); if (other_value.connId().is_bound()) field_connId = other_value.connId(); else field_connId.clean_up(); if (other_value.remName().is_bound()) field_remName = other_value.remName(); else field_remName.clean_up(); if (other_value.remPort().is_bound()) field_remPort = other_value.remPort(); else field_remPort.clean_up(); if (other_value.locName().is_bound()) field_locName = other_value.locName(); else field_locName.clean_up(); if (other_value.locPort().is_bound()) field_locPort = other_value.locPort(); else field_locPort.clean_up(); if (other_value.msg().is_bound()) field_msg = other_value.msg(); else field_msg.clean_up(); } void TRXC__RecvFrom::clean_up() { field_connId.clean_up(); field_remName.clean_up(); field_remPort.clean_up(); field_locName.clean_up(); field_locPort.clean_up(); field_msg.clean_up(); } const TTCN_Typedescriptor_t* TRXC__RecvFrom::get_descriptor() const { return &TRXC__RecvFrom_descr_; } TRXC__RecvFrom& TRXC__RecvFrom::operator=(const TRXC__RecvFrom& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @TRXC_CodecPort.TRXC_RecvFrom."); if (other_value.connId().is_bound()) field_connId = other_value.connId(); else field_connId.clean_up(); if (other_value.remName().is_bound()) field_remName = other_value.remName(); else field_remName.clean_up(); if (other_value.remPort().is_bound()) field_remPort = other_value.remPort(); else field_remPort.clean_up(); if (other_value.locName().is_bound()) field_locName = other_value.locName(); else field_locName.clean_up(); if (other_value.locPort().is_bound()) field_locPort = other_value.locPort(); else field_locPort.clean_up(); if (other_value.msg().is_bound()) field_msg = other_value.msg(); else field_msg.clean_up(); } return *this; } boolean TRXC__RecvFrom::operator==(const TRXC__RecvFrom& other_value) const { return field_connId==other_value.field_connId && field_remName==other_value.field_remName && field_remPort==other_value.field_remPort && field_locName==other_value.field_locName && field_locPort==other_value.field_locPort && field_msg==other_value.field_msg; } boolean TRXC__RecvFrom::is_bound() const { return (field_connId.is_bound()) || (field_remName.is_bound()) || (field_remPort.is_bound()) || (field_locName.is_bound()) || (field_locPort.is_bound()) || (field_msg.is_bound()); } boolean TRXC__RecvFrom::is_value() const { return field_connId.is_value() && field_remName.is_value() && field_remPort.is_value() && field_locName.is_value() && field_locPort.is_value() && field_msg.is_value(); } void TRXC__RecvFrom::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ connId := "); field_connId.log(); TTCN_Logger::log_event_str(", remName := "); field_remName.log(); TTCN_Logger::log_event_str(", remPort := "); field_remPort.log(); TTCN_Logger::log_event_str(", locName := "); field_locName.log(); TTCN_Logger::log_event_str(", locPort := "); field_locPort.log(); TTCN_Logger::log_event_str(", msg := "); field_msg.log(); TTCN_Logger::log_event_str(" }"); } void TRXC__RecvFrom::set_implicit_omit() { if (connId().is_bound()) connId().set_implicit_omit(); if (remName().is_bound()) remName().set_implicit_omit(); if (remPort().is_bound()) remPort().set_implicit_omit(); if (locName().is_bound()) locName().set_implicit_omit(); if (locPort().is_bound()) locPort().set_implicit_omit(); if (msg().is_bound()) msg().set_implicit_omit(); } void TRXC__RecvFrom::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 (60 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) connId().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remName().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) remPort().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) locName().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) locPort().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(5)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "connId")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { connId().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remName")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remName().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remPort")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remPort().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "locName")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { locName().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "locPort")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { locPort().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "msg")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { msg().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @TRXC_CodecPort.TRXC_RecvFrom: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@TRXC_CodecPort.TRXC_RecvFrom"); } } void TRXC__RecvFrom::encode_text(Text_Buf& text_buf) const { field_connId.encode_text(text_buf); field_remName.encode_text(text_buf); field_remPort.encode_text(text_buf); field_locName.encode_text(text_buf); field_locPort.encode_text(text_buf); field_msg.encode_text(text_buf); } void TRXC__RecvFrom::decode_text(Text_Buf& text_buf) { field_connId.decode_text(text_buf); field_remName.decode_text(text_buf); field_remPort.decode_text(text_buf); field_locName.decode_text(text_buf); field_locPort.decode_text(text_buf); field_msg.decode_text(text_buf); } struct TRXC__RecvFrom_template::single_value_struct { INTEGER_template field_connId; CHARSTRING_template field_remName; INTEGER_template field_remPort; CHARSTRING_template field_locName; INTEGER_template field_locPort; TRXC__Types::TrxcMessage_template field_msg; }; void TRXC__RecvFrom_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_connId = ANY_VALUE; single_value->field_remName = ANY_VALUE; single_value->field_remPort = ANY_VALUE; single_value->field_locName = ANY_VALUE; single_value->field_locPort = ANY_VALUE; single_value->field_msg = ANY_VALUE; } } } void TRXC__RecvFrom_template::copy_value(const TRXC__RecvFrom& other_value) { single_value = new single_value_struct; if (other_value.connId().is_bound()) { single_value->field_connId = other_value.connId(); } else { single_value->field_connId.clean_up(); } if (other_value.remName().is_bound()) { single_value->field_remName = other_value.remName(); } else { single_value->field_remName.clean_up(); } if (other_value.remPort().is_bound()) { single_value->field_remPort = other_value.remPort(); } else { single_value->field_remPort.clean_up(); } if (other_value.locName().is_bound()) { single_value->field_locName = other_value.locName(); } else { single_value->field_locName.clean_up(); } if (other_value.locPort().is_bound()) { single_value->field_locPort = other_value.locPort(); } else { single_value->field_locPort.clean_up(); } if (other_value.msg().is_bound()) { single_value->field_msg = other_value.msg(); } else { single_value->field_msg.clean_up(); } set_selection(SPECIFIC_VALUE); } void TRXC__RecvFrom_template::copy_template(const TRXC__RecvFrom_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.connId().get_selection()) { single_value->field_connId = other_value.connId(); } else { single_value->field_connId.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.remName().get_selection()) { single_value->field_remName = other_value.remName(); } else { single_value->field_remName.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.remPort().get_selection()) { single_value->field_remPort = other_value.remPort(); } else { single_value->field_remPort.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.locName().get_selection()) { single_value->field_locName = other_value.locName(); } else { single_value->field_locName.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.locPort().get_selection()) { single_value->field_locPort = other_value.locPort(); } else { single_value->field_locPort.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.msg().get_selection()) { single_value->field_msg = other_value.msg(); } else { single_value->field_msg.clean_up(); } case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = other_value.value_list.n_values; value_list.list_value = new TRXC__RecvFrom_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 TRXC__RecvFrom_template(*other_value.implication_.precondition); implication_.implied_template = new TRXC__RecvFrom_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 @TRXC_CodecPort.TRXC_RecvFrom."); break; } set_selection(other_value); } TRXC__RecvFrom_template::TRXC__RecvFrom_template() { } TRXC__RecvFrom_template::TRXC__RecvFrom_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TRXC__RecvFrom_template::TRXC__RecvFrom_template(const TRXC__RecvFrom& other_value) { copy_value(other_value); } TRXC__RecvFrom_template::TRXC__RecvFrom_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TRXC__RecvFrom&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @TRXC_CodecPort.TRXC_RecvFrom from an unbound optional field."); } } TRXC__RecvFrom_template::TRXC__RecvFrom_template(TRXC__RecvFrom_template* p_precondition, TRXC__RecvFrom_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TRXC__RecvFrom_template::TRXC__RecvFrom_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } TRXC__RecvFrom_template::TRXC__RecvFrom_template(const TRXC__RecvFrom_template& other_value) : Base_Template() { copy_template(other_value); } TRXC__RecvFrom_template::~TRXC__RecvFrom_template() { clean_up(); } TRXC__RecvFrom_template& TRXC__RecvFrom_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TRXC__RecvFrom_template& TRXC__RecvFrom_template::operator=(const TRXC__RecvFrom& other_value) { clean_up(); copy_value(other_value); return *this; } TRXC__RecvFrom_template& TRXC__RecvFrom_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TRXC__RecvFrom&)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 @TRXC_CodecPort.TRXC_RecvFrom."); } return *this; } TRXC__RecvFrom_template& TRXC__RecvFrom_template::operator=(const TRXC__RecvFrom_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TRXC__RecvFrom_template::match(const TRXC__RecvFrom& 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.connId().is_bound()) return FALSE; if(!single_value->field_connId.match(other_value.connId(), legacy))return FALSE; if(!other_value.remName().is_bound()) return FALSE; if(!single_value->field_remName.match(other_value.remName(), legacy))return FALSE; if(!other_value.remPort().is_bound()) return FALSE; if(!single_value->field_remPort.match(other_value.remPort(), legacy))return FALSE; if(!other_value.locName().is_bound()) return FALSE; if(!single_value->field_locName.match(other_value.locName(), legacy))return FALSE; if(!other_value.locPort().is_bound()) return FALSE; if(!single_value->field_locPort.match(other_value.locPort(), legacy))return FALSE; if(!other_value.msg().is_bound()) return FALSE; if(!single_value->field_msg.match(other_value.msg(), legacy))return FALSE; return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @TRXC_CodecPort.TRXC_RecvFrom."); } return FALSE; } boolean TRXC__RecvFrom_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_connId.is_bound() || single_value->field_remName.is_bound() || single_value->field_remPort.is_bound() || single_value->field_locName.is_bound() || single_value->field_locPort.is_bound() || single_value->field_msg.is_bound(); } boolean TRXC__RecvFrom_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_connId.is_value() && single_value->field_remName.is_value() && single_value->field_remPort.is_value() && single_value->field_locName.is_value() && single_value->field_locPort.is_value() && single_value->field_msg.is_value(); } void TRXC__RecvFrom_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; } TRXC__RecvFrom TRXC__RecvFrom_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 @TRXC_CodecPort.TRXC_RecvFrom."); TRXC__RecvFrom ret_val; if (single_value->field_connId.is_bound()) { ret_val.connId() = single_value->field_connId.valueof(); } if (single_value->field_remName.is_bound()) { ret_val.remName() = single_value->field_remName.valueof(); } if (single_value->field_remPort.is_bound()) { ret_val.remPort() = single_value->field_remPort.valueof(); } if (single_value->field_locName.is_bound()) { ret_val.locName() = single_value->field_locName.valueof(); } if (single_value->field_locPort.is_bound()) { ret_val.locPort() = single_value->field_locPort.valueof(); } if (single_value->field_msg.is_bound()) { ret_val.msg() = single_value->field_msg.valueof(); } return ret_val; } void TRXC__RecvFrom_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 @TRXC_CodecPort.TRXC_RecvFrom."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TRXC__RecvFrom_template[list_length]; } TRXC__RecvFrom_template& TRXC__RecvFrom_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 @TRXC_CodecPort.TRXC_RecvFrom."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @TRXC_CodecPort.TRXC_RecvFrom."); return value_list.list_value[list_index]; } INTEGER_template& TRXC__RecvFrom_template::connId() { set_specific(); return single_value->field_connId; } const INTEGER_template& TRXC__RecvFrom_template::connId() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field connId of a non-specific template of type @TRXC_CodecPort.TRXC_RecvFrom."); return single_value->field_connId; } CHARSTRING_template& TRXC__RecvFrom_template::remName() { set_specific(); return single_value->field_remName; } const CHARSTRING_template& TRXC__RecvFrom_template::remName() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field remName of a non-specific template of type @TRXC_CodecPort.TRXC_RecvFrom."); return single_value->field_remName; } INTEGER_template& TRXC__RecvFrom_template::remPort() { set_specific(); return single_value->field_remPort; } const INTEGER_template& TRXC__RecvFrom_template::remPort() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field remPort of a non-specific template of type @TRXC_CodecPort.TRXC_RecvFrom."); return single_value->field_remPort; } CHARSTRING_template& TRXC__RecvFrom_template::locName() { set_specific(); return single_value->field_locName; } const CHARSTRING_template& TRXC__RecvFrom_template::locName() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field locName of a non-specific template of type @TRXC_CodecPort.TRXC_RecvFrom."); return single_value->field_locName; } INTEGER_template& TRXC__RecvFrom_template::locPort() { set_specific(); return single_value->field_locPort; } const INTEGER_template& TRXC__RecvFrom_template::locPort() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field locPort of a non-specific template of type @TRXC_CodecPort.TRXC_RecvFrom."); return single_value->field_locPort; } TRXC__Types::TrxcMessage_template& TRXC__RecvFrom_template::msg() { set_specific(); return single_value->field_msg; } const TRXC__Types::TrxcMessage_template& TRXC__RecvFrom_template::msg() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field msg of a non-specific template of type @TRXC_CodecPort.TRXC_RecvFrom."); return single_value->field_msg; } int TRXC__RecvFrom_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 6; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom 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 @TRXC_CodecPort.TRXC_RecvFrom containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_RecvFrom containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @TRXC_CodecPort.TRXC_RecvFrom."); } return 0; } void TRXC__RecvFrom_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ connId := "); single_value->field_connId.log(); TTCN_Logger::log_event_str(", remName := "); single_value->field_remName.log(); TTCN_Logger::log_event_str(", remPort := "); single_value->field_remPort.log(); TTCN_Logger::log_event_str(", locName := "); single_value->field_locName.log(); TTCN_Logger::log_event_str(", locPort := "); single_value->field_locPort.log(); TTCN_Logger::log_event_str(", msg := "); single_value->field_msg.log(); TTCN_Logger::log_event_str(" }"); break; case COMPLEMENTED_LIST: TTCN_Logger::log_event_str("complement"); case CONJUNCTION_MATCH: if (template_selection == CONJUNCTION_MATCH) { TTCN_Logger::log_event_str("conjunct"); } case VALUE_LIST: TTCN_Logger::log_char('('); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) { if (list_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[list_count].log(); } TTCN_Logger::log_char(')'); break; case IMPLICATION_MATCH: implication_.precondition->log(); TTCN_Logger::log_event_str(" implies "); implication_.implied_template->log(); break; case DYNAMIC_MATCH: TTCN_Logger::log_event_str("@dynamic template"); break; default: log_generic(); } log_ifpresent(); } void TRXC__RecvFrom_template::log_match(const TRXC__RecvFrom& 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_connId.match(match_value.connId(), legacy)){ TTCN_Logger::log_logmatch_info(".connId"); single_value->field_connId.log_match(match_value.connId(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_remName.match(match_value.remName(), legacy)){ TTCN_Logger::log_logmatch_info(".remName"); single_value->field_remName.log_match(match_value.remName(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_remPort.match(match_value.remPort(), legacy)){ TTCN_Logger::log_logmatch_info(".remPort"); single_value->field_remPort.log_match(match_value.remPort(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_locName.match(match_value.locName(), legacy)){ TTCN_Logger::log_logmatch_info(".locName"); single_value->field_locName.log_match(match_value.locName(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_locPort.match(match_value.locPort(), legacy)){ TTCN_Logger::log_logmatch_info(".locPort"); single_value->field_locPort.log_match(match_value.locPort(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_msg.match(match_value.msg(), legacy)){ TTCN_Logger::log_logmatch_info(".msg"); single_value->field_msg.log_match(match_value.msg(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ connId := "); single_value->field_connId.log_match(match_value.connId(), legacy); TTCN_Logger::log_event_str(", remName := "); single_value->field_remName.log_match(match_value.remName(), legacy); TTCN_Logger::log_event_str(", remPort := "); single_value->field_remPort.log_match(match_value.remPort(), legacy); TTCN_Logger::log_event_str(", locName := "); single_value->field_locName.log_match(match_value.locName(), legacy); TTCN_Logger::log_event_str(", locPort := "); single_value->field_locPort.log_match(match_value.locPort(), legacy); TTCN_Logger::log_event_str(", msg := "); single_value->field_msg.log_match(match_value.msg(), legacy); TTCN_Logger::log_event_str(" }"); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void TRXC__RecvFrom_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (connId().is_bound()) connId().set_implicit_omit(); if (remName().is_bound()) remName().set_implicit_omit(); if (remPort().is_bound()) remPort().set_implicit_omit(); if (locName().is_bound()) locName().set_implicit_omit(); if (locPort().is_bound()) locPort().set_implicit_omit(); if (msg().is_bound()) msg().set_implicit_omit(); } void TRXC__RecvFrom_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_connId.encode_text(text_buf); single_value->field_remName.encode_text(text_buf); single_value->field_remPort.encode_text(text_buf); single_value->field_locName.encode_text(text_buf); single_value->field_locPort.encode_text(text_buf); single_value->field_msg.encode_text(text_buf); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: text_buf.push_int(value_list.n_values); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) value_list.list_value[list_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @TRXC_CodecPort.TRXC_RecvFrom."); } } void TRXC__RecvFrom_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_connId.decode_text(text_buf); single_value->field_remName.decode_text(text_buf); single_value->field_remPort.decode_text(text_buf); single_value->field_locName.decode_text(text_buf); single_value->field_locPort.decode_text(text_buf); single_value->field_msg.decode_text(text_buf); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new TRXC__RecvFrom_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 @TRXC_CodecPort.TRXC_RecvFrom."); } } void TRXC__RecvFrom_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: { TRXC__RecvFrom_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) connId().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) remName().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) remPort().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) locName().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) locPort().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(5)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "connId")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { connId().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remName")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remName().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "remPort")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { remPort().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "locName")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { locName().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "locPort")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { locPort().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "msg")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { msg().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @TRXC_CodecPort.TRXC_RecvFrom: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TRXC__RecvFrom_template* precondition = new TRXC__RecvFrom_template; precondition->set_param(*param.get_elem(0)); TRXC__RecvFrom_template* implied_template = new TRXC__RecvFrom_template; implied_template->set_param(*param.get_elem(1)); *this = TRXC__RecvFrom_template(precondition, implied_template); } break; default: param.type_error("record template", "@TRXC_CodecPort.TRXC_RecvFrom"); } is_ifpresent = param.get_ifpresent(); } void TRXC__RecvFrom_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_connId.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_RecvFrom"); single_value->field_remName.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_RecvFrom"); single_value->field_remPort.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_RecvFrom"); single_value->field_locName.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_RecvFrom"); single_value->field_locPort.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_RecvFrom"); single_value->field_msg.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_RecvFrom"); 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 : "@TRXC_CodecPort.TRXC_RecvFrom"); } boolean TRXC__RecvFrom_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TRXC__RecvFrom_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) connId().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "connId")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { connId().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "msg")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { msg().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @TRXC_CodecPort.TRXC_Send: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@TRXC_CodecPort.TRXC_Send"); } } void TRXC__Send::encode_text(Text_Buf& text_buf) const { field_connId.encode_text(text_buf); field_msg.encode_text(text_buf); } void TRXC__Send::decode_text(Text_Buf& text_buf) { field_connId.decode_text(text_buf); field_msg.decode_text(text_buf); } struct TRXC__Send_template::single_value_struct { INTEGER_template field_connId; TRXC__Types::TrxcMessage_template field_msg; }; void TRXC__Send_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_connId = ANY_VALUE; single_value->field_msg = ANY_VALUE; } } } void TRXC__Send_template::copy_value(const TRXC__Send& other_value) { single_value = new single_value_struct; if (other_value.connId().is_bound()) { single_value->field_connId = other_value.connId(); } else { single_value->field_connId.clean_up(); } if (other_value.msg().is_bound()) { single_value->field_msg = other_value.msg(); } else { single_value->field_msg.clean_up(); } set_selection(SPECIFIC_VALUE); } void TRXC__Send_template::copy_template(const TRXC__Send_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.connId().get_selection()) { single_value->field_connId = other_value.connId(); } else { single_value->field_connId.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.msg().get_selection()) { single_value->field_msg = other_value.msg(); } else { single_value->field_msg.clean_up(); } case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = other_value.value_list.n_values; value_list.list_value = new TRXC__Send_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 TRXC__Send_template(*other_value.implication_.precondition); implication_.implied_template = new TRXC__Send_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 @TRXC_CodecPort.TRXC_Send."); break; } set_selection(other_value); } TRXC__Send_template::TRXC__Send_template() { } TRXC__Send_template::TRXC__Send_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TRXC__Send_template::TRXC__Send_template(const TRXC__Send& other_value) { copy_value(other_value); } TRXC__Send_template::TRXC__Send_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TRXC__Send&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @TRXC_CodecPort.TRXC_Send from an unbound optional field."); } } TRXC__Send_template::TRXC__Send_template(TRXC__Send_template* p_precondition, TRXC__Send_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TRXC__Send_template::TRXC__Send_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } TRXC__Send_template::TRXC__Send_template(const TRXC__Send_template& other_value) : Base_Template() { copy_template(other_value); } TRXC__Send_template::~TRXC__Send_template() { clean_up(); } TRXC__Send_template& TRXC__Send_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TRXC__Send_template& TRXC__Send_template::operator=(const TRXC__Send& other_value) { clean_up(); copy_value(other_value); return *this; } TRXC__Send_template& TRXC__Send_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TRXC__Send&)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 @TRXC_CodecPort.TRXC_Send."); } return *this; } TRXC__Send_template& TRXC__Send_template::operator=(const TRXC__Send_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TRXC__Send_template::match(const TRXC__Send& 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.connId().is_bound()) return FALSE; if(!single_value->field_connId.match(other_value.connId(), legacy))return FALSE; if(!other_value.msg().is_bound()) return FALSE; if(!single_value->field_msg.match(other_value.msg(), legacy))return FALSE; return TRUE; case VALUE_LIST: case COMPLEMENTED_LIST: for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST; return template_selection == COMPLEMENTED_LIST; case CONJUNCTION_MATCH: for (unsigned int i = 0; i < value_list.n_values; i++) { if (!value_list.list_value[i].match(other_value)) { return FALSE; } } return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value); case DYNAMIC_MATCH: return dyn_match->ptr->match(other_value); default: TTCN_error("Matching an uninitialized/unsupported template of type @TRXC_CodecPort.TRXC_Send."); } return FALSE; } boolean TRXC__Send_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_connId.is_bound() || single_value->field_msg.is_bound(); } boolean TRXC__Send_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_connId.is_value() && single_value->field_msg.is_value(); } void TRXC__Send_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; } TRXC__Send TRXC__Send_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 @TRXC_CodecPort.TRXC_Send."); TRXC__Send ret_val; if (single_value->field_connId.is_bound()) { ret_val.connId() = single_value->field_connId.valueof(); } if (single_value->field_msg.is_bound()) { ret_val.msg() = single_value->field_msg.valueof(); } return ret_val; } void TRXC__Send_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 @TRXC_CodecPort.TRXC_Send."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TRXC__Send_template[list_length]; } TRXC__Send_template& TRXC__Send_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 @TRXC_CodecPort.TRXC_Send."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @TRXC_CodecPort.TRXC_Send."); return value_list.list_value[list_index]; } INTEGER_template& TRXC__Send_template::connId() { set_specific(); return single_value->field_connId; } const INTEGER_template& TRXC__Send_template::connId() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field connId of a non-specific template of type @TRXC_CodecPort.TRXC_Send."); return single_value->field_connId; } TRXC__Types::TrxcMessage_template& TRXC__Send_template::msg() { set_specific(); return single_value->field_msg; } const TRXC__Types::TrxcMessage_template& TRXC__Send_template::msg() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field msg of a non-specific template of type @TRXC_CodecPort.TRXC_Send."); return single_value->field_msg; } int TRXC__Send_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_Send 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 @TRXC_CodecPort.TRXC_Send 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 @TRXC_CodecPort.TRXC_Send containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_Send containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_Send containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_Send containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_Send containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_Send containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @TRXC_CodecPort.TRXC_Send containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @TRXC_CodecPort.TRXC_Send."); } return 0; } void TRXC__Send_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ connId := "); single_value->field_connId.log(); TTCN_Logger::log_event_str(", msg := "); single_value->field_msg.log(); TTCN_Logger::log_event_str(" }"); break; case COMPLEMENTED_LIST: TTCN_Logger::log_event_str("complement"); case CONJUNCTION_MATCH: if (template_selection == CONJUNCTION_MATCH) { TTCN_Logger::log_event_str("conjunct"); } case VALUE_LIST: TTCN_Logger::log_char('('); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) { if (list_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[list_count].log(); } TTCN_Logger::log_char(')'); break; case IMPLICATION_MATCH: implication_.precondition->log(); TTCN_Logger::log_event_str(" implies "); implication_.implied_template->log(); break; case DYNAMIC_MATCH: TTCN_Logger::log_event_str("@dynamic template"); break; default: log_generic(); } log_ifpresent(); } void TRXC__Send_template::log_match(const TRXC__Send& 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_connId.match(match_value.connId(), legacy)){ TTCN_Logger::log_logmatch_info(".connId"); single_value->field_connId.log_match(match_value.connId(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_msg.match(match_value.msg(), legacy)){ TTCN_Logger::log_logmatch_info(".msg"); single_value->field_msg.log_match(match_value.msg(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } }else { TTCN_Logger::print_logmatch_buffer(); match_value.log(); TTCN_Logger::log_event_str(" with "); log(); TTCN_Logger::log_event_str(" unmatched"); } } return; } if (template_selection == SPECIFIC_VALUE) { TTCN_Logger::log_event_str("{ connId := "); single_value->field_connId.log_match(match_value.connId(), legacy); TTCN_Logger::log_event_str(", msg := "); single_value->field_msg.log_match(match_value.msg(), legacy); TTCN_Logger::log_event_str(" }"); } else { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } } void TRXC__Send_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (connId().is_bound()) connId().set_implicit_omit(); if (msg().is_bound()) msg().set_implicit_omit(); } void TRXC__Send_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_connId.encode_text(text_buf); single_value->field_msg.encode_text(text_buf); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: text_buf.push_int(value_list.n_values); for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) value_list.list_value[list_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @TRXC_CodecPort.TRXC_Send."); } } void TRXC__Send_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_connId.decode_text(text_buf); single_value->field_msg.decode_text(text_buf); case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: break; case VALUE_LIST: case COMPLEMENTED_LIST: value_list.n_values = text_buf.pull_int().get_val(); value_list.list_value = new TRXC__Send_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 @TRXC_CodecPort.TRXC_Send."); } } void TRXC__Send_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: { TRXC__Send_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) connId().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msg().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "connId")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { connId().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "msg")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { msg().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @TRXC_CodecPort.TRXC_Send: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TRXC__Send_template* precondition = new TRXC__Send_template; precondition->set_param(*param.get_elem(0)); TRXC__Send_template* implied_template = new TRXC__Send_template; implied_template->set_param(*param.get_elem(1)); *this = TRXC__Send_template(precondition, implied_template); } break; default: param.type_error("record template", "@TRXC_CodecPort.TRXC_Send"); } is_ifpresent = param.get_ifpresent(); } void TRXC__Send_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_connId.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_Send"); single_value->field_msg.check_restriction(t_res, t_name ? t_name : "@TRXC_CodecPort.TRXC_Send"); 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 : "@TRXC_CodecPort.TRXC_Send"); } boolean TRXC__Send_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TRXC__Send_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_idxitem_selection) { case MESSAGE_0: delete (my_head)->message_0; break; case MESSAGE_1: delete (my_head)->message_1; break; case MESSAGE_2: delete (my_head)->message_2; 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 TRXC__CODEC__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } TRXC__CODEC__PT::TRXC__CODEC__PT(const char *par_port_name) : IPL4asp__PortType::IPL4asp__PT_PROVIDER(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } TRXC__CODEC__PT::~TRXC__CODEC__PT() { clear_queue(); } void TRXC__CODEC__PT::send(const TRXC__Send& 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(" @TRXC_CodecPort.TRXC_Send : "), send_par.log(), TTCN_Logger::end_event_log2str())); } IPL4asp__Types::ASP__Send mapped_par; TRXC__to__IPL4__Send(send_par, mapped_par); if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALSEND)) { TTCN_Logger::log_dualport_map(0, "@IPL4asp_Types.ASP_Send", (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALSEND, TRUE), mapped_par.log(), TTCN_Logger::end_event_log2str()), 0); } if (destination_component == SYSTEM_COMPREF) outgoing_send(mapped_par); else { Text_Buf text_buf; prepare_message(text_buf, "@IPL4asp_Types.ASP_Send"); mapped_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void TRXC__CODEC__PT::send(const TRXC__Send& 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 TRXC__CODEC__PT::send(const TRXC__Send& 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, "@TRXC_CodecPort.TRXC_Send"); 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(" @TRXC_CodecPort.TRXC_Send : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void TRXC__CODEC__PT::send(const TRXC__Send_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const TRXC__Send& send_par_value = TRXC__Send(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void TRXC__CODEC__PT::send(const TRXC__Send_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const TRXC__Send& send_par_value = TRXC__Send(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void TRXC__CODEC__PT::send(const TRXC__Send_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const TRXC__Send& send_par_value = TRXC__Send(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } PORT* TRXC__CODEC__PT::get_provider_port() { (void)get_default_destination(); return this; } alt_status TRXC__CODEC__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(": @TRXC_CodecPort.TRXC_RecvFrom: "), 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: 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(": @Socket_API_Definitions.PortEvent: "), my_head->message_2->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 TRXC__CODEC__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(": @TRXC_CodecPort.TRXC_RecvFrom: "), 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: 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(": @Socket_API_Definitions.PortEvent: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } return ALT_YES; } } alt_status TRXC__CODEC__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(": @TRXC_CodecPort.TRXC_RecvFrom: "), 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease: "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_2: 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(": @Socket_API_Definitions.PortEvent: "), my_head->message_2->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 TRXC__CODEC__PT::receive(const TRXC__RecvFrom_template& value_template, TRXC__RecvFrom *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 @TRXC_CodecPort.TRXC_RecvFrom.", 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(": @TRXC_CodecPort.TRXC_RecvFrom : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status TRXC__CODEC__PT::check_receive(const TRXC__RecvFrom_template& value_template, TRXC__RecvFrom *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 @TRXC_CodecPort.TRXC_RecvFrom.", 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(": @TRXC_CodecPort.TRXC_RecvFrom : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status TRXC__CODEC__PT::trigger(const TRXC__RecvFrom_template& value_template, TRXC__RecvFrom *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 @TRXC_CodecPort.TRXC_RecvFrom.", 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(": @TRXC_CodecPort.TRXC_RecvFrom : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status TRXC__CODEC__PT::receive(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *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 @IPL4asp_Types.ASP_ConnId_ReadyToRelease.", 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status TRXC__CODEC__PT::check_receive(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *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 @IPL4asp_Types.ASP_ConnId_ReadyToRelease.", 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status TRXC__CODEC__PT::trigger(const IPL4asp__Types::ASP__ConnId__ReadyToRelease_template& value_template, IPL4asp__Types::ASP__ConnId__ReadyToRelease *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 @IPL4asp_Types.ASP_ConnId_ReadyToRelease.", 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(": @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status TRXC__CODEC__PT::receive(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *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_2) { 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 @Socket_API_Definitions.PortEvent.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_2)) { 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_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } 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_2), 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(": @Socket_API_Definitions.PortEvent : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status TRXC__CODEC__PT::check_receive(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *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_2) { 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 @Socket_API_Definitions.PortEvent.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_2)) { 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_2), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } 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_2), 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(": @Socket_API_Definitions.PortEvent : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status TRXC__CODEC__PT::trigger(const Socket__API__Definitions::PortEvent_template& value_template, Socket__API__Definitions::PortEvent *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_2) { 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 @Socket_API_Definitions.PortEvent.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_2)) { 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_2), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_2; } 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_2), 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(": @Socket_API_Definitions.PortEvent : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void TRXC__CODEC__PT::incoming_message(const IPL4asp__Types::ASP__RecvFrom& 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); } } 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+1, CHARSTRING(0, NULL), (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_MQUEUE, TRUE), TTCN_Logger::log_event_str(" @IPL4asp_Types.ASP_RecvFrom : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } TRXC__RecvFrom *mapped_par = new TRXC__RecvFrom; try { IPL4__to__TRXC__RecvFrom(incoming_par, *mapped_par); } catch (...) { delete mapped_par; throw; } msg_tail_count++; if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALRECV)) { TTCN_Logger::log_dualport_map(1, "@TRXC_CodecPort.TRXC_RecvFrom", (TTCN_Logger::begin_event(TTCN_Logger::PORTEVENT_DUALRECV, TRUE), mapped_par->log(), TTCN_Logger::end_event_log2str()), msg_tail_count); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_0; new_item->message_0 = mapped_par; new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void TRXC__CODEC__PT::incoming_message(const Socket__API__Definitions::PortEvent& 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(" @Socket_API_Definitions.PortEvent : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_2; new_item->message_2 = new Socket__API__Definitions::PortEvent(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void TRXC__CODEC__PT::incoming_message(const IPL4asp__Types::ASP__ConnId__ReadyToRelease& 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(" @IPL4asp_Types.ASP_ConnId_ReadyToRelease : "), 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 IPL4asp__Types::ASP__ConnId__ReadyToRelease(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void TRXC__CODEC__PT::incoming_message(const IPL4asp__Types::ASP__RecvFrom& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void TRXC__CODEC__PT::incoming_message(const Socket__API__Definitions::PortEvent& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void TRXC__CODEC__PT::incoming_message(const IPL4asp__Types::ASP__ConnId__ReadyToRelease& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } boolean TRXC__CODEC__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@IPL4asp_Types.ASP_RecvFrom")) { IPL4asp__Types::ASP__RecvFrom incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@Socket_API_Definitions.PortEvent")) { Socket__API__Definitions::PortEvent incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@IPL4asp_Types.ASP_ConnId_ReadyToRelease")) { IPL4asp__Types::ASP__ConnId__ReadyToRelease incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else return FALSE; } /* Bodies of functions, altsteps and testcases */ TRXC__RecvFrom_template tr__TRXC__RecvFrom(const INTEGER_template& cid, const TRXC__Types::TrxcMessage_template& msg) { TTCN_Location current_location("TRXC_CodecPort.ttcn", 16, TTCN_Location::LOCATION_TEMPLATE, "tr_TRXC_RecvFrom"); TRXC__RecvFrom_template ret_val; ret_val.connId() = cid; ret_val.remName() = ANY_VALUE; ret_val.remPort() = ANY_VALUE; ret_val.locName() = ANY_VALUE; ret_val.locPort() = ANY_VALUE; ret_val.msg() = msg; return ret_val; } void IPL4__to__TRXC__RecvFrom(const IPL4asp__Types::ASP__RecvFrom& pin, TRXC__RecvFrom& pout) { TTCN_Location current_location("TRXC_CodecPort.ttcn", 30, TTCN_Location::LOCATION_FUNCTION, "IPL4_to_TRXC_RecvFrom"); current_location.update_lineno(31); /* TRXC_CodecPort.ttcn, line 31 */ pout.connId() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(pin).connId(); current_location.update_lineno(32); /* TRXC_CodecPort.ttcn, line 32 */ pout.remName() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(pin).remName(); current_location.update_lineno(33); /* TRXC_CodecPort.ttcn, line 33 */ pout.remPort() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(pin).remPort(); current_location.update_lineno(34); /* TRXC_CodecPort.ttcn, line 34 */ pout.locName() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(pin).locName(); current_location.update_lineno(35); /* TRXC_CodecPort.ttcn, line 35 */ pout.locPort() = const_cast< const IPL4asp__Types::ASP__RecvFrom&>(pin).locPort(); current_location.update_lineno(36); /* TRXC_CodecPort.ttcn, line 36 */ pout.msg() = TRXC__Types::dec__TrxcMessage(oct2char(const_cast< const IPL4asp__Types::ASP__RecvFrom&>(pin).msg())); } void TRXC__to__IPL4__Send(const TRXC__Send& pin, IPL4asp__Types::ASP__Send& pout) { TTCN_Location current_location("TRXC_CodecPort.ttcn", 39, TTCN_Location::LOCATION_FUNCTION, "TRXC_to_IPL4_Send"); current_location.update_lineno(40); /* TRXC_CodecPort.ttcn, line 40 */ pout.connId() = const_cast< const TRXC__Send&>(pin).connId(); current_location.update_lineno(41); /* TRXC_CodecPort.ttcn, line 41 */ { Socket__API__Definitions::ProtoTuple& tmp_8 = pout.proto(); /* 7388 */ tmp_8.udp() = NULL_VALUE; } current_location.update_lineno(42); /* TRXC_CodecPort.ttcn, line 42 */ pout.msg() = char2oct(TRXC__Types::enc__TrxcMessage(const_cast< const TRXC__Send&>(pin).msg())); } TRXC__Send_template ts__TRXC__Send(const INTEGER& cid, const TRXC__Types::TrxcMessage_template& msg) { TTCN_Location current_location("TRXC_CodecPort.ttcn", 57, TTCN_Location::LOCATION_TEMPLATE, "ts_TRXC_Send"); TRXC__Send_template ret_val; ret_val.connId() = cid; ret_val.msg() = msg; return ret_val; } TRXC__Types::TrxcMessage f__TRXC__transceive(TRXC__CODEC__PT& pt, const INTEGER& conn__id, const TRXC__Types::TrxcMessage_template& tx, const TRXC__Types::TrxcMessage_template& tr) { TRXC__Types::TrxcMessage_template tr_shadow(tr); TTCN_Location current_location("TRXC_CodecPort.ttcn", 62, TTCN_Location::LOCATION_FUNCTION, "f_TRXC_transceive"); current_location.update_lineno(65); /* TRXC_CodecPort.ttcn, line 65 */ TRXC__RecvFrom rf; current_location.update_lineno(66); /* TRXC_CodecPort.ttcn, line 66 */ TIMER T("T", 3.0); current_location.update_lineno(68); /* TRXC_CodecPort.ttcn, line 68 */ if (tr_shadow.get_istemplate_kind((const char*)cs_0)) { current_location.update_lineno(69); /* TRXC_CodecPort.ttcn, line 69 */ { TRXC__Types::TrxcResponse_template& tmp_11 = tr_shadow.rsp(); tmp_11.verb() = const_cast< const TRXC__Types::TrxcMessage_template&>(tx).cmd().verb(); tmp_11.status() = ANY_VALUE; tmp_11.params() = ANY_OR_OMIT; } } current_location.update_lineno(77); /* TRXC_CodecPort.ttcn, line 77 */ pt.send(ts__TRXC__Send(conn__id, tx), FALSE, NULL); current_location.update_lineno(78); /* TRXC_CodecPort.ttcn, line 78 */ T.start(); current_location.update_lineno(79); /* TRXC_CodecPort.ttcn, line 79 */ { tmp_12: alt_status tmp_12_alt_flag_0 = ALT_MAYBE; alt_status tmp_12_alt_flag_1 = ALT_MAYBE; alt_status tmp_12_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_12_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(80); /* TRXC_CodecPort.ttcn, line 80 */ tmp_12_alt_flag_0 = pt.receive(tr__TRXC__RecvFrom(INTEGER_template(conn__id), tr_shadow), &(rf), any_compref, NULL, NULL, NULL); if (tmp_12_alt_flag_0 == ALT_YES) { current_location.update_lineno(81); /* TRXC_CodecPort.ttcn, line 81 */ return const_cast< const TRXC__RecvFrom&>(rf).msg(); } } if (tmp_12_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(83); /* TRXC_CodecPort.ttcn, line 83 */ tmp_12_alt_flag_1 = T.timeout(NULL); if (tmp_12_alt_flag_1 == ALT_YES) { current_location.update_lineno(84); /* TRXC_CodecPort.ttcn, line 84 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for "),tr_shadow.log(),TTCN_Logger::log_event_str(" on "),pt.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(85); /* TRXC_CodecPort.ttcn, line 85 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_12_default_flag == ALT_MAYBE) { tmp_12_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_12_default_flag == ALT_YES || tmp_12_default_flag == ALT_BREAK) break; else if (tmp_12_default_flag == ALT_REPEAT) goto tmp_12; } current_location.update_lineno(79); /* TRXC_CodecPort.ttcn, line 79 */ if (tmp_12_alt_flag_0 == ALT_NO && tmp_12_alt_flag_1 == ALT_NO && tmp_12_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file TRXC_CodecPort.ttcn between lines 79 and 87."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(88); /* TRXC_CodecPort.ttcn, line 88 */ return const_cast< const TRXC__RecvFrom&>(rf).msg(); } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("TRXC_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "TRXC_CodecPort"); IPL4asp__PortType::module_object.pre_init_module(); TRXC__Types::module_object.pre_init_module(); module_object.add_function("IPL4_to_TRXC_RecvFrom", (genericfunc_t)&IPL4__to__TRXC__RecvFrom, NULL); module_object.add_function("TRXC_to_IPL4_Send", (genericfunc_t)&TRXC__to__IPL4__Send, NULL); module_object.add_function("f_TRXC_transceive", (genericfunc_t)&f__TRXC__transceive, NULL); } void post_init_module() { TTCN_Location current_location("TRXC_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "TRXC_CodecPort"); IPL4asp__PortType::module_object.post_init_module(); TRXC__Types::module_object.post_init_module(); current_location.update_lineno(64); /* TRXC_CodecPort.ttcn, line 64 */ template_f__TRXC__transceive_tr_defval = ANY_VALUE; } } /* end of namespace */