multicache.h
Go to the documentation of this file.
/***************************************************************************
begin : Wed May 08 2013
copyright : (C) 2020 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
* *
***************************************************************************/
#ifndef GWENHYWFAR_MULTICACHE_H
#define GWENHYWFAR_MULTICACHE_H
#include <gwenhywfar/list1.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/idlist64.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GWEN_MULTICACHE GWEN_MULTICACHE;
typedef struct GWEN_MULTICACHE_TYPE GWEN_MULTICACHE_TYPE;
typedef int GWENHYWFAR_CB(*GWEN_MULTICACHE_TYPE_ATTACH_FN)(void *p);
typedef int GWENHYWFAR_CB(*GWEN_MULTICACHE_TYPE_FREE_FN)(void *p);
typedef int GWENHYWFAR_CB(*GWEN_MULTICACHE_TYPE_ATTACH_OBJECT_FN)(const GWEN_MULTICACHE_TYPE *ct, void *p);
typedef int GWENHYWFAR_CB(*GWEN_MULTICACHE_TYPE_FREE_OBJECT_FN)(const GWEN_MULTICACHE_TYPE *ct, void *p);
GWENHYWFAR_API GWEN_MULTICACHE_TYPE *GWEN_MultiCache_Type_new(GWEN_MULTICACHE *mc);
GWENHYWFAR_API void GWEN_MultiCache_Type_free(GWEN_MULTICACHE_TYPE *ct);
GWENHYWFAR_API void *GWEN_MultiCache_Type_GetData(const GWEN_MULTICACHE_TYPE *ct, uint32_t id);
GWENHYWFAR_API 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);
GWENHYWFAR_API 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);
GWENHYWFAR_API void GWEN_MultiCache_Type_SetData(GWEN_MULTICACHE_TYPE *ct, uint32_t id, void *ptr, uint32_t size);
GWENHYWFAR_API 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);
GWENHYWFAR_API 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);
GWENHYWFAR_API void GWEN_MultiCache_Type_PurgeData(GWEN_MULTICACHE_TYPE *ct, uint32_t id);
GWENHYWFAR_API void GWEN_MultiCache_Type_PurgeAll(GWEN_MULTICACHE_TYPE *ct);
GWENHYWFAR_API GWEN_IDLIST64 *GWEN_MultiCache_Type_GetIdsInCache(const GWEN_MULTICACHE_TYPE *ct);
GWENHYWFAR_API void GWEN_MultiCache_Type_SetAttachFn(GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_ATTACH_FN fn);
GWENHYWFAR_API void GWEN_MultiCache_Type_SetFreeFn(GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_FREE_FN fn);
GWENHYWFAR_API void GWEN_MultiCache_Type_SetAttachObjectFn(GWEN_MULTICACHE_TYPE *ct,
GWEN_MULTICACHE_TYPE_ATTACH_OBJECT_FN fn);
GWENHYWFAR_API void GWEN_MultiCache_Type_SetFreeObjectFn(GWEN_MULTICACHE_TYPE *ct,
GWEN_MULTICACHE_TYPE_FREE_OBJECT_FN fn);
GWENHYWFAR_API GWEN_MULTICACHE *GWEN_MultiCache_new(uint64_t maxSize);
GWENHYWFAR_API void GWEN_MultiCache_free(GWEN_MULTICACHE *mc);
GWENHYWFAR_API uint64_t GWEN_MultiCache_GetMaxSizeUsed(const GWEN_MULTICACHE *mc);
GWENHYWFAR_API int GWEN_MultiCache_GetUsageString(const GWEN_MULTICACHE *mc, char *ptrBuffer, int lenBuffer);
#ifdef __cplusplus
}
#endif
#endif
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWENHYWFAR_CB
#define GWENHYWFAR_CB
Definition gwenhywfarapi.h:89
idlist64.h
GWEN_IDLIST64
GWEN_SIMPLEPTRLIST GWEN_IDLIST64
Definition idlist64.h:42
list1.h
misc.h
GWEN_MultiCache_Type_SetDataWithParams5
GWENHYWFAR_API 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)
GWEN_MultiCache_GetMaxSizeUsed
GWENHYWFAR_API uint64_t GWEN_MultiCache_GetMaxSizeUsed(const GWEN_MULTICACHE *mc)
GWEN_MULTICACHE
struct GWEN_MULTICACHE GWEN_MULTICACHE
Definition multicache.h:59
GWEN_MultiCache_Type_PurgeData
GWENHYWFAR_API void GWEN_MultiCache_Type_PurgeData(GWEN_MULTICACHE_TYPE *ct, uint32_t id)
GWEN_MultiCache_Type_SetAttachObjectFn
GWENHYWFAR_API void GWEN_MultiCache_Type_SetAttachObjectFn(GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_ATTACH_OBJECT_FN fn)
GWEN_MULTICACHE_TYPE_ATTACH_FN
int GWENHYWFAR_CB(* GWEN_MULTICACHE_TYPE_ATTACH_FN)(void *p)
Definition multicache.h:63
GWEN_MultiCache_Type_GetData
GWENHYWFAR_API void * GWEN_MultiCache_Type_GetData(const GWEN_MULTICACHE_TYPE *ct, uint32_t id)
GWEN_MultiCache_Type_SetFreeObjectFn
GWENHYWFAR_API void GWEN_MultiCache_Type_SetFreeObjectFn(GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_FREE_OBJECT_FN fn)
GWEN_MULTICACHE_TYPE
struct GWEN_MULTICACHE_TYPE GWEN_MULTICACHE_TYPE
Definition multicache.h:60
GWEN_MultiCache_free
GWENHYWFAR_API void GWEN_MultiCache_free(GWEN_MULTICACHE *mc)
GWEN_MultiCache_new
GWENHYWFAR_API GWEN_MULTICACHE * GWEN_MultiCache_new(uint64_t maxSize)
GWEN_MultiCache_Type_GetDataWithParams
GWENHYWFAR_API 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)
GWEN_MultiCache_Type_SetAttachFn
GWENHYWFAR_API void GWEN_MultiCache_Type_SetAttachFn(GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_ATTACH_FN fn)
GWEN_MULTICACHE_TYPE_ATTACH_OBJECT_FN
int GWENHYWFAR_CB(* GWEN_MULTICACHE_TYPE_ATTACH_OBJECT_FN)(const GWEN_MULTICACHE_TYPE *ct, void *p)
Definition multicache.h:66
GWEN_MultiCache_Type_free
GWENHYWFAR_API void GWEN_MultiCache_Type_free(GWEN_MULTICACHE_TYPE *ct)
GWEN_MultiCache_GetUsageString
GWENHYWFAR_API int GWEN_MultiCache_GetUsageString(const GWEN_MULTICACHE *mc, char *ptrBuffer, int lenBuffer)
GWEN_MultiCache_Type_SetFreeFn
GWENHYWFAR_API void GWEN_MultiCache_Type_SetFreeFn(GWEN_MULTICACHE_TYPE *ct, GWEN_MULTICACHE_TYPE_FREE_FN fn)
GWEN_MULTICACHE_TYPE_FREE_OBJECT_FN
int GWENHYWFAR_CB(* GWEN_MULTICACHE_TYPE_FREE_OBJECT_FN)(const GWEN_MULTICACHE_TYPE *ct, void *p)
Definition multicache.h:67
GWEN_MultiCache_Type_GetDataWithParams5
GWENHYWFAR_API 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_MultiCache_Type_new
GWENHYWFAR_API GWEN_MULTICACHE_TYPE * GWEN_MultiCache_Type_new(GWEN_MULTICACHE *mc)
GWEN_MultiCache_Type_GetIdsInCache
GWENHYWFAR_API GWEN_IDLIST64 * GWEN_MultiCache_Type_GetIdsInCache(const GWEN_MULTICACHE_TYPE *ct)
GWEN_MultiCache_Type_PurgeAll
GWENHYWFAR_API void GWEN_MultiCache_Type_PurgeAll(GWEN_MULTICACHE_TYPE *ct)
GWEN_MULTICACHE_TYPE_FREE_FN
int GWENHYWFAR_CB(* GWEN_MULTICACHE_TYPE_FREE_FN)(void *p)
Definition multicache.h:64
GWEN_MultiCache_Type_SetData
GWENHYWFAR_API void GWEN_MultiCache_Type_SetData(GWEN_MULTICACHE_TYPE *ct, uint32_t id, void *ptr, uint32_t size)
GWEN_MultiCache_Type_SetDataWithParams
GWENHYWFAR_API 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)