Main Page Alphabetical List Compound List File List Compound Members File Members
GATTableAnyKey.h File ReferenceHeader file for the GATTableAnyKey class.
More...
#include "GAT.h"
Include dependency graph for GATTableAnyKey.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
|
Defines |
| #define | _GATTABLEANYKEY_H_ 1 |
Typedefs |
| typedef GATuint32(* | GATTable_GetKeySizeProc )(GATTable_const, void const *) |
| typedef GATBool(* | GATTable_EqualKeysProc )(GATTable_const, void const *, void const *) |
| typedef unsigned long(* | GATTable_GetHashProc )(GATTable_const, void const *) |
| typedef int(* | GATTable_CloneKeyProc )(GATTable_const, void const *, void **) |
| typedef void(* | GATTable_DestroyKeyProc )(GATTable_const, void **) |
Functions |
| GATBool | GATTable_Default_Equal_Keys (GATTable_const table, void const *key1, const void *key2) |
| | GATTable_Default_Equal_Keys.
|
| unsigned long | GATTable_Default_Hash_sdbm (GATTable_const table, void const *key) |
| | GATTable_Default_Hash_sdbm.
|
| GATResult | GATTable_Default_Clone_Key (GATTable_const table, void const *src, void **dest) |
| | GATTable_Default_CloneKey.
|
| void | GATTable_Default_Destroy_Key (GATTable_const table, void **key) |
| | GATTable_Default_Destroy_Key.
|
| GATTable | GATTable_CreateAnyKey (GATTable_GetKeySizeProc get_keysize, GATTable_EqualKeysProc equalkeys, GATTable_CloneKeyProc copykey, GATTable_GetHashProc get_hash, GATTable_DestroyKeyProc destroy_key) |
| | GATTable_CreateAnyKey Create the GATTable object.
|
Detailed Description
Header file for the GATTableAnyKey class.
This in an additional interface to the GATTable object, which allows to specify arbitrary key types.
Please note, that table type of tables are not serialisable! So use it with care.
- Date:
-
Tue Nov 4 2003
- Version:
-
- Header:
-
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATTableAnyKey.h,v 1.5 2004/03/24 19:30:58 hartmutkaiser Exp
Copyright (C) Hartmut Kaiser This file is part of the GAT Engine. Contributed by Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.
Use, modification and distribution is subject to the Gridlab Software License. (See accompanying file GLlicense.txt or copy at http://www.gridlab.org/GLlicense.txt)
Definition in file GATTableAnyKey.h.
Define Documentation
| #define _GATTABLEANYKEY_H_ 1
|
|
Typedef Documentation
| typedef unsigned long(* GATTable_GetHashProc)(GATTable_const, void const *)
|
|
| typedef int(* GATTable_CloneKeyProc)(GATTable_const, void const *, void **)
|
|
Function Documentation
|
|
GATTable_Default_Equal_Keys.
The function GATTable_Default_Equal_Keys is the default callback function which is used to compare two different keys of a GATTableAnyKey for equality. This function compares the keys with the help of the function memcmp. - Parameters:
-
| table |
The table, for which these keys are to be used. |
| key1 |
first key for comparison. |
| key2 |
second key for comparison. |
- Returns:
-
GATTrue for equal keys, GATFalse for non equal keys
Definition at line 1651 of file GATTable.c.
References GATBool, GATFalse, GATTable_const, GATTable_Internal_Get_KeySize(), GATTrue, GATuint32, key1, and key2.
Referenced by GATTable_CreateAnyKey(). |
| unsigned long GATTable_Default_Hash_sdbm |
( |
GATTable_const |
table, |
|
|
void const * |
key |
|
) |
|
|
| void GATTable_Default_Destroy_Key |
( |
GATTable_const |
table, |
|
|
void ** |
key |
|
) |
|
|
|
|
GATTable_CreateAnyKey Create the GATTable object.
This is the method used by any application code to create a GATTable object, which used the provided callback functions.
Note though, that objects of this type may not be used for serialisation. - Parameters:
-
| get_keysize |
The callback function to calculate the size of a given key. This parameter must be supplied. |
| equalkeys |
The callback function to compare two keys for equality. If this param is 0 (zero) the default callback function will be used (GATTable_Default_Equal_Keys). |
| get_hash |
The callback function to calculate the hash value for a given key. If this param is 0 (zero) the default callback function will be used used (GATTable_Default_Hash_sdbm). |
| destroy_key |
The callback function to destroy a key (deallocate all associated memory). If this parameter is 0 (zero), the default callback function will be used (GATTable_Default_Destroy_Key). |
- Returns:
-
The GATTable object
Definition at line 226 of file GATTable.c.
References GATTable_S::clone_key, GATTable_S::destroy_key, GATTable_S::element_count, GATTable_S::equal_keys, GATTable_S::GATObject__vtable, GATTable_S::GATSerialisable__vtable, GATTable__vtable, GATTable_CloneKeyProc, GATTable_Default_Clone_Key(), GATTable_Default_Destroy_Key(), GATTable_Default_Equal_Keys(), GATTable_Default_Hash_sdbm(), GATTable_DestroyKeyProc, GATTable_EqualKeysProc, GATTable_GetHashProc, GATTable_GetKeySizeProc, GATTable_ISerialisable__vtable, GATuint32, GATTable_S::get_hash, GATTable_S::get_key_size, GATTable_S::load_limit, size, GATTable_S::table, and GATTable_S::table_length.
Referenced by GATMonitorable_Impl_Create(), and GATTable_Create(). |
|