Objectively
Ultra-lightweight object oriented framework for GNU C.
Loading...
Searching...
No Matches
Dictionary.h File Reference

Key-value stores. More...

Go to the source code of this file.

Data Structures

struct  Dictionary
 Key-value stores. More...
 

Typedefs

typedef void(* DictionaryEnumerator) (const Dictionary *dictionary, ident obj, ident key, ident data)
 A function type for Dictionary enumeration (iteration).
 
typedef bool(* DictionaryPredicate) (ident obj, ident key, ident data)
 A function pointer for Dictionary filtering.
 

Functions

OBJECTIVELY_EXPORT Class_Dictionary (void)
 

Detailed Description

Key-value stores.

Definition in file Dictionary.h.

Typedef Documentation

◆ DictionaryEnumerator

typedef void(* DictionaryEnumerator) (const Dictionary *dictionary, ident obj, ident key, ident data)

A function type for Dictionary enumeration (iteration).

Parameters
dictionaryThe Dictionary.
objThe Object for the current iteration.
keyThe key for the current iteration.
dataUser data.

Definition at line 44 of file Dictionary.h.

◆ DictionaryPredicate

typedef bool(* DictionaryPredicate) (ident obj, ident key, ident data)

A function pointer for Dictionary filtering.

Parameters
objThe Object to filter.
keyThe key to filter.
dataUser data.
Returns
True if the pair passes the filter, false otherwise.

Definition at line 53 of file Dictionary.h.

Function Documentation

◆ _Dictionary()

OBJECTIVELY_EXPORT Class * _Dictionary ( void  )

Definition at line 762 of file Dictionary.c.

762 {
763 static Class *clazz;
764 static Once once;
765
766 do_once(&once, {
767 clazz = _initialize(&(const ClassDef) {
768 .name = "Dictionary",
769 .superclass = _Object(),
770 .instanceSize = sizeof(Dictionary),
771 .interfaceOffset = offsetof(Dictionary, interface),
772 .interfaceSize = sizeof(DictionaryInterface),
774 });
775 });
776
777 return clazz;
778}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition Class.c:86
static void initialize(Class *clazz)
Definition Dictionary.c:722
Class * _Object(void)
Definition Object.c:136
long Once
The Once type.
Definition Once.h:37
#define do_once(once, block)
Executes the given block at most one time.
Definition Once.h:43
ClassDefs are passed to _initialize via an archetype to initialize a Class.
Definition Class.h:41
The runtime representation of a Class.
Definition Class.h:95
Key-value stores.
Definition Dictionary.h:60