Пример #1
0
            public int CompareTo(object target)
            {
                MappedIDPair targetIDPair = (MappedIDPair)target;
                int          targetID     = targetIDPair.Orig();

                return(sourceID == targetID ? 0 : (sourceID < targetID ? -1 : 1));
            }
Пример #2
0
        public virtual IPreparedComparison PrepareComparison(IContext context, object source
                                                             )
        {
            MappedIDPair sourceIDPair = (MappedIDPair)source;
            int          sourceID     = sourceIDPair.Orig();

            return(new _IPreparedComparison_50(sourceID));
        }
Пример #3
0
        public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer reader, object
                                            obj)
        {
            MappedIDPair mappedIDs = (MappedIDPair)obj;

            _origHandler.WriteIndexEntry(context, reader, mappedIDs.Orig());
            _mappedHandler.WriteIndexEntry(context, reader, mappedIDs.Mapped());
        }
Пример #4
0
 public override int MappedId(int oldID)
 {
     if (_cache.Orig() == oldID)
     {
         return _cache.Mapped();
     }
     var classID = MappedClassID(oldID);
     if (classID != 0)
     {
         return classID;
     }
     var range = _idTree.SearchRange(Trans(), new MappedIDPair(oldID, 0));
     var pointers = range.Pointers();
     if (pointers.MoveNext())
     {
         var pointer = (BTreePointer) pointers.Current;
         _cache = (MappedIDPair) pointer.Key();
         return _cache.Mapped();
     }
     return 0;
 }
Пример #5
0
 protected override void MapNonClassIDs(int origID, int mappedID)
 {
     _cache = new MappedIDPair(origID, mappedID);
     _idTree.Add(Trans(), _cache);
     if (_commitFrequency > 0)
     {
         _idInsertCount++;
         if (_commitFrequency == _idInsertCount)
         {
             _idTree.Commit(Trans());
             _idInsertCount = 0;
         }
     }
 }