Table of Contents

Class CsvEntityList<TKey, TEntity>

Namespace
StockSharp.Algo.Storages.Csv
Assembly
StockSharp.Algo.dll

List of trade objects, received from the CSV storage.

public abstract class CsvEntityList<TKey, TEntity> : SynchronizedList<TEntity>, IStorageEntityList<TEntity>, INotifyList<TEntity>, INotifyCollection<TEntity>, IList<TEntity>, ICollection<TEntity>, IEnumerable<TEntity>, IEnumerable, ISynchronizedCollection<TEntity>, ISynchronizedCollection, ICsvEntityList where TEntity : class

Type Parameters

TKey

Key type.

TEntity

Entity type.

Inheritance
CsvEntityList<TKey, TEntity>
Implements
INotifyList<TEntity>
INotifyCollection<TEntity>
IList<TEntity>
ICollection<TEntity>
IEnumerable<TEntity>
ISynchronizedCollection<TEntity>
ISynchronizedCollection
Extension Methods

Constructors

CsvEntityList(CsvEntityRegistry, string)

Initializes a new instance of the CsvEntityList<TKey, TEntity>.

protected CsvEntityList(CsvEntityRegistry registry, string fileName)

Parameters

registry CsvEntityRegistry

The CSV storage of trading objects.

fileName string

CSV file name.

Properties

Cache

Cached items.

public TEntity[] Cache { get; }

Property Value

TEntity[]

CreateArchivedCopy

Create archived copy.

public bool CreateArchivedCopy { get; set; }

Property Value

bool

DelayAction

The interface for presentation in the form of list of trade objects, received from the external storage.

public DelayAction DelayAction { get; set; }

Property Value

DelayAction

FileName

CSV file name.

public string FileName { get; }

Property Value

string

Registry

The CSV storage of trading objects.

protected CsvEntityRegistry Registry { get; }

Property Value

CsvEntityRegistry

Methods

AddCache(TEntity)

Add item to cache.

protected virtual void AddCache(TEntity item)

Parameters

item TEntity

New item.

ClearCache()

Clear cache.

protected virtual void ClearCache()

Contains(TEntity)

public override bool Contains(TEntity item)

Parameters

item TEntity

Returns

bool

GetCopy()

Get archived copy body.

public byte[] GetCopy()

Returns

byte[]

File body.

GetKey(TEntity)

Get key from trade object.

protected abstract TKey GetKey(TEntity item)

Parameters

item TEntity

Trade object.

Returns

TKey

The key.

IsChanged(TEntity, bool)

Is entity changed.

protected virtual bool IsChanged(TEntity entity, bool forced)

Parameters

entity TEntity

Trade object.

forced bool

Forced update.

Returns

bool

Is changed.

OnAdding(TEntity)

protected override bool OnAdding(TEntity item)

Parameters

item TEntity

Trade object.

Returns

bool

OnCleared()

protected override void OnCleared()

OnRemoved(TEntity)

protected override void OnRemoved(TEntity item)

Parameters

item TEntity

Trade object.

OnRemovedRange(IEnumerable<TEntity>)

protected void OnRemovedRange(IEnumerable<TEntity> items)

Parameters

items IEnumerable<TEntity>

Read(FastCsvReader)

Read data from CSV.

protected abstract TEntity Read(FastCsvReader reader)

Parameters

reader FastCsvReader

CSV reader.

Returns

TEntity

Trade object.

RemoveCache(TEntity)

Remove item from cache.

protected virtual void RemoveCache(TEntity item)

Parameters

item TEntity

Item.

Save(TEntity)

To save the trading object.

public void Save(TEntity entity)

Parameters

entity TEntity

The trading object.

Save(TEntity, bool)

Save object into storage.

public virtual void Save(TEntity entity, bool forced)

Parameters

entity TEntity

Trade object.

forced bool

Forced update.

ToString()

public override string ToString()

Returns

string

UpdateCache(TEntity)

Update item in cache.

protected virtual void UpdateCache(TEntity item)

Parameters

item TEntity

Item.

Write(CsvFileWriter, TEntity)

Write data into CSV.

protected abstract void Write(CsvFileWriter writer, TEntity data)

Parameters

writer CsvFileWriter

CSV writer.

data TEntity

Trade object.