// 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 "PCUIF_CodecPort.hh" namespace PCUIF__CodecPort { /* Literal string constants */ const unsigned char os_0_octets[] = { 1, 2, 3, 4 }; extern const OCTETSTRING os_0(4, os_0_octets); const unsigned char module_checksum[] = { 0x4f, 0x24, 0x99, 0x5e, 0x95, 0x74, 0x74, 0xa8, 0xaf, 0x80, 0x3c, 0x2e, 0x2d, 0xe2, 0xfe, 0xf0 }; /* Global variable definitions */ UNIVERSAL_CHARSTRING PCUIF__send__data_data_default_coding("RAW"); const XERdescriptor_t PCUIF__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 PCUIF__send__data_id_descr_ = { "@PCUIF_CodecPort.PCUIF_send_data.id", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PCUIF__send__data_id_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for PCUIF__send__data const TTCN_Typedescriptor_t PCUIF__send__data_descr_ = { "@PCUIF_CodecPort.PCUIF_send_data", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE }; INTEGER_template template_t__SD__PCUIF__MSGT_bts__nr_defval; const INTEGER_template& t__SD__PCUIF__MSGT_bts__nr_defval = template_t__SD__PCUIF__MSGT_bts__nr_defval; INTEGER const_f__PCUIF__tx__imm__ass__pch_bts__nr_defval; const INTEGER& f__PCUIF__tx__imm__ass__pch_bts__nr_defval = const_f__PCUIF__tx__imm__ass__pch_bts__nr_defval; BOOLEAN const_f__PCUIF__tx__imm__ass__pch_wait__for__cnf_defval; const BOOLEAN& f__PCUIF__tx__imm__ass__pch_wait__for__cnf_defval = const_f__PCUIF__tx__imm__ass__pch_wait__for__cnf_defval; OCTETSTRING const_f__PCUIF__tx__imm__ass__pch_msg__id_defval; const OCTETSTRING& f__PCUIF__tx__imm__ass__pch_msg__id_defval = const_f__PCUIF__tx__imm__ass__pch_msg__id_defval; BOOLEAN const_f__PCUIF__tx__mac__block__agch_confirm_defval; const BOOLEAN& f__PCUIF__tx__mac__block__agch_confirm_defval = const_f__PCUIF__tx__mac__block__agch_confirm_defval; INTEGER const_f__PCUIF__tx__mac__block__agch_bts__nr_defval; const INTEGER& f__PCUIF__tx__mac__block__agch_bts__nr_defval = const_f__PCUIF__tx__mac__block__agch_bts__nr_defval; BOOLEAN const_f__PCUIF__tx__mac__block__agch_wait__for__cnf_defval; const BOOLEAN& f__PCUIF__tx__mac__block__agch_wait__for__cnf_defval = const_f__PCUIF__tx__mac__block__agch_wait__for__cnf_defval; OCTETSTRING const_f__PCUIF__tx__mac__block__agch_msg__id_defval; const OCTETSTRING& f__PCUIF__tx__mac__block__agch_msg__id_defval = const_f__PCUIF__tx__mac__block__agch_msg__id_defval; TTCN_Module module_object("PCUIF_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 */ PCUIF__send__data::PCUIF__send__data() { } PCUIF__send__data::PCUIF__send__data(const PCUIF__Types::PCUIF__Message& par_data, const INTEGER& par_id) : field_data(par_data), field_id(par_id) { } PCUIF__send__data::PCUIF__send__data(const PCUIF__send__data& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @PCUIF_CodecPort.PCUIF_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 PCUIF__send__data::clean_up() { field_data.clean_up(); field_id.clean_up(); } const TTCN_Typedescriptor_t* PCUIF__send__data::get_descriptor() const { return &PCUIF__send__data_descr_; } PCUIF__send__data& PCUIF__send__data::operator=(const PCUIF__send__data& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @PCUIF_CodecPort.PCUIF_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 PCUIF__send__data::operator==(const PCUIF__send__data& other_value) const { return field_data==other_value.field_data && field_id==other_value.field_id; } boolean PCUIF__send__data::is_bound() const { return (field_data.is_bound()) || (field_id.is_bound()); } boolean PCUIF__send__data::is_value() const { return field_data.is_value() && field_id.is_value(); } void PCUIF__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 PCUIF__send__data::set_implicit_omit() { if (data().is_bound()) data().set_implicit_omit(); if (id().is_bound()) id().set_implicit_omit(); } void PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@PCUIF_CodecPort.PCUIF_send_data"); } } void PCUIF__send__data::encode_text(Text_Buf& text_buf) const { field_data.encode_text(text_buf); field_id.encode_text(text_buf); } void PCUIF__send__data::decode_text(Text_Buf& text_buf) { field_data.decode_text(text_buf); field_id.decode_text(text_buf); } struct PCUIF__send__data_template::single_value_struct { PCUIF__Types::PCUIF__Message_template field_data; INTEGER_template field_id; }; void PCUIF__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 PCUIF__send__data_template::copy_value(const PCUIF__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 PCUIF__send__data_template::copy_template(const PCUIF__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 PCUIF__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 PCUIF__send__data_template(*other_value.implication_.precondition); implication_.implied_template = new PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); break; } set_selection(other_value); } PCUIF__send__data_template::PCUIF__send__data_template() { } PCUIF__send__data_template::PCUIF__send__data_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PCUIF__send__data_template::PCUIF__send__data_template(const PCUIF__send__data& other_value) { copy_value(other_value); } PCUIF__send__data_template::PCUIF__send__data_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PCUIF__send__data&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @PCUIF_CodecPort.PCUIF_send_data from an unbound optional field."); } } PCUIF__send__data_template::PCUIF__send__data_template(PCUIF__send__data_template* p_precondition, PCUIF__send__data_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PCUIF__send__data_template::PCUIF__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; } PCUIF__send__data_template::PCUIF__send__data_template(const PCUIF__send__data_template& other_value) : Base_Template() { copy_template(other_value); } PCUIF__send__data_template::~PCUIF__send__data_template() { clean_up(); } PCUIF__send__data_template& PCUIF__send__data_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PCUIF__send__data_template& PCUIF__send__data_template::operator=(const PCUIF__send__data& other_value) { clean_up(); copy_value(other_value); return *this; } PCUIF__send__data_template& PCUIF__send__data_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); } return *this; } PCUIF__send__data_template& PCUIF__send__data_template::operator=(const PCUIF__send__data_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PCUIF__send__data_template::match(const PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); } return FALSE; } boolean PCUIF__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 PCUIF__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 PCUIF__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; } PCUIF__send__data PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); PCUIF__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 PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PCUIF__send__data_template[list_length]; } PCUIF__send__data_template& PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @PCUIF_CodecPort.PCUIF_send_data."); return value_list.list_value[list_index]; } PCUIF__Types::PCUIF__Message_template& PCUIF__send__data_template::data() { set_specific(); return single_value->field_data; } const PCUIF__Types::PCUIF__Message_template& PCUIF__send__data_template::data() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field data of a non-specific template of type @PCUIF_CodecPort.PCUIF_send_data."); return single_value->field_data; } INTEGER_template& PCUIF__send__data_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& PCUIF__send__data_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @PCUIF_CodecPort.PCUIF_send_data."); return single_value->field_id; } int PCUIF__send__data_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @PCUIF_CodecPort.PCUIF_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 @PCUIF_CodecPort.PCUIF_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 @PCUIF_CodecPort.PCUIF_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 @PCUIF_CodecPort.PCUIF_send_data containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @PCUIF_CodecPort.PCUIF_send_data containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @PCUIF_CodecPort.PCUIF_send_data containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @PCUIF_CodecPort.PCUIF_send_data containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @PCUIF_CodecPort.PCUIF_send_data containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @PCUIF_CodecPort.PCUIF_send_data containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @PCUIF_CodecPort.PCUIF_send_data."); } return 0; } void PCUIF__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 PCUIF__send__data_template::log_match(const PCUIF__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 PCUIF__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 PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); } } void PCUIF__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 PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data."); } } void PCUIF__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: { PCUIF__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 @PCUIF_CodecPort.PCUIF_send_data: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PCUIF__send__data_template* precondition = new PCUIF__send__data_template; precondition->set_param(*param.get_elem(0)); PCUIF__send__data_template* implied_template = new PCUIF__send__data_template; implied_template->set_param(*param.get_elem(1)); *this = PCUIF__send__data_template(precondition, implied_template); } break; default: param.type_error("record template", "@PCUIF_CodecPort.PCUIF_send_data"); } is_ifpresent = param.get_ifpresent(); } void PCUIF__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 : "@PCUIF_CodecPort.PCUIF_send_data"); single_value->field_id.check_restriction(t_res, t_name ? t_name : "@PCUIF_CodecPort.PCUIF_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 : "@PCUIF_CodecPort.PCUIF_send_data"); } boolean PCUIF__send__data_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PCUIF__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 PCUIF__CODEC__PT::clear_queue() { while (msg_queue_head != NULL) remove_msg_queue_head(); } PCUIF__CODEC__PT::PCUIF__CODEC__PT(const char *par_port_name) : UD__PortType::UD__PT_PROVIDER(par_port_name) { msg_queue_head = NULL; msg_queue_tail = NULL; } PCUIF__CODEC__PT::~PCUIF__CODEC__PT() { clear_queue(); } void PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__CODEC__PT::send(const PCUIF__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(" @PCUIF_CodecPort.PCUIF_send_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } UD__Types::UD__send__data mapped_par; PCUIF__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 PCUIF__CODEC__PT::send(const PCUIF__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 PCUIF__CODEC__PT::send(const PCUIF__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, "@PCUIF_CodecPort.PCUIF_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(" @PCUIF_CodecPort.PCUIF_send_data : "), send_par.log(), TTCN_Logger::end_event_log2str())); } else send(send_par, COMPONENT(get_default_destination()), timestamp_redirect); } void PCUIF__CODEC__PT::send(const PCUIF__send__data_template& send_par, const COMPONENT& destination_component, FLOAT* timestamp_redirect) { const PCUIF__send__data& send_par_value = PCUIF__send__data(send_par.valueof()); send(send_par_value, destination_component, timestamp_redirect); } void PCUIF__CODEC__PT::send(const PCUIF__send__data_template& send_par, size_t nof_components, const COMPONENT* destination_components, FLOAT* timestamp_redirect) { const PCUIF__send__data& send_par_value = PCUIF__send__data(send_par.valueof()); send(send_par_value, nof_components, destination_components, timestamp_redirect); } void PCUIF__CODEC__PT::send(const PCUIF__send__data_template& send_par, boolean broadcast, FLOAT* timestamp_redirect) { const PCUIF__send__data& send_par_value = PCUIF__send__data(send_par.valueof()); send(send_par_value, broadcast, timestamp_redirect); } PORT* PCUIF__CODEC__PT::get_provider_port() { (void)get_default_destination(); return this; } alt_status PCUIF__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(": @PCUIF_CodecPort.PCUIF_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 PCUIF__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(": @PCUIF_CodecPort.PCUIF_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 PCUIF__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(": @PCUIF_CodecPort.PCUIF_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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__CODEC__PT::receive(const PCUIF__send__data_template& value_template, PCUIF__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 @PCUIF_CodecPort.PCUIF_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(": @PCUIF_CodecPort.PCUIF_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 PCUIF__CODEC__PT::check_receive(const PCUIF__send__data_template& value_template, PCUIF__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 @PCUIF_CodecPort.PCUIF_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(": @PCUIF_CodecPort.PCUIF_send_data : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } return ALT_YES; } } alt_status PCUIF__CODEC__PT::trigger(const PCUIF__send__data_template& value_template, PCUIF__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 @PCUIF_CodecPort.PCUIF_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(": @PCUIF_CodecPort.PCUIF_send_data : "), my_head->message_3->log(), TTCN_Logger::end_event_log2str()), msg_head_count+1); } remove_msg_queue_head(); return ALT_YES; } } void PCUIF__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 PCUIF__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 PCUIF__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 PCUIF__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())); } PCUIF__send__data *mapped_par = new PCUIF__send__data; try { UD__to__PCUIF(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, "@PCUIF_CodecPort.PCUIF_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 PCUIF__CODEC__PT::incoming_message(const UD__Types::UD__listen__result& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void PCUIF__CODEC__PT::incoming_message(const UD__Types::UD__connect__result& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void PCUIF__CODEC__PT::incoming_message(const UD__Types::UD__connected& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } void PCUIF__CODEC__PT::incoming_message(const UD__Types::UD__send__data& incoming_par) { incoming_message(incoming_par, SYSTEM_COMPREF); } boolean PCUIF__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 PCUIF__to__UD(const PCUIF__send__data& pin, UD__Types::UD__send__data& pout) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 25, TTCN_Location::LOCATION_FUNCTION, "PCUIF_to_UD"); current_location.update_lineno(26); /* PCUIF_CodecPort.ttcn, line 26 */ pout.id() = const_cast< const PCUIF__send__data&>(pin).id(); current_location.update_lineno(27); /* PCUIF_CodecPort.ttcn, line 27 */ pout.data() = PCUIF__Types::enc__PCUIF__Message(const_cast< const PCUIF__send__data&>(pin).data()); } void fix__padding(PCUIF__Types::PCUIF__data& data) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 30, TTCN_Location::LOCATION_FUNCTION, "fix_padding"); current_location.update_lineno(31); /* PCUIF_CodecPort.ttcn, line 31 */ { OCTETSTRING tmp_2; tmp_2 = substr(const_cast< const PCUIF__Types::PCUIF__data&>(data).data(), 0, const_cast< const PCUIF__Types::PCUIF__data&>(data).len()); data.data() = tmp_2; } } void UD__to__PCUIF(const UD__Types::UD__send__data& pin, PCUIF__send__data& pout) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 34, TTCN_Location::LOCATION_FUNCTION, "UD_to_PCUIF"); current_location.update_lineno(35); /* PCUIF_CodecPort.ttcn, line 35 */ pout.id() = const_cast< const UD__Types::UD__send__data&>(pin).id(); current_location.update_lineno(36); /* PCUIF_CodecPort.ttcn, line 36 */ pout.data() = PCUIF__Types::dec__PCUIF__Message(const_cast< const UD__Types::UD__send__data&>(pin).data()); current_location.update_lineno(40); /* PCUIF_CodecPort.ttcn, line 40 */ { boolean tmp_10; { boolean tmp_5 = pout.is_bound(); if(tmp_5) { const PCUIF__send__data& tmp_6 = pout; const PCUIF__Types::PCUIF__Message& tmp_7 = tmp_6.data(); tmp_5 = tmp_7.is_bound(); if(tmp_5) { const PCUIF__Types::PCUIF__Message& tmp_8 = tmp_7; const PCUIF__Types::PCUIF__MsgUnion& tmp_9 = tmp_8.u(); tmp_5 = tmp_9.is_bound(); if (tmp_5) { tmp_5 = tmp_9.ischosen(PCUIF__Types::PCUIF__MsgUnion::ALT_data__req); } } } tmp_10 = tmp_5; } if (tmp_10) { current_location.update_lineno(40); /* PCUIF_CodecPort.ttcn, line 40 */ fix__padding(pout.data().u().data__req()); } } current_location.update_lineno(41); /* PCUIF_CodecPort.ttcn, line 41 */ { boolean tmp_16; { boolean tmp_11 = pout.is_bound(); if(tmp_11) { const PCUIF__send__data& tmp_12 = pout; const PCUIF__Types::PCUIF__Message& tmp_13 = tmp_12.data(); tmp_11 = tmp_13.is_bound(); if(tmp_11) { const PCUIF__Types::PCUIF__Message& tmp_14 = tmp_13; const PCUIF__Types::PCUIF__MsgUnion& tmp_15 = tmp_14.u(); tmp_11 = tmp_15.is_bound(); if (tmp_11) { tmp_11 = tmp_15.ischosen(PCUIF__Types::PCUIF__MsgUnion::ALT_data__ind); } } } tmp_16 = tmp_11; } if (tmp_16) { current_location.update_lineno(41); /* PCUIF_CodecPort.ttcn, line 41 */ fix__padding(pout.data().u().data__ind()); } } } PCUIF__send__data_template t__SD__PCUIF(const INTEGER& id, const PCUIF__Types::PCUIF__Message_template& pdu) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 63, TTCN_Location::LOCATION_TEMPLATE, "t_SD_PCUIF"); PCUIF__send__data_template ret_val; ret_val.data() = pdu; ret_val.id() = id; return ret_val; } PCUIF__send__data_template t__SD__PCUIF__MSGT(const INTEGER& id, const PCUIF__Types::PCUIF__MsgType_template& msg__type, const INTEGER_template& bts__nr) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 68, TTCN_Location::LOCATION_TEMPLATE, "t_SD_PCUIF_MSGT"); PCUIF__send__data_template ret_val; { PCUIF__Types::PCUIF__Message_template& tmp_17 = ret_val.data(); tmp_17.msg__type() = msg__type; tmp_17.bts__nr() = bts__nr; tmp_17.spare() = ANY_VALUE; tmp_17.u() = ANY_VALUE; } ret_val.id() = id; return ret_val; } INTEGER f__pcuif__connect(PCUIF__CODEC__PT& pt, const CHARSTRING& sock) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 79, TTCN_Location::LOCATION_FUNCTION, "f_pcuif_connect"); current_location.update_lineno(80); /* PCUIF_CodecPort.ttcn, line 80 */ UD__Types::UD__connect__result res; current_location.update_lineno(81); /* PCUIF_CodecPort.ttcn, line 81 */ TIMER T("T", 5.0); current_location.update_lineno(83); /* PCUIF_CodecPort.ttcn, line 83 */ T.start(); current_location.update_lineno(84); /* PCUIF_CodecPort.ttcn, line 84 */ { UD__Types::UD__connect_template tmp_18; tmp_18.path() = sock; tmp_18.id() = -1; pt.send(tmp_18, FALSE, NULL); } current_location.update_lineno(85); /* PCUIF_CodecPort.ttcn, line 85 */ { tmp_19: alt_status tmp_19_alt_flag_0 = ALT_MAYBE; alt_status tmp_19_alt_flag_1 = ALT_MAYBE; alt_status tmp_19_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_19_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(86); /* PCUIF_CodecPort.ttcn, line 86 */ tmp_19_alt_flag_0 = pt.receive(UD__Types::UD__connect__result_template(ANY_VALUE), &(res), any_compref, NULL, NULL, NULL); if (tmp_19_alt_flag_0 == ALT_YES) { current_location.update_lineno(87); /* PCUIF_CodecPort.ttcn, line 87 */ { boolean tmp_20; { boolean tmp_21; { boolean tmp_22 = res.is_bound(); if(tmp_22) { const OPTIONAL< UD__Types::UD__Result >& tmp_23 = res.result(); switch (tmp_23.get_selection()) { case OPTIONAL_UNBOUND: tmp_22 = FALSE; break; case OPTIONAL_OMIT: tmp_22 = FALSE; break; default: { const UD__Types::UD__Result& tmp_24 = (const UD__Types::UD__Result&) tmp_23; tmp_22 = tmp_24.is_present(); break;} } } tmp_21 = tmp_22; } if (tmp_21) { boolean tmp_25 = res.is_bound(); if(tmp_25) { const OPTIONAL< UD__Types::UD__Result >& tmp_26 = res.result(); switch (tmp_26.get_selection()) { case OPTIONAL_UNBOUND: case OPTIONAL_OMIT: tmp_25 = FALSE; break; default: break; } if(tmp_25) { const UD__Types::UD__Result& tmp_27 = (const UD__Types::UD__Result&) tmp_26; tmp_25 = tmp_27.is_bound(); if(tmp_25) { const OPTIONAL< UD__Types::UD__Result__code >& tmp_28 = tmp_27.result__code(); switch (tmp_28.get_selection()) { case OPTIONAL_UNBOUND: tmp_25 = FALSE; break; case OPTIONAL_OMIT: tmp_25 = FALSE; break; default: { const UD__Types::UD__Result__code& tmp_29 = (const UD__Types::UD__Result__code&) tmp_28; tmp_25 = tmp_29.is_present(); break;} } } } } tmp_21 = tmp_25; } tmp_20 = tmp_21; } if (tmp_20) tmp_20 = (const_cast< const UD__Types::UD__connect__result&>(res).result()().result__code() == UD__Types::UD__Result__code::ERROR_); if (tmp_20) { current_location.update_lineno(89); /* PCUIF_CodecPort.ttcn, line 89 */ { boolean tmp_35; { boolean tmp_30 = res.is_bound(); if(tmp_30) { const OPTIONAL< UD__Types::UD__Result >& tmp_31 = res.result(); switch (tmp_31.get_selection()) { case OPTIONAL_UNBOUND: case OPTIONAL_OMIT: tmp_30 = FALSE; break; default: break; } if(tmp_30) { const UD__Types::UD__Result& tmp_32 = (const UD__Types::UD__Result&) tmp_31; tmp_30 = tmp_32.is_bound(); if(tmp_30) { const OPTIONAL< CHARSTRING >& tmp_33 = tmp_32.err(); switch (tmp_33.get_selection()) { case OPTIONAL_UNBOUND: tmp_30 = FALSE; break; case OPTIONAL_OMIT: tmp_30 = FALSE; break; default: { const CHARSTRING& tmp_34 = (const CHARSTRING&) tmp_33; tmp_30 = tmp_34.is_present(); break;} } } } } tmp_35 = tmp_30; } if (tmp_35) { current_location.update_lineno(90); /* PCUIF_CodecPort.ttcn, line 90 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Error connecting to PCU 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(92); /* PCUIF_CodecPort.ttcn, line 92 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Error connecting to PCU socket "),sock.log(),TTCN_Logger::end_event_log2str())); } } current_location.update_lineno(94); /* PCUIF_CodecPort.ttcn, line 94 */ TTCN_Runtime::stop_component(MTC_COMPREF); } else { current_location.update_lineno(96); /* PCUIF_CodecPort.ttcn, line 96 */ return const_cast< const UD__Types::UD__connect__result&>(res).id(); } } } } if (tmp_19_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(99); /* PCUIF_CodecPort.ttcn, line 99 */ tmp_19_alt_flag_1 = T.timeout(NULL); if (tmp_19_alt_flag_1 == ALT_YES) { current_location.update_lineno(100); /* PCUIF_CodecPort.ttcn, line 100 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout connecting to PCU socket "),sock.log(),TTCN_Logger::end_event_log2str())); current_location.update_lineno(101); /* PCUIF_CodecPort.ttcn, line 101 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_19_default_flag == ALT_MAYBE) { tmp_19_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_19_default_flag == ALT_YES || tmp_19_default_flag == ALT_BREAK) break; else if (tmp_19_default_flag == ALT_REPEAT) goto tmp_19; } current_location.update_lineno(85); /* PCUIF_CodecPort.ttcn, line 85 */ if (tmp_19_alt_flag_0 == ALT_NO && tmp_19_alt_flag_1 == ALT_NO && tmp_19_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file PCUIF_CodecPort.ttcn between lines 85 and 103."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(104); /* PCUIF_CodecPort.ttcn, line 104 */ return -23; } void f__pcuif__close(PCUIF__CODEC__PT& pt, const INTEGER& id) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 107, TTCN_Location::LOCATION_FUNCTION, "f_pcuif_close"); current_location.update_lineno(109); /* PCUIF_CodecPort.ttcn, line 109 */ { UD__Types::UD__close_template tmp_36; tmp_36.id() = id; pt.send(tmp_36, FALSE, NULL); } } INTEGER f__pcuif__listen(PCUIF__CODEC__PT& pt, const CHARSTRING& sock) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 112, TTCN_Location::LOCATION_FUNCTION, "f_pcuif_listen"); current_location.update_lineno(113); /* PCUIF_CodecPort.ttcn, line 113 */ UD__Types::UD__listen__result res; current_location.update_lineno(114); /* PCUIF_CodecPort.ttcn, line 114 */ UD__Types::UD__connected udc; current_location.update_lineno(115); /* PCUIF_CodecPort.ttcn, line 115 */ TIMER T("T", 5.0); current_location.update_lineno(117); /* PCUIF_CodecPort.ttcn, line 117 */ { UD__Types::UD__listen_template tmp_37; tmp_37.path() = sock; pt.send(tmp_37, FALSE, NULL); } current_location.update_lineno(118); /* PCUIF_CodecPort.ttcn, line 118 */ T.start(); current_location.update_lineno(119); /* PCUIF_CodecPort.ttcn, line 119 */ { tmp_38: alt_status tmp_38_alt_flag_0 = ALT_MAYBE; alt_status tmp_38_alt_flag_1 = ALT_MAYBE; alt_status tmp_38_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_38_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(120); /* PCUIF_CodecPort.ttcn, line 120 */ tmp_38_alt_flag_0 = pt.receive(UD__Types::UD__listen__result_template(ANY_VALUE), &(res), any_compref, NULL, NULL, NULL); if (tmp_38_alt_flag_0 == ALT_YES) { current_location.update_lineno(121); /* PCUIF_CodecPort.ttcn, line 121 */ { boolean tmp_39; { boolean tmp_40; { boolean tmp_41 = res.is_bound(); if(tmp_41) { const OPTIONAL< UD__Types::UD__Result >& tmp_42 = res.result(); switch (tmp_42.get_selection()) { case OPTIONAL_UNBOUND: tmp_41 = FALSE; break; case OPTIONAL_OMIT: tmp_41 = FALSE; break; default: { const UD__Types::UD__Result& tmp_43 = (const UD__Types::UD__Result&) tmp_42; tmp_41 = tmp_43.is_present(); break;} } } tmp_40 = tmp_41; } if (tmp_40) { boolean tmp_44 = res.is_bound(); if(tmp_44) { const OPTIONAL< UD__Types::UD__Result >& tmp_45 = res.result(); switch (tmp_45.get_selection()) { case OPTIONAL_UNBOUND: case OPTIONAL_OMIT: tmp_44 = FALSE; break; default: break; } if(tmp_44) { const UD__Types::UD__Result& tmp_46 = (const UD__Types::UD__Result&) tmp_45; tmp_44 = tmp_46.is_bound(); if(tmp_44) { const OPTIONAL< UD__Types::UD__Result__code >& tmp_47 = tmp_46.result__code(); switch (tmp_47.get_selection()) { case OPTIONAL_UNBOUND: tmp_44 = FALSE; break; case OPTIONAL_OMIT: tmp_44 = FALSE; break; default: { const UD__Types::UD__Result__code& tmp_48 = (const UD__Types::UD__Result__code&) tmp_47; tmp_44 = tmp_48.is_present(); break;} } } } } tmp_40 = tmp_44; } tmp_39 = tmp_40; } if (tmp_39) tmp_39 = (const_cast< const UD__Types::UD__listen__result&>(res).result()().result__code() == UD__Types::UD__Result__code::ERROR_); if (tmp_39) { current_location.update_lineno(123); /* PCUIF_CodecPort.ttcn, line 123 */ { boolean tmp_54; { boolean tmp_49 = res.is_bound(); if(tmp_49) { const OPTIONAL< UD__Types::UD__Result >& tmp_50 = res.result(); switch (tmp_50.get_selection()) { case OPTIONAL_UNBOUND: case OPTIONAL_OMIT: tmp_49 = FALSE; break; default: break; } if(tmp_49) { const UD__Types::UD__Result& tmp_51 = (const UD__Types::UD__Result&) tmp_50; tmp_49 = tmp_51.is_bound(); if(tmp_49) { const OPTIONAL< CHARSTRING >& tmp_52 = tmp_51.err(); switch (tmp_52.get_selection()) { case OPTIONAL_UNBOUND: tmp_49 = FALSE; break; case OPTIONAL_OMIT: tmp_49 = FALSE; break; default: { const CHARSTRING& tmp_53 = (const CHARSTRING&) tmp_52; tmp_49 = tmp_53.is_present(); break;} } } } } tmp_54 = tmp_49; } if (tmp_54) { current_location.update_lineno(124); /* PCUIF_CodecPort.ttcn, line 124 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Error listening on PCU socket "),sock.log(),TTCN_Logger::log_event_str(": "),const_cast< const UD__Types::UD__listen__result&>(res).result()().err().log(),TTCN_Logger::end_event_log2str())); } else { current_location.update_lineno(126); /* PCUIF_CodecPort.ttcn, line 126 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Error listening on PCU socket "),sock.log(),TTCN_Logger::end_event_log2str())); } } current_location.update_lineno(128); /* PCUIF_CodecPort.ttcn, line 128 */ TTCN_Runtime::stop_component(MTC_COMPREF); } else { current_location.update_lineno(130); /* PCUIF_CodecPort.ttcn, line 130 */ return const_cast< const UD__Types::UD__listen__result&>(res).id(); } } } } if (tmp_38_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(133); /* PCUIF_CodecPort.ttcn, line 133 */ tmp_38_alt_flag_1 = T.timeout(NULL); if (tmp_38_alt_flag_1 == ALT_YES) { current_location.update_lineno(134); /* PCUIF_CodecPort.ttcn, line 134 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for PCU socket "),sock.log(),TTCN_Logger::log_event_str(" connection"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(135); /* PCUIF_CodecPort.ttcn, line 135 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_38_default_flag == ALT_MAYBE) { tmp_38_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_38_default_flag == ALT_YES || tmp_38_default_flag == ALT_BREAK) break; else if (tmp_38_default_flag == ALT_REPEAT) goto tmp_38; } current_location.update_lineno(119); /* PCUIF_CodecPort.ttcn, line 119 */ if (tmp_38_alt_flag_0 == ALT_NO && tmp_38_alt_flag_1 == ALT_NO && tmp_38_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file PCUIF_CodecPort.ttcn between lines 119 and 137."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(138); /* PCUIF_CodecPort.ttcn, line 138 */ return -23; } void f__PCUIF__tx__imm__ass__pch(PCUIF__CODEC__PT& pt, const INTEGER& conn__id, const OCTETSTRING& imm__ass, const HEXSTRING& imsi, const INTEGER& bts__nr, const BOOLEAN& wait__for__cnf, const OCTETSTRING& msg__id) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 141, TTCN_Location::LOCATION_FUNCTION, "f_PCUIF_tx_imm_ass_pch"); current_location.update_lineno(143); /* PCUIF_CodecPort.ttcn, line 143 */ TIMER T("T", 3.0); current_location.update_lineno(145); /* PCUIF_CodecPort.ttcn, line 145 */ PCUIF__Types::PCUIF__pch pch; pch.msg__id() = msg__id; pch.imsi() = hex2str(imsi); pch.data() = imm__ass; pch.confirm() = TRUE; current_location.update_lineno(151); /* PCUIF_CodecPort.ttcn, line 151 */ pt.send(t__SD__PCUIF(conn__id, PCUIF__Types::ts__PCUIF__DATA__REQ(bts__nr, 0, 0, 0, 0, PCUIF__Types::PCUIF__Sapi::PCU__IF__SAPI__PCH__2, PCUIF__Types::enc__PCUIF__pch(pch))), FALSE, NULL); current_location.update_lineno(154); /* PCUIF_CodecPort.ttcn, line 154 */ if ((wait__for__cnf == FALSE)) { current_location.update_lineno(155); /* PCUIF_CodecPort.ttcn, line 155 */ return; } current_location.update_lineno(158); /* PCUIF_CodecPort.ttcn, line 158 */ T.start(); current_location.update_lineno(159); /* PCUIF_CodecPort.ttcn, line 159 */ { tmp_55: alt_status tmp_55_alt_flag_0 = ALT_MAYBE; alt_status tmp_55_alt_flag_1 = ALT_MAYBE; alt_status tmp_55_alt_flag_2 = ALT_MAYBE; alt_status tmp_55_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_55_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(160); /* PCUIF_CodecPort.ttcn, line 160 */ tmp_55_alt_flag_0 = pt.receive(t__SD__PCUIF(conn__id, PCUIF__Types::tr__PCUIF__DATA__CNF__2(INTEGER_template(bts__nr), PCUIF__Types::PCUIF__Sapi_template(PCUIF__Types::PCUIF__Sapi::PCU__IF__SAPI__PCH__2), PCUIF__Types::tr__PCUIF__DATA__CNF__2_msg__id_defval)), NULL, any_compref, NULL, NULL, NULL); if (tmp_55_alt_flag_0 == ALT_YES) { current_location.update_lineno(161); /* PCUIF_CodecPort.ttcn, line 161 */ TTCN_Logger::log_str(TTCN_USER, "IMM.ASS was sent on PCH"); break; } } if (tmp_55_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(163); /* PCUIF_CodecPort.ttcn, line 163 */ tmp_55_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL); if (tmp_55_alt_flag_1 == ALT_YES) { current_location.update_lineno(163); /* PCUIF_CodecPort.ttcn, line 163 */ goto tmp_55; } } if (tmp_55_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(164); /* PCUIF_CodecPort.ttcn, line 164 */ tmp_55_alt_flag_2 = T.timeout(NULL); if (tmp_55_alt_flag_2 == ALT_YES) { current_location.update_lineno(165); /* PCUIF_CodecPort.ttcn, line 165 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for PCU DATA.cnf (PCH)"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(166); /* PCUIF_CodecPort.ttcn, line 166 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_55_default_flag == ALT_MAYBE) { tmp_55_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_55_default_flag == ALT_YES || tmp_55_default_flag == ALT_BREAK) break; else if (tmp_55_default_flag == ALT_REPEAT) goto tmp_55; } current_location.update_lineno(159); /* PCUIF_CodecPort.ttcn, line 159 */ if (tmp_55_alt_flag_0 == ALT_NO && tmp_55_alt_flag_1 == ALT_NO && tmp_55_alt_flag_2 == ALT_NO && tmp_55_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file PCUIF_CodecPort.ttcn between lines 159 and 168."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } } void f__PCUIF__tx__mac__block__agch(PCUIF__CODEC__PT& pt, const INTEGER& conn__id, const OCTETSTRING& mac__block, const BOOLEAN& confirm, const INTEGER& bts__nr, const BOOLEAN& wait__for__cnf, const OCTETSTRING& msg__id) { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 173, TTCN_Location::LOCATION_FUNCTION, "f_PCUIF_tx_mac_block_agch"); current_location.update_lineno(175); /* PCUIF_CodecPort.ttcn, line 175 */ TIMER T("T", 3.0); current_location.update_lineno(177); /* PCUIF_CodecPort.ttcn, line 177 */ PCUIF__Types::PCUIF__agch agch; agch.msg__id() = msg__id; agch.data() = mac__block; agch.confirm() = confirm; current_location.update_lineno(182); /* PCUIF_CodecPort.ttcn, line 182 */ pt.send(t__SD__PCUIF(conn__id, PCUIF__Types::ts__PCUIF__DATA__REQ(bts__nr, 0, 0, 0, 0, PCUIF__Types::PCUIF__Sapi::PCU__IF__SAPI__AGCH__2, PCUIF__Types::enc__PCUIF__agch(agch))), FALSE, NULL); current_location.update_lineno(185); /* PCUIF_CodecPort.ttcn, line 185 */ if ((wait__for__cnf == FALSE)) { current_location.update_lineno(186); /* PCUIF_CodecPort.ttcn, line 186 */ return; } current_location.update_lineno(189); /* PCUIF_CodecPort.ttcn, line 189 */ T.start(); current_location.update_lineno(190); /* PCUIF_CodecPort.ttcn, line 190 */ { tmp_56: alt_status tmp_56_alt_flag_0 = ALT_MAYBE; alt_status tmp_56_alt_flag_1 = ALT_MAYBE; alt_status tmp_56_alt_flag_2 = ALT_MAYBE; alt_status tmp_56_default_flag = ALT_MAYBE; boolean first_run = TRUE; TTCN_Snapshot::take_new(FALSE); for ( ; ; ) { if (tmp_56_alt_flag_0 == ALT_MAYBE) { current_location.update_lineno(191); /* PCUIF_CodecPort.ttcn, line 191 */ tmp_56_alt_flag_0 = pt.receive(t__SD__PCUIF(conn__id, PCUIF__Types::tr__PCUIF__DATA__CNF__2(INTEGER_template(bts__nr), PCUIF__Types::PCUIF__Sapi_template(PCUIF__Types::PCUIF__Sapi::PCU__IF__SAPI__AGCH__2), PCUIF__Types::tr__PCUIF__DATA__CNF__2_msg__id_defval)), NULL, any_compref, NULL, NULL, NULL); if (tmp_56_alt_flag_0 == ALT_YES) { current_location.update_lineno(192); /* PCUIF_CodecPort.ttcn, line 192 */ TTCN_Logger::log_str(TTCN_USER, "IMM.ASS was sent on AGCH"); break; } } if (tmp_56_alt_flag_1 == ALT_MAYBE) { current_location.update_lineno(194); /* PCUIF_CodecPort.ttcn, line 194 */ tmp_56_alt_flag_1 = pt.receive(any_compref, NULL, NULL, NULL); if (tmp_56_alt_flag_1 == ALT_YES) { current_location.update_lineno(194); /* PCUIF_CodecPort.ttcn, line 194 */ goto tmp_56; } } if (tmp_56_alt_flag_2 == ALT_MAYBE) { current_location.update_lineno(195); /* PCUIF_CodecPort.ttcn, line 195 */ tmp_56_alt_flag_2 = T.timeout(NULL); if (tmp_56_alt_flag_2 == ALT_YES) { current_location.update_lineno(196); /* PCUIF_CodecPort.ttcn, line 196 */ TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for PCU DATA.cnf (AGCH)"),TTCN_Logger::end_event_log2str())); current_location.update_lineno(197); /* PCUIF_CodecPort.ttcn, line 197 */ TTCN_Runtime::stop_component(MTC_COMPREF); } } if (tmp_56_default_flag == ALT_MAYBE) { tmp_56_default_flag = TTCN_Default::try_altsteps(first_run); if (tmp_56_default_flag == ALT_YES || tmp_56_default_flag == ALT_BREAK) break; else if (tmp_56_default_flag == ALT_REPEAT) goto tmp_56; } current_location.update_lineno(190); /* PCUIF_CodecPort.ttcn, line 190 */ if (tmp_56_alt_flag_0 == ALT_NO && tmp_56_alt_flag_1 == ALT_NO && tmp_56_alt_flag_2 == ALT_NO && tmp_56_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file PCUIF_CodecPort.ttcn between lines 190 and 199."); TTCN_Snapshot::take_new(TRUE); first_run = FALSE; } } current_location.update_lineno(200); /* PCUIF_CodecPort.ttcn, line 200 */ return; } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "PCUIF_CodecPort"); PCUIF__Types::module_object.pre_init_module(); UD__PortType::module_object.pre_init_module(); module_object.add_function("PCUIF_to_UD", (genericfunc_t)&PCUIF__to__UD, NULL); module_object.add_function("fix_padding", (genericfunc_t)&fix__padding, NULL); module_object.add_function("UD_to_PCUIF", (genericfunc_t)&UD__to__PCUIF, NULL); module_object.add_function("f_pcuif_connect", (genericfunc_t)&f__pcuif__connect, NULL); module_object.add_function("f_pcuif_close", (genericfunc_t)&f__pcuif__close, NULL); module_object.add_function("f_pcuif_listen", (genericfunc_t)&f__pcuif__listen, NULL); module_object.add_function("f_PCUIF_tx_imm_ass_pch", (genericfunc_t)&f__PCUIF__tx__imm__ass__pch, NULL); module_object.add_function("f_PCUIF_tx_mac_block_agch", (genericfunc_t)&f__PCUIF__tx__mac__block__agch, NULL); } void post_init_module() { TTCN_Location current_location("PCUIF_CodecPort.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "PCUIF_CodecPort"); PCUIF__Types::module_object.post_init_module(); UD__PortType::module_object.post_init_module(); current_location.update_lineno(69); /* PCUIF_CodecPort.ttcn, line 69 */ template_t__SD__PCUIF__MSGT_bts__nr_defval = ANY_VALUE; current_location.update_lineno(142); /* PCUIF_CodecPort.ttcn, line 142 */ const_f__PCUIF__tx__imm__ass__pch_bts__nr_defval = 0; current_location.update_lineno(142); /* PCUIF_CodecPort.ttcn, line 142 */ const_f__PCUIF__tx__imm__ass__pch_wait__for__cnf_defval = TRUE; current_location.update_lineno(142); /* PCUIF_CodecPort.ttcn, line 142 */ const_f__PCUIF__tx__imm__ass__pch_msg__id_defval = os_0; current_location.update_lineno(173); /* PCUIF_CodecPort.ttcn, line 173 */ const_f__PCUIF__tx__mac__block__agch_confirm_defval = TRUE; current_location.update_lineno(174); /* PCUIF_CodecPort.ttcn, line 174 */ const_f__PCUIF__tx__mac__block__agch_bts__nr_defval = 0; current_location.update_lineno(174); /* PCUIF_CodecPort.ttcn, line 174 */ const_f__PCUIF__tx__mac__block__agch_wait__for__cnf_defval = TRUE; current_location.update_lineno(174); /* PCUIF_CodecPort.ttcn, line 174 */ const_f__PCUIF__tx__mac__block__agch_msg__id_defval = os_0; } } /* end of namespace */