2026-05-25 17:27:59 +01:00
|
|
|
#ifndef FX_COLLECTIONS_HASHTABLE_H_
|
|
|
|
|
#define FX_COLLECTIONS_HASHTABLE_H_
|
|
|
|
|
|
|
|
|
|
#include <fx/bst.h>
|
|
|
|
|
#include <fx/iterator.h>
|
|
|
|
|
#include <fx/macros.h>
|
|
|
|
|
#include <fx/misc.h>
|
|
|
|
|
#include <fx/queue.h>
|
|
|
|
|
#include <fx/status.h>
|
|
|
|
|
#include <fx/value.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
FX_DECLS_BEGIN;
|
|
|
|
|
|
|
|
|
|
#define FX_TYPE_HASHTABLE (fx_hashtable_get_type())
|
|
|
|
|
#define FX_TYPE_HASHTABLE_ITERATOR (fx_hashtable_iterator_get_type())
|
|
|
|
|
#define FX_TYPE_HASHTABLE_ITEM (fx_hashtable_item_get_type())
|
|
|
|
|
|
|
|
|
|
FX_DECLARE_TYPE(fx_hashtable);
|
|
|
|
|
FX_DECLARE_TYPE(fx_hashtable_iterator);
|
|
|
|
|
FX_DECLARE_TYPE(fx_hashtable_item);
|
|
|
|
|
|
|
|
|
|
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_hashtable)
|
|
|
|
|
FX_TYPE_CLASS_DECLARATION_END(fx_hashtable)
|
|
|
|
|
|
|
|
|
|
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_hashtable_iterator)
|
|
|
|
|
FX_TYPE_CLASS_DECLARATION_END(fx_hashtable_iterator)
|
|
|
|
|
|
|
|
|
|
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_hashtable_item)
|
|
|
|
|
FX_TYPE_CLASS_DECLARATION_END(fx_hashtable_item)
|
|
|
|
|
|
|
|
|
|
FX_API fx_type_id fx_hashtable_get_type(void);
|
|
|
|
|
FX_API fx_type_id fx_hashtable_iterator_get_type(void);
|
|
|
|
|
FX_API fx_type_id fx_hashtable_item_get_type(void);
|
|
|
|
|
|
|
|
|
|
FX_TYPE_DEFAULT_CONSTRUCTOR(fx_hashtable, FX_TYPE_HASHTABLE);
|
|
|
|
|
FX_API fx_hashtable *fx_hashtable_create(void);
|
|
|
|
|
|
|
|
|
|
FX_API fx_status
|
|
|
|
|
fx_hashtable_put(fx_hashtable *hashtable, fx_value *key, fx_value *value);
|
|
|
|
|
FX_API const fx_value *fx_hashtable_get(
|
|
|
|
|
const fx_hashtable *hashtable,
|
|
|
|
|
const fx_value *key);
|
|
|
|
|
|
|
|
|
|
FX_API size_t fx_hashtable_get_count(const fx_hashtable *hashtable);
|
|
|
|
|
FX_API bool fx_hashtable_is_empty(const fx_hashtable *hashtable);
|
|
|
|
|
|
2026-05-28 20:52:40 +01:00
|
|
|
FX_API const fx_iterator *fx_hashtable_begin(const fx_hashtable *hashtable);
|
2026-05-25 17:27:59 +01:00
|
|
|
|
2026-05-28 20:52:40 +01:00
|
|
|
FX_API const fx_value *fx_hashtable_item_get_key(const fx_hashtable_item *item);
|
|
|
|
|
FX_API const fx_value *fx_hashtable_item_get_value(
|
|
|
|
|
const fx_hashtable_item *item);
|
2026-05-25 17:27:59 +01:00
|
|
|
|
|
|
|
|
FX_DECLS_END;
|
|
|
|
|
|
|
|
|
|
#endif
|