Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
Data Structures | Typedefs | Functions
Dictionary.h File Reference

Immutable key-value stores. More...

#include <Objectively/Array.h>
#include <Objectively/Object.h>

Go to the source code of this file.

Data Structures

struct  Dictionary
 Immutable key-value stores. More...
 

Typedefs

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

Functions

OBJECTIVELY_EXPORT Class_Dictionary (void)
 

Detailed Description

Immutable 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 451 of file Dictionary.c.

451 {
452 static Class *clazz;
453 static Once once;
454
455 do_once(&once, {
456 clazz = _initialize(&(const ClassDef) {
457 .name = "Dictionary",
458 .superclass = _Object(),
459 .instanceSize = sizeof(Dictionary),
460 .interfaceOffset = offsetof(Dictionary, interface),
461 .interfaceSize = sizeof(DictionaryInterface),
463 });
464 });
465
466 return clazz;
467}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition: Class.c:91
static void initialize(Class *clazz)
Definition: Dictionary.c:424
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
Immutable key-value stores.
Definition: Dictionary.h:60
Class * _Object(void)
The Object archetype.
Definition: Object.c:136