Beispiel #1
0
        /// <inheritdoc />
        public void Assign(Snapshot snapshot, MemoryPath path, MemoryEntry value, bool forceStrongWrite)
        {
            if (snapshot.AssignInfo == null)
            {
                snapshot.AssignInfo = new AssignInfo();
            }
            MemoryIndexModificationList pathModifications = snapshot.AssignInfo.GetOrCreatePathModification(path);

            // Collecting all sources of the data
            MemoryEntryCollector entryCollector = new MemoryEntryCollector(snapshot);

            entryCollector.ProcessRootMemoryEntry(value);

            // Collecting all locations where to assign into
            TreeIndexCollector treeCollector = new TreeIndexCollector(snapshot);

            treeCollector.PostProcessAliases = true;
            treeCollector.ProcessPath(path);

            // Provides an assign operation
            AssignWorker worker = new AssignWorker(Factories, snapshot, entryCollector, treeCollector, pathModifications);

            worker.ForceStrongWrite = forceStrongWrite;
            worker.Assign();
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AssignWorker"/> class.
        /// </summary>
        /// <param name="factories">The factories.</param>
        /// <param name="snapshot">The snapshot.</param>
        /// <param name="memoryEntryCollector">The memory entry collector.</param>
        /// <param name="treeCollector">The tree collector.</param>
        /// <param name="pathModifications">The path modifications.</param>
        public AssignWorker(ModularMemoryModelFactories factories, Snapshot snapshot, MemoryEntryCollector memoryEntryCollector,
                            TreeIndexCollector treeCollector, MemoryIndexModificationList pathModifications)
            : base(factories, snapshot, treeCollector, pathModifications)
        {
            this.memoryEntryCollector = memoryEntryCollector;

            ForceStrongWrite = false;
            AssignAliasesIntoCollectedIndexes = false;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AliasWorker"/> class.
 /// </summary>
 /// <param name="factories">The factories.</param>
 /// <param name="snapshot">The snapshot.</param>
 /// <param name="treeCollector">The tree collector.</param>
 /// <param name="pathModifications">The path modifications.</param>
 public AliasWorker(ModularMemoryModelFactories factories, Snapshot snapshot, TreeIndexCollector treeCollector, MemoryIndexModificationList pathModifications)
     : base(factories, snapshot, treeCollector, pathModifications)
 {
     EntryCollector = new MemoryEntryCollector(snapshot);
 }