/// <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); }
/// <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); }
/// <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); }
/// <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"); } }
/// <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"); } }
/// <inheritdoc /> public ISnapshotStructureProxy CreateGlobalContextInstance(ModularMemoryModelFactories factories) { return(CopySnapshotStructureProxy.CreateGlobal(factories)); }
/// <inheritdoc /> public ISnapshotStructureProxy CreateEmptyInstance(ModularMemoryModelFactories factories) { return(CopySnapshotStructureProxy.CreateEmpty(factories)); }