Class MemoryStatisticsValue<T>
The class for tracking the number of active objects of the particular type.
Namespace: StockSharp.Logging
Assembly: StockSharp.Logging.dll
Syntax
public class MemoryStatisticsValue<T> : Object, IPersistable, IMemoryStatisticsValue
Type Parameters
Name | Description |
---|---|
T | The object type. |
Constructors
MemoryStatisticsValue(String)
Initializes a new instance of the MemoryStatisticsValue<T>.
Declaration
public MemoryStatisticsValue(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name. |
Properties
IsObjectTracking
Whether the storage of objects available through Objects is on. The default is off.
Declaration
public bool IsObjectTracking { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsTraceObjects
To log the objects creating and deletion. The default is off.
Declaration
public bool IsTraceObjects { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Name
Name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
ObjectCount
The number of active objects.
Declaration
public int ObjectCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Objects
Active objects.
Declaration
public T[] Objects { get; }
Property Value
Type | Description |
---|---|
T[] |
ThrowOnRemoveDeleted
To check that they are going to delete a previously deleted object.
Declaration
public bool ThrowOnRemoveDeleted { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Add(T)
To add a new object.
Declaration
public void Add(T obj)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The new object. |
Add(IEnumerable<T>)
To add new objects.
Declaration
public void Add(IEnumerable<T> objects)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | objects | Active objects. |
Clear(Boolean)
To clear active objects ObjectCount.
Declaration
public void Clear(bool resetCounter = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | resetCounter | Whether to clear the objects counter. |
Load(SettingsStorage)
Load settings.
Declaration
public void Load(SettingsStorage storage)
Parameters
Type | Name | Description |
---|---|---|
Ecng.Serialization.SettingsStorage | storage | Settings storage. |
Remove(T)
To delete the active object.
Declaration
public void Remove(T obj)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The active object. |
Remove(IEnumerable<T>)
To delete active objects.
Declaration
public void Remove(IEnumerable<T> objects)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | objects | Active objects. |
Remove(Int32)
To change ObjectCount, reducing it by the number of deleted objects.
Declaration
public void Remove(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | The number of deleted objects. |
Save(SettingsStorage)
Save settings.
Declaration
public void Save(SettingsStorage storage)
Parameters
Type | Name | Description |
---|---|---|
Ecng.Serialization.SettingsStorage | storage | Settings storage. |