1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
16 * Szabo, Janos Zoltan – initial implementation
18 ******************************************************************************/
25 #ifdef TITAN_RUNTIME_2
27 class Set_Of_Template;
29 class Restricted_Length_Template;
30 class Record_Of_Template;
32 enum answer { FAILURE, SUCCESS, NO_CHANCE };
33 enum type_of_matching { SUBSET, EXACT, SUPERSET };
34 extern void **allocate_pointers(int n_elements);
35 extern void **reallocate_pointers(void **old_pointer, int old_n_elements,
37 extern void free_pointers(void **old_pointer);
39 #ifdef TITAN_RUNTIME_2
40 typedef boolean (*compare_function_t)(const Record_Of_Type *left_ptr, int left_index,
41 const Record_Of_Type *right_ptr, int right_index);
43 typedef boolean (*compare_function_t)(const Base_Type *left_ptr, int left_index,
44 const Base_Type *right_ptr, int right_index);
47 typedef boolean (*match_function_t)(const Base_Type *value_ptr, int value_index,
48 const Restricted_Length_Template *template_ptr, int template_index, boolean legacy);
50 typedef void (*log_function_t)(const Base_Type *value_ptr,
51 const Restricted_Length_Template *template_ptr, int index_value,
52 int index_template, boolean legacy);
54 #ifdef TITAN_RUNTIME_2
55 extern boolean compare_set_of(const Record_Of_Type *left_ptr, int left_size,
56 const Record_Of_Type *right_ptr, int right_size,
57 compare_function_t compare_function);
59 extern boolean compare_set_of(const Base_Type *left_ptr, int left_size,
60 const Base_Type *right_ptr, int right_size,
61 compare_function_t compare_function);
64 extern boolean match_array(const Base_Type *value_ptr, int value_size,
65 const Restricted_Length_Template *template_ptr, int template_size,
66 match_function_t match_function, boolean legacy);
68 extern boolean match_record_of(const Base_Type *value_ptr, int value_size,
69 const Record_Of_Template *template_ptr, int template_size,
70 match_function_t match_function, boolean legacy);
72 extern boolean match_set_of(const Base_Type *value_ptr, int value_size,
73 const Restricted_Length_Template *template_ptr, int template_size,
74 match_function_t match_function, boolean legacy);
76 extern void log_match_heuristics(const Base_Type *value_ptr, int value_size,
77 const Restricted_Length_Template *template_ptr, int template_size,
78 match_function_t match_function, log_function_t log_function, boolean legacy);
80 boolean match_set_of_internal(const Base_Type *value_ptr,
81 int value_start, int value_size,
82 const Restricted_Length_Template *template_ptr,
83 int template_start, int template_size,
84 match_function_t match_function,
85 type_of_matching match_type,
86 int* number_of_uncovered, int* pair_list,
87 unsigned int number_of_checked, boolean legacy);