/// <summary> /// Writes this object to the given writer. /// </summary> public void WriteBinary(IBinaryRawWriter writer, bool changesOnly) { IgniteArgumentCheck.NotNull(writer, "writer"); if (_isNew || _dirtyAll || !changesOnly || (_removedKeys == null && _list.All(x => x.IsDirty))) { // Write in full mode. writer.WriteInt(_list.Count); foreach (var entry in _list) { writer.WriteString(entry.Key); // Write as byte array to enable partial deserialization. writer.WriteByteArray(entry.GetBytes()); } } else { // Write in diff mode. var removed = GetRemovedKeys(); var count = _list.Count(x => x.IsDirty) + (removed == null ? 0 : removed.Count); writer.WriteInt(count); // reserve count // Write removed keys as [key + null]. if (removed != null) { foreach (var removedKey in removed) { writer.WriteString(removedKey); writer.WriteByteArray(null); } } // Write dirty items. foreach (var entry in _list) { if (!entry.IsDirty) { continue; } writer.WriteString(entry.Key); // Write as byte array to enable partial deserialization. writer.WriteByteArray(entry.GetBytes()); } } }
public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(SiteModelID); writer.WriteInt((int)OTGCellBottomLeftX); writer.WriteInt((int)OTGCellBottomLeftY); writer.WriteDouble(CellSize); writer.WriteByte((byte)SurveyedSurfacePatchType); writer.WriteBoolean(ProcessingMap != null); if (ProcessingMap != null) { writer.WriteByteArray(ProcessingMap.ToBytes()); } writer.WriteBoolean(IncludedSurveyedSurfaces != null); if (IncludedSurveyedSurfaces != null) { var count = IncludedSurveyedSurfaces.Length; writer.WriteInt(count); for (int i = 0; i < count; i++) { writer.WriteGuid(IncludedSurveyedSurfaces[i]); } } }
public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteByteArray(data); }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(RequestID); writer.WriteInt((int)GridDataType); writer.WriteByteArray(ProdDataMaskBytes); writer.WriteByteArray(SurveyedSurfaceOnlyMaskBytes); writer.WriteBoolean(IncludeSurveyedSurfaceInformation); AreaControlSet.ToBinary(writer); writer.WriteInt((int)SubGridsRequestComputeStyle); }
/// <summary> /// Writes this object to the given writer. /// </summary> public void WriteBinary(IBinaryRawWriter writer, bool changesOnly) { ((IgniteSessionStateItemCollection)Items).WriteBinary(writer, changesOnly); writer.WriteByteArray(SerializeStaticObjects()); writer.WriteInt(Timeout); writer.WriteGuid(LockNodeId); writer.WriteLong(LockId); writer.WriteTimestamp(LockTime); }
public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteString(FileName); writer.WriteGuid(AssetId); writer.WriteBoolean(IsJohnDoe); writer.WriteByteArray(TagFileContent); writer.WriteInt((int)SubmissionFlags); writer.WriteInt((int)OriginSource); }
public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteLong(InsertUTC.ToBinary()); writer.WriteByteArray(Content); writer.WriteGuid(ProjectUID); writer.WriteGuid(MachineUid); writer.WriteInt((int)Operation); writer.WriteInt((int)Origin); }
public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteByte((byte)CalcResult); writer.WriteBoolean(Heights != null); if (Heights != null) { writer.WriteByteArray(Heights.ToBytes()); } }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteBoolean(TileBitmapData != null); if (TileBitmapData != null) { writer.WriteByteArray(TileBitmapData); } }
public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(ProjectID); writer.WriteGuid(AssetID); writer.WriteString(TAGFileName); writer.WriteString(TCCOrgID); writer.WriteByteArray(TagFileContent); writer.WriteBoolean(TreatAsJohnDoe); writer.WriteInt((int)SubmissionFlags); writer.WriteInt((int)OriginSource); }
public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(NodeId); writer.WriteGuid(RequestDescriptor); writer.WriteBoolean(Payload?.Bytes != null); if (Payload?.Bytes != null) { writer.WriteByteArray(Payload.Bytes); } }
public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(SourceNodeUid); writer.WriteGuid(SiteModelID); writer.WriteBoolean(ExistenceMapModified); writer.WriteBoolean(DesignsModified); writer.WriteBoolean(SurveyedSurfacesModified); writer.WriteBoolean(CsibModified); writer.WriteBoolean(MachinesModified); writer.WriteBoolean(MachineTargetValuesModified); writer.WriteBoolean(MachineDesignsModified); writer.WriteBoolean(ProofingRunsModified); writer.WriteByteArray(ExistenceMapChangeMask); writer.WriteBoolean(AlignmentsModified); writer.WriteBoolean(SiteModelMarkedForDeletion); writer.WriteGuid(ChangeEventUid); writer.WriteLong(TimeSentUtc.ToBinary()); }
public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(ProjectID); writer.WriteBoolean(DesignDescriptor != null); DesignDescriptor?.ToBinary(writer); writer.WriteBoolean(Extents != null); Extents?.ToBinary(writer); writer.WriteBoolean(ExistenceMap != null); if (ExistenceMap != null) { writer.WriteByteArray(ExistenceMap.ToBytes()); } }
/// <summary> /// Serialises content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteInt(TotalNumberOfPagesToCoverFilteredData); writer.WriteBoolean(SubGrids != null); if (SubGrids != null) { writer.WriteInt(SubGrids.Count); foreach (var subGrid in SubGrids) { writer.WriteInt((int)subGrid.GridDataType); writer.WriteByteArray(subGrid.ToBytes()); } } }
public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteInt((int)ReturnCode); writer.WriteDouble(Northing); writer.WriteDouble(Easting); writer.WriteInt(CellPasses.Count); using (var ms = RecyclableMemoryStreamManagerHelper.Manager.GetStream()) { using (var bw = new BinaryWriter(ms, Encoding.UTF8, true)) { CellPasses.ForEach(result => { result.Write(bw); }); } var bytes = ms.ToArray(); writer.WriteByteArray(bytes); } }
/// <summary> /// Writes this object to the given writer. /// </summary> public void WriteBinary(IBinaryRawWriter writer, bool changesOnly) { IgniteArgumentCheck.NotNull(writer, "writer"); if (_isNew || _dirtyAll || !changesOnly || (_removedKeys == null && _list.All(x => x.IsDirty))) { // Write in full mode. writer.WriteInt(_list.Count); foreach (var entry in _list) { writer.WriteString(entry.Key); // Write as byte array to enable partial deserialization. writer.WriteByteArray(entry.GetBytes()); } } else { // Write in diff mode. var removed = GetRemovedKeys(); var count = _list.Count(x => x.IsDirty) + (removed == null ? 0 : removed.Count); writer.WriteInt(count); // reserve count // Write removed keys as [key + null]. if (removed != null) { foreach (var removedKey in removed) { writer.WriteString(removedKey); writer.WriteByteArray(null); } } // Write dirty items. foreach (var entry in _list) { if (!entry.IsDirty) continue; writer.WriteString(entry.Key); // Write as byte array to enable partial deserialization. writer.WriteByteArray(entry.GetBytes()); } } }