//      throw new IllegalStateException();
        public virtual void CollectIDs(QueryingReadContext readContext)
        {
            IInternalReadContext context = (IInternalReadContext)readContext;
            int payloadOffset            = context.ReadInt();

            if (payloadOffset == 0)
            {
                return;
            }
            int savedOffSet = context.Offset();

            try
            {
                ITypeHandler4 typeHandler = ReadTypeHandler(context, payloadOffset);
                if (typeHandler == null)
                {
                    return;
                }
                SeekSecondaryOffset(context, typeHandler);
                if (IsPlainObject(typeHandler))
                {
                    readContext.Collector().AddId(readContext.ReadInt());
                    return;
                }
                CollectIdContext collectIdContext = new _CollectIdContext_201(readContext, readContext
                                                                              .Transaction(), readContext.Collector(), null, readContext.Buffer());
                Handlers4.CollectIdsInternal(collectIdContext, context.Container().Handlers.CorrectHandlerVersion
                                                 (typeHandler, context.HandlerVersion()), 0, false);
            }
            finally
            {
                context.Seek(savedOffSet);
            }
        }
Example #2
0
        public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context)
        {
            int payLoadOffSet = context.ReadInt();

            if (payLoadOffSet == 0)
            {
                return(null);
            }
            context.Seek(payLoadOffSet);
            int           classMetadataID = context.ReadInt();
            ClassMetadata classMetadata   = context.Container().ClassMetadataForID(classMetadataID
                                                                                   );

            if (classMetadata == null)
            {
                return(null);
            }
            return(classMetadata.ReadCandidateHandler(context));
        }
Example #3
0
        public virtual void CollectIDs(QueryingReadContext context)
        {
            ITypeHandler4 elementHandler = ReadElementTypeHandler(context, context);
            int           elementCount   = context.ReadInt();

            for (int i = 0; i < elementCount; i++)
            {
                context.ReadId(elementHandler);
            }
        }
Example #4
0
        public virtual void CollectIDs(QueryingReadContext context)
        {
            KeyValueHandlerPair handlers = ReadKeyValueTypeHandlers(context, context);
            int elementCount             = context.ReadInt();

            for (int i = 0; i < elementCount; i++)
            {
                context.ReadId(handlers._keyHandler);
                context.SkipId(handlers._valueHandler);
            }
        }
Example #5
0
        public override ITypeHandler4 ReadCandidateHandler(QueryingReadContext context)
        {
            int id     = 0;
            int offset = context.Offset();

            try
            {
                id = context.ReadInt();
            }
            catch (Exception)
            {
            }
            context.Seek(offset);
            if (id != 0)
            {
                StatefulBuffer reader = context.Container().ReadStatefulBufferById(context.Transaction
                                                                                       (), id);
                if (reader != null)
                {
                    ObjectHeader oh = new ObjectHeader(context.Container(), reader);
                    try
                    {
                        if (oh.ClassMetadata() != null)
                        {
                            context.Buffer(reader);
                            return(oh.ClassMetadata().SeekCandidateHandler(context));
                        }
                    }
                    catch (Exception e)
                    {
                    }
                }
            }
            // TODO: Check Exception Types
            // Errors typically occur, if classes don't match
            return(null);
        }