private readonly MemoryMap.WriteToDelegate <T> _writeTo; // Holds the write-to delegate. /// <summary> /// Creates a new memory mapped file. /// </summary> public MappedAccessorVariable(MemoryMap file, Stream stream, MemoryMap.ReadFromDelegate <T> readFrom, MemoryMap.WriteToDelegate <T> writeTo) : base(file, stream, -1) { _readFrom = readFrom; _writeTo = writeTo; }
/// <summary> /// Creates a new memory mapped file based on the given stream and the given size in bytes. /// </summary> /// <param name="position">The position to start at.</param> /// <param name="sizeInBytes">The size.</param> /// <param name="readFrom"></param> /// <param name="writeTo"></param> /// <returns></returns> protected override MappedAccessor <T> DoCreateVariable <T>(long position, long sizeInBytes, MemoryMap.ReadFromDelegate <T> readFrom, MemoryMap.WriteToDelegate <T> writeTo) { return(new Accessors.MappedAccessorVariable <T>(this, new CappedStream(_stream, position, sizeInBytes), readFrom, writeTo)); }