-
Notifications
You must be signed in to change notification settings - Fork 0
/
lazydict.h
114 lines (75 loc) · 2.05 KB
/
lazydict.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifndef OOCMAP_LAZYDICT_H
#define OOCMAP_LAZYDICT_H
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "oocmap.h"
#include "lmdb.h"
//
// OOCLazyDict
//
typedef struct {
PyObject_HEAD
OOCMapObject* ooc;
uint32_t dictId;
} OOCLazyDictObject;
extern PyTypeObject OOCLazyDictType;
OOCLazyDictObject* OOCLazyDict_fastnew(OOCMapObject* ooc, uint32_t dictId);
Py_ssize_t OOCLazyDictObject_length(OOCLazyDictObject* self, OOCTransaction& txn);
PyObject* OOCLazyDictObject_eager(OOCLazyDictObject* self, OOCTransaction& txn);
PyObject* OOCLazyDict_eager(PyObject* pySelf);
//
// OOCLazyDictItems
//
typedef struct {
PyObject_HEAD
OOCLazyDictObject* dict;
} OOCLazyDictItemsObject;
extern PyTypeObject OOCLazyDictItemsType;
OOCLazyDictItemsObject* OOCLazyDictItems_fastnew(OOCLazyDictObject* dict);
//
// OOCLazyDictItemsIter
//
typedef struct {
PyObject_HEAD
OOCLazyDictObject* dict;
MDB_cursor* cursor;
} OOCLazyDictItemsIterObject;
extern PyTypeObject OOCLazyDictItemsIterType;
OOCLazyDictItemsIterObject* OOCLazyDictItemsIter_fastnew(OOCLazyDictObject* dict);
//
// OOCLazyDictKeys
//
typedef struct {
PyObject_HEAD
OOCLazyDictObject* dict;
} OOCLazyDictKeysObject;
extern PyTypeObject OOCLazyDictKeysType;
OOCLazyDictKeysObject* OOCLazyDictKeys_fastnew(OOCLazyDictObject* dict);
//
// OOCLazyDictKeysIter
//
typedef struct {
PyObject_HEAD
PyObject* itemsIter;
} OOCLazyDictKeysIterObject;
extern PyTypeObject OOCLazyDictKeysIterType;
OOCLazyDictKeysIterObject* OOCLazyDictKeysIter_fastnew(OOCLazyDictObject* dict);
//
// OOCLazyDictValues
//
typedef struct {
PyObject_HEAD
OOCLazyDictObject* dict;
} OOCLazyDictValuesObject;
extern PyTypeObject OOCLazyDictValuesType;
OOCLazyDictValuesObject* OOCLazyDictValues_fastnew(OOCLazyDictObject* dict);
//
// OOCLazyDictValuesIter
//
typedef struct {
PyObject_HEAD
PyObject* itemsIter;
} OOCLazyDictValuesIterObject;
extern PyTypeObject OOCLazyDictValuesIterType;
OOCLazyDictValuesIterObject* OOCLazyDictValuesIter_fastnew(OOCLazyDictObject* dict);
#endif