Class CsvMarketDataSerializer<TData>
- Namespace
- StockSharp.Algo.Storages.Csv
- Assembly
- StockSharp.Algo.dll
The serializer in the CSV format.
public abstract class CsvMarketDataSerializer<TData> : IMarketDataSerializer<TData>, IMarketDataSerializer
Type Parameters
TData
Data type.
- Inheritance
-
CsvMarketDataSerializer<TData>
- Implements
-
IMarketDataSerializer<TData>
- Derived
- Inherited Members
- Extension Methods
Constructors
CsvMarketDataSerializer(SecurityId, Encoding)
Initializes a new instance of the CsvMarketDataSerializer<TData>.
protected CsvMarketDataSerializer(SecurityId securityId, Encoding encoding = null)
Parameters
securityId
SecurityIdSecurity ID.
encoding
EncodingEncoding.
CsvMarketDataSerializer(Encoding)
Initializes a new instance of the CsvMarketDataSerializer<TData>.
protected CsvMarketDataSerializer(Encoding encoding = null)
Parameters
encoding
EncodingEncoding.
Properties
Encoding
Encoding.
public Encoding Encoding { get; }
Property Value
Format
Storage format.
public StorageFormats Format { get; }
Property Value
SecurityId
Security ID.
public SecurityId SecurityId { get; }
Property Value
TimePrecision
Time precision.
public TimeSpan TimePrecision { get; }
Property Value
Methods
CreateMetaInfo(DateTime)
To create empty meta-information.
public virtual IMarketDataMetaInfo CreateMetaInfo(DateTime date)
Parameters
date
DateTimeDate.
Returns
- IMarketDataMetaInfo
Meta-information on data for one day.
Deserialize(Stream, IMarketDataMetaInfo)
To load data from the stream.
public virtual IEnumerable<TData> Deserialize(Stream stream, IMarketDataMetaInfo metaInfo)
Parameters
stream
StreamThe stream.
metaInfo
IMarketDataMetaInfoMeta-information on data for one day.
Returns
- IEnumerable<TData>
Data.
Read(FastCsvReader, IMarketDataMetaInfo)
Read data from the specified reader.
protected abstract TData Read(FastCsvReader reader, IMarketDataMetaInfo metaInfo)
Parameters
reader
FastCsvReaderCSV reader.
metaInfo
IMarketDataMetaInfoMeta-information on data for one day.
Returns
- TData
Data.
Serialize(Stream, IEnumerable<TData>, IMarketDataMetaInfo)
Save data into stream.
public virtual void Serialize(Stream stream, IEnumerable<TData> data, IMarketDataMetaInfo metaInfo)
Parameters
stream
StreamData stream.
data
IEnumerable<TData>Data.
metaInfo
IMarketDataMetaInfoMeta-information on data for one day.
Write(CsvFileWriter, TData, IMarketDataMetaInfo)
Write data to the specified writer.
protected abstract void Write(CsvFileWriter writer, TData data, IMarketDataMetaInfo metaInfo)
Parameters
writer
CsvFileWriterCSV writer.
data
TDataData.
metaInfo
IMarketDataMetaInfoMeta-information on data for one day.