Пример #1
0
        public static BTreeNode ReadNode(BTree tree, byte[] buffer, int offset)
        {
            BTreeNodeDescriptor descriptor = (BTreeNodeDescriptor)Utilities.ToStruct <BTreeNodeDescriptor>(buffer, offset);

            switch (descriptor.Kind)
            {
            case BTreeNodeKind.HeaderNode:
                return(new BTreeHeaderNode(tree, descriptor));

            case BTreeNodeKind.IndexNode:
            case BTreeNodeKind.LeafNode:
                throw new NotImplementedException("Attempt to read index/leaf node without key and data types");

            default:
                throw new NotImplementedException("Unrecognized BTree node kind: " + descriptor.Kind);
            }
        }
Пример #2
0
        public static BTreeNode ReadNode <TKey>(BTree tree, byte[] buffer, int offset)
            where TKey : BTreeKey, new()
        {
            BTreeNodeDescriptor descriptor = (BTreeNodeDescriptor)Utilities.ToStruct <BTreeNodeDescriptor>(buffer, offset);

            switch (descriptor.Kind)
            {
            case BTreeNodeKind.HeaderNode:
                return(new BTreeHeaderNode(tree, descriptor));

            case BTreeNodeKind.LeafNode:
                return(new BTreeLeafNode <TKey>(tree, descriptor));

            case BTreeNodeKind.IndexNode:
                return(new BTreeIndexNode <TKey>(tree, descriptor));

            default:
                throw new NotImplementedException("Unrecognized BTree node kind: " + descriptor.Kind);
            }
        }
Пример #3
0
 public BTreeNode(BTree tree, BTreeNodeDescriptor descriptor)
 {
     _tree       = tree;
     _descriptor = descriptor;
 }
Пример #4
0
 public BTreeHeaderNode(BTree tree, BTreeNodeDescriptor descriptor)
     : base(tree, descriptor)
 {
 }
Пример #5
0
 public BTreeNode(BTree tree, BTreeNodeDescriptor descriptor)
 {
     this.Tree       = tree;
     this.Descriptor = descriptor;
 }
Пример #6
0
 public BTreeLeafNode(BTree tree, BTreeNodeDescriptor descriptor)
     : base(tree, descriptor)
 {
 }
Пример #7
0
 public BTreeHeaderNode(BTree tree, BTreeNodeDescriptor descriptor)
     : base(tree, descriptor)
 {
 }
Пример #8
0
 public BTreeIndexNode(BTree tree, BTreeNodeDescriptor descriptor)
     : base(tree, descriptor)
 {
 }