private static void UpdateStoredBufferFromExisting(ILazinator e) { e.SerializeLazinator(); var buffer = e.LazinatorMemoryStorage.GetConsolidatedMemory(); BufferWriter b = new BufferWriter(); b.Write(buffer.Span); e.UpdateStoredBuffer(ref b, 0, buffer.Span.Length, IncludeChildrenMode.IncludeAllChildren, true); }
private static LazinatorMemory GetLazinatorMemoryCopy(ILazinator e) { e.SerializeLazinator(); var buffer = e.LazinatorMemoryStorage.GetConsolidatedMemory(); BufferWriter b = new BufferWriter(); b.Write(buffer.Span); return(b.LazinatorMemory); }
public async static Task SaveRemotes(ILazinator hierarchy, bool freeRemoteStorage = true, bool excludeTopOfHierarchy = false) { hierarchy.SerializeLazinator(); foreach (ILazinator remoteLazinator in hierarchy.EnumerateLazinatorNodes(x => x is IRemote && (!excludeTopOfHierarchy || x != hierarchy), true, x => true, true, false)) { await SaveRemotes(remoteLazinator, freeRemoteStorage, true); IRemote r = (IRemote)remoteLazinator; await r.SaveValue(freeRemoteStorage); } }
private static void ConfirmBuffersUpdateInTandem(ILazinator itemToUpdate) { itemToUpdate.SerializeLazinator(); var initialMemoryChunk = itemToUpdate.LazinatorMemoryStorage.SingleMemoryChunk; var allocationID = initialMemoryChunk.AllocationID; itemToUpdate.ForEachLazinator(x => { if (x.LazinatorMemoryStorage.IsEmpty == false) { MemoryChunk c = x.LazinatorMemoryStorage.SingleMemoryChunk; if (c != null) { c.AllocationID.Should().Be(allocationID); } } return(x); }, true, true); }