Ejemplo n.º 1
0
        /// <exception cref="Db4objects.Db4o.Internal.FieldIndexException"></exception>
        public sealed override void CollectIDs(CollectIdContext context)
        {
            if (!Alive())
            {
                IncrementOffset(context.Buffer(), context);
                return;
            }
            ITypeHandler4 handler = HandlerRegistry.CorrectHandlerVersion(context, GetHandler
                                                                              ());

            Handlers4.CollectIdsInternal(context, handler, LinkLength(context), true);
        }
Ejemplo n.º 2
0
        public static void CollectIdsInternal(CollectIdContext context, ITypeHandler4 handler
                                              , int linkLength, bool doWithSlotIndirection)
        {
            if (!(IsCascading(handler)))
            {
                var buffer = context.Buffer();
                buffer.Seek(buffer.Offset() + linkLength);
                return;
            }
            if (handler is StandardReferenceTypeHandler)
            {
                context.AddId();
                return;
            }
            var container  = (LocalObjectContainer)context.Container();
            var slotFormat = context.SlotFormat();

            if (HandleAsObject(handler))
            {
                // TODO: Code is similar to QCandidate.readArrayCandidates. Try to refactor to one place.
                var collectionID     = context.ReadInt();
                var collectionBuffer = container.ReadBufferById(context.Transaction()
                                                                , collectionID);
                var objectHeader = new ObjectHeader(container, collectionBuffer);
                var subContext   = new QueryingReadContext(context.Transaction(), context
                                                           .HandlerVersion(), collectionBuffer, collectionID, context.Collector());
                objectHeader.ClassMetadata().CollectIDs(subContext);
                return;
            }
            var queryingReadContext = new QueryingReadContext(context.Transaction
                                                                  (), context.HandlerVersion(), context.Buffer(), 0, context.Collector());
            IClosure4 collectIDsFromQueryingContext = new _IClosure4_263(handler, queryingReadContext
                                                                         );

            if (doWithSlotIndirection)
            {
                slotFormat.DoWithSlotIndirection(queryingReadContext, handler, collectIDsFromQueryingContext
                                                 );
            }
            else
            {
                collectIDsFromQueryingContext.Run();
            }
        }
Ejemplo n.º 3
0
            public object Run()
            {
                var queryingReadContext = new QueryingReadContext(context.Transaction
                                                                      (), context.HandlerVersion(), context.Buffer(), 0, context.Collector());

                ((ICascadingTypeHandler)_enclosing._typeHandler).CollectIDs(queryingReadContext
                                                                            );
                return(null);
            }