Example #1
0
		public override void CollectIDs(CollectIdContext context)
		{
			if (!Handlers4.IsCascading(_typeHandler))
			{
				IncrementOffset(context, context);
				return;
			}
			context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_58(this, context
				));
		}
Example #2
0
		public static void CollectIdsInternal(CollectIdContext context, ITypeHandler4 handler
			, int linkLength, bool doWithSlotIndirection)
		{
			if (!(IsCascading(handler)))
			{
				IReadBuffer buffer = context.Buffer();
				buffer.Seek(buffer.Offset() + linkLength);
				return;
			}
			if (handler is StandardReferenceTypeHandler)
			{
				context.AddId();
				return;
			}
			LocalObjectContainer container = (LocalObjectContainer)context.Container();
			SlotFormat slotFormat = context.SlotFormat();
			if (HandleAsObject(handler))
			{
				// TODO: Code is similar to QCandidate.readArrayCandidates. Try to refactor to one place.
				int collectionID = context.ReadInt();
				ByteArrayBuffer collectionBuffer = container.ReadBufferById(context.Transaction()
					, collectionID);
				ObjectHeader objectHeader = new ObjectHeader(container, collectionBuffer);
				QueryingReadContext subContext = new QueryingReadContext(context.Transaction(), context
					.HandlerVersion(), collectionBuffer, collectionID, context.Collector());
				objectHeader.ClassMetadata().CollectIDs(subContext);
				return;
			}
			QueryingReadContext 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();
			}
		}
 public _MarshallingInfoTraverseAspectCommand_349(StandardReferenceTypeHandler _enclosing
     , BooleanByRef aspectFound, CollectIdContext subContext, IMarshallingInfo baseArg1
     ) : base(baseArg1)
 {
     this._enclosing = _enclosing;
     this.aspectFound = aspectFound;
     this.subContext = subContext;
 }
 public _MarshallingInfoTraverseAspectCommand_311(IPredicate4 predicate, CollectIdContext
     context, IMarshallingInfo baseArg1) : base(baseArg1)
 {
     this.predicate = predicate;
     this.context = context;
 }
 public virtual void CollectIDs(CollectIdContext context, IPredicate4 predicate)
 {
     ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_311(predicate
         , context, EnsureFieldList(context));
     TraverseAllAspects(context, command);
 }
Example #6
0
		public abstract void CollectIDs(CollectIdContext context);
Example #7
0
 private void CollectIDs(CollectIdContext context, IPredicate4 predicate)
 {
     if (!StandardReferenceTypeHandlerIsUsed())
     {
         throw new InvalidOperationException();
     }
     ((StandardReferenceTypeHandler) CorrectHandlerVersion(context)).CollectIDs(context
         , predicate);
 }
Example #8
0
 public void CollectIDs(CollectIdContext context)
 {
     CollectIDs(context, new _IPredicate4_555());
 }
Example #9
0
 public void CollectIDs(CollectIdContext context, string fieldName)
 {
     CollectIDs(context, new _IPredicate4_546(fieldName));
 }
		private void AssertCollectedIds(CollectIdContext context, object[] expectedReferences
			)
		{
			Iterator4Assert.SameContent(Iterators.Map(expectedReferences, new _IFunction4_66(
				this)), new TreeKeyIterator(context.Ids()));
		}
 public virtual void CollectIDs(CollectIdContext context, IPredicate4 predicate)
 {
 }
Example #12
0
 public void Visit(object treeInt)
 {
     var id = ((TreeInt) treeInt)._key;
     var reader = stream.ReadStatefulBufferById(_enclosing._enclosing.
         _trans, id);
     if (reader != null)
     {
         var oh = new ObjectHeader(stream, reader);
         var context = new CollectIdContext(_enclosing._enclosing._trans
             , oh, reader);
         oh.ClassMetadata().CollectIDs(context, fieldName);
         Tree.Traverse(context.Ids(), new _IVisitor4_394(idsNew));
     }
 }
Example #13
0
				public void Visit(object treeInt)
				{
					int id = ((TreeInt)treeInt)._key;
					StatefulBuffer buffer = this._enclosing._container.ReadStatefulBufferById(this._enclosing
						._trans, id);
					if (buffer != null)
					{
						ObjectHeader oh = new ObjectHeader(this._enclosing._container, buffer);
						CollectIdContext context = new CollectIdContext(this._enclosing._trans, oh, buffer
							);
						oh.ClassMetadata().CollectIDs(context, fieldName);
						Tree.Traverse(context.Ids(), new _IVisitor4_516(idsNew));
					}
				}
		/// <exception cref="Db4objects.Db4o.Internal.FieldIndexException"></exception>
		public sealed override void CollectIDs(CollectIdContext context)
		{
			if (!Alive())
			{
				IncrementOffset(context.Buffer());
				return;
			}
			ITypeHandler4 handler = HandlerRegistry.CorrectHandlerVersion(context, GetHandler
				());
			Handlers4.CollectIdsInternal(context, handler, LinkLength(), true);
		}
Example #15
0
			public _IClosure4_58(TypeHandlerAspect _enclosing, CollectIdContext context)
			{
				this._enclosing = _enclosing;
				this.context = context;
			}