RAVE
raveobject_hashtable.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------------------------------------------------------------------------*/
28#ifndef RAVEOBJECT_HASHTABLE_H_
29#define RAVEOBJECT_HASHTABLE_H_
30
31#include "rave_object.h"
32#include "rave_list.h"
33#include "raveobject_list.h"
34
39
44
52int RaveObjectHashTable_put(RaveObjectHashTable_t* table, const char* key, RaveCoreObject* obj);
53
61
68
75int RaveObjectHashTable_exists(RaveObjectHashTable_t* table, const char* key);
76
84
90
100
108
114
115#endif /* RAVE_HASHTABLE_H */
Implementation of a simple list.
Generic implementation of an object that is used within rave.
void RaveObjectHashTable_clear(RaveObjectHashTable_t *table)
Clears all entries in the table.
Definition raveobject_hashtable.c:423
int RaveObjectHashTable_size(RaveObjectHashTable_t *table)
Returns the number of items in this table.
Definition raveobject_hashtable.c:365
RaveList_t * RaveObjectHashTable_keys(RaveObjectHashTable_t *table)
Returns the keys for the table at the current state.
Definition raveobject_hashtable.c:430
void RaveObjectHashTable_destroyKeyList(RaveList_t *l)
Helper function to destroy the returned list of keys.
Definition raveobject_hashtable.c:471
RaveCoreObject * RaveObjectHashTable_remove(RaveObjectHashTable_t *table, const char *key)
Removes the item with the specified key and returns it.
Definition raveobject_hashtable.c:384
int RaveObjectHashTable_put(RaveObjectHashTable_t *table, const char *key, RaveCoreObject *obj)
Inserts a key - object binding in the table.
Definition raveobject_hashtable.c:305
RaveObjectList_t * RaveObjectHashTable_values(RaveObjectHashTable_t *table)
Returns the values for the table.
Definition raveobject_hashtable.c:452
int RaveObjectHashTable_exists(RaveObjectHashTable_t *table, const char *key)
Returns if the specified key exists or not.
Definition raveobject_hashtable.c:376
RaveCoreObject * RaveObjectHashTable_get(RaveObjectHashTable_t *table, const char *key)
Returns the object referred to by key.
Definition raveobject_hashtable.c:346
RaveCoreObjectType RaveObjectHashTable_TYPE
Type definition to use when creating a rave object.
Definition raveobject_hashtable.c:484
Implementation of a rave object list that ensures that the objects contained within the list are rele...
Represents a list.
Definition rave_list.c:36
Represents a hash table.
Definition raveobject_hashtable.c:45
Represents a list.
Definition raveobject_list.c:35
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