Beispiel #1
0
 /// <summary>
 /// B+树,固定长度字符串为键,映射至对象。
 /// </summary>
 /// <param name="tree">绑定到的B+树</param>
 /// <param name="formatter">序列化器,默认为二进制序列化</param>
 internal BPlusTreeObject(BPlusTreeBytes tree, IFormatter formatter)
 {
   this.tree = tree;
   if (formatter == null)
   {
     this.formatter = new BinaryFormatter();
   }
 }
 /// <summary>
 /// B+树,固定长度字符串为键,映射至对象。
 /// </summary>
 /// <param name="tree">绑定到的B+树</param>
 /// <param name="formatter">序列化器,默认为二进制序列化</param>
 internal BPlusTreeObject(BPlusTreeBytes tree, IFormatter formatter)
 {
     this.tree = tree;
     if (formatter == null)
     {
         this.formatter = new BinaryFormatter();
     }
 }
Beispiel #3
0
 /// <summary>
 /// B+树,固定长度字符串为键,映射至字符串。
 /// </summary>
 /// <param name="tree">绑定到的B+树</param>
 internal BPlusTree(BPlusTreeBytes tree)
 {
     if (tree == null)
     {
         throw new ArgumentNullException("tree");
     }
     this.tree = tree;
 }
Beispiel #4
0
 /// <summary>
 /// B+树,固定长度字符串为键,映射至对象。
 /// </summary>
 /// <param name="tree">绑定到的B+树</param>
 internal BPlusTreeObject(BPlusTreeBytes tree)
   : this(tree, null)
 {
 }
Beispiel #5
0
 /// <summary>
 /// B+树,固定长度字符串为键,映射至字符串。
 /// </summary>
 /// <param name="tree">绑定到的B+树</param>
 internal BPlusTree(BPlusTreeBytes tree)
 {
   if (tree == null)
     throw new ArgumentNullException("tree");
   this.tree = tree;
 }
        /// <summary>
        /// 创建B+树
        /// </summary>
        /// <param name="treeFileStream">指定树文件的文件流</param>
        /// <param name="blockFileStream">指定块文件的文件流</param>
        /// <param name="keyLength">树允许的键的长度</param>
        /// <param name="nodeCapacity">树允许的各子节点的最大容量</param>
        /// <param name="blockSize">块大小</param>
        /// <returns>B+树</returns>
        public static BPlusTreeObject Create(Stream treeFileStream, Stream blockFileStream, int keyLength, int nodeCapacity, int blockSize)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Create(treeFileStream, blockFileStream, keyLength, nodeCapacity, blockSize);

            return(new BPlusTreeObject(tree));
        }
        /// <summary>
        /// 创建B+树
        /// </summary>
        /// <param name="treeFileName">指定树文件的文件名</param>
        /// <param name="blockFileName">指定块文件的文件名</param>
        /// <param name="keyLength">树允许的键的长度</param>
        /// <returns>B+树</returns>
        public static BPlusTreeObject Create(string treeFileName, string blockFileName, int keyLength)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Create(treeFileName, blockFileName, keyLength);

            return(new BPlusTreeObject(tree));
        }
        /// <summary>
        /// 创建B+树
        /// </summary>
        /// <param name="treeFileName">指定树文件的文件名</param>
        /// <param name="blockFileName">指定块文件的文件名</param>
        /// <param name="keyLength">树允许的键的长度</param>
        /// <param name="nodeCapacity">树允许的各子节点的最大容量</param>
        /// <param name="blockSize">块大小</param>
        /// <returns>B+树</returns>
        public static BPlusTreeObject Create(string treeFileName, string blockFileName, int keyLength, int nodeCapacity, int blockSize)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Create(treeFileName, blockFileName, keyLength, nodeCapacity, blockSize);

            return(new BPlusTreeObject(tree));
        }
 /// <summary>
 /// B+树,固定长度字符串为键,映射至对象。
 /// </summary>
 /// <param name="tree">绑定到的B+树</param>
 internal BPlusTreeObject(BPlusTreeBytes tree)
     : this(tree, null)
 {
 }
        /// <summary>
        /// 从文件打开B+树,该树为只读树。
        /// </summary>
        /// <param name="treeFileName">指定树文件的文件名</param>
        /// <param name="blockFileName">指定块文件的文件名</param>
        /// <param name="formatter">序列化器</param>
        /// <returns>B+树</returns>
        public static BPlusTreeObject OpenReadOnly(string treeFileName, string blockFileName, IFormatter formatter)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.OpenReadOnly(treeFileName, blockFileName);

            return(new BPlusTreeObject(tree, formatter));
        }
        /// <summary>
        /// 从文件打开B+树
        /// </summary>
        /// <param name="treeFileStream">指定树文件的文件流</param>
        /// <param name="blockFileStream">指定块文件的文件流</param>
        /// <param name="formatter">序列化器</param>
        /// <returns>B+树</returns>
        public static BPlusTreeObject Open(Stream treeFileStream, Stream blockFileStream, IFormatter formatter)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Open(treeFileStream, blockFileStream);

            return(new BPlusTreeObject(tree, formatter));
        }
        /// <summary>
        /// 从文件打开B+树
        /// </summary>
        /// <param name="treeFileName">指定树文件的文件名</param>
        /// <param name="blockFileName">指定块文件的文件名</param>
        /// <returns>B+树</returns>
        public static BPlusTreeObject Open(string treeFileName, string blockFileName)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Open(treeFileName, blockFileName);

            return(new BPlusTreeObject(tree));
        }
        /// <summary>
        /// 创建B+树
        /// </summary>
        /// <param name="treeFileStream">指定树文件的文件流</param>
        /// <param name="blockFileStream">指定块文件的文件流</param>
        /// <param name="keyLength">树允许的键的长度</param>
        /// <param name="formatter">序列化器</param>
        /// <returns>B+树</returns>
        public static BPlusTreeObject Create(Stream treeFileStream, Stream blockFileStream, int keyLength, IFormatter formatter)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Create(treeFileStream, blockFileStream, keyLength);

            return(new BPlusTreeObject(tree, formatter));
        }
Beispiel #14
0
        /// <summary>
        /// 创建B+树
        /// </summary>
        /// <param name="treeFileStream">指定树文件的文件流</param>
        /// <param name="blockFileStream">指定块文件的文件流</param>
        /// <param name="keyLength">树允许的键的长度</param>
        /// <returns>B+树</returns>
        public static BPlusTree Create(Stream treeFileStream, Stream blockFileStream, int keyLength)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Create(treeFileStream, blockFileStream, keyLength);

            return(new BPlusTree(tree));
        }
Beispiel #15
0
        /// <summary>
        /// 从文件打开B+树,该树为只读树。
        /// </summary>
        /// <param name="treeFileName">指定树文件的文件名</param>
        /// <param name="blockFileName">指定块文件的文件名</param>
        /// <returns>B+树</returns>
        public static BPlusTree OpenReadOnly(string treeFileName, string blockFileName)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.OpenReadOnly(treeFileName, blockFileName);

            return(new BPlusTree(tree));
        }
Beispiel #16
0
        /// <summary>
        /// 从文件打开B+树
        /// </summary>
        /// <param name="treeFileStream">指定树文件的文件流</param>
        /// <param name="blockFileStream">指定块文件的文件流</param>
        /// <returns>B+树</returns>
        public static BPlusTree Open(Stream treeFileStream, Stream blockFileStream)
        {
            BPlusTreeBytes tree = BPlusTreeBytes.Open(treeFileStream, blockFileStream);

            return(new BPlusTree(tree));
        }