public virtual object DoWithSlotIndirection(IReadBuffer buffer, IClosure4 closure ) { int payLoadOffset = buffer.ReadInt(); buffer.ReadInt(); // length, not used int savedOffset = buffer.Offset(); object res = null; if (payLoadOffset != 0) { buffer.Seek(payLoadOffset); res = closure.Run(); } buffer.Seek(savedOffset); return(res); }
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 virtual object DoWithSlotIndirection(IReadBuffer buffer, IClosure4 closure ) { int payLoadOffset = buffer.ReadInt(); buffer.ReadInt(); // length, not used int savedOffset = buffer.Offset(); object res = null; if (payLoadOffset != 0) { buffer.Seek(payLoadOffset); res = closure.Run(); } buffer.Seek(savedOffset); return res; }
public void IncrementOffset(IReadBuffer buffer, IHandlerVersionContext context) { buffer.Seek(buffer.Offset() + LinkLength(context)); }
public void IncrementOffset(IReadBuffer buffer) { buffer.Seek(buffer.Offset() + LinkLength()); }
public virtual int Offset() { return(_buffer.Offset()); }
private static void SkipData(IReadBuffer deleteContext) { int numBytes = deleteContext.ReadInt(); deleteContext.Seek(deleteContext.Offset() + numBytes); }