コード例 #1
0
        /// <summary>
        /// Creates new structure object with copy of diven data object.
        /// </summary>
        /// <param name="data">The old data.</param>
        /// <returns>
        /// New structure object with copy of diven data object.
        /// </returns>
        public static ISnapshotStructureProxy CreateWithData(TrackingSnapshotStructureContainer data)
        {
            TrackingSnapshotStructureProxy proxy = new TrackingSnapshotStructureProxy(data.Factories);

            proxy.readonlyInstance = data;
            return(proxy);
        }
コード例 #2
0
        /// <summary>
        /// Creates new structure object as copy of this structure which contains the same data as this instace.
        /// </summary>
        /// <returns>
        /// New copy of this structure which contains the same data as this instace.
        /// </returns>
        public TrackingSnapshotStructureProxy Copy()
        {
            TrackingSnapshotStructureProxy proxy = new TrackingSnapshotStructureProxy(factories);

            proxy.readonlyInstance = this.readonlyInstance;
            return(proxy);
        }
コード例 #3
0
        /// <summary>
        /// Creates empty structure which contains no data in containers.
        /// </summary>
        /// <param name="factories">The factories.</param>
        /// <returns>
        /// New empty structure which contains no data in containers.
        /// </returns>
        public static TrackingSnapshotStructureProxy CreateEmpty(ModularMemoryModelFactories factories)
        {
            TrackingSnapshotStructureProxy proxy = new TrackingSnapshotStructureProxy(factories);

            proxy.snapshotStructure = TrackingSnapshotStructureContainer.CreateEmpty(factories);
            proxy.readonlyInstance  = proxy.snapshotStructure;
            proxy.isReadonly        = false;
            return(proxy);
        }
コード例 #4
0
        /// <inheritdoc />
        public ISnapshotStructureProxy CreateNewInstanceWithData(IReadOnlySnapshotStructure oldData)
        {
            TrackingSnapshotStructureContainer data = oldData as TrackingSnapshotStructureContainer;

            if (data != null)
            {
                return(TrackingSnapshotStructureProxy.CreateWithData(data));
            }
            else
            {
                throw new InvalidCastException("Argument is not of type TrackingSnapshotStructureContainer");
            }
        }
コード例 #5
0
        /// <inheritdoc />
        public ISnapshotStructureProxy CopyInstance(ISnapshotStructureProxy oldData)
        {
            TrackingSnapshotStructureProxy proxy = oldData as TrackingSnapshotStructureProxy;

            if (proxy != null)
            {
                return(proxy.Copy());
            }
            else
            {
                throw new InvalidCastException("Argument is not of type CopySnapshotStructureProxy");
            }
        }
コード例 #6
0
        /// <summary>
        /// Creates the structure with memory stack with global level only.
        /// </summary>
        /// <param name="factories">The factories.</param>
        /// <returns>
        /// New structure with memory stack with global level only.
        /// </returns>
        public static TrackingSnapshotStructureProxy CreateGlobal(ModularMemoryModelFactories factories)
        {
            TrackingSnapshotStructureProxy proxy = new TrackingSnapshotStructureProxy(factories);

            proxy.snapshotStructure = TrackingSnapshotStructureContainer.CreateEmpty(factories);
            proxy.isReadonly        = false;

            proxy.snapshotStructure.AddStackLevel(Snapshot.GLOBAL_CALL_LEVEL);
            proxy.snapshotStructure.SetLocalStackLevelNumber(Snapshot.GLOBAL_CALL_LEVEL);

            proxy.readonlyInstance = proxy.snapshotStructure;
            return(proxy);
        }
コード例 #7
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CreateGlobalContextInstance(ModularMemoryModelFactories factories)
 {
     return(TrackingSnapshotStructureProxy.CreateGlobal(factories));
 }
コード例 #8
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CreateEmptyInstance(ModularMemoryModelFactories factories)
 {
     return(TrackingSnapshotStructureProxy.CreateEmpty(factories));
 }