Beispiel #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(SnapshotStructureContainer data)
        {
            CopySnapshotStructureProxy proxy = new CopySnapshotStructureProxy();

            proxy.snapshotStructure = data.Copy();
            return(proxy);
        }
Beispiel #2
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 CopySnapshotStructureProxy CreateGlobal(ModularMemoryModelFactories factories)
        {
            CopySnapshotStructureProxy proxy = new CopySnapshotStructureProxy();

            proxy.snapshotStructure = SnapshotStructureContainer.CreateGlobal(factories);
            return(proxy);
        }
Beispiel #3
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 CopySnapshotStructureProxy Copy()
        {
            CopySnapshotStructureProxy proxy = new CopySnapshotStructureProxy();

            proxy.snapshotStructure = this.snapshotStructure.Copy();
            return(proxy);
        }
Beispiel #4
0
        /// <inheritdoc />
        public ISnapshotStructureProxy CreateNewInstanceWithData(IReadOnlySnapshotStructure oldData)
        {
            SnapshotStructureContainer data = oldData as SnapshotStructureContainer;

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

            if (proxy != null)
            {
                return(proxy.Copy());
            }
            else
            {
                throw new InvalidCastException("Argument is not of type CopySnapshotStructureProxy");
            }
        }
Beispiel #6
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CreateGlobalContextInstance(ModularMemoryModelFactories factories)
 {
     return(CopySnapshotStructureProxy.CreateGlobal(factories));
 }
Beispiel #7
0
 /// <inheritdoc />
 public ISnapshotStructureProxy CreateEmptyInstance(ModularMemoryModelFactories factories)
 {
     return(CopySnapshotStructureProxy.CreateEmpty(factories));
 }