|
Module Simantics/BTreeThis module is undocumented. This is a list of its definitions. bTreeOf :: Resource -> <ReadGraph> BTree Opens a handle to the B-tree stored at the given resource, the resource
that cachedBTreeOf :: Resource -> <ReadGraph> BTree Like createBTree :: Integer -> Resource -> <WriteGraph> BTree Creates a new empty B-tree in the graph and returns a handle to it. The integer is the minimum degree of the tree: every node other than the root holds between that many keys minus one and twice that many minus one, so a larger degree means fewer and larger nodes. The resource is the relation by which the tree attaches its nodes and the inserted values to their parent node. Requires a write transaction. Use createCachedBTree :: Integer -> Resource -> <WriteGraph> BTree Like entriesOfBTree :: BTree -> <ReadGraph> [(Variant, Resource)] All entries of the tree as key-value pairs, in ascending key order. Requires a read transaction. flushCachedBTree :: BTree -> <WriteGraph> () Writes the pending changes of a cached tree into the graph. A tree opened
with insertBTree :: BTree -> Variant -> Resource -> <WriteGraph> () Adds an entry mapping the given key to the given resource. Requires a write transaction. Inserting does not replace: a key that is already in the tree gets a second
entry, and both stay there. removeBTree :: BTree -> Variant -> <WriteGraph> () Removes one entry with the given key. Does nothing if the tree has no such entry. Only the entry is removed; the resource it pointed to is left in the graph. Requires a write transaction. rootOfBTree :: BTree -> Resource The resource that represents the whole tree, the one searchBTree :: BTree -> Variant -> <ReadGraph> Maybe Resource The resource stored under the given key, or searchRangeBTree :: BTree -> Maybe Variant -> Maybe Variant -> <ReadGraph> [(Variant, Resource)] The entries whose key lies between the given bounds, in ascending key
order. Both bounds are inclusive, and |