public virtual void CollectIDs(CollectIdContext context, IPredicate4 predicate) { ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_311(predicate , context, EnsureFieldList(context)); TraverseAllAspects(context, command); }
public virtual void TestCollectIdsByFieldName() { ClassMetadataCollectIdsTestCase.Item root = QueryRootItem(); CollectIdContext context = CollectIdContext.ForID(Trans(), (int)Db().GetID(root)); context.ClassMetadata().CollectIDs(context, "typedRef"); AssertCollectedIds(context, new object[] { root.typedRef }); }
public _MarshallingInfoTraverseAspectCommand_349(StandardReferenceTypeHandler _enclosing , BooleanByRef aspectFound, CollectIdContext subContext, IMarshallingInfo baseArg1 ) : base(baseArg1) { this._enclosing = _enclosing; this.aspectFound = aspectFound; this.subContext = subContext; }
public virtual void TestCollectIds() { ClassMetadataCollectIdsTestCase.Item root = QueryRootItem(); CollectIdContext context = CollectIdContext.ForID(Trans(), (int)Db().GetID(root)); context.ClassMetadata().CollectIDs(context); AssertCollectedIds(context, new object[] { root.typedRef, root.untypedRef, root.UntypedElementAt (0) }); }
public override void CollectIDs(CollectIdContext context) { if (!Handlers4.IsCascading(_typeHandler)) { IncrementOffset(context, context); return; } context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_58(this, context )); }
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> private bool CollectIDsByTypehandlerAspect(QueryingReadContext context) { BooleanByRef aspectFound = new BooleanByRef(false); CollectIdContext subContext = CollectIdContext.ForID(context.Transaction(), context .Collector(), context.CollectionID()); ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_349(this , aspectFound, subContext, EnsureFieldList(subContext)); TraverseAllAspects(subContext, command); return(aspectFound.value); }
public object Apply(object current) { int id = ((int)current); CollectIdContext context = CollectIdContext.ForID(this._enclosing.i_trans, id); if (context == null) { return(Iterators.Skip); } context.ClassMetadata().CollectIDs(context, fieldName); return(new TreeKeyIterator(context.Ids())); }
/// <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); }
public void Visit(object treeInt) { int id = ((TreeInt)treeInt)._key; StatefulBuffer reader = stream.ReadStatefulBufferById(this._enclosing._enclosing. _trans, id); if (reader != null) { ObjectHeader oh = new ObjectHeader(stream, reader); CollectIdContext context = new CollectIdContext(this._enclosing._enclosing._trans , oh, reader); oh.ClassMetadata().CollectIDs(context, fieldName); Tree.Traverse(context.Ids(), new _IVisitor4_394(idsNew)); } }
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(); } }
public virtual IEnumerator ReferencesFrom(int id) { CollectIdContext context = CollectIdContext.ForID(_transaction, id); ClassMetadata classMetadata = context.ClassMetadata(); if (null == classMetadata) { // most probably ClassMetadata reading return(Iterators.EmptyIterator); } if (!classMetadata.HasIdentity()) { throw new InvalidOperationException(classMetadata.ToString()); } if (!Handlers4.IsCascading(classMetadata.TypeHandler())) { return(Iterators.EmptyIterator); } classMetadata.CollectIDs(context); return(new TreeKeyIterator(context.Ids())); }
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) { }
public abstract void CollectIDs(CollectIdContext context);
private void AssertCollectedIds(CollectIdContext context, object[] expectedReferences ) { Iterator4Assert.SameContent(Iterators.Map(expectedReferences, new _IFunction4_66( this)), new TreeKeyIterator(context.Ids())); }
public _IClosure4_58(TypeHandlerAspect _enclosing, CollectIdContext context) { this._enclosing = _enclosing; this.context = context; }