示例#1
0
        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);
        }
示例#2
0
        private static LazinatorMemory GetLazinatorMemoryCopy(ILazinator e)
        {
            e.SerializeLazinator();
            var          buffer = e.LazinatorMemoryStorage.GetConsolidatedMemory();
            BufferWriter b      = new BufferWriter();

            b.Write(buffer.Span);
            return(b.LazinatorMemory);
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
        }