RAVE
raveobject_list.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of RAVE.
5
6RAVE is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11RAVE is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with RAVE. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
30#ifndef RAVEOBJECT_LIST_H
31#define RAVEOBJECT_LIST_H
32
33#include "rave_object.h"
34
39
44
52
62
69
77
84
92
100
106
113
123void RaveObjectList_sort(RaveObjectList_t* list, int (*sortfun)(const void*, const void*));
124
133
134#endif /* RAVEOBJECT_LIST_H */
Generic implementation of an object that is used within rave.
void RaveObjectList_sort(RaveObjectList_t *list, int(*sortfun)(const void *, const void *))
Sorts the list according to the provided sort function.
Definition raveobject_list.c:178
RaveCoreObject * RaveObjectList_getLast(RaveObjectList_t *list)
Returns the item at the end.
Definition raveobject_list.c:141
int RaveObjectList_indexOf(RaveObjectList_t *list, RaveCoreObject *obj)
Locates the object at returns the index in the list.
Definition raveobject_list.c:184
RaveCoreObject * RaveObjectList_remove(RaveObjectList_t *list, int index)
Removes the item at the specified position and returns it.
Definition raveobject_list.c:148
int RaveObjectList_size(RaveObjectList_t *list)
Returns the number of items in this list.
Definition raveobject_list.c:128
RaveCoreObject * RaveObjectList_get(RaveObjectList_t *list, int index)
Returns the item at the specified position.
Definition raveobject_list.c:134
RaveCoreObjectType RaveObjectList_TYPE
Type definition to use when creating a rave object.
Definition raveobject_list.c:200
void RaveObjectList_release(RaveObjectList_t *list, int index)
Removes the item at the specified position and releases it.
Definition raveobject_list.c:155
RaveCoreObject * RaveObjectList_removeLast(RaveObjectList_t *list)
Removes the last item.
Definition raveobject_list.c:171
int RaveObjectList_add(RaveObjectList_t *list, RaveCoreObject *obj)
Add one instance to the list.
Definition raveobject_list.c:102
int RaveObjectList_insert(RaveObjectList_t *list, int index, RaveCoreObject *obj)
Inserts the object at the specified index, if index < 0 or index > size, then this function will add ...
Definition raveobject_list.c:115
void RaveObjectList_clear(RaveObjectList_t *list)
Removes all entries from the list.
Definition raveobject_list.c:162
Represents a list.
Definition raveobject_list.c:35
RAVE_OBJECT_HEAD RaveList_t * list
Always on top.
Definition raveobject_list.c:37
The basic raveobject that contains the header information for all rave objects.
Definition rave_object.h:42
The rave object type definition.
Definition rave_object.h:52