Esempio n. 1
0
        public void Delete(object Value)
        {
            T ValueConvert = (T)Value;

            MapperFilePostion mapperPosition = ColumnMapper[ValueConvert];

            ColumnMapper.Remove(ValueConvert);

            //Remove From Mapper
            using (var accessor = MemoryMappedColumnMapFile.CreateViewAccessor(mapperPosition.MapPosition, MapRowSize, MemoryMappedFileAccess.Write))
            {
                accessor.WriteArray(0, DeleteBuffer, 0, DeleteBuffer.Length);
            }
            MemoryMappedColumnMapCountAccessor.Write(0, ColumnMapper.Count);
        }
Esempio n. 2
0
        public void Update(object OldValue, object NewValue)
        {
            T OldValueConvert = (T)OldValue;
            T NewValueConvert = (T)NewValue;

            MapperFilePostion mapperFilePostion = ColumnMapper[OldValueConvert];

            ColumnMapper.Remove(OldValueConvert);
            ColumnMapper.Add(NewValueConvert, mapperFilePostion);
            byte[] ValueByte = ION.SerializeObject(NewValueConvert, PadRight: true, PadAmount: MapRowSize);

            using (var accessor = MemoryMappedColumnMapFile.CreateViewAccessor(mapperFilePostion.MapPosition, MapRowSize, MemoryMappedFileAccess.Write))
            {
                accessor.WriteArray(0, ValueByte, 0, ValueByte.Length);
            }
            MemoryMappedColumnMapCountAccessor.Write(0, ColumnMapper.Count);
        }