/// <summary> /// Return an indicative size for memory consumption of this class to be used in cache tracking /// </summary> public virtual int IndicativeSizeInBytes() { var filterMapSize = FilterMap?.IndicativeSizeInBytes() ?? 0; var prodDataMapSize = ProdDataMap?.IndicativeSizeInBytes() ?? 0; return(filterMapSize + prodDataMapSize); }
/// <summary> /// Write the contents of the Items array using the supplied writer /// </summary> public override void Write(BinaryWriter writer) { base.Write(writer); writer.Write((int)GridDataType); writer.Write(CellSize); writer.Write(IndexOriginOffset); ProdDataMap.Write(writer); FilterMap.Write(writer); }
/// <summary> /// Assigns the state of one client leaf sub grid to this client leaf sub grid /// Note: The cell values are explicitly NOT copied in this operation /// </summary> public void Assign(IClientLeafSubGrid source) { level = source.Level; originX = source.OriginX; originY = source.OriginY; // Grid data type is never assigned from one client grid to another... //GridDataType = source.GridDataType; CellSize = source.CellSize; IndexOriginOffset = source.IndexOriginOffset; ProdDataMap.Assign(source.ProdDataMap); FilterMap.Assign(source.FilterMap); }
/// <summary> /// Fill the items array by reading the binary representation using the provided reader. /// </summary> /// <param name="reader"></param> public override void Read(BinaryReader reader) { base.Read(reader); if ((GridDataType)reader.ReadInt32() != GridDataType) { throw new TRexSubGridIOException("GridDataType in stream does not match GridDataType of local sub grid instance"); } CellSize = reader.ReadDouble(); IndexOriginOffset = reader.ReadInt32(); ProdDataMap.Read(reader); FilterMap.Read(reader); }