GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

GATTable.c File Reference

Main file for the GATFile class. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "GATInternal.h"
#include "GATType.h"
#include "GATTable.h"
#include "GATTableAnyKey.h"
#include "GATErrors.h"
#include "GATXdsWrapper.h"
#include "GATUtil.h"

Include dependency graph for GATTable.c:

Include dependency graph

Go to the source code of this file.

Compounds

struct  Hash_String_S
struct  Hash_float_S
struct  Hash_int_S
struct  Hash_short_S
struct  Hash_double_S
struct  Hash_GATObject_S
struct  Hash_Element_S
struct  GATTable_S

Typedefs

typedef Hash_String_SHash_String
typedef Hash_float_SHash_float
typedef Hash_int_SHash_int
typedef Hash_short_SHash_short
typedef Hash_double_SHash_double
typedef Hash_GATObject_SHash_GATObject
typedef Hash_Element_SHash_Element

Functions

 GATOBJECT_DEFINE_VTABLE (GATTable)
 GATSERIALISABLE_DEFINE_VTABLE (GATTable)
 GATOBJECT_DEFINE_CONVERTERS (GATTable) static GATBool GATTable_Internal_Equal_Keys(GATTable_ const table
unsigned long GATTable_Internal_Hash_sdbm (GATTable_const table, void const *key)
 GATTable_Internal_Hash_sdbm Creates a hash from a key using sdbm.

GATuint32 GATTable_Internal_Get_KeySize (GATTable_const table, void const *key)
 GATTable_Internal_Get_KeySize.

GATResult GATTable_Internal_CloneKey (GATTable_const table, void const *src, void **dest)
 GATTable_Internal_CloneKey.

void GATTable_Internal_Destroy_Key (GATTable_const table, void **key)
 GATTable_Internal_Destroy_Key.

GATuint32 GATTable_Internal_Index (GATuint32 table_length, unsigned long hash_value)
 GATTable_Internal_Index Find the hash table index for a given hash value.

GATResult GATTable_Internal_Expand (GATTable table)
 GATTable_Internal_Expand Expands the hash table by a 2^n+1.

GATResult GATTable_Internal_Add (GATTable table, const void *key, void *value, GATType type)
 GATTable_Internal_Add Add any type to the hash table Uses void* as the type and the type is defined as a GATType.

GATResult GATTable_SerialiseItems (GATTable_const list, GATXds xds, GATXdsScope flag, void **buffer, size_t *buffer_size, GATBool clear_dirty)
GATResult GATTable_DeSerialise_Create (GATXds xds, GATuint32 table_length, GATuint32 element_count, GATTable *table)
 GATTable_DeSerialise_Create.

GATBool GATTable_Internal_Equal_Keys_String (GATTable_const table, void const *key1, const void *key2)
GATuint32 GATTable_Internal_Get_KeySize_String (GATTable_const table, void const *key)
GATResult GATTable_Internal_CloneKey_String (GATTable_const table, void const *src, void **dest)
GATResult GATTable_Register_GATSerialisable ()
 GATTable_Register_GATSerialisable The GATTable_Register_GATSerialisable function registers the serialization vtable with the GAT engine to allow generic object creation.

GATTable GATTable_Create (void)
 GATTable_Create Create the GATTable object.

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.

GATType GATTable_GetType (GATTable_const table)
 int GATTable_GetType(GATTable_const file) Return the type of the GATTable

GATResult GATTable_Clone (GATTable_const table, GATTable *new_table)
 int GATTable_Clone(GATTable_const filehandle, GATTable *new_file) Clone the given GATTable

GATResult GATTable_Equals (GATTable_const lhs, GATTable_const rhs, GATBool *isequal)
 int GATTable_Equals(GATTable_const lhs, GATTable_const rhs, GATBool *isequal) Compares two GATTable objects

void GATTable_Destroy (GATTable *table)
 GATTable_Destroy The GATTable destructor.

GATResult GATTable_GetInterface (GATTable_const table, GATInterface iftype, void const **ifp)
 int GATTable_GetInterface(GATTable_const table, GATInterface iftype, void const **ifp) Get an interface supported by a GATList

GATResult GATTable_Remove (GATTable table, const void *key)
 GATTable_Remove Remove a key,value pair from the hash table.

GATResult GATTable_Add_int (GATTable table, const void *key, GATint32 data)
 GATTable_Add_Int Add a type int to the hash table.

GATResult GATTable_Add_short (GATTable table, const void *key, GATint16 data)
 GATTable_Add_Short Add a type short to the hash table.

GATResult GATTable_Add_double (GATTable table, const void *key, GATdouble64 data)
 GATTable_Add_Double Add a type double to the hash table.

GATResult GATTable_Add_float (GATTable table, const void *key, GATfloat32 data)
 GATTable_Add_Float Add a type float to the hash table.

GATResult GATTable_Add_String (GATTable table, const void *key, const char *data)
 GATTable_Add_String Add a type string to the hash table.

GATResult GATTable_Add_GATObject (GATTable table, const void *key, GATObject_const data)
 GATTable_Add_GATObject Add a type GATObject to the hash table.

GATType GATTable_Get_ElementType (GATTable_const table, const void *key)
 GATTable_Get_ElementType Get the type associated with a key.

void ** GATTable_GetKeys (GATTable_const table)
 GATTable_GetKeys Get a list of all the current keys in the hash table.

void GATTable_ReleaseKeys (GATTable_const this, void ***keys)
 GATTable_ReleaseKeys.

GATResult GATTable_Get_int (GATTable_const table, const void *key, GATint32 *data)
 GATTable_Get_Int Get the int type data associated with a key.

GATResult GATTable_Get_short (GATTable_const table, const void *key, GATint16 *data)
 GATTable_Get_Short Get the short type data associated with a key.

GATResult GATTable_Get_double (GATTable_const table, const void *key, double *data)
 GATTable_Get_Double Get the double type data associated with a key.

GATResult GATTable_Get_float (GATTable_const table, const void *key, float *data)
 GATTable_Get_Float Get the float type data associated with a key.

GATResult GATTable_Get_String (GATTable_const table, const void *key, char *data, GATuint32 length)
 GATTable_Get_String Get the string type data associated with a key.

GATResult GATTable_Get_GATObject (GATTable_const table, const void *key, GATObject_const *data)
 GATTable_Get_GATObject Get the GATObject type data associated with a key.

GATResult GATTable_internal_Get_GATObjectRef (GATTable_const table, const void *key, GATObject *object)
 GATTable_internal_Get_GATObjectRef.

GATResult GATTable_Serialise (GATTable table, GATObject stream, GATBool clear_dirty)
 int GATTable_Serialise(GATTable file, GATObject stream, GATBool clear_dirty) Serialise a GATTable object

GATTable GATTable_DeSerialise (GATContext context, GATObject stream, GATResult *result)
 GATTable GATTable_DeSerialise(GATContext context, GATObject stream, GATBool clear_dirty) De-serialise a GATTable object.

GATResult GATTable_GetIsDirty (GATTable_const table, GATBool *isdirty)
 GATTable_GetIsDirty.

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.

GATBool GATTable_Default_Equal_Keys (GATTable_const table, void const *key1, void const *key2)
 GATTable_Default_Equal_Keys.

void GATTable_Default_Destroy_Key (GATTable_const table, void **key)
 GATTable_Default_Destroy_Key.

GATuint32 GATTable_Size (GATTable_const table)
 GATTable_Size Return the number of elements stored inside a table.

GATBool GATTable_Internal_Equal_Keys (GATTable_const table, void const *key1, void const *key2)
 GATTable_Internal_Equal_keys Compare the values of two hash keys.


Variables

void const * key1
void const const void * key2
GATTable_vtable GATTable__vtable
GATTable_ISerialisable_vtable GATTable_ISerialisable__vtable


Detailed Description

Main file for the GATFile class.

A GATFile is an abstract representation of a physical file.

Date:
Wed Sep 24 2003
Version:
Header:
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/src/GATFile.c,v 1.61 2004/04/20 12:33:22 hartmutkaiser Exp

Copyright (C) Tom Goodale Copyright (C) Hartmut Kaiser This file is part of the GAT Engine. Contributed by Tom Goodale <goodale@aei.mpg.de> and 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 GATTable.c.


Typedef Documentation

typedef struct Hash_String_S * Hash_String
 

typedef struct Hash_float_S * Hash_float
 

typedef struct Hash_int_S * Hash_int
 

typedef struct Hash_short_S * Hash_short
 

typedef struct Hash_double_S * Hash_double
 

typedef struct Hash_GATObject_S * Hash_GATObject
 

typedef struct Hash_Element_S* Hash_Element
 


Function Documentation

GATOBJECT_DEFINE_VTABLE GATTable   
 

GATSERIALISABLE_DEFINE_VTABLE GATTable   
 

GATOBJECT_DEFINE_CONVERTERS GATTable    const
 

unsigned long GATTable_Internal_Hash_sdbm GATTable_const    table,
void const *    key
[static]
 

GATTable_Internal_Hash_sdbm Creates a hash from a key using sdbm.

Parameters:
table  The table, for which this hash value is to be calculated.
key  The key to create a hash from.
Returns:
the hash value

Definition at line 1742 of file GATTable.c.

References GATTable_const.

Referenced by GATTable_Get_double(), GATTable_Get_ElementType(), GATTable_Get_float(), GATTable_Get_GATObject(), GATTable_Get_int(), GATTable_Get_short(), GATTable_Get_String(), GATTable_Internal_Add(), GATTable_internal_Get_GATObjectRef(), and GATTable_Remove().

GATuint32 GATTable_Internal_Get_KeySize GATTable_const    table,
void const *    key
[static]
 

GATTable_Internal_Get_KeySize.

The function GATTable_Internal_Get_KeySize returns the size to be allocated for the given key.

Parameters:
table  The table, into which this key is to be inserted.
key  The key to calculate the size for

Definition at line 1756 of file GATTable.c.

References GATTable_const.

Referenced by GATTable_Default_Clone_Key(), GATTable_Default_Equal_Keys(), and GATTable_Default_Hash_sdbm().

GATResult GATTable_Internal_CloneKey GATTable_const    table,
void const *    src,
void **    dest
[static]
 

GATTable_Internal_CloneKey.

The function GATTable_Internal_CloneKey is used to copy a key.

Parameters:
table  The table, into which this key is to be inserted.
dest  The destination area, where the new key is to be constructed (the memory was allocated already).
src  The source memory area, where the key is to be copied from.
Returns:
A GAT error code.

Definition at line 1780 of file GATTable.c.

References GATTable_const, and src.

Referenced by GATTable_GetKeys(), and GATTable_Internal_Add().

void GATTable_Internal_Destroy_Key GATTable_const    table,
void **    key
[static]
 

GATTable_Internal_Destroy_Key.

The function GATTable_Default_Destroy_Key is the default callback function which is used to destroy a key (deallocate all associated memory). This function compares free's the key with the std function free().

Parameters:
table  The table, for which these keys are to be used.
key  The pointer to the key to deallocate.

Definition at line 1804 of file GATTable.c.

References GATTable_const.

Referenced by GATTable_Destroy(), GATTable_Internal_Add(), and GATTable_Remove().

GATuint32 GATTable_Internal_Index GATuint32    table_length,
unsigned long    hash_value
[static]
 

GATTable_Internal_Index Find the hash table index for a given hash value.

The table must be of 2^n

Parameters:
table_length  The length of the hash table.
hash_value  The hash value that the index is required for
Returns:
the index for the hash value

Definition at line 1819 of file GATTable.c.

References GATuint32.

Referenced by GATTable_Get_double(), GATTable_Get_ElementType(), GATTable_Get_float(), GATTable_Get_GATObject(), GATTable_Get_int(), GATTable_Get_short(), GATTable_Get_String(), GATTable_Internal_Add(), GATTable_Internal_Expand(), GATTable_internal_Get_GATObjectRef(), and GATTable_Remove().

GATResult GATTable_Internal_Expand GATTable    table [static]
 

GATTable_Internal_Expand Expands the hash table by a 2^n+1.

Parameters:
table  The hash table to expand.
Returns:
GAT error code

Definition at line 1834 of file GATTable.c.

References GAT_MEMORYFAILURE, GAT_SUCCESS, GATResult, GATTable_Internal_Index(), GATuint32, Hash_Element_S::hash, GATTable_S::load_limit, Hash_Element_S::next, GATTable_S::table, and GATTable_S::table_length.

Referenced by GATTable_Internal_Add().

GATResult GATTable_Internal_Add GATTable    table,
const void *    key,
void *    value,
GATType    type
[static]
 

GATTable_Internal_Add Add any type to the hash table Uses void* as the type and the type is defined as a GATType.

Parameters:
table  The hash table to enter the value into.
key  the hash key to use for adding table value
value  the value of the data to be added
type  the type of data to be added
Returns:
GAT error code

Definition at line 1909 of file GATTable.c.

References GATTable_S::element_count, GAT_FAIL, GAT_KEY_ALREADY_EXISTS, GAT_MEMORYFAILURE, GAT_SUCCESS, GATResult, GATTable_Internal_CloneKey(), GATTable_Internal_Destroy_Key(), GATTable_Internal_Equal_Keys(), GATTable_Internal_Expand(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType, GATuint32, Hash_Element_S::hash, GATTable_S::isdirty, Hash_Element_S::key, GATTable_S::load_limit, Hash_Element_S::next, GATTable_S::table, GATTable_S::table_length, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATTable_Add_double(), GATTable_Add_float(), GATTable_Add_GATObject(), GATTable_Add_int(), GATTable_Add_short(), and GATTable_Add_String().

GATResult GATTable_SerialiseItems GATTable_const    list,
GATXds    xds,
GATXdsScope    flag,
void **    buffer,
size_t *    buffer_size,
GATBool    clear_dirty
[static]
 

Definition at line 1991 of file GATTable.c.

References GAT_KEY_TYPE_ERROR, GAT_NO_INTERFACE, GAT_SUCCESS, GAT_UNUSED_PARAMETER, GATBool, GATResult, GATTable_const, GATTable_Default_Destroy_Key(), GATTable_Default_Hash_sdbm(), GATTable_Internal_CloneKey_String(), GATTable_Internal_Equal_Keys_String(), GATTable_Internal_Get_KeySize_String(), GATType_GATdouble64, GATType_GATfloat32, GATType_GATint16, GATType_GATint32, GATType_GATObject, GATType_String, GATuint32, GATXds, GATXds_Encode(), GATXds_GetBuffer(), GATXdsScope, GATXdsScope_Gift, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATTable_Serialise().

GATResult GATTable_DeSerialise_Create GATXds    xds,
GATuint32    table_length,
GATuint32    element_count,
GATTable   table
[static]
 

GATTable_DeSerialise_Create.

The function GATTable_DeSerialise_Create creates a new GATTable object and fills it from the given stream.

Parameters:
context  The GAT context to be used for object construction.
xds  The XDS engine to use for decoding.
table_length  table is size of the internal table data structure.
element_count  table is the expected table element count.
table  The pointer to the variable, which should receive the newly constructed GATTable object.
Returns:
An error code.

Definition at line 2099 of file GATTable.c.

References GATTable_S::clone_key, data, GATTable_S::destroy_key, GATTable_S::element_count, GATTable_S::equal_keys, GAT_INVALID_PARAMETER, GAT_KEY_TYPE_ERROR, GAT_MEMORYFAILURE, GAT_SUCCESS, GATTable_S::GATObject__vtable, GATObject_Destroy(), GATResult, GATTable_S::GATSerialisable__vtable, GATTable__vtable, GATTable_Add_double(), GATTable_Add_float(), GATTable_Add_GATObject(), GATTable_Add_int(), GATTable_Add_short(), GATTable_Add_String(), GATTable_Default_Destroy_Key(), GATTable_Default_Hash_sdbm(), GATTable_Destroy(), GATTable_Internal_CloneKey_String(), GATTable_Internal_Equal_Keys_String(), GATTable_Internal_Get_KeySize_String(), GATTable_ISerialisable__vtable, GATType_GATdouble64, GATType_GATfloat32, GATType_GATint16, GATType_GATint32, GATType_GATObject, GATType_NoType, GATType_String, GATuint32, GATXds, GATXds_Decode(), GATXdsScope, GATTable_S::get_hash, GATTable_S::get_key_size, GATTable_S::load_limit, GATTable_S::table, and GATTable_S::table_length.

Referenced by GATTable_DeSerialise().

GATBool GATTable_Internal_Equal_Keys_String GATTable_const    table,
void const *    key1,
const void *    key2
[static]
 

Definition at line 1725 of file GATTable.c.

References GAT_UNUSED_PARAMETER, GATFalse, GATTable_const, GATTrue, key1, and key2.

Referenced by GATTable_Create(), GATTable_DeSerialise_Create(), and GATTable_SerialiseItems().

GATuint32 GATTable_Internal_Get_KeySize_String GATTable_const    table,
void const *    key
[static]
 

Definition at line 1762 of file GATTable.c.

References GAT_UNUSED_PARAMETER, and GATTable_const.

Referenced by GATTable_Create(), GATTable_DeSerialise_Create(), and GATTable_SerialiseItems().

GATResult GATTable_Internal_CloneKey_String GATTable_const    table,
void const *    src,
void **    dest
[static]
 

Definition at line 1786 of file GATTable.c.

References GAT_MEMORYFAILURE, GAT_SUCCESS, GAT_UNUSED_PARAMETER, GATTable_const, GATUtil_strdup(), and src.

Referenced by GATTable_Create(), GATTable_DeSerialise_Create(), and GATTable_SerialiseItems().

GATResult GATTable_Register_GATSerialisable void   
 

GATTable_Register_GATSerialisable The GATTable_Register_GATSerialisable function registers the serialization vtable with the GAT engine to allow generic object creation.

table function is called by the GAT engine, there is no need to use it directly.

Definition at line 182 of file GATTable.c.

References GATObject_Register_GATSerialisable(), GATResult, GATTable_ISerialisable__vtable, and GATType_GATTable.

Referenced by GATObject_Register_GATSerialisables().

GATTable GATTable_Create void   
 

GATTable_Create Create the GATTable object.

This is the method used by any application code to create the GATTable object.

Parameters:
void. 
Returns:
The GATTable object

Definition at line 197 of file GATTable.c.

References GATTable_CreateAnyKey(), GATTable_Default_Destroy_Key(), GATTable_Default_Hash_sdbm(), GATTable_Internal_CloneKey_String(), GATTable_Internal_Equal_Keys_String(), and GATTable_Internal_Get_KeySize_String().

Referenced by advertservice_db_get_node_metadata(), create_hardware_resource_description(), create_software_description(), fill_GATTable(), GATConfig_Create(), GATFileOpsAdaptor_Data_Create(), GATJobCPIInstance_Data_Create(), GATJobDescription_internal_GetEnvironment(), GATMetric_CreateMetric(), GATPreferences_Create(), GATResourceDescription_i_Create(), GATSoftwareDescription_Create(), get_hardware_rd_direct(), get_os_software_rd_direct(), get_sw_description_direct(), Load(), main(), on_checkpoint_issued_1(), ParseConfigFile(), resourcebroker_adaptor_CreateHardwareResourceDescription(), resourcebroker_adaptor_CreateSoftwareDescription(), and resourcebroker_adaptor_GetEnvironment().

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.

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().

GATType GATTable_GetType GATTable_const    table
 

int GATTable_GetType(GATTable_const file) Return the type of the GATTable

table is the method used by any application code to return the type of a given GATTable object.

Parameters:
GATTable  The table to analyze.
Returns:
Always returns GATType_GATTable

Definition at line 285 of file GATTable.c.

References GAT_UNUSED_PARAMETER, GATTable_const, GATType, and GATType_GATTable.

GATResult GATTable_Clone GATTable_const    table,
GATTable   new_table
 

int GATTable_Clone(GATTable_const filehandle, GATTable *new_file) Clone the given GATTable

table is the method used by any application code to clone a GATTable object.

Parameters:
GATTable  The table to copy.
Returns:
The cloned GATTable object

Definition at line 302 of file GATTable.c.

References GATTable_S::clone_key, GATTable_S::destroy_key, GATTable_S::element_count, GATTable_S::equal_keys, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATTable_S::GATObject__vtable, GATResult, GATTable_S::GATSerialisable__vtable, GATTable__vtable, GATTable_Add_double(), GATTable_Add_float(), GATTable_Add_GATObject(), GATTable_Add_int(), GATTable_Add_short(), GATTable_Add_String(), GATTable_const, GATTable_Destroy(), GATTable_ISerialisable__vtable, GATType_GATdouble64, GATType_GATfloat32, GATType_GATint16, GATType_GATint32, GATType_GATObject, GATType_String, GATuint32, GATTable_S::get_hash, GATTable_S::get_key_size, Hash_Element_S::key, GATTable_S::load_limit, Hash_Element_S::next, GATTable_S::table, GATTable_S::table_length, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATJobCPIInstance_Data_Clone(), GATMetric_Clone(), GATMetric_Create(), GATMetric_GetParameters(), GATMonitorable_Impl_Clone(), GATPreferences_Clone(), GATPreferences_Set(), GATRequest_Create(), GATResourceDescription_Clone(), GATResourceDescription_i_Create(), GATResourceDescription_i_SetDescription(), GATSoftwareDescription_Create(), GATSoftwareDescription_DeSerialise_Create(), GATSoftwareDescription_SetAttributes(), test_GATTable_Cloning(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), and test_remove_unknown().

GATResult GATTable_Equals GATTable_const    lhs,
GATTable_const    rhs,
GATBool   isequal
 

int GATTable_Equals(GATTable_const lhs, GATTable_const rhs, GATBool *isequal) Compares two GATTable objects

The function GATTable_Equals compares two tables GATTable, which hold arbitrary data.

Parameters:
lhs  The first table to compare
rhs  The second table to compare
Returns:
GAT_SUCCESS on equality, and GAT_FALSE otherwise. May return other error codes too.

Definition at line 411 of file GATTable.c.

References GAT_INVALID_HANDLE, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATBool, GATFalse, GATObject_Equals(), GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTrue, GATType_GATdouble64, GATType_GATfloat32, GATType_GATint16, GATType_GATint32, GATType_GATObject, GATType_String, GATuint32, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATJobCPIInstance_Data_Equals(), GATMetric_Equals(), GATMonitorable_Impl_Equals(), GATPreferences_Equals(), GATResourceDescription_Equals(), GATSoftwareDescription_Equals(), main(), test_GATTable_Cloning(), and test_GATTable_Serialising().

void GATTable_Destroy GATTable   table
 

GATTable_Destroy The GATTable destructor.

Parameters:
table  Pointer to the hash table.
Returns:
void

Definition at line 510 of file GATTable.c.

References GATObject_Destroy(), GATTable_Internal_Destroy_Key(), GATType_GATObject, GATType_String, GATuint32, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by advertservice_db_get_node_metadata(), create_hardware_resource_description(), create_software_description(), GATConfig_Destroy(), GATFileOpsAdaptor_Data_Destroy(), GATJobCPIInstance_Data_Destroy(), GATJobDescription_internal_GetEnvironment(), GATMetric_CreateMetric(), GATMetric_Destroy(), GATMonitorable_Impl_Destroy(), GATPreferences_Destroy(), GATPreferences_Set(), GATRequest_Destroy(), GATResourceDescription_DeSerialise(), GATResourceDescription_Destroy(), GATResourceDescription_i_Create(), GATResourceDescription_i_SetDescription(), GATSoftwareDescription_DeSerialise(), GATSoftwareDescription_Destroy(), GATSoftwareDescription_SetAttributes(), GATTable_Clone(), GATTable_DeSerialise_Create(), get_hardware_rd_direct(), get_os_software_rd_direct(), get_sw_description_direct(), main(), on_checkpoint_issued_1(), resourcebroker_adaptor_CreateHardwareResourceDescription(), resourcebroker_adaptor_CreateSoftwareDescription(), resourcebroker_adaptor_GetEnvironment(), test_GATTable_Cloning(), test_GATTable_Serialising(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), and test_remove_unknown().

GATResult GATTable_GetInterface GATTable_const    table,
GATInterface    iftype,
void const **    ifp
 

int GATTable_GetInterface(GATTable_const table, GATInterface iftype, void const **ifp) Get an interface supported by a GATList

The function GATTable_GetInterface allows to get a pointer to an additional interface supported by table GATTable.

Parameters:
object  The object to be asked for the new interface.
iftype  The interface the object is to be asked for.
ifp  The pointer, through which the result is to be returned.
Returns:
An error type.

Definition at line 558 of file GATTable.c.

References GAT_INVALID_PARAMETER, GAT_NO_INTERFACE, GAT_SUCCESS, GATInterface, GATInterface_ISerialisable, GATResult, and GATTable_const.

GATResult GATTable_Remove GATTable    table,
const void *    key
 

GATTable_Remove Remove a key,value pair from the hash table.

Parameters:
table  The hash table to remove from.
key  The the key for the key,value pair to be removed
Returns:
GAT error code

Definition at line 590 of file GATTable.c.

References GATTable_S::element_count, GAT_KEY_NOT_FOUND, GAT_SUCCESS, GATObject_Destroy(), GATResult, GATTable_Internal_Destroy_Key(), GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_GATObject, GATType_String, GATuint32, GATTable_S::isdirty, Hash_Element_S::key, Hash_Element_S::next, GATTable_S::table, GATTable_S::table_length, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATPreferences_Remove(), test_GATTable_Cloning(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), and test_remove_unknown().

GATResult GATTable_Add_int GATTable    table,
const void *    key,
GATint32    data
 

GATTable_Add_Int Add a type int to the hash table.

Parameters:
table  The hash table to add the data to.
key  The key value to associate the data to.
data  The int data to be added
Returns:
GAT error code

Definition at line 642 of file GATTable.c.

References data, Hash_int_S::data, GAT_MEMORYFAILURE, GAT_SUCCESS, GATint32, GATResult, GATTable_Internal_Add(), and GATType_GATint32.

Referenced by fill_GATTable(), GATJobCPIInstance_Data_Create(), GATMetric_CreateMetric(), GATTable_Clone(), and GATTable_DeSerialise_Create().

GATResult GATTable_Add_short GATTable    table,
const void *    key,
GATint16    data
 

GATTable_Add_Short Add a type short to the hash table.

Parameters:
table  The hash table to add the data to.
key  The key value to associate the data to.
data  The short data to be added
Returns:
GAT error code

Definition at line 674 of file GATTable.c.

References data, Hash_short_S::data, GAT_MEMORYFAILURE, GAT_SUCCESS, GATint16, GATResult, GATTable_Internal_Add(), and GATType_GATint16.

Referenced by fill_GATTable(), GATMetric_CreateMetric(), GATTable_Clone(), and GATTable_DeSerialise_Create().

GATResult GATTable_Add_double GATTable    table,
const void *    key,
GATdouble64    data
 

GATTable_Add_Double Add a type double to the hash table.

Parameters:
table  The hash table to add the data to.
key  The key value to associate the data to.
data  The double data to be added
Returns:
GAT error code

Definition at line 710 of file GATTable.c.

References data, Hash_double_S::data, GAT_MEMORYFAILURE, GAT_SUCCESS, GATdouble64, GATResult, GATTable_Internal_Add(), and GATType_GATdouble64.

Referenced by fill_GATTable(), GATMetric_CreateMetric(), GATTable_Clone(), and GATTable_DeSerialise_Create().

GATResult GATTable_Add_float GATTable    table,
const void *    key,
GATfloat32    data
 

GATTable_Add_Float Add a type float to the hash table.

Parameters:
table  The hash table to add the data to.
key  The key value to associate the data to.
data  The float data to be added
Returns:
GAT error code

Definition at line 744 of file GATTable.c.

References data, Hash_float_S::data, GAT_MEMORYFAILURE, GAT_SUCCESS, GATfloat32, GATResult, GATTable_Internal_Add(), and GATType_GATfloat32.

Referenced by create_hardware_resource_description(), fill_GATTable(), GATMetric_CreateMetric(), GATTable_Clone(), GATTable_DeSerialise_Create(), get_hardware_rd_direct(), and resourcebroker_adaptor_CreateHardwareResourceDescription().

GATResult GATTable_Add_String GATTable    table,
const void *    key,
const char *    data
 

GATTable_Add_String Add a type string to the hash table.

Parameters:
table  The hash table to add the data to.
key  The key value to associate the data to.
data  The string data to be added
Returns:
GAT error code

Definition at line 779 of file GATTable.c.

References data, Hash_String_S::data, GAT_MEMORYFAILURE, GAT_SUCCESS, GATResult, GATTable_Internal_Add(), and GATType_String.

Referenced by advertservice_db_get_node_metadata(), create_hardware_resource_description(), create_software_description(), fileops_copy_config(), fill_GATTable(), GATAdvertService_EnsureMetaDataItem(), GATJobCPIInstance_Data_Create(), GATMetric_CreateMetric(), GATPreferences_Add(), GATResourceBroker_SetJobEnvironment(), GATResourceDescription_i_AddResourceAttribute_String(), GATTable_Clone(), GATTable_DeSerialise_Create(), get_hardware_rd_direct(), get_os_software_rd_direct(), get_sw_description_direct(), main(), on_checkpoint_issued_1(), ParseConfigFile(), and resourcebroker_adaptor_CreateHardwareResourceDescription().

GATResult GATTable_Add_GATObject GATTable    table,
const void *    key,
GATObject_const    data
 

GATTable_Add_GATObject Add a type GATObject to the hash table.

Parameters:
table  The hash table to add the data to.
key  The key value to associate the data to.
data  The float data to be added
Returns:
GAT error code

Definition at line 822 of file GATTable.c.

References data, Hash_GATObject_S::data, GAT_MEMORYFAILURE, GAT_SUCCESS, GATObject_Clone(), GATObject_const, GATObject_Destroy(), GATResult, GATTable_Internal_Add(), and GATType_GATObject.

Referenced by create_software_description(), fill_GATTable(), GATJobCPIInstance_Data_Create(), GATJobDescription_internal_GetEnvironment(), GATMonitorable_Impl_Create(), GATResourceDescription_i_AddResourceAttribute_GATObject(), GATTable_Clone(), GATTable_DeSerialise_Create(), get_sw_description_direct(), resourcebroker_adaptor_FillCommandLine(), resourcebroker_adaptor_FillEnvironment(), and resourcebroker_adaptor_GetEnvironment().

GATType GATTable_Get_ElementType GATTable_const    table,
const void *    key
 

GATTable_Get_ElementType Get the type associated with a key.

Parameters:
table  The hash table to get the type from.
key  The key value associated with the data type.
Returns:
GATType

Definition at line 861 of file GATTable.c.

References GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType, GATType_NoType, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, and Hash_Element_S::type.

Referenced by GATMetric_GetParameterTypeByName(), resourcebroker_adaptor_FillEnvironment(), and test_entry_types().

void** GATTable_GetKeys GATTable_const    table
 

GATTable_GetKeys Get a list of all the current keys in the hash table.

The key list is terminated by a NULL

Parameters:
table  The hash table to get the keys from.
Returns:
the list of keys

Definition at line 899 of file GATTable.c.

References GAT_MEMORYFAILURE, GAT_SUCCESS, GATTable_const, GATTable_Internal_CloneKey(), GATuint32, Hash_Element_S::key, and Hash_Element_S::next.

Referenced by advertservice_db_find(), advertservice_db_write_data(), fill_GATTable(), GATMonitorable_Impl_GetMetrics(), and GATPreferences_Match().

void GATTable_ReleaseKeys GATTable_const    table,
void ***    keys
 

GATTable_ReleaseKeys.

The function GATTable_ReleaseKeys may be used to free all the keys allocated by a call to the GATTable_GetKeys function.

Parameters:
table  The table, from which the keys where retrieved.
keys  The pointer to the array of keys returned by a call to the GATTable_GetKeys function.

Definition at line 953 of file GATTable.c.

References GAT_UNUSED_PARAMETER, GATTable_const, and GATuint32.

Referenced by advertservice_db_find(), advertservice_db_write_data(), and GATPreferences_Match().

GATResult GATTable_Get_int GATTable_const    table,
const void *    key,
GATint32   data
 

GATTable_Get_Int Get the int type data associated with a key.

Parameters:
table  The hash table get the data from.
key  The key value to associate the data to.
data  The recovered int data
Returns:
GAT error code

Definition at line 978 of file GATTable.c.

References data, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_NOT_FOUND, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATint32, GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_GATint32, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by advertservice_adaptor_register(), endpoint_adaptor_register(), GATMetric_GetParameterByName(), resourcebroker_adaptor_register(), test_negatives_double(), test_negatives_float(), test_negatives_int(), test_negatives_object(), test_negatives_short(), test_negatives_string(), test_positives(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), and test_remove_unknown().

GATResult GATTable_Get_short GATTable_const    table,
const void *    key,
GATint16   data
 

GATTable_Get_Short Get the short type data associated with a key.

Parameters:
table  The hash table get the data from.
key  The key value to associate the data to.
data  The recovered short data
Returns:
GAT error code

Definition at line 1035 of file GATTable.c.

References data, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_NOT_FOUND, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATint16, GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_GATint16, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATMetric_GetParameterByName(), test_negatives_double(), test_negatives_float(), test_negatives_int(), test_negatives_object(), test_negatives_short(), test_negatives_string(), test_positives(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), and test_remove_unknown().

GATResult GATTable_Get_double GATTable_const    table,
const void *    key,
double *    data
 

GATTable_Get_Double Get the double type data associated with a key.

Parameters:
table  The hash table get the data from.
key  The key value to associate the data to.
data  The recovered double data
Returns:
GAT error code

Definition at line 1092 of file GATTable.c.

References data, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_NOT_FOUND, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_GATdouble64, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATMetric_GetParameterByName(), test_negatives_double(), test_negatives_float(), test_negatives_int(), test_negatives_object(), test_negatives_short(), test_negatives_string(), test_positives(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), and test_remove_unknown().

GATResult GATTable_Get_float GATTable_const    table,
const void *    key,
float *    data
 

GATTable_Get_Float Get the float type data associated with a key.

Parameters:
table  The hash table get the data from.
key  The key value to associate the data to.
data  The recovered float data
Returns:
GAT error code

Definition at line 1149 of file GATTable.c.

References data, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_NOT_FOUND, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_GATfloat32, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATMetric_GetParameterByName(), test_hw_requirements(), test_negatives_double(), test_negatives_float(), test_negatives_int(), test_negatives_object(), test_negatives_short(), test_negatives_string(), test_positives(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), and test_remove_unknown().

GATResult GATTable_Get_String GATTable_const    table,
const void *    key,
char *    data,
GATuint32    length
 

GATTable_Get_String Get the string type data associated with a key.

Parameters:
table  The hash table get the data from.
key  The key value to associate the data to.
data  The recovered string data. If table parameter is 0 (zero), the function does not try to recover the data but simply returns the required size of the buffer needed to recover the data.
length  length of the string buffer arg data
Returns:
length of string found or error code

Definition at line 1209 of file GATTable.c.

References data, GAT_INVALID_HANDLE, GAT_KEY_NOT_FOUND, GAT_KEY_TYPE_ERROR, GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_String, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by advertservice_db_find(), advertservice_db_write_data(), fileops_get_table_entry(), GATAdvertService_EnsureMetaDataItem(), GATMetric_GetParameterByName(), GATPreferences_Match(), main(), resourcebroker_adaptor_GATRequestCPI_request_notifier_listener(), resourcebroker_adaptor_SubmitJob(), test_hw_requirements(), test_negatives_double(), test_negatives_float(), test_negatives_int(), test_negatives_object(), test_negatives_short(), test_negatives_string(), test_os_requirements(), test_positives(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), test_remove_unknown(), and test_sw_attributes().

GATResult GATTable_Get_GATObject GATTable_const    table,
const void *    key,
GATObject_const   data
 

GATTable_Get_GATObject Get the GATObject type data associated with a key.

Parameters:
table  The hash table get the data from.
key  The key value to associate the data to.
data  The recovered GATObject data
Returns:
GAT error code

Definition at line 1278 of file GATTable.c.

References data, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_NOT_FOUND, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATObject_const, GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_GATObject, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATMetric_GetParameterByName(), GATMonitorable_Impl_FireEvent(), GATMonitorable_Impl_RemoveRegisteredMetric(), test_negatives_double(), test_negatives_float(), test_negatives_int(), test_negatives_object(), test_negatives_short(), test_negatives_string(), test_positives(), test_remove_double(), test_remove_float(), test_remove_int(), test_remove_object(), test_remove_short(), test_remove_string(), test_remove_unknown(), test_std_file_attriutes(), and test_sw_attributes().

GATResult GATTable_internal_Get_GATObjectRef GATTable_const    table,
const void *    key,
GATObject   object
 

GATTable_internal_Get_GATObjectRef.

The functions GATTable_internal_Get_GATObjectRef allows to access a GATObject stored inside a GATTable without copying it.

Parameters:
table  The hash table get the data from.
key  The key value to associate the data to.
data  The recovered reference to the GATObject data
Remarks:
This is an internal function, do not use it directly.
Returns:
An error code.

Definition at line 1340 of file GATTable.c.

References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_KEY_NOT_FOUND, GAT_KEY_TYPE_ERROR, GAT_SUCCESS, GATResult, GATTable_const, GATTable_Internal_Equal_Keys(), GATTable_Internal_Hash_sdbm(), GATTable_Internal_Index(), GATTrue, GATType_GATObject, GATuint32, Hash_Element_S::hash, Hash_Element_S::key, Hash_Element_S::next, Hash_Element_S::type, and Hash_Element_S::value.

Referenced by GATJobDescription_internal_GetEnvironment(), GATMonitorable_Impl_AddMetricListener(), and GATMonitorable_Impl_RegisterPolling().

GATResult GATTable_Serialise GATTable    table,
GATObject    stream,
GATBool    clear_dirty
 

int GATTable_Serialise(GATTable file, GATObject stream, GATBool clear_dirty) Serialise a GATTable object

The function GATTable_Serialise serialises the given GATTable object into the given stream.

Parameters:
file  The GATTable object to serialise.
stream  The stream interface to use for the serialisation.
clear_dirty  If the clear_dirty parameter is set to GATTrue, the internal dirty flag of table object is to be reset (no used here)
Returns:
An error code.

Definition at line 1404 of file GATTable.c.

References assert, GATTable_S::element_count, GAT_INVALID_HANDLE, GAT_SUCCESS, GATBool, GATFalse, GATResult, GATStreamable_Write(), GATTable_SerialiseItems(), GATTABLE_VERSION1, GATuint32, GATXds, GATXds_Destroy(), GATXds_Encode(), GATXds_Init(), GATXdsScope_Gift, GATXdsType_Encode, GATTable_S::isdirty, and GATTable_S::table_length.

Referenced by GATJobCPIInstance_Data_Serialize(), and test_GATTable_Serialising().

GATTable GATTable_DeSerialise GATContext    context,
GATObject    stream,
GATResult   result
 

GATTable GATTable_DeSerialise(GATContext context, GATObject stream, GATBool clear_dirty) De-serialise a GATTable object.

The function GATTable_DeSerialise de-serialises a streamed GATTable object from the given stream It constructs a new instance of the de-serialised object.

Parameters:
context  The GAT context to be used for object construction.
stream  The stream interface to use for the serialisation.
result  The pointer to a variable, which receives the status code of the operation.
Returns:
The newly constructed GATTable object.

Definition at line 1476 of file GATTable.c.

References GAT_MEMORYFAILURE, GAT_SUCCESS, GAT_UNKNOWN_FORMAT, GATOrigin_Current, GATResult, GATStreamable_Read(), GATStreamable_Seek(), GATTable_DeSerialise_Create(), GATTABLE_LASTVERSION, GATTABLE_MINOR_MASK, GATuint32, GATXds, GATXds_Decode(), GATXds_Destroy(), GATXds_GetBufferLen(), GATXds_InitEx(), GATXdsScope, GATXdsScope_Gift, GATXdsScope_Loan, and GATXdsType_Decode.

Referenced by test_GATTable_Serialising().

GATResult GATTable_GetIsDirty GATTable_const    table,
GATBool   isdirty
 

GATTable_GetIsDirty.

The function GATTable_GetIsDirty retrieves the status of the dirty flag of table GATTable object.

Parameters:
file  The GATTable object to inspect for its dirty status.
isdirty  The pointer to a variable, which receives the dirty status.
Returns:
An error code.

Definition at line 1564 of file GATTable.c.

References GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_SUCCESS, GATBool, GATResult, and GATTable_const.

unsigned long GATTable_Default_Hash_sdbm GATTable_const    table,
void const *    key
 

GATTable_Default_Hash_sdbm.

The function GATTable_Default_Hash_sdbm is the default callback function which is used to calculate the hash value for a given key. This function calculates the hash value based on the plain memory representation of the key.

Parameters:
table  The table, for which this hash value is to be calculated.
key  The key to create a hash from.
Returns:
the hash value

Definition at line 1595 of file GATTable.c.

References GATTable_const, GATTable_Internal_Get_KeySize(), and GATuint32.

Referenced by GATTable_Create(), GATTable_CreateAnyKey(), GATTable_DeSerialise_Create(), and GATTable_SerialiseItems().

GATResult GATTable_Default_Clone_Key GATTable_const    table,
void const *    src,
void **    dest
 

GATTable_Default_CloneKey.

The function GATTable_Default_Clone_Key is the default callback function which is used to copy a key to a new location. This function calculates copies the key with the help of the function memcpy.

Parameters:
table  The table, into which this key is to be inserted.
src  The source memory area, where the key is to be copied from.
dest  The destination area, which receives the new key.
Returns:
A GAT error code.

Definition at line 1630 of file GATTable.c.

References GAT_MEMORYFAILURE, GAT_SUCCESS, GATTable_const, GATTable_Internal_Get_KeySize(), GATuint32, GATUtil_memdup(), and src.

Referenced by GATTable_CreateAnyKey().

GATBool GATTable_Default_Equal_Keys GATTable_const    table,
void const *    key1,
void const *    key2
 

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().

void GATTable_Default_Destroy_Key GATTable_const    table,
void **    key
 

GATTable_Default_Destroy_Key.

The function GATTable_Default_Destroy_Key is the default callback function which is used to destroy a key (deallocate all associated memory). This function compares free's the key with the std function free().

Parameters:
table  The table, for which these keys are to be used.
key  The pointer to the key to deallocate.

Definition at line 1675 of file GATTable.c.

References GAT_UNUSED_PARAMETER, and GATTable_const.

Referenced by GATTable_Create(), GATTable_CreateAnyKey(), GATTable_DeSerialise_Create(), and GATTable_SerialiseItems().

GATuint32 GATTable_Size GATTable_const    table
 

GATTable_Size Return the number of elements stored inside a table.

The function GATTable_Size returns the number of elements, currently stored inside the given table.

Parameters:
table  The table to be queried for its number of elements
Returns:
If successful, the function returns number of elements. If an error occures, (size_t)(-1) is returned.

Definition at line 1696 of file GATTable.c.

References GATTable_const, and GATuint32.

Referenced by advertservice_db_find(), and fill_GATTable().

GATBool GATTable_Internal_Equal_Keys GATTable_const    table,
void const *    key1,
void const *    key2
[static]
 

GATTable_Internal_Equal_keys Compare the values of two hash keys.

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 1718 of file GATTable.c.

References GATTable_const, key1, and key2.

Referenced by GATTable_Equals(), GATTable_Get_double(), GATTable_Get_ElementType(), GATTable_Get_float(), GATTable_Get_GATObject(), GATTable_Get_int(), GATTable_Get_short(), GATTable_Get_String(), GATTable_Internal_Add(), GATTable_internal_Get_GATObjectRef(), and GATTable_Remove().


Variable Documentation

void const* key1
 

Definition at line 119 of file GATTable.c.

Referenced by GATMonitorable_Impl_EqualKeys(), GATTable_Default_Equal_Keys(), GATTable_Internal_Equal_Keys(), and GATTable_Internal_Equal_Keys_String().

void const const void* key2
 

Definition at line 119 of file GATTable.c.

Referenced by GATMonitorable_Impl_EqualKeys(), GATTable_Default_Equal_Keys(), GATTable_Internal_Equal_Keys(), and GATTable_Internal_Equal_Keys_String().

GATTable_vtable GATTable__vtable [static]
 

Initial value:

 {
  GATTable_GetType, 
  GATTable_Destroy, 
  GATTable_Equals, 
  GATTable_Clone,
  GATTable_GetInterface,
  NULL
}

Definition at line 158 of file GATTable.c.

Referenced by GATTable_Clone(), GATTable_CreateAnyKey(), and GATTable_DeSerialise_Create().

GATTable_ISerialisable_vtable GATTable_ISerialisable__vtable [static]
 

Initial value:

 {
  GATTable_Serialise,
  GATTable_DeSerialise,
  GATTable_GetIsDirty
}

Definition at line 167 of file GATTable.c.

Referenced by GATTable_Clone(), GATTable_CreateAnyKey(), GATTable_DeSerialise_Create(), and GATTable_Register_GATSerialisable().