Newer
Older
/*
* Authors:
* Alexey V. Stratulat <alexey.stratulat@demlabs.net>
* DeM Labs Inc. https://demlabs.net
* CellFrame https://cellframe.net
* Sources https://gitlab.demlabs.net/cellframe
* Copyright (c) 2017-2021
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _WRAPPING_DAP_CHAIN_DATUM_
#define _WRAPPING_DAP_CHAIN_DATUM_
#include "Python.h"
#include "dap_chain_datum.h"
#include "datetime.h"
#include "wrapping_dap_chain_datum_tx.h"

alexey.stratulat
committed
#include "wrapping_dap_chain_datum_token.h"
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
#ifdef __cplusplus
extern "C" {
#endif
/* DAP Chain datum type id */
typedef struct PyDapChainDatumTypeId{
PyObject_HEAD
dap_chain_datum_typeid_t *type_id;
}PyDapChainDatumTypeIdObject;
static PyTypeObject DapChainDatumTypeIdObject_DapChainDatumTypeIdObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.DatumTypeId", /* tp_name */
sizeof(PyDapChainDatumTypeIdObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum type id object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* -------------------------------- */
typedef struct PyDapChainDatum{
PyObject_HEAD
dap_chain_datum_t *datum;
}PyDapChainDatumObject;
//void PyDapChainDatumObject_dealloc(PyDapChainDatumObject* object);
PyObject *PyDapChainDatumObject_new(PyTypeObject *type_object, PyObject *args, PyObject *kwds);
PyObject *dap_chain_datum_size_py(PyObject *self, PyObject *args);

alexey.stratulat
committed
PyObject *dap_chain_datum_get_ts_created_py(PyObject *self, void* closure);
PyObject *dap_chain_datum_is_type_tx(PyObject *self, PyObject *args);
PyObject *wrapping_dap_chain_datum_get_datum_tx(PyObject *self, PyObject *args);

alexey.stratulat
committed
PyObject *dap_chain_datum_is_type_token(PyObject *self, PyObject *args);
PyObject *wrapping_dap_chain_datum_get_datum_token(PyObject *self, PyObject *args);
PyObject *dap_chain_datum_is_type_emission(PyObject *self, PyObject *args);
PyObject *wrapping_dap_chain_datum_get_datum_token_emission(PyObject *self, PyObject *args);
PyObject *dap_chain_datum_get_type_str_py(PyObject *self, PyObject *args);

alexey.stratulat
committed
PyObject *wrapping_dap_chain_datum_get_version_str_py(PyObject *self, void* closure);
static PyMethodDef DapChainDatumMethods[] = {

alexey.stratulat
committed
{"getSize", dap_chain_datum_size_py, METH_NOARGS, ""},
{"isDatumTX", dap_chain_datum_is_type_tx, METH_NOARGS, ""},
{"getDatumTX", wrapping_dap_chain_datum_get_datum_tx, METH_NOARGS, ""},

alexey.stratulat
committed
{"isDatumToken", dap_chain_datum_is_type_token, METH_NOARGS, ""},
{"getDatumToken", wrapping_dap_chain_datum_get_datum_token, METH_NOARGS, ""},
{"isDatumTokenEmission", dap_chain_datum_is_type_emission, METH_NOARGS, ""},
{"getDatumTokenEmission", wrapping_dap_chain_datum_get_datum_token_emission, METH_NOARGS, ""},
{"getTypeStr", dap_chain_datum_get_type_str_py, METH_NOARGS, ""},
static PyGetSetDef DapChainDatumGetSet[] = {

alexey.stratulat
committed
{"versionStr", (getter)wrapping_dap_chain_datum_get_version_str_py, NULL, NULL},
{"tsCreated", (getter)dap_chain_datum_get_ts_created_py, NULL, NULL},
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
static PyTypeObject DapChainDatumObject_DapChainDatumObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.Datum", /* tp_name */
sizeof(PyDapChainDatumObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyDapChainDatumObject_new, /* tp_new */
};
/* -------------------------------- */
/* DAP Chain datum iter*/
typedef struct PyDapChainDatumIter{
PyObject_HEAD
dap_chain_datum_iter_t *datum_iter;
}PyDapChainDatumIterObject;
static PyTypeObject DapChainDatumIterObject_DapChainDatumIterObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.DatumIter", /* tp_name */
sizeof(PyDapChainDatumIterObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum iter object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* -------------------------------- */
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_DATUM_