123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- ##############################################################################
- #
- # Copyright (c) 2001-2012 Zope Foundation and Contributors.
- # All Rights Reserved.
- #
- # This software is subject to the provisions of the Zope Public License,
- # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
- # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
- # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
- # FOR A PARTICULAR PURPOSE
- #
- ##############################################################################
-
- __all__ = ('Bucket', 'Set', 'BTree', 'TreeSet',
- 'OIBucket', 'OISet', 'OIBTree', 'OITreeSet',
- 'union', 'intersection', 'difference',
- 'weightedUnion', 'weightedIntersection',
- )
-
- from zope.interface import moduleProvides
-
- from .Interfaces import IObjectIntegerBTreeModule
- from ._base import Bucket
- from ._base import MERGE
- from ._base import MERGE_WEIGHT_numeric
- from ._base import MERGE_DEFAULT_float
- from ._base import Set
- from ._base import Tree as BTree
- from ._base import TreeSet
- from ._base import _TreeIterator
- from ._base import difference as _difference
- from ._base import intersection as _intersection
- from ._base import set_operation as _set_operation
- from ._base import to_ob as _to_key
- from ._base import to_int as _to_value
- from ._base import union as _union
- from ._base import weightedIntersection as _weightedIntersection
- from ._base import weightedUnion as _weightedUnion
- from ._base import _fix_pickle
- from ._compat import import_c_extension
-
- _BUCKET_SIZE = 60
- _TREE_SIZE = 250
- using64bits = True
-
- class OIBucketPy(Bucket):
- _to_key = _to_key
- _to_value = _to_value
- MERGE = MERGE
- MERGE_WEIGHT = MERGE_WEIGHT_numeric
- MERGE_DEFAULT = MERGE_DEFAULT_float
-
-
- class OISetPy(Set):
- _to_key = _to_key
- MERGE = MERGE
- MERGE_WEIGHT = MERGE_WEIGHT_numeric
- MERGE_DEFAULT = MERGE_DEFAULT_float
-
-
- class OIBTreePy(BTree):
- max_leaf_size = _BUCKET_SIZE
- max_internal_size = _TREE_SIZE
- _to_key = _to_key
- _to_value = _to_value
- MERGE = MERGE
- MERGE_WEIGHT = MERGE_WEIGHT_numeric
- MERGE_DEFAULT = MERGE_DEFAULT_float
-
-
- class OITreeSetPy(TreeSet):
- max_leaf_size = _BUCKET_SIZE
- max_internal_size = _TREE_SIZE
- _to_key = _to_key
- MERGE = MERGE
- MERGE_WEIGHT = MERGE_WEIGHT_numeric
- MERGE_DEFAULT = MERGE_DEFAULT_float
-
-
- class OITreeIteratorPy(_TreeIterator):
- pass
-
-
- # Can't declare forward refs, so fix up afterwards:
-
- OIBucketPy._mapping_type = OIBucketPy._bucket_type = OIBucketPy
- OIBucketPy._set_type = OISetPy
-
- OISetPy._mapping_type = OIBucketPy
- OISetPy._set_type = OISetPy._bucket_type = OISetPy
-
- OIBTreePy._mapping_type = OIBTreePy._bucket_type = OIBucketPy
- OIBTreePy._set_type = OISetPy
-
- OITreeSetPy._mapping_type = OIBucketPy
- OITreeSetPy._set_type = OITreeSetPy._bucket_type = OISetPy
-
-
- differencePy = _set_operation(_difference, OISetPy)
- unionPy = _set_operation(_union, OISetPy)
- intersectionPy = _set_operation(_intersection, OISetPy)
- weightedUnionPy = _set_operation(_weightedUnion, OISetPy)
- weightedIntersectionPy = _set_operation(_weightedIntersection, OISetPy)
-
- import_c_extension(globals())
-
- _fix_pickle(globals(), __name__)
-
- moduleProvides(IObjectIntegerBTreeModule)
|