2 * Navit, a modular navigation system.
3 * Copyright (C) 2005-2008 Navit Team
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
23 #include "roadprofile.h"
26 roadprofile_set_attr_do(struct roadprofile *this, struct attr *attr)
30 this->speed=attr->u.num;
33 this->maxspeed=attr->u.num;
35 case attr_route_weight:
36 this->route_weight=attr->u.num;
44 roadprofile_new(struct attr *parent, struct attr **attrs)
46 struct roadprofile *this_;
48 this_=g_new0(struct roadprofile, 1);
49 this_->attrs=attr_list_dup(attrs);
51 for (attr=attrs;*attr; attr++)
52 roadprofile_set_attr_do(this_, *attr);
57 roadprofile_get_attr(struct roadprofile *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
59 return attr_generic_get_attr(this_->attrs, NULL, type, attr, iter);
63 roadprofile_set_attr(struct roadprofile *this_, struct attr *attr)
65 roadprofile_set_attr_do(this_, attr);
66 this_->attrs=attr_generic_set_attr(this_->attrs, attr);
71 roadprofile_add_attr(struct roadprofile *this_, struct attr *attr)
73 this_->attrs=attr_generic_add_attr(this_->attrs, attr);
78 roadprofile_remove_attr(struct roadprofile *this_, struct attr *attr)
80 this_->attrs=attr_generic_remove_attr(this_->attrs, attr);