class DeltaTree
Declaration
class DeltaTree { /* full declaration omitted */ };
Description
DeltaTree - a multiway search tree (BTree) structure with some fancy features. B-Trees are generally more memory and cache efficient than binary trees, because they store multiple keys/values in each node. This implements a key/value mapping from index to delta, and allows fast lookup on index. However, an added (important) bonus is that it can also efficiently tell us the full accumulated delta for a specific file offset as well, without traversing the whole tree.
Declared at: clang/include/clang/Rewrite/Core/DeltaTree.h:25
Member Variables
- private void* Root
Method Overview
- public void AddDelta(unsigned int FileIndex, int Delta)
- public DeltaTree()
- public DeltaTree(const clang::DeltaTree & RHS)
- public int getDeltaAt(unsigned int FileIndex) const
- public ~DeltaTree()
Methods
¶void AddDelta(unsigned int FileIndex, int Delta)
void AddDelta(unsigned int FileIndex, int Delta)
Description
AddDelta - When a change is made that shifts around the text buffer, this method is used to record that info. It inserts a delta of 'Delta' into the current DeltaTree at offset FileIndex.
Declared at: clang/include/clang/Rewrite/Core/DeltaTree.h:45
Parameters
- unsigned int FileIndex
- int Delta
¶DeltaTree()
DeltaTree()
Declared at: clang/include/clang/Rewrite/Core/DeltaTree.h:29
¶DeltaTree(const clang::DeltaTree& RHS)
DeltaTree(const clang::DeltaTree& RHS)
Declared at: clang/include/clang/Rewrite/Core/DeltaTree.h:32
Parameters
- const clang::DeltaTree& RHS
¶int getDeltaAt(unsigned int FileIndex) const
int getDeltaAt(unsigned int FileIndex) const
Description
getDeltaAt - Return the accumulated delta at the specified file offset. This includes all insertions or delections that occurred *before* the specified file index.
Declared at: clang/include/clang/Rewrite/Core/DeltaTree.h:40
Parameters
- unsigned int FileIndex
¶~DeltaTree()
~DeltaTree()
Declared at: clang/include/clang/Rewrite/Core/DeltaTree.h:35