Top | ![]() |
![]() |
![]() |
![]() |
void | ide_search_reducer_init () |
gboolean | ide_search_reducer_accepts () |
void | ide_search_reducer_take () |
void | ide_search_reducer_push () |
void | ide_search_reducer_destroy () |
GPtrArray * | ide_search_reducer_free () |
This is a helper structure for search engines to reduce the number of items they inflate when performing a search.
void ide_search_reducer_init (IdeSearchReducer *reducer
,gsize max_results
);
Initializes a new IdeSearchReducer to be used to reduce the number of search results that are created. This is generally just used to help keep search performance good.
gboolean ide_search_reducer_accepts (IdeSearchReducer *reducer
,gfloat score
);
This helper allows you to check if a result with score
would be allowed
into the result set, or if the score is too low. This helps in situations
where you want to avoid inflating an IdeSearchResult unless necessary.
void ide_search_reducer_take (IdeSearchReducer *reducer
,IdeSearchResult *result
);
Like ide_search_reducer_push()
but takes ownership of result
by
stealing the reference.
void ide_search_reducer_push (IdeSearchReducer *reducer
,IdeSearchResult *result
);
Adds result to the set unless it scores too low.
void
ide_search_reducer_destroy (IdeSearchReducer *reducer
);
Frees the results.
GPtrArray * ide_search_reducer_free (IdeSearchReducer *reducer
,gboolean free_results
);
Frees all items associated with the result set, unless free_results
is
FALSE
and then the results are returned as an array.
An array of IdeSearchResult unless free_results
is TRUE
, then
NULL
is returned.
[nullable][transfer container][element-type Ide.SearchResult]