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
-
IStorageEntityList<TEntity>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
CsvEntityRegistryThe CSV storage of trading objects.
fileName
stringCSV file name.
Properties
Cache
Cached items.
public TEntity[] Cache { get; }
Property Value
- TEntity[]
CreateArchivedCopy
Create archived copy.
public bool CreateArchivedCopy { get; set; }
Property Value
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
Registry
The CSV storage of trading objects.
protected CsvEntityRegistry Registry { get; }
Property Value
Methods
AddCache(TEntity)
Add item to cache.
protected virtual void AddCache(TEntity item)
Parameters
item
TEntityNew item.
ClearCache()
Clear cache.
protected virtual void ClearCache()
Contains(TEntity)
public override bool Contains(TEntity item)
Parameters
item
TEntity
Returns
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
TEntityTrade object.
Returns
- TKey
The key.
IsChanged(TEntity, bool)
Is entity
changed.
protected virtual bool IsChanged(TEntity entity, bool forced)
Parameters
entity
TEntityTrade object.
forced
boolForced update.
Returns
- bool
Is changed.
OnAdding(TEntity)
protected override bool OnAdding(TEntity item)
Parameters
item
TEntityTrade object.
Returns
OnCleared()
protected override void OnCleared()
OnRemoved(TEntity)
protected override void OnRemoved(TEntity item)
Parameters
item
TEntityTrade 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
FastCsvReaderCSV reader.
Returns
- TEntity
Trade object.
RemoveCache(TEntity)
Remove item from cache.
protected virtual void RemoveCache(TEntity item)
Parameters
item
TEntityItem.
Save(TEntity)
To save the trading object.
public void Save(TEntity entity)
Parameters
entity
TEntityThe trading object.
Save(TEntity, bool)
Save object into storage.
public virtual void Save(TEntity entity, bool forced)
Parameters
entity
TEntityTrade object.
forced
boolForced update.
ToString()
public override string ToString()
Returns
UpdateCache(TEntity)
Update item in cache.
protected virtual void UpdateCache(TEntity item)
Parameters
item
TEntityItem.
Write(CsvFileWriter, TEntity)
Write data into CSV.
protected abstract void Write(CsvFileWriter writer, TEntity data)
Parameters
writer
CsvFileWriterCSV writer.
data
TEntityTrade object.