-
Notifications
You must be signed in to change notification settings - Fork 0
/
_datastructures.pxd
93 lines (69 loc) · 3.28 KB
/
_datastructures.pxd
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
# Definitions for datastructures.py
import cython
from nti.externalization.externalization._externalizer cimport to_external_object as _toExternalObject
from nti.externalization.externalization._dictionary cimport to_minimal_standard_external_dictionary
from nti.externalization.externalization._dictionary cimport internal_to_standard_external_dictionary
from nti.externalization.__base_interfaces cimport get_standard_external_fields
from nti.externalization.__base_interfaces cimport StandardExternalFields as SEF
from nti.externalization.__base_interfaces cimport get_standard_internal_fields
from nti.externalization.__base_interfaces cimport StandardInternalFields as SIF
from nti.externalization.internalization._fields cimport validate_named_field_value
from nti.externalization.internalization._factories cimport find_factory_for
from nti.externalization.__interface_cache cimport cache_for
cdef IInternalObjectIOFinder
cdef IAnonymousObjectFactory
cdef SEF StandardExternalFields
cdef SIF StandardInternalFields
cdef validate_named_field_value
cdef make_repr
cdef isSyntheticKey
cdef find_most_derived_interface
cdef NotGiven
cdef IDict_providedBy
cdef _anonymous_dict_factory
cdef class ExternalizableDictionaryMixin(object):
# This is a mixin used with other C base classes (E.g., persistent)
# in this package. That's not a great idea, but it exists.
# So this cannot have any C-level attributes or vtable (cdef or
# cpdef ivars/methods) without causing metaclass problems.
pass
cdef class AbstractDynamicObjectIO(ExternalizableDictionaryMixin):
cpdef _ext_all_possible_keys(self)
cpdef _ext_setattr(self, ext_self, k, value)
cpdef _ext_getattr(self, ext_self, k, default=*)
cpdef _ext_replacement_getattr(self, k, default=*)
@cython.locals(
k=str # cython can optimize k.startswith('constantstring')
)
cpdef _ext_keys(self)
cpdef _ext_primitive_keys(self)
cpdef _ext_accept_update_key(self, k, ext_self, ext_keys)
cpdef _ext_accept_external_id(self, ext_self, parsed)
cpdef find_factory_for_named_value(self, key, value, registry)
cdef _updateFromExternalObject(self, parsed)
# cdef class _ExternalizableInstanceDict(AbstractDynamicObjectIO):
# cdef dict __dict__
# This class is sometimes subclassed while also subclassing persistent.Persistent,
# which doesn't work if it's an extension class, so we can't do that. It's rarely used,
# so performance doesn't matter as much.
#cdef class ExternalizableInstanceDict(AbstractDynamicObjectIO):
# pass
cdef class InterfaceObjectIO(AbstractDynamicObjectIO):
cdef readonly _ext_self
cdef readonly _iface
cdef readonly bint validate_after_update
# The dict is necessary because we assign to _ext_primitive_out_ivars,
# which so far was only defined as a class attribute (for
# which we use generic getattr)
cdef dict __dict__
#cdef _ext_primitive_out_ivars
cpdef _ext_find_schema(self, ext_self, iface_upper_bound)
cpdef _ext_find_primitive_keys(self)
cpdef _ext_schemas_to_consider(self, ext_self)
cpdef _validate_after_update(self, iface, ext_self)
cdef class ModuleScopedInterfaceObjectIO(InterfaceObjectIO):
@cython.locals(
search_module_name=str,
)
cpdef _ext_schemas_to_consider(self, ext_self)
cdef tuple _primitives