// 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 "HNBLLIF_CodecPort.hh" namespace HNBLLIF__CodecPort { /* Literal string constants */ const unsigned char module_checksum[] = { 0xd6, 0xd0, 0x24, 0x8e, 0xc8, 0x19, 0x0b, 0xc4, 0xda, 0x1a, 0xb7, 0xd6, 0x98, 0x65, 0xed, 0x0b }; /* Global variable definitions */ UNIVERSAL_CHARSTRING HNBLLIF__send__data_data_default_coding("RAW"); const XERdescriptor_t HNBLLIF__send__data_id_xer_ = { {"id>\n", "id>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE }; const TTCN_Typedescriptor_t HNBLLIF__send__data_id_descr_ = { "@HNBLLIF_CodecPort.HNBLLIF_send_data.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &HNBLLIF__send__data_id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for HNBLLIF__send__data const TTCN_Typedescriptor_t HNBLLIF__send__data_descr_ = { "@HNBLLIF_CodecPort.HNBLLIF_send_data", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; TTCN_Module module_object("HNBLLIF_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 */ HNBLLIF__send__data::HNBLLIF__send__data() { } HNBLLIF__send__data::HNBLLIF__send__data(const HNBLLIF__Types::HNBLLIF__Message& par_data, const INTEGER& par_id) : field_data(par_data), field_id(par_id) { } HNBLLIF__send__data::HNBLLIF__send__data(const HNBLLIF__send__data& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBLLIF_CodecPort.HNBLLIF_send_data."); if (other_value.data().is_bound()) field_data = other_value.data(); else field_data.clean_up(); if (other_value.id().is_bound()) field_id = other_value.id(); else field_id.clean_up(); } void HNBLLIF__send__data::clean_up() { field_data.clean_up(); field_id.clean_up(); } const TTCN_Typedescriptor_t* HNBLLIF__send__data::get_descriptor() const { return &HNBLLIF__send__data_descr_; } HNBLLIF__send__data& HNBLLIF__send__data::operator=(const HNBLLIF__send__data& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBLLIF_CodecPort.HNBLLIF_send_data."); if (other_value.data().is_bound()) field_data = other_value.data(); else field_data.clean_up(); if (other_value.id().is_bound()) field_id = other_value.id(); else field_id.clean_up(); } return *this; } boolean HNBLLIF__send__data::operator==(const HNBLLIF__send__data& other_value) const { return field_data==other_value.field_data && field_id==other_value.field_id; } boolean HNBLLIF__send__data::is_bound() const { return (field_data.is_bound()) || (field_id.is_bound()); } boolean HNBLLIF__send__data::is_value() const { return field_data.is_value() && field_id.is_value(); } void HNBLLIF__send__data::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ data := "); field_data.log(); TTCN_Logger::log_event_str(", id := "); field_id.log(); TTCN_Logger::log_event_str(" }"); } void HNBLLIF__send__data::set_implicit_omit() { if (data().is_bound()) data().set_implicit_omit(); if (id().is_bound()) id().set_implicit_omit(); } void HNBLLIF__send__data::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) data().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) id().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(), "data")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { data().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBLLIF_CodecPort.HNBLLIF_send_data: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBLLIF_CodecPort.HNBLLIF_send_data"); } } void HNBLLIF__send__data::encode_text(Text_Buf& text_buf) const { field_data.encode_text(text_buf); field_id.encode_text(text_buf); } void HNBLLIF__send__data::decode_text(Text_Buf& text_buf) { field_data.decode_text(text_buf); field_id.decode_text(text_buf); } struct HNBLLIF__send__data_template::single_value_struct { HNBLLIF__Types::HNBLLIF__Message_template field_data; INTEGER_template field_id; }; void HNBLLIF__send__data_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_data = ANY_VALUE; single_value->field_id = ANY_VALUE; } } } void HNBLLIF__send__data_template::copy_value(const HNBLLIF__send__data& other_value) { single_value = new single_value_struct; if (other_value.data().is_bound()) { single_value->field_data = other_value.data(); } else { single_value->field_data.clean_up(); } if (other_value.id().is_bound()) { single_value->field_id = other_value.id(); } else { single_value->field_id.clean_up(); } set_selection(SPECIFIC_VALUE); } void HNBLLIF__send__data_template::copy_template(const HNBLLIF__send__data_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.data().get_selection()) { single_value->field_data = other_value.data(); } else { single_value->field_data.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.id().get_selection()) { single_value->field_id = other_value.id(); } else { single_value->field_id.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 HNBLLIF__send__data_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 HNBLLIF__send__data_template(*other_value.implication_.precondition); implication_.implied_template = new HNBLLIF__send__data_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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); break; } set_selection(other_value); } HNBLLIF__send__data_template::HNBLLIF__send__data_template() { } HNBLLIF__send__data_template::HNBLLIF__send__data_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNBLLIF__send__data_template::HNBLLIF__send__data_template(const HNBLLIF__send__data& other_value) { copy_value(other_value); } HNBLLIF__send__data_template::HNBLLIF__send__data_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBLLIF__send__data&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data from an unbound optional field."); } } HNBLLIF__send__data_template::HNBLLIF__send__data_template(HNBLLIF__send__data_template* p_precondition, HNBLLIF__send__data_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNBLLIF__send__data_template::HNBLLIF__send__data_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; } HNBLLIF__send__data_template::HNBLLIF__send__data_template(const HNBLLIF__send__data_template& other_value) : Base_Template() { copy_template(other_value); } HNBLLIF__send__data_template::~HNBLLIF__send__data_template() { clean_up(); } HNBLLIF__send__data_template& HNBLLIF__send__data_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNBLLIF__send__data_template& HNBLLIF__send__data_template::operator=(const HNBLLIF__send__data& other_value) { clean_up(); copy_value(other_value); return *this; } HNBLLIF__send__data_template& HNBLLIF__send__data_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBLLIF__send__data&)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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); } return *this; } HNBLLIF__send__data_template& HNBLLIF__send__data_template::operator=(const HNBLLIF__send__data_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNBLLIF__send__data_template::match(const HNBLLIF__send__data& 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.data().is_bound()) return FALSE; if(!single_value->field_data.match(other_value.data(), legacy))return FALSE; if(!other_value.id().is_bound()) return FALSE; if(!single_value->field_id.match(other_value.id(), 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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); } return FALSE; } boolean HNBLLIF__send__data_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_data.is_bound() || single_value->field_id.is_bound(); } boolean HNBLLIF__send__data_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_data.is_value() && single_value->field_id.is_value(); } void HNBLLIF__send__data_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; } HNBLLIF__send__data HNBLLIF__send__data_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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); HNBLLIF__send__data ret_val; if (single_value->field_data.is_bound()) { ret_val.data() = single_value->field_data.valueof(); } if (single_value->field_id.is_bound()) { ret_val.id() = single_value->field_id.valueof(); } return ret_val; } void HNBLLIF__send__data_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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNBLLIF__send__data_template[list_length]; } HNBLLIF__send__data_template& HNBLLIF__send__data_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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBLLIF_CodecPort.HNBLLIF_send_data."); return value_list.list_value[list_index]; } HNBLLIF__Types::HNBLLIF__Message_template& HNBLLIF__send__data_template::data() { set_specific(); return single_value->field_data; } const HNBLLIF__Types::HNBLLIF__Message_template& HNBLLIF__send__data_template::data() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field data of a non-specific template of type @HNBLLIF_CodecPort.HNBLLIF_send_data."); return single_value->field_data; } INTEGER_template& HNBLLIF__send__data_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& HNBLLIF__send__data_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBLLIF_CodecPort.HNBLLIF_send_data."); return single_value->field_id; } int HNBLLIF__send__data_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data 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 @HNBLLIF_CodecPort.HNBLLIF_send_data 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 @HNBLLIF_CodecPort.HNBLLIF_send_data containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBLLIF_CodecPort.HNBLLIF_send_data containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBLLIF_CodecPort.HNBLLIF_send_data."); } return 0; } void HNBLLIF__send__data_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ data := "); single_value->field_data.log(); TTCN_Logger::log_event_str(", id := "); single_value->field_id.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 HNBLLIF__send__data_template::log_match(const HNBLLIF__send__data& 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_data.match(match_value.data(), legacy)){ TTCN_Logger::log_logmatch_info(".data"); single_value->field_data.log_match(match_value.data(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_id.match(match_value.id(), legacy)){ TTCN_Logger::log_logmatch_info(".id"); single_value->field_id.log_match(match_value.id(), 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("{ data := "); single_value->field_data.log_match(match_value.data(), legacy); TTCN_Logger::log_event_str(", id := "); single_value->field_id.log_match(match_value.id(), 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 HNBLLIF__send__data_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (data().is_bound()) data().set_implicit_omit(); if (id().is_bound()) id().set_implicit_omit(); } void HNBLLIF__send__data_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_data.encode_text(text_buf); single_value->field_id.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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); } } void HNBLLIF__send__data_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_data.decode_text(text_buf); single_value->field_id.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 HNBLLIF__send__data_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 @HNBLLIF_CodecPort.HNBLLIF_send_data."); } } void HNBLLIF__send__data_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: { HNBLLIF__send__data_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) data().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) id().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(), "data")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { data().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBLLIF_CodecPort.HNBLLIF_send_data: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HNBLLIF__send__data_template* precondition = new HNBLLIF__send__data_template; precondition->set_param(*param.get_elem(0)); HNBLLIF__send__data_template* implied_template = new HNBLLIF__send__data_template; implied_template->set_param(*param.get_elem(1)); *this = HNBLLIF__send__data_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBLLIF_CodecPort.HNBLLIF_send_data"); } is_ifpresent = param.get_ifpresent(); } void HNBLLIF__send__data_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_data.check_restriction(t_res, t_name ? t_name : "@HNBLLIF_CodecPort.HNBLLIF_send_data"); single_value->field_id.check_restriction(t_res, t_name ? t_name : "@HNBLLIF_CodecPort.HNBLLIF_send_data"); 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 : "@HNBLLIF_CodecPort.HNBLLIF_send_data"); } boolean HNBLLIF__send__data_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNBLLIF__send__data_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; case MESSAGE_3: delete (my_head)->message_3; 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 HNBLLIF__CODEC__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } HNBLLIF__CODEC__PT::HNBLLIF__CODEC__PT(const char *par_port_name) : UD__PortType::UD__PT_PROVIDER(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } HNBLLIF__CODEC__PT::~HNBLLIF__CODEC__PT() { clear_queue(); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__close& 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(" @UD_Types.UD_close : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) { (void)get_default_destination(); outgoing_send(send_par); } else { Text_Buf text_buf; prepare_message(text_buf, "@UD_Types.UD_close"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__close& 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 HNBLLIF__CODEC__PT::send(const UD__Types::UD__close& 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, "@UD_Types.UD_close"); 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(" @UD_Types.UD_close : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__close_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const UD__Types::UD__close& send_par_value = UD__Types::UD__close(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__close_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const UD__Types::UD__close& send_par_value = UD__Types::UD__close(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__close_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const UD__Types::UD__close& send_par_value = UD__Types::UD__close(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__listen& 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(" @UD_Types.UD_listen : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) { (void)get_default_destination(); outgoing_send(send_par); } else { Text_Buf text_buf; prepare_message(text_buf, "@UD_Types.UD_listen"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__listen& 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 HNBLLIF__CODEC__PT::send(const UD__Types::UD__listen& 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, "@UD_Types.UD_listen"); 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(" @UD_Types.UD_listen : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__listen_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const UD__Types::UD__listen& send_par_value = UD__Types::UD__listen(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__listen_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const UD__Types::UD__listen& send_par_value = UD__Types::UD__listen(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__listen_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const UD__Types::UD__listen& send_par_value = UD__Types::UD__listen(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__shutdown& 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(" @UD_Types.UD_shutdown : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) { (void)get_default_destination(); outgoing_send(send_par); } else { Text_Buf text_buf; prepare_message(text_buf, "@UD_Types.UD_shutdown"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__shutdown& 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 HNBLLIF__CODEC__PT::send(const UD__Types::UD__shutdown& 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, "@UD_Types.UD_shutdown"); 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(" @UD_Types.UD_shutdown : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__shutdown_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const UD__Types::UD__shutdown& send_par_value = UD__Types::UD__shutdown(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__shutdown_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const UD__Types::UD__shutdown& send_par_value = UD__Types::UD__shutdown(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__shutdown_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const UD__Types::UD__shutdown& send_par_value = UD__Types::UD__shutdown(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__connect& 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(" @UD_Types.UD_connect : "), send_par.log(), TTCN_Logger::end_event_log2str())); } if (destination_component == SYSTEM_COMPREF) { (void)get_default_destination(); outgoing_send(send_par); } else { Text_Buf text_buf; prepare_message(text_buf, "@UD_Types.UD_connect"); send_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__connect& 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 HNBLLIF__CODEC__PT::send(const UD__Types::UD__connect& 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, "@UD_Types.UD_connect"); 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(" @UD_Types.UD_connect : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__connect_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const UD__Types::UD__connect& send_par_value = UD__Types::UD__connect(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__connect_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const UD__Types::UD__connect& send_par_value = UD__Types::UD__connect(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const UD__Types::UD__connect_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const UD__Types::UD__connect& send_par_value = UD__Types::UD__connect(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const HNBLLIF__send__data& 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(" @HNBLLIF_CodecPort.HNBLLIF_send_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } UD__Types::UD__send__data mapped_par; HNBLLIF__to__UD(send_par, mapped_par); if (TTCN_Logger::log_this_event(TTCN_Logger::PORTEVENT_DUALSEND)) { TTCN_Logger::log_dualport_map(0, "@UD_Types.UD_send_data", (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, "@UD_Types.UD_send_data"); mapped_par.encode_text(text_buf); send_data(text_buf, destination_component); } } void HNBLLIF__CODEC__PT::send(const HNBLLIF__send__data& 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 HNBLLIF__CODEC__PT::send(const HNBLLIF__send__data& 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, "@HNBLLIF_CodecPort.HNBLLIF_send_data"); 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(" @HNBLLIF_CodecPort.HNBLLIF_send_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const HNBLLIF__send__data_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const HNBLLIF__send__data& send_par_value = HNBLLIF__send__data(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const HNBLLIF__send__data_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const HNBLLIF__send__data& send_par_value = HNBLLIF__send__data(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void HNBLLIF__CODEC__PT::send(const HNBLLIF__send__data_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const HNBLLIF__send__data& send_par_value = HNBLLIF__send__data(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } PORT* HNBLLIF__CODEC__PT::get_provider_port() { (void)get_default_destination(); return this; } alt_status HNBLLIF__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(": @UD_Types.UD_listen_result: "), 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(": @UD_Types.UD_connect_result: "), 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(": @UD_Types.UD_connected: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: 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(": @HNBLLIF_CodecPort.HNBLLIF_send_data: "), my_head->message_3->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 HNBLLIF__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(": @UD_Types.UD_listen_result: "), 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(": @UD_Types.UD_connect_result: "), 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(": @UD_Types.UD_connected: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: 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(": @HNBLLIF_CodecPort.HNBLLIF_send_data: "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; default: TTCN_error("Internal error: unknown message"); } } return ALT_YES; } } alt_status HNBLLIF__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(": @UD_Types.UD_listen_result: "), 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(": @UD_Types.UD_connect_result: "), 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(": @UD_Types.UD_connected: "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); break; case MESSAGE_3: 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(": @HNBLLIF_CodecPort.HNBLLIF_send_data: "), my_head->message_3->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 HNBLLIF__CODEC__PT::receive(const UD__Types::UD__listen__result_template& value_template, UD__Types::UD__listen__result *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 @UD_Types.UD_listen_result.", 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(": @UD_Types.UD_listen_result : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::check_receive(const UD__Types::UD__listen__result_template& value_template, UD__Types::UD__listen__result *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 @UD_Types.UD_listen_result.", 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(": @UD_Types.UD_listen_result : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::trigger(const UD__Types::UD__listen__result_template& value_template, UD__Types::UD__listen__result *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 @UD_Types.UD_listen_result.", 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(": @UD_Types.UD_listen_result : "), my_head->message_0->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::receive(const UD__Types::UD__connect__result_template& value_template, UD__Types::UD__connect__result *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 @UD_Types.UD_connect_result.", 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(": @UD_Types.UD_connect_result : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::check_receive(const UD__Types::UD__connect__result_template& value_template, UD__Types::UD__connect__result *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 @UD_Types.UD_connect_result.", 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(": @UD_Types.UD_connect_result : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::trigger(const UD__Types::UD__connect__result_template& value_template, UD__Types::UD__connect__result *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 @UD_Types.UD_connect_result.", 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(": @UD_Types.UD_connect_result : "), my_head->message_1->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::receive(const UD__Types::UD__connected_template& value_template, UD__Types::UD__connected *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 @UD_Types.UD_connected.", 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(": @UD_Types.UD_connected : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::check_receive(const UD__Types::UD__connected_template& value_template, UD__Types::UD__connected *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 @UD_Types.UD_connected.", 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(": @UD_Types.UD_connected : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::trigger(const UD__Types::UD__connected_template& value_template, UD__Types::UD__connected *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 @UD_Types.UD_connected.", 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(": @UD_Types.UD_connected : "), my_head->message_2->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::receive(const HNBLLIF__send__data_template& value_template, HNBLLIF__send__data *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_3) { 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 @HNBLLIF_CodecPort.HNBLLIF_send_data.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_3)) { 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_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } 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_3), 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(": @HNBLLIF_CodecPort.HNBLLIF_send_data : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::check_receive(const HNBLLIF__send__data_template& value_template, HNBLLIF__send__data *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_3) { 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 @HNBLLIF_CodecPort.HNBLLIF_send_data.", port_name); return ALT_NO; } else if (!value_template.match(*my_head->message_3)) { 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_3), TTCN_Logger::end_event_log2str())); } return ALT_NO; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } 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_3), 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(": @HNBLLIF_CodecPort.HNBLLIF_send_data : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status HNBLLIF__CODEC__PT::trigger(const HNBLLIF__send__data_template& value_template, HNBLLIF__send__data *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_3) { 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 @HNBLLIF_CodecPort.HNBLLIF_send_data.", port_name); remove_msg_queue_head(); return ALT_REPEAT; } else if (!value_template.match(*my_head->message_3)) { 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_3), TTCN_Logger::end_event_log2str())); } remove_msg_queue_head(); return ALT_REPEAT; } else { if (value_redirect != NULL) { *value_redirect = *my_head->message_3; } 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_3), 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(": @HNBLLIF_CodecPort.HNBLLIF_send_data : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__listen__result& 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(" @UD_Types.UD_listen_result : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } msg_queue_item *new_item = new msg_queue_item; new_item->item_selection = MESSAGE_0; new_item->message_0 = new UD__Types::UD__listen__result(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__connect__result& 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(" @UD_Types.UD_connect_result : "), 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 UD__Types::UD__connect__result(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__connected& 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(" @UD_Types.UD_connected : "), 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 UD__Types::UD__connected(incoming_par); new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__send__data& 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(" @UD_Types.UD_send_data : "), incoming_par.log(), TTCN_Logger::end_event_log2str())); } HNBLLIF__send__data *mapped_par = new HNBLLIF__send__data; try { UD__to__HNBLLIF(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, "@HNBLLIF_CodecPort.HNBLLIF_send_data", (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_3; new_item->message_3 = mapped_par; new_item->sender_component = sender_component; append_to_msg_queue(new_item); } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__listen__result& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__connect__result& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__connected& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void HNBLLIF__CODEC__PT::incoming_message(const UD__Types::UD__send__data& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } boolean HNBLLIF__CODEC__PT::process_message(const char *message_type, Text_Buf& incoming_buf, component sender_component, OCTETSTRING&) { if (!strcmp(message_type, "@UD_Types.UD_listen_result")) { UD__Types::UD__listen__result incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@UD_Types.UD_connect_result")) { UD__Types::UD__connect__result incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@UD_Types.UD_connected")) { UD__Types::UD__connected incoming_par; incoming_par.decode_text(incoming_buf); incoming_message(incoming_par, sender_component); return TRUE; } else if (!strcmp(message_type, "@UD_Types.UD_send_data")) { UD__Types::UD__send__data 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 */ void HNBLLIF__to__UD(const HNBLLIF__send__data& pin, UD__Types::UD__send__data& pout) { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 24, TTCN_Location::LOCATION_FUNCTION, "HNBLLIF_to_UD"); current_location.update_lineno(25); /* HNBLLIF_CodecPort.ttcn, line 25 */ pout.id() = const_cast< const HNBLLIF__send__data&>(pin).id(); current_location.update_lineno(26); /* HNBLLIF_CodecPort.ttcn, line 26 */ pout.data() = HNBLLIF__Types::enc__HNBLLIF__Message(const_cast< const HNBLLIF__send__data&>(pin).data()); } void UD__to__HNBLLIF(const UD__Types::UD__send__data& pin, HNBLLIF__send__data& pout) { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 29, TTCN_Location::LOCATION_FUNCTION, "UD_to_HNBLLIF"); current_location.update_lineno(30); /* HNBLLIF_CodecPort.ttcn, line 30 */ pout.id() = const_cast< const UD__Types::UD__send__data&>(pin).id(); current_location.update_lineno(31); /* HNBLLIF_CodecPort.ttcn, line 31 */ pout.data() = HNBLLIF__Types::dec__HNBLLIF__Message(const_cast< const UD__Types::UD__send__data&>(pin).data()); } HNBLLIF__send__data_template t__SD__HNBLLIF(const INTEGER& id, const HNBLLIF__Types::HNBLLIF__Message_template& pdu) { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 53, TTCN_Location::LOCATION_TEMPLATE, "t_SD_HNBLLIF"); HNBLLIF__send__data_template ret_val; ret_val.data() = pdu; ret_val.id() = id; return ret_val; } HNBLLIF__send__data_template ts__SD__HNBLLIF(const INTEGER& id, const HNBLLIF__Types::HNBLLIF__Message_template& pdu) { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 57, TTCN_Location::LOCATION_TEMPLATE, "ts_SD_HNBLLIF"); HNBLLIF__send__data_template ret_val; ret_val.data() = pdu; ret_val.id() = id; return ret_val; } INTEGER f__hnbllif__connect(HNBLLIF__CODEC__PT& pt, const CHARSTRING& sock) { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 62, TTCN_Location::LOCATION_FUNCTION, "f_hnbllif_connect"); current_location.update_lineno(63); /* HNBLLIF_CodecPort.ttcn, line 63 */ UD__Types::UD__connect__result res; current_location.update_lineno(64); /* HNBLLIF_CodecPort.ttcn, line 64 */ TIMER T("T", 5.0); current_location.update_lineno(66); /* HNBLLIF_CodecPort.ttcn, line 66 */ T.start(); current_location.update_lineno(67); /* HNBLLIF_CodecPort.ttcn, line 67 */ { UD__Types::UD__connect_template tmp_4; tmp_4.path() = sock; tmp_4.id() = -1; pt.send(tmp_4, FALSE, NULL); } current_location.update_lineno(68); /* HNBLLIF_CodecPort.ttcn, line 68 */ { tmp_5: alt_status tmp_5_alt_flag_0 = ALT_MAYBE; alt_status tmp_5_alt_flag_1 = ALT_MAYBE; alt_status tmp_5_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_5_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(69); /* HNBLLIF_CodecPort.ttcn, line 69 */ tmp_5_alt_flag_0 = pt.receive(UD__Types::UD__connect__result_template(ANY_VALUE), &(res), any_compref, NULL, NULL, NULL); if (tmp_5_alt_flag_0 == ALT_YES) { current_location.update_lineno(70); /* HNBLLIF_CodecPort.ttcn, line 70 */ { boolean tmp_6; { boolean tmp_7; { boolean tmp_8 = res.is_bound(); if(tmp_8) { const OPTIONAL< UD__Types::UD__Result >& tmp_9 = res.result(); switch (tmp_9.get_selection()) { case OPTIONAL_UNBOUND: tmp_8 = FALSE; break; case OPTIONAL_OMIT: tmp_8 = FALSE; break; default: { const UD__Types::UD__Result& tmp_10 = (const UD__Types::UD__Result&) tmp_9; tmp_8 = tmp_10.is_present(); break;} } } tmp_7 = tmp_8; } if (tmp_7) { boolean tmp_11 = res.is_bound(); if(tmp_11) { const OPTIONAL< UD__Types::UD__Result >& tmp_12 = res.result(); switch (tmp_12.get_selection()) { case OPTIONAL_UNBOUND: case OPTIONAL_OMIT: tmp_11 = FALSE; break; default: break; } if(tmp_11) { const UD__Types::UD__Result& tmp_13 = (const UD__Types::UD__Result&) tmp_12; tmp_11 = tmp_13.is_bound(); if(tmp_11) { const OPTIONAL< UD__Types::UD__Result__code >& tmp_14 = tmp_13.result__code(); switch (tmp_14.get_selection()) { case OPTIONAL_UNBOUND: tmp_11 = FALSE; break; case OPTIONAL_OMIT: tmp_11 = FALSE; break; default: { const UD__Types::UD__Result__code& tmp_15 = (const UD__Types::UD__Result__code&) tmp_14; tmp_11 = tmp_15.is_present(); break;} } } } } tmp_7 = tmp_11; } tmp_6 = tmp_7; } if (tmp_6) tmp_6 = (const_cast< const UD__Types::UD__connect__result&>(res).result()().result__code() == UD__Types::UD__Result__code::ERROR_); if (tmp_6) { current_location.update_lineno(72); /* HNBLLIF_CodecPort.ttcn, line 72 */ { boolean tmp_21; { boolean tmp_16 = res.is_bound(); if(tmp_16) { const OPTIONAL< UD__Types::UD__Result >& tmp_17 = res.result(); switch (tmp_17.get_selection()) { case OPTIONAL_UNBOUND: case OPTIONAL_OMIT: tmp_16 = FALSE; break; default: break; } if(tmp_16) { const UD__Types::UD__Result& tmp_18 = (const UD__Types::UD__Result&) tmp_17; tmp_16 = tmp_18.is_bound(); if(tmp_16) { const OPTIONAL< CHARSTRING >& tmp_19 = tmp_18.err(); switch (tmp_19.get_selection()) { case OPTIONAL_UNBOUND: tmp_16 = FALSE; break; case OPTIONAL_OMIT: tmp_16 = FALSE; break; default: { const CHARSTRING& tmp_20 = (const CHARSTRING&) tmp_19; tmp_16 = tmp_20.is_present(); break;} } } } } tmp_21 = tmp_16; } if (tmp_21) { current_location.update_lineno(73); /* HNBLLIF_CodecPort.ttcn, line 73 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Error connecting to HNBLL socket "),sock.log(),TTCN_Logger::log_event_str(": "),const_cast< const UD__Types::UD__connect__result&>(res).result()().err().log(),TTCN_Logger::end_event_log2str())); } else { current_location.update_lineno(75); /* HNBLLIF_CodecPort.ttcn, line 75 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Error connecting to HNBLL socket "),sock.log(),TTCN_Logger::end_event_log2str())); } } current_location.update_lineno(77); /* HNBLLIF_CodecPort.ttcn, line 77 */ TTCN_Runtime::stop_component(MTC_COMPREF); } else { current_location.update_lineno(79); /* HNBLLIF_CodecPort.ttcn, line 79 */ return const_cast< const UD__Types::UD__connect__result&>(res).id(); } } } } if (tmp_5_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(82); /* HNBLLIF_CodecPort.ttcn, line 82 */ tmp_5_alt_flag_1 = T.timeout(NULL); if (tmp_5_alt_flag_1 == ALT_YES) { current_location.update_lineno(83); /* HNBLLIF_CodecPort.ttcn, line 83 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout connecting to HNBLL socket "),sock.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(84); /* HNBLLIF_CodecPort.ttcn, line 84 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_5_default_flag == ALT_MAYBE) { tmp_5_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_5_default_flag == ALT_YES || tmp_5_default_flag == ALT_BREAK) break; else if (tmp_5_default_flag == ALT_REPEAT) goto tmp_5; } current_location.update_lineno(68); /* HNBLLIF_CodecPort.ttcn, line 68 */ if (tmp_5_alt_flag_0 == ALT_NO && tmp_5_alt_flag_1 == ALT_NO && tmp_5_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file HNBLLIF_CodecPort.ttcn between lines 68 and 86."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(87); /* HNBLLIF_CodecPort.ttcn, line 87 */ return -23; } void f__hnbllif__close(HNBLLIF__CODEC__PT& pt, const INTEGER& id) { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 90, TTCN_Location::LOCATION_FUNCTION, "f_hnbllif_close"); current_location.update_lineno(92); /* HNBLLIF_CodecPort.ttcn, line 92 */ { UD__Types::UD__close_template tmp_22; tmp_22.id() = id; pt.send(tmp_22, FALSE, NULL); } } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "HNBLLIF_CodecPort"); HNBLLIF__Types::module_object.pre_init_module(); UD__PortType::module_object.pre_init_module(); module_object.add_function("HNBLLIF_to_UD", (genericfunc_t)&HNBLLIF__to__UD, NULL); module_object.add_function("UD_to_HNBLLIF", (genericfunc_t)&UD__to__HNBLLIF, NULL); module_object.add_function("f_hnbllif_connect", (genericfunc_t)&f__hnbllif__connect, NULL); module_object.add_function("f_hnbllif_close", (genericfunc_t)&f__hnbllif__close, NULL); } void post_init_module() { TTCN_Location current_location("HNBLLIF_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "HNBLLIF_CodecPort"); HNBLLIF__Types::module_object.post_init_module(); UD__PortType::module_object.post_init_module(); } } /* end of namespace */