gwenhywfar  5.10.1
Macros | Functions
multicache.c File Reference
#include "multicache_p.h"
#include <gwenhywfar/debug.h>
Include dependency graph for multicache.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG
 

Functions

 GWEN_IDMAP_FUNCTIONS (GWEN_MULTICACHE_ENTRY, GWEN_MultiCache_Entry)
 
 GWEN_LIST_FUNCTIONS (GWEN_MULTICACHE_ENTRY, GWEN_MultiCache_Entry)
 
 GWEN_LIST_FUNCTIONS (GWEN_MULTICACHE_TYPE, GWEN_MultiCache_Type)
 
int GWEN_MultiCache_AddEntry (GWEN_MULTICACHE *mc, GWEN_MULTICACHE_ENTRY *e)
 
void GWEN_MultiCache_Entry_free (GWEN_MULTICACHE_ENTRY *e)
 
GWEN_MULTICACHE_TYPEGWEN_MultiCache_Entry_GetCacheType (const GWEN_MULTICACHE_ENTRY *e)
 
void * GWEN_MultiCache_Entry_GetDataPtr (const GWEN_MULTICACHE_ENTRY *e)
 
uint32_t GWEN_MultiCache_Entry_GetDataSize (const GWEN_MULTICACHE_ENTRY *e)
 
uint32_t GWEN_MultiCache_Entry_GetId (const GWEN_MULTICACHE_ENTRY *e)
 
uint32_t GWEN_MultiCache_Entry_GetParam1 (const GWEN_MULTICACHE_ENTRY *e)
 
uint32_t GWEN_MultiCache_Entry_GetParam2 (const GWEN_MULTICACHE_ENTRY *e)
 
uint32_t GWEN_MultiCache_Entry_GetParam3 (const GWEN_MULTICACHE_ENTRY *e)
 
uint32_t GWEN_MultiCache_Entry_GetParam4 (const GWEN_MULTICACHE_ENTRY *e)
 
double GWEN_MultiCache_Entry_GetParam5 (const GWEN_MULTICACHE_ENTRY *e)
 
GWEN_MULTICACHE_ENTRY * GWEN_MultiCache_Entry_new (GWEN_MULTICACHE_TYPE *ct, uint32_t id, void *p, uint32_t i)
 
void GWEN_MultiCache_Entry_SetParam1 (GWEN_MULTICACHE_ENTRY *e, uint32_t i)
 
void GWEN_MultiCache_Entry_SetParam2 (GWEN_MULTICACHE_ENTRY *e, uint32_t i)
 
void GWEN_MultiCache_Entry_SetParam3 (GWEN_MULTICACHE_ENTRY *e, uint32_t i)
 
void GWEN_MultiCache_Entry_SetParam4 (GWEN_MULTICACHE_ENTRY *e, uint32_t i)
 
void GWEN_MultiCache_Entry_SetParam5 (GWEN_MULTICACHE_ENTRY *e, double d)
 
void GWEN_MultiCache_free (GWEN_MULTICACHE *mc)
 
uint64_t GWEN_MultiCache_GetMaxSizeUsed (const GWEN_MULTICACHE *mc)
 
int GWEN_MultiCache_GetUsageString (const GWEN_MULTICACHE *mc, char *ptrBuffer, int lenBuffer)
 
void GWEN_MultiCache_IncCacheHits (GWEN_MULTICACHE *mc)
 
void GWEN_MultiCache_IncCacheMisses (GWEN_MULTICACHE *mc)
 
GWEN_MULTICACHEGWEN_MultiCache_new (uint64_t maxSize)
 
void GWEN_MultiCache_ReleaseEntriesForType (GWEN_MULTICACHE *mc, GWEN_MULTICACHE_TYPE *ct)
 
void GWEN_MultiCache_ReleaseEntry (GWEN_MULTICACHE *mc, GWEN_MULTICACHE_ENTRY *e)
 
int GWEN_MultiCache_Type_AttachData (const GWEN_MULTICACHE_TYPE *ct, void *p)
 
void GWEN_MultiCache_Type_free (GWEN_MULTICACHE_TYPE *ct)
 
int GWEN_MultiCache_Type_FreeData (const GWEN_MULTICACHE_TYPE *ct, void *p)
 
void * GWEN_MultiCache_Type_GetData (const GWEN_MULTICACHE_TYPE *ct, uint32_t id)
 
void * GWEN_MultiCache_Type_GetDataWithParams (const GWEN_MULTICACHE_TYPE *ct, uint32_t id, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4)
 
void * GWEN_MultiCache_Type_GetDataWithParams5 (const GWEN_MULTICACHE_TYPE *ct, uint32_t id, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4, double param5)
 
GWEN_IDLIST64GWEN_MultiCache_Type_GetIdsInCache (const GWEN_MULTICACHE_TYPE *ct)
 
GWEN_MULTICACHE_TYPEGWEN_MultiCache_Type_new (GWEN_MULTICACHE *mc)
 
void GWEN_MultiCache_Type_PurgeAll (GWEN_MULTICACHE_TYPE *ct)
 
void GWEN_MultiCache_Type_PurgeData (GWEN_MULTICACHE_TYPE *ct, uint32_t id)
 
void GWEN_MultiCache_Type_ReleaseEntry (GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_ENTRY *e)
 
void GWEN_MultiCache_Type_SetAttachFn (GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_ATTACH_FN fn)
 
void GWEN_MultiCache_Type_SetAttachObjectFn (GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_ATTACH_OBJECT_FN fn)
 
void GWEN_MultiCache_Type_SetData (GWEN_MULTICACHE_TYPE *ct, uint32_t id, void *ptr, uint32_t size)
 
void GWEN_MultiCache_Type_SetDataWithParams (GWEN_MULTICACHE_TYPE *ct, uint32_t id, void *ptr, uint32_t size, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4)
 
void GWEN_MultiCache_Type_SetDataWithParams5 (GWEN_MULTICACHE_TYPE *ct, uint32_t id, void *ptr, uint32_t size, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4, double param5)
 
void GWEN_MultiCache_Type_SetFreeFn (GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_FREE_FN fn)
 
void GWEN_MultiCache_Type_SetFreeObjectFn (GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_FREE_OBJECT_FN fn)
 
void GWEN_MultiCache_UsingEntry (GWEN_MULTICACHE *mc, GWEN_MULTICACHE_ENTRY *e)
 

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 29 of file multicache.c.

Function Documentation

◆ GWEN_IDMAP_FUNCTIONS()

GWEN_IDMAP_FUNCTIONS ( GWEN_MULTICACHE_ENTRY  ,
GWEN_MultiCache_Entry   
)

◆ GWEN_LIST_FUNCTIONS() [1/2]

GWEN_LIST_FUNCTIONS ( GWEN_MULTICACHE_ENTRY  ,
GWEN_MultiCache_Entry   
)

◆ GWEN_LIST_FUNCTIONS() [2/2]

GWEN_LIST_FUNCTIONS ( GWEN_MULTICACHE_TYPE  ,
GWEN_MultiCache_Type   
)

◆ GWEN_MultiCache_AddEntry()

int GWEN_MultiCache_AddEntry ( GWEN_MULTICACHE mc,
GWEN_MULTICACHE_ENTRY *  e 
)

◆ GWEN_MultiCache_Entry_free()

void GWEN_MultiCache_Entry_free ( GWEN_MULTICACHE_ENTRY *  e)

Definition at line 61 of file multicache.c.

References GWEN_FREE_OBJECT, and GWEN_LIST_FINI.

Referenced by GWEN_MultiCache_ReleaseEntry().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetCacheType()

GWEN_MULTICACHE_TYPE* GWEN_MultiCache_Entry_GetCacheType ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 95 of file multicache.c.

Referenced by GWEN_MultiCache_AddEntry(), GWEN_MultiCache_ReleaseEntriesForType(), GWEN_MultiCache_ReleaseEntry(), and GWEN_MultiCache_Type_GetIdsInCache().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetDataPtr()

void* GWEN_MultiCache_Entry_GetDataPtr ( const GWEN_MULTICACHE_ENTRY *  e)

◆ GWEN_MultiCache_Entry_GetDataSize()

uint32_t GWEN_MultiCache_Entry_GetDataSize ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 79 of file multicache.c.

Referenced by GWEN_MultiCache_AddEntry(), and GWEN_MultiCache_ReleaseEntry().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetId()

uint32_t GWEN_MultiCache_Entry_GetId ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 71 of file multicache.c.

Referenced by GWEN_MultiCache_Type_ReleaseEntry().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetParam1()

uint32_t GWEN_MultiCache_Entry_GetParam1 ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 103 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetDataWithParams(), and GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetParam2()

uint32_t GWEN_MultiCache_Entry_GetParam2 ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 119 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetDataWithParams(), and GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetParam3()

uint32_t GWEN_MultiCache_Entry_GetParam3 ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 135 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetDataWithParams(), and GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetParam4()

uint32_t GWEN_MultiCache_Entry_GetParam4 ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 151 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetDataWithParams(), and GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_GetParam5()

double GWEN_MultiCache_Entry_GetParam5 ( const GWEN_MULTICACHE_ENTRY *  e)

Definition at line 167 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_new()

GWEN_MULTICACHE_ENTRY* GWEN_MultiCache_Entry_new ( GWEN_MULTICACHE_TYPE ct,
uint32_t  id,
void *  p,
uint32_t  i 
)

Definition at line 44 of file multicache.c.

References GWEN_LIST_INIT, and GWEN_NEW_OBJECT.

Referenced by GWEN_MultiCache_Type_SetData(), GWEN_MultiCache_Type_SetDataWithParams(), and GWEN_MultiCache_Type_SetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_SetParam1()

void GWEN_MultiCache_Entry_SetParam1 ( GWEN_MULTICACHE_ENTRY *  e,
uint32_t  i 
)

Definition at line 111 of file multicache.c.

Referenced by GWEN_MultiCache_Type_SetDataWithParams(), and GWEN_MultiCache_Type_SetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_SetParam2()

void GWEN_MultiCache_Entry_SetParam2 ( GWEN_MULTICACHE_ENTRY *  e,
uint32_t  i 
)

Definition at line 127 of file multicache.c.

Referenced by GWEN_MultiCache_Type_SetDataWithParams(), and GWEN_MultiCache_Type_SetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_SetParam3()

void GWEN_MultiCache_Entry_SetParam3 ( GWEN_MULTICACHE_ENTRY *  e,
uint32_t  i 
)

Definition at line 143 of file multicache.c.

Referenced by GWEN_MultiCache_Type_SetDataWithParams(), and GWEN_MultiCache_Type_SetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_SetParam4()

void GWEN_MultiCache_Entry_SetParam4 ( GWEN_MULTICACHE_ENTRY *  e,
uint32_t  i 
)

Definition at line 159 of file multicache.c.

Referenced by GWEN_MultiCache_Type_SetDataWithParams(), and GWEN_MultiCache_Type_SetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Entry_SetParam5()

void GWEN_MultiCache_Entry_SetParam5 ( GWEN_MULTICACHE_ENTRY *  e,
double  d 
)

Definition at line 175 of file multicache.c.

Referenced by GWEN_MultiCache_Type_SetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_IncCacheHits()

void GWEN_MultiCache_IncCacheHits ( GWEN_MULTICACHE mc)

Definition at line 710 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetData(), GWEN_MultiCache_Type_GetDataWithParams(), and GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_IncCacheMisses()

void GWEN_MultiCache_IncCacheMisses ( GWEN_MULTICACHE mc)

Definition at line 719 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetData(), GWEN_MultiCache_Type_GetDataWithParams(), and GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function:

◆ GWEN_MultiCache_ReleaseEntriesForType()

void GWEN_MultiCache_ReleaseEntriesForType ( GWEN_MULTICACHE mc,
GWEN_MULTICACHE_TYPE ct 
)

Definition at line 676 of file multicache.c.

References GWEN_MultiCache_Entry_GetCacheType(), and GWEN_MultiCache_ReleaseEntry().

Referenced by GWEN_MultiCache_Type_free(), and GWEN_MultiCache_Type_PurgeAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_MultiCache_ReleaseEntry()

void GWEN_MultiCache_ReleaseEntry ( GWEN_MULTICACHE mc,
GWEN_MULTICACHE_ENTRY *  e 
)

◆ GWEN_MultiCache_Type_AttachData()

int GWEN_MultiCache_Type_AttachData ( const GWEN_MULTICACHE_TYPE ct,
void *  p 
)

◆ GWEN_MultiCache_Type_FreeData()

int GWEN_MultiCache_Type_FreeData ( const GWEN_MULTICACHE_TYPE ct,
void *  p 
)

Definition at line 447 of file multicache.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

Referenced by GWEN_MultiCache_ReleaseEntry().

Here is the caller graph for this function:

◆ GWEN_MultiCache_Type_ReleaseEntry()

void GWEN_MultiCache_Type_ReleaseEntry ( GWEN_MULTICACHE_TYPE ct,
GWEN_MULTICACHE_ENTRY *  e 
)

Definition at line 463 of file multicache.c.

References GWEN_MultiCache_Entry_GetId().

Referenced by GWEN_MultiCache_ReleaseEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_MultiCache_UsingEntry()

void GWEN_MultiCache_UsingEntry ( GWEN_MULTICACHE mc,
GWEN_MULTICACHE_ENTRY *  e 
)

Definition at line 698 of file multicache.c.

Referenced by GWEN_MultiCache_Type_GetData(), GWEN_MultiCache_Type_GetDataWithParams(), and GWEN_MultiCache_Type_GetDataWithParams5().

Here is the caller graph for this function: