OPIC
Object Persistence In C
Data Structures | Typedefs | Functions
Hash

Data Structures

struct  OPHashTable
 An opaque object that manage associations of fixed length key-value pairs. More...
 
struct  HTFunnel
 An opaque object for doing massive update or quries on OPHashTable. More...
 
struct  PascalHashTable
 An opaque object that manages associations of key-value pairs. More...
 

Typedefs

typedef void(* OPHashIterator) (void *key, void *value, size_t keysize, size_t valsize, void *context)
 HashTable iterator interface. More...
 
typedef void(* OPFunnelUpsertCB) (void *key, void *table_value, void *funnel_value, void *ctx, size_t keysize, size_t valsize, size_t ctxsize, bool is_duplicate)
 Callback type for doing upsert operation with funnel. More...
 
typedef void(* OPFunnelGetCB) (void *key, void *value, void *ctx, size_t keysize, size_t valsize, size_t ctxsize)
 Callback type for doing get operation with funnel. More...
 
typedef void(* OPFunnelDeleteCB) (void *key, void *value, void *ctx, size_t keysize, size_t valsize, size_t ctxsize)
 Callback type for doing delete operation with funnel. More...
 
typedef uint64_t(* OPHash) (void *key, size_t size)
 Hash function interface. More...
 

Functions

static uint64_t OPDefaultHash (void *key, size_t size)
 Default hash function. More...
 

Detailed Description

Typedef Documentation

◆ OPHashIterator

typedef void(* OPHashIterator) (void *key, void *value, size_t keysize, size_t valsize, void *context)

#include <opic/hash/op_hash.h>

HashTable iterator interface.

Parameters
keypointer to key
valuepointer to value
keysizelength of the key
valsizelength of the value
contextuser defined context
See also
RHHIterate for example usage.

Definition at line 59 of file op_hash.h.

◆ OPFunnelUpsertCB

typedef void(* OPFunnelUpsertCB) (void *key, void *table_value, void *funnel_value, void *ctx, size_t keysize, size_t valsize, size_t ctxsize, bool is_duplicate)

#include <opic/hash/op_hash.h>

Callback type for doing upsert operation with funnel.

Parameters
keyThe key upserting to hash table
table_valueThe value in table (old value).
funnel_valueThe value in funnel (new value).
ctxUser defined context.
keysizeSize of the key.
valsizeBoth table_value and funnel_value has same size valsize.
ctxsizeSize of the context.
is_duplicateTrue when this upsert operation is on a duplicate key (update case). False when this key is newly inserted.

Definition at line 89 of file op_hash.h.

◆ OPFunnelGetCB

typedef void(* OPFunnelGetCB) (void *key, void *value, void *ctx, size_t keysize, size_t valsize, size_t ctxsize)

#include <opic/hash/op_hash.h>

Callback type for doing get operation with funnel.

Parameters
keyThe key upserting to hash table
valueThe value in table.
ctxUser defined context.
keysizeSize of the key.
valsizeSize of the value.
ctxsizeSize of the context.

Definition at line 107 of file op_hash.h.

◆ OPFunnelDeleteCB

typedef void(* OPFunnelDeleteCB) (void *key, void *value, void *ctx, size_t keysize, size_t valsize, size_t ctxsize)

#include <opic/hash/op_hash.h>

Callback type for doing delete operation with funnel.

Parameters
keyThe key upserting to hash table
valueThe value in table.
ctxUser defined context.
keysizeSize of the key.
valsizeSize of the value.
ctxsizeSize of the context.

Definition at line 122 of file op_hash.h.

◆ OPHash

OPHash

#include <opic/hash/op_hash.h>

Hash function interface.

Parameters
keypointer to the key
sizesize of the key

Definition at line 45 of file op_hash.h.

Function Documentation

◆ OPDefaultHash()

static uint64_t OPDefaultHash ( void *  key,
size_t  size 
)
inlinestatic

#include <opic/hash/op_hash.h>

Default hash function.

This is the implementation of OPHash.

Definition at line 70 of file op_hash.h.