示例#1
0
 public void CacheNode(SbnQueryOnlyNode sbnQueryOnlyNode)
 {
     if (sbnQueryOnlyNode.Nid < _nodeToBin.Length)
     {
         _nodeToBin[sbnQueryOnlyNode.Nid].Node = sbnQueryOnlyNode;
     }
 }
示例#2
0
        /// <summary>
        /// Creates an istance of this class
        /// </summary>
        /// <param name="sbnFilename"></param>
        /// <param name="sbxFilename"></param>
        private SbnQueryOnlyTree(string sbnFilename, string sbxFilename)
        {
            _sbnStream = new FileStream(sbnFilename, FileMode.Open, FileAccess.Read, FileShare.Read, 8192);
            _sbnHeader = new SbnHeader();
            var sbnReader = new BinaryReader(_sbnStream);

            _sbnHeader.Read(sbnReader);
            _sbnBinIndex = SbnBinIndex.Read(sbnReader);

            _sbxStream = new FileStream(sbxFilename, FileMode.Open, FileAccess.Read, FileShare.Read, 8192);

            FirstLeafNodeId = (int)Math.Pow(2, GetNumberOfLevels(_sbnHeader.NumRecords) - 1);
            MaxCacheLevel   = DefaultMaxCacheLevel;

            SbnQueryOnlyNode.CreateRoot(this);
            _sbxStream.Position = 0;
        }