Coconut Framework
beta
|
Define CNDictionary data structure. More...
Go to the source code of this file.
Classes | |
struct | CNDictionary |
Dictionary of pointer. More... | |
Macros | |
#define | CNHashTableSizeOfDictionary 64 |
Typedefs | |
typedef void(* | CNReleaseDictionaryItemFuncRef )(void *item, struct CNResource *resource) |
typedef CNBoolean(* | CNVisitElementOfDictionaryFuncRef )(const struct CNFixedString *key, void *src, void *info) |
Functions | |
void | CNInitDictionary (struct CNDictionary *dst, CNReleaseDictionaryItemFuncRef func, struct CNResource *resource) |
Initialize CNDictionary. More... | |
void | CNDestroyDictionary (struct CNDictionary *dst) |
Deallocate CNDictionary. More... | |
static size_t | CNCountOfDictionary (const struct CNDictionary *src) |
Number of items in dictionary. More... | |
static struct CNResource * | CNResourceOfDictionary (struct CNDictionary *src) |
Get resource fot the dictionary. More... | |
void * | CNSearchDataInDictionary (const struct CNDictionary *dict, const struct CNFixedString *key) |
Search data in data dictionary. More... | |
void | CNSetDataToDictionary (struct CNDictionary *dict, const struct CNFixedString *key, void *value) |
Set data for key to CNDictionary. More... | |
CNBoolean | CNVisitElementOfDictionary (const struct CNDictionary *src, CNVisitElementOfDictionaryFuncRef visitfunc, void *info) |
Visit all elements in the dictionary. More... | |
Define CNDictionary data structure.
#define CNHashTableSizeOfDictionary 64 |
Max hash table size of CNDictionary
typedef void(* CNReleaseDictionaryItemFuncRef)(void *item, struct CNResource *resource) |
Function to destroy the item in CNDictionary
typedef CNBoolean(* CNVisitElementOfDictionaryFuncRef)(const struct CNFixedString *key, void *src, void *info) |
The function to visit the element in CNDictionary
void CNInitDictionary | ( | struct CNDictionary * | dst, |
CNReleaseDictionaryItemFuncRef | func, | ||
struct CNResource * | resource | ||
) |
Initialize CNDictionary.
dst | Destination dictionary |
func | Function to release dictionary item |
resource | Resource to allocate dictionary |
void CNDestroyDictionary | ( | struct CNDictionary * | dst | ) |
Deallocate CNDictionary.
dst | Destination dictionary |
Referenced by CNDestroyObjectDictionary().
|
inlinestatic |
Number of items in dictionary.
src | Source dictionary |
References CNDictionary::itemCount.
Referenced by CNCountOfObjectDictionary().
|
static |
Get resource fot the dictionary.
src | Source dictionary |
References CNDictionary::resource.
Referenced by CNResourceOfObjectDictionary().
void* CNSearchDataInDictionary | ( | const struct CNDictionary * | dict, |
const struct CNFixedString * | key | ||
) |
Search data in data dictionary.
obj | Matched data |
NULL | No matched data |
dict | Source dictionary |
key | Key string |
Referenced by CNSearchObjectInDictionary().
void CNSetDataToDictionary | ( | struct CNDictionary * | dict, |
const struct CNFixedString * | key, | ||
void * | value | ||
) |
Set data for key to CNDictionary.
dict | Destination dictionary |
key | Key string |
value | Value |
Referenced by CNSetObjectToDictionary().
CNBoolean CNVisitElementOfDictionary | ( | const struct CNDictionary * | src, |
CNVisitElementOfDictionaryFuncRef | visitfunc, | ||
void * | info | ||
) |
Visit all elements in the dictionary.
TRUE | All elements are visited |
FALSE | All elements are NOT visited |
src | Source array |
visitfunc | Function which is called foreach elements |
info | Additiona parameter for visit function |
Referenced by CNVisitElementOfObjectDictionary().