navit  0.5.6
About: NavIt is a car navigation system with GPS tracking and a routing engine.
  Fossies Dox: navit-0.5.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mapset.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct mapsetmapset_new (struct attr *parent, struct attr **attrs)
 Creates a new, empty mapset. More...
 
struct mapsetmapset_dup (struct mapset *ms)
 
struct attr_itermapset_attr_iter_new (void *unused)
 
void mapset_attr_iter_destroy (struct attr_iter *iter)
 
int mapset_add_attr (struct mapset *ms, struct attr *attr)
 Adds a map to a mapset. More...
 
int mapset_remove_attr (struct mapset *ms, struct attr *attr)
 
int mapset_get_attr (struct mapset *ms, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 
void mapset_destroy (struct mapset *ms)
 Destroys a mapset. More...
 
struct mapmapset_get_map_by_name (struct mapset *ms, const char *map_name)
 Gets a map from the mapset by name. More...
 
struct mapset_handlemapset_open (struct mapset *ms)
 Returns a new handle for a mapset. More...
 
struct mapmapset_next (struct mapset_handle *msh, int active)
 Gets the next map from a mapset handle. More...
 
void mapset_close (struct mapset_handle *msh)
 Closes a mapset handle after it is no longer used. More...
 
struct mapset_searchmapset_search_new (struct mapset *ms, struct item *item, struct attr *search_attr, int partial)
 Starts a search on a mapset. More...
 
struct itemmapset_search_get_item (struct mapset_search *this_)
 Returns the next found item from a mapset search. More...
 
void mapset_search_destroy (struct mapset_search *this_)
 Destroys a mapset search. More...
 
struct mapsetmapset_ref (struct mapset *m)
 
void mapset_unref (struct mapset *m)
 

Function Documentation

◆ mapset_add_attr()

int mapset_add_attr ( struct mapset ms,
struct attr attr 
)

Adds a map to a mapset.

Parameters
msThe mapset to add the map to
mThe map to be added

Definition at line 86 of file mapset.c.

References attr_generic_add_attr(), mapset::attrs, g_list_append(), attr::map, mapset::maps, attr::type, and attr::u.

Referenced by Java_org_navitproject_navit_NavitCallbackHandler_callbackMessageChannel(), mapset_add_py(), navit_get_search_results_map(), navit_init(), and pedestrian_navit_init().

◆ mapset_attr_iter_destroy()

void mapset_attr_iter_destroy ( struct attr_iter iter)

Definition at line 76 of file mapset.c.

References g_free(), and attr_iter::iter.

Referenced by request_mapset_attr_iter_destroy().

◆ mapset_attr_iter_new()

struct attr_iter* mapset_attr_iter_new ( void *  unused)

Definition at line 72 of file mapset.c.

References g_new0.

Referenced by request_mapset_attr_iter().

◆ mapset_close()

◆ mapset_destroy()

void mapset_destroy ( struct mapset ms)

Destroys a mapset.

This destroys a mapset. Please note that it does not touch the contained maps in any way.

Parameters
msThe mapset to be destroyed

Definition at line 138 of file mapset.c.

References attr_list_free(), mapset::attrs, g_free(), g_list_free(), and mapset::maps.

Referenced by mapset_destroy_py().

◆ mapset_dup()

struct mapset* mapset_dup ( struct mapset ms)

Definition at line 64 of file mapset.c.

References mapset::attrs, g_list_copy(), mapset::maps, mapset_new(), and NULL.

◆ mapset_get_attr()

int mapset_get_attr ( struct mapset ms,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

◆ mapset_get_map_by_name()

struct map* mapset_get_map_by_name ( struct mapset ms,
const char *  map_name 
)

Gets a map from the mapset by name.

Parameters
msThe map
map_namethe map name used by the search
Returns
The next map

Definition at line 230 of file mapset.c.

References map_get_attr(), mapset_close(), mapset_next(), mapset_open(), NULL, attr::str, and attr::u.

Referenced by Java_org_navitproject_navit_NavitCallbackHandler_callbackMessageChannel(), navit_cmd_map_add_curr_pos(), navit_cmd_map_item_set_attr(), and navit_get_search_results_map().

◆ mapset_new()

struct mapset* mapset_new ( struct attr parent,
struct attr **  attrs 
)

Creates a new, empty mapset.

Returns
The new mapset

Definition at line 53 of file mapset.c.

References attr_list_dup(), mapset::attrs, mapset::func, g_new0, mapset_func, and navit_object_ref().

Referenced by mapset_dup(), and mapset_new_py().

◆ mapset_next()

struct map* mapset_next ( struct mapset_handle msh,
int  active 
)

Gets the next map from a mapset handle.

The active argument governs whether (and how) to limit the search to active maps:

Passing 0 causes this function to cycle through all maps, whether active or not.

Passing a value of 2 will return only maps which have the attr_route_active attribute set to true.

Passing a value of 3 will return only maps which have the attr_search_active attribute set to true.

Passing any other nonzero value will return only maps which have the attr_active attribute set to true, or not set at all.

Parameters
mshThe mapset handle to get the next map of
activeWhether to cycle only through active maps (see description)
Returns
The next map

Definition at line 192 of file mapset.c.

References active, _GList::data, g_list_next, mapset_handle::l, map_get_attr(), NULL, attr::num, and attr::u.

Referenced by NGQPoint::_coordName(), do_draw(), Backend::get_pois(), NGQPoint::getPOI(), gui_internal_cmd2_route_height_profile(), gui_internal_cmd_pois(), map_route_occluded_get_buildings(), mapset_get_map_by_name(), model_poi(), navit_destroy(), navit_get_attr(), navit_init(), navit_map_progress(), osd_route_guard_init(), osd_speed_cam_draw(), route_find_nearest_street(), route_graph_build_next_map(), tracking_doupdate_lines(), traffic_location_get_matching_points(), traffic_location_populate_route_graph(), and traffic_message_restore_segments().

◆ mapset_open()

◆ mapset_ref()

struct mapset* mapset_ref ( struct mapset m)

◆ mapset_remove_attr()

int mapset_remove_attr ( struct mapset ms,
struct attr attr 
)

◆ mapset_search_destroy()

void mapset_search_destroy ( struct mapset_search this_)

Destroys a mapset search.

Parameters
thisThe mapset search to be destroyed

Definition at line 374 of file mapset.c.

Referenced by search_list_get_result(), and search_list_search_free().

◆ mapset_search_get_item()

struct item* mapset_search_get_item ( struct mapset_search this_)

Returns the next found item from a mapset search.

This function returns the next item from a mapset search or NULL if there are no more items found. It automatically iterates through all the maps in the mapset. Please note that maps which have the attr_active attribute associated with them and set to false are not searched.

Parameters
thisThe mapset search to return an item from
Returns
The next found item or NULL if there are no more items found

Definition at line 321 of file mapset.c.

References _GList::data, g_list_next, mapset_search::item, mapset_search::map, map_get_attr(), map_search_destroy(), map_search_get_item(), map_search_new(), mapset::maps, mapset_search::mapset, mapset_search::ms, NULL, attr::num, mapset_search::partial, mapset_search::search_attr, attr::type, and attr::u.

Referenced by search_list_get_result().

◆ mapset_search_new()

struct mapset_search* mapset_search_new ( struct mapset ms,
struct item item,
struct attr search_attr,
int  partial 
)

Starts a search on a mapset.

This function starts a search on a mapset. What attributes one can search for depends on the map plugin. See the description of map_search_new() in map.c for details.

If you enable partial matches bear in mind that the search matches only the begin of the strings - a search for a street named "street" would match to "streetfoo", but not to "somestreet". Search is case insensitive.

The item passed to this function specifies a "superior item" to "search within" - e.g. a town in which we want to search for a street, or a country in which to search for a town.

Parameters
msThe mapset that should be searched
itemSpecifies a superior item to "search within" (see description)
search_attrAttribute specifying what to search for. See description.
partialSet this to true to also have partial matches. See description.
Returns
A new mapset search struct for this search

Definition at line 295 of file mapset.c.

References dbg, g_new0, item, lvl_debug, mapset_search::ms, NULL, mapset_search::partial, and mapset_search::search_attr.

Referenced by search_list_get_result().

◆ mapset_unref()

void mapset_unref ( struct mapset m)