LibGimbal 0.0.0 (PRERELEASE)
Ultimate C17/C++20 Cross-Language Runtime Framework and Meta Type System
gimbal_container.h
1#ifndef GIMBAL_CONTAINER_H
2#define GIMBAL_CONTAINER_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8//#include "../gimbal_types.h"
9//#include "../gimbal_api.h"
10
11
12
13/*A. Sequence containers:
14 * 1) vector
15 * 2) forward list
16 *
17 * B. Associative containers:
18 * 1) map
19 * 2) hash
20 *
21 */
22
23// JUST FOCUS ON VECTOR + MAP FOR NOW, UNIFY STRING + VECTOR
24
25
26
27/*
28#define GBL_META_OBJECT_VECTOR_TABLE ( \
29 ( GblVector, Vector, "Dynamic Array Container"), \
30 (
31 (gblVectorClear, clear, (void)
32
33
34\
35 (GBL_META_TYPE_VTABLE_TO, 0x0, To, "To"), \
36 (GBL_META_TYPE_VTABLE_COMPARE, 0x1, Compare, "Compare"), \
37 (GBL_META_TYPE_VTABLE_DESTRUCTOR, 0x2, Destructor, "Destructor"), \
38 (GBL_META_TYPE_VTABLE_COUNT, 0x3, BuiltinCount, "Builtin virtual method count") \
39 ) \
40 )
41*/
42
43
44// Do all the convenience shit for GblVariant too
45
46// vararg initializer for create/assign?
47//GBL_VECTOR_FOREACH
48
49/*
50//overload so you can do
51GblVector vec = GBL_API_CALL_INLINE(VECTOR_CREATE [, GblContext hCtx, GblSize elementSize, GblSize structSize, const void* pInitialData, GblSize elemenCount));
52
53
54*/
55
56/* STRING SHIT THAT CAN GO HERE:
57 * context
58 * isEmpty()
59 * isStack()
60 * clear()
61 * take()/give()
62 * stackSize()
63 * capacity()
64 * resize()/reserve()
65 * concatenate()
66*/
67// set comparator for for find?
68
69
70
71#if 0
72
73
74typedef struct GblAssociativeContainer {
75 GblContainer containerBase;
76 GblSize keySize;
77
78} GblAssociativeContainer;
79
80GBL_RESULT gblMapConstruct(GblMap* pMap, GblContext* pCtx, GblSize keySize, GblSize valueSize, Comparator*);
81GBL_RESULT gblMapDestruct(GblMap* pMap);
82GBL_RESULT gblMapAt(GblMap* pMap, void* pKey, void** ppEntry);
83GBL_RESULT gblMapNext(GblMap* pMap, void* pKeyCurrent, void* pKeyNext);
84GBL_RESULT gblMapInsert(GblMap* pMap, const void* pKey, const void* pValue);
85GBL_RESULT gblMapErase(GblMap* pMap, const void* pKey);
86
87
88
89#endif
90
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif // GIMBAL_CONTAINER_H