Ejemplo n.º 1
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteFloat(LastCellPassElevation1);
            writer.WriteFloat(LastCellPassElevation2);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes the configuration to writer.
        /// </summary>
        public static void Write(IBinaryRawWriter writer, ISwapSpaceSpi spi)
        {
            Debug.Assert(writer != null);

            var fileSwap = spi as FileSwapSpaceSpi;

            if (spi == null)
            {
                writer.WriteByte((byte) Type.None);
            }
            else if (fileSwap != null)
            {
                writer.WriteByte((byte) Type.File);

                writer.WriteString(fileSwap.BaseDirectory);
                writer.WriteFloat(fileSwap.MaximumSparsity);
                writer.WriteInt(fileSwap.MaximumWriteQueueSize);
                writer.WriteInt(fileSwap.ReadStripesNumber);
                writer.WriteInt(fileSwap.WriteBufferSize);

            }
            else
            {
                throw new InvalidOperationException("Unsupported swap space SPI: " + spi.GetType());
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Writes the configuration to writer.
        /// </summary>
        public static void Write(IBinaryRawWriter writer, ISwapSpaceSpi spi)
        {
            Debug.Assert(writer != null);

            var fileSwap = spi as FileSwapSpaceSpi;

            if (spi == null)
            {
                writer.WriteByte((byte)Type.None);
            }
            else if (fileSwap != null)
            {
                writer.WriteByte((byte)Type.File);

                writer.WriteString(fileSwap.BaseDirectory);
                writer.WriteFloat(fileSwap.MaximumSparsity);
                writer.WriteInt(fileSwap.MaximumWriteQueueSize);
                writer.WriteInt(fileSwap.ReadStripesNumber);
                writer.WriteInt(fileSwap.WriteBufferSize);
            }
            else
            {
                throw new InvalidOperationException("Unsupported swap space SPI: " + spi.GetType());
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Writes this instane to the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal void Write(IBinaryRawWriter writer)
        {
            writer.WriteInt((int)AtomicityMode);
            writer.WriteInt((int)AtomicWriteOrderMode);
            writer.WriteInt(Backups);
            writer.WriteInt((int)CacheMode);
            writer.WriteBoolean(CopyOnRead);
            writer.WriteBoolean(EagerTtl);
            writer.WriteBoolean(EnableSwap);
            writer.WriteBoolean(EvictSynchronized);
            writer.WriteInt(EvictSynchronizedConcurrencyLevel);
            writer.WriteInt(EvictSynchronizedKeyBufferSize);
            writer.WriteLong((long)EvictSynchronizedTimeout.TotalMilliseconds);
            writer.WriteBoolean(Invalidate);
            writer.WriteBoolean(KeepBinaryInStore);
            writer.WriteBoolean(LoadPreviousValue);
            writer.WriteLong((long)LockTimeout.TotalMilliseconds);
            writer.WriteLong((long)LongQueryWarningTimeout.TotalMilliseconds);
            writer.WriteInt(MaxConcurrentAsyncOperations);
            writer.WriteFloat(MaxEvictionOverflowRatio);
            writer.WriteInt((int)MemoryMode);
            writer.WriteString(Name);
            writer.WriteLong(OffHeapMaxMemory);
            writer.WriteBoolean(ReadFromBackup);
            writer.WriteInt(RebalanceBatchSize);
            writer.WriteLong((long)RebalanceDelay.TotalMilliseconds);
            writer.WriteInt((int)RebalanceMode);
            writer.WriteLong((long)RebalanceThrottle.TotalMilliseconds);
            writer.WriteLong((long)RebalanceTimeout.TotalMilliseconds);
            writer.WriteBoolean(SqlEscapeAll);
            writer.WriteInt(SqlOnheapRowCacheSize);
            writer.WriteInt(StartSize);
            writer.WriteInt(WriteBehindBatchSize);
            writer.WriteBoolean(WriteBehindEnabled);
            writer.WriteLong((long)WriteBehindFlushFrequency.TotalMilliseconds);
            writer.WriteInt(WriteBehindFlushSize);
            writer.WriteInt(WriteBehindFlushThreadCount);
            writer.WriteInt((int)WriteSynchronizationMode);
            writer.WriteObject(CacheStoreFactory);

            if (QueryEntities != null)
            {
                writer.WriteInt(QueryEntities.Count);

                foreach (var entity in QueryEntities)
                {
                    if (entity == null)
                    {
                        throw new InvalidOperationException("Invalid cache configuration: QueryEntity can't be null.");
                    }

                    entity.Write(writer);
                }
            }
            else
            {
                writer.WriteInt(0);
            }
        }
Ejemplo n.º 5
0
        //Procedure ReadFromStream(const Stream : TStream);
        //Procedure WriteToStream(const Stream : TStream);

        /// <summary>
        /// Serializes content of the cell to the writer
        /// </summary>
        public void ToBinary(IBinaryRawWriter writer)
        {
            writer.WriteShort(TargetCCV);
            writer.WriteShort(TargetMDP);
            writer.WriteFloat(TargetLiftThickness);
            writer.WriteInt(TargetPassCount);
            writer.WriteInt(TempWarningLevelMin);
            writer.WriteInt(TempWarningLevelMax);
            writer.WriteByte(TargetCCA);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteDouble(Station);
            writer.WriteDouble(InterceptLength);

            writer.WriteInt(OTGCellX);
            writer.WriteInt(OTGCellY);

            writer.WriteFloat(DesignElev);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteBoolean(OverrideMachineThickness);
            writer.WriteInt((int)LiftThicknessType);
            writer.WriteDouble(OverridingLiftThickness);
            writer.WriteInt((int)CCVSummaryTypes);
            writer.WriteBoolean(CCVSummarizeTopLayerOnly);
            writer.WriteFloat(FirstPassThickness);
            writer.WriteInt((int)MDPSummaryTypes);
            writer.WriteBoolean(MDPSummarizeTopLayerOnly);
            writer.WriteInt((int)LiftDetectionType);
            writer.WriteBoolean(IncludeSuperseded);
            writer.WriteDouble(TargetLiftThickness);
            writer.WriteDouble(AboveToleranceLiftThickness);
            writer.WriteDouble(BelowToleranceLiftThickness);
            writer.WriteDouble(DeadBandLowerBoundary);
            writer.WriteDouble(DeadBandUpperBoundary);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Writes this instance to the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal void Write(IBinaryRawWriter writer)
        {
            writer.WriteInt((int)AtomicityMode);
            writer.WriteInt((int)AtomicWriteOrderMode);
            writer.WriteInt(Backups);
            writer.WriteInt((int)CacheMode);
            writer.WriteBoolean(CopyOnRead);
            writer.WriteBoolean(EagerTtl);
            writer.WriteBoolean(EnableSwap);
            writer.WriteBoolean(EvictSynchronized);
            writer.WriteInt(EvictSynchronizedConcurrencyLevel);
            writer.WriteInt(EvictSynchronizedKeyBufferSize);
            writer.WriteLong((long)EvictSynchronizedTimeout.TotalMilliseconds);
            writer.WriteBoolean(Invalidate);
            writer.WriteBoolean(KeepBinaryInStore);
            writer.WriteBoolean(LoadPreviousValue);
            writer.WriteLong((long)LockTimeout.TotalMilliseconds);
            writer.WriteLong((long)LongQueryWarningTimeout.TotalMilliseconds);
            writer.WriteInt(MaxConcurrentAsyncOperations);
            writer.WriteFloat(MaxEvictionOverflowRatio);
            writer.WriteInt((int)MemoryMode);
            writer.WriteString(Name);
            writer.WriteLong(OffHeapMaxMemory);
            writer.WriteBoolean(ReadFromBackup);
            writer.WriteInt(RebalanceBatchSize);
            writer.WriteLong((long)RebalanceDelay.TotalMilliseconds);
            writer.WriteInt((int)RebalanceMode);
            writer.WriteLong((long)RebalanceThrottle.TotalMilliseconds);
            writer.WriteLong((long)RebalanceTimeout.TotalMilliseconds);
            writer.WriteBoolean(SqlEscapeAll);
            writer.WriteInt(SqlOnheapRowCacheSize);
            writer.WriteInt(StartSize);
            writer.WriteInt(WriteBehindBatchSize);
            writer.WriteBoolean(WriteBehindEnabled);
            writer.WriteLong((long)WriteBehindFlushFrequency.TotalMilliseconds);
            writer.WriteInt(WriteBehindFlushSize);
            writer.WriteInt(WriteBehindFlushThreadCount);
            writer.WriteInt((int)WriteSynchronizationMode);
            writer.WriteBoolean(ReadThrough);
            writer.WriteBoolean(WriteThrough);
            writer.WriteBoolean(EnableStatistics);
            writer.WriteObject(CacheStoreFactory);

            if (QueryEntities != null)
            {
                writer.WriteInt(QueryEntities.Count);

                foreach (var entity in QueryEntities)
                {
                    if (entity == null)
                    {
                        throw new InvalidOperationException("Invalid cache configuration: QueryEntity can't be null.");
                    }

                    entity.Write(writer);
                }
            }
            else
            {
                writer.WriteInt(0);
            }

            if (NearConfiguration != null)
            {
                writer.WriteBoolean(true);
                NearConfiguration.Write(writer);
            }
            else
            {
                writer.WriteBoolean(false);
            }

            EvictionPolicyBase.Write(writer, EvictionPolicy);
            AffinityFunctionSerializer.Write(writer, AffinityFunction);
            ExpiryPolicySerializer.WritePolicyFactory(writer, ExpiryPolicyFactory);

            if (PluginConfigurations != null)
            {
                writer.WriteInt(PluginConfigurations.Count);

                foreach (var cachePlugin in PluginConfigurations)
                {
                    if (cachePlugin == null)
                    {
                        throw new InvalidOperationException("Invalid cache configuration: " +
                                                            "ICachePluginConfiguration can't be null.");
                    }

                    if (cachePlugin.CachePluginConfigurationClosureFactoryId != null)
                    {
                        writer.WriteBoolean(true);
                        writer.WriteInt(cachePlugin.CachePluginConfigurationClosureFactoryId.Value);
                        cachePlugin.WriteBinary(writer);
                    }
                    else
                    {
                        if (!cachePlugin.GetType().IsSerializable)
                        {
                            throw new InvalidOperationException("Invalid cache configuration: " +
                                                                "ICachePluginConfiguration should be Serializable.");
                        }

                        writer.WriteBoolean(false);
                        writer.WriteObject(cachePlugin);
                    }
                }
            }
            else
            {
                writer.WriteInt(0);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Writes this instane to the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal void Write(IBinaryRawWriter writer)
        {
            writer.WriteInt((int) AtomicityMode);
            writer.WriteInt((int) AtomicWriteOrderMode);
            writer.WriteInt(Backups);
            writer.WriteInt((int) CacheMode);
            writer.WriteBoolean(CopyOnRead);
            writer.WriteBoolean(EagerTtl);
            writer.WriteBoolean(EnableSwap);
            writer.WriteBoolean(EvictSynchronized);
            writer.WriteInt(EvictSynchronizedConcurrencyLevel);
            writer.WriteInt(EvictSynchronizedKeyBufferSize);
            writer.WriteLong((long) EvictSynchronizedTimeout.TotalMilliseconds);
            writer.WriteBoolean(Invalidate);
            writer.WriteBoolean(KeepBinaryInStore);
            writer.WriteBoolean(LoadPreviousValue);
            writer.WriteLong((long) LockTimeout.TotalMilliseconds);
            writer.WriteLong((long) LongQueryWarningTimeout.TotalMilliseconds);
            writer.WriteInt(MaxConcurrentAsyncOperations);
            writer.WriteFloat(MaxEvictionOverflowRatio);
            writer.WriteInt((int) MemoryMode);
            writer.WriteString(Name);
            writer.WriteLong(OffHeapMaxMemory);
            writer.WriteBoolean(ReadFromBackup);
            writer.WriteInt(RebalanceBatchSize);
            writer.WriteLong((long) RebalanceDelay.TotalMilliseconds);
            writer.WriteInt((int) RebalanceMode);
            writer.WriteLong((long) RebalanceThrottle.TotalMilliseconds);
            writer.WriteLong((long) RebalanceTimeout.TotalMilliseconds);
            writer.WriteBoolean(SqlEscapeAll);
            writer.WriteInt(SqlOnheapRowCacheSize);
            writer.WriteInt(StartSize);
            writer.WriteInt(WriteBehindBatchSize);
            writer.WriteBoolean(WriteBehindEnabled);
            writer.WriteLong((long) WriteBehindFlushFrequency.TotalMilliseconds);
            writer.WriteInt(WriteBehindFlushSize);
            writer.WriteInt(WriteBehindFlushThreadCount);
            writer.WriteInt((int) WriteSynchronizationMode);
            writer.WriteObject(CacheStoreFactory);

            if (QueryEntities != null)
            {
                writer.WriteInt(QueryEntities.Count);

                foreach (var entity in QueryEntities)
                {
                    if (entity == null)
                        throw new InvalidOperationException("Invalid cache configuration: QueryEntity can't be null.");

                    entity.Write(writer);
                }
            }
            else
                writer.WriteInt(0);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Serializes content of the cell to the writer
        /// </summary>
        public void ToBinary(IBinaryRawWriter writer)
        {
            writer.WriteInt(StartCellPassIdx);
            writer.WriteInt(EndCellPassIdx);
            writer.WriteShort(MachineID);
            writer.WriteLong(LastLayerPassTime.ToBinary());

            writer.WriteShort(CCV);
            writer.WriteLong(CCV_Time.ToBinary());
            writer.WriteShort(CCV_MachineID);
            writer.WriteFloat(CCV_Elev);
            writer.WriteShort(TargetCCV);
            writer.WriteInt(CCV_CellPassIdx);

            writer.WriteShort(MDP);
            writer.WriteLong(MDP_Time.ToBinary());
            writer.WriteShort(MDP_MachineID);
            writer.WriteFloat(MDP_Elev);
            writer.WriteShort(TargetMDP);

            writer.WriteByte(CCA);
            writer.WriteLong(CCA_Time.ToBinary());
            writer.WriteShort(CCA_MachineID);
            writer.WriteFloat(CCA_Elev);
            writer.WriteShort(TargetCCA);

            writer.WriteByte(RadioLatency);
            writer.WriteInt(TargetPassCount);
            writer.WriteFloat(Thickness);
            writer.WriteFloat(TargetThickness);
            writer.WriteFloat(Height);
            writer.WriteShort(RMV);
            writer.WriteInt(Frequency);
            writer.WriteInt(Amplitude);
            writer.WriteInt(MaterialTemperature);
            writer.WriteLong(MaterialTemperature_Time.ToBinary());
            writer.WriteShort(MaterialTemperature_MachineID);
            writer.WriteFloat(MaterialTemperature_Elev);

            writer.WriteInt((int)Status);
            writer.WriteFloat(MaxThickness);
            writer.WriteInt(FilteredPassCount);
            writer.WriteInt(FilteredHalfPassCount);
            writer.WriteFloat(MinimumPassHeight);
            writer.WriteFloat(MaximumPassHeight);
            writer.WriteFloat(FirstPassHeight);
            writer.WriteFloat(LastPassHeight);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            int count = Layers?.Count() ?? 0;

            writer.WriteInt(count);
            for (int i = 0; i < count; i++)
            {
                Layers[i].ToBinary(writer);
            }

            writer.WriteFloat(CellLowestElev);
            writer.WriteFloat(CellHighestElev);
            writer.WriteFloat(CellLastElev);
            writer.WriteFloat(CellFirstElev);
            writer.WriteFloat(CellLowestCompositeElev);
            writer.WriteFloat(CellHighestCompositeElev);
            writer.WriteFloat(CellLastCompositeElev);
            writer.WriteFloat(CellFirstCompositeElev);

            writer.WriteShort(CellCCV);
            writer.WriteShort(CellTargetCCV);
            writer.WriteShort(CellPreviousMeasuredCCV);
            writer.WriteShort(CellPreviousMeasuredTargetCCV);

            writer.WriteFloat(CellCCVElev);

            writer.WriteShort(CellMDP);
            writer.WriteShort(CellTargetMDP);
            writer.WriteFloat(CellMDPElev);

            writer.WriteByte(CellCCA);
            writer.WriteShort(CellTargetCCA);
            writer.WriteFloat(CellCCAElev);

            writer.WriteFloat(CellTopLayerThickness);
            writer.WriteBoolean(IncludesProductionData);

            writer.WriteInt(TopLayerPassCount);
            writer.WriteInt(TopLayerPassCountTargetRangeMin);
            writer.WriteInt(TopLayerPassCountTargetRangeMax);

            writer.WriteInt(CellMaxSpeed);
            writer.WriteInt(CellMinSpeed);

            Passes.ToBinary(writer);

            writer.WriteBooleanArray(FilteredPassFlags);
            writer.WriteInt(FilteredPassCount);
            writer.WriteInt(FilteredHalfPassCount);
            writer.WriteInt((int)AttributeExistenceFlags);

            writer.WriteInt(CellMaterialTemperature);
            writer.WriteInt(CellMaterialTemperatureWarnMin);
            writer.WriteInt(CellMaterialTemperatureWarnMax);

            writer.WriteFloat(CellMaterialTemperatureElev);
        }