SecurityTrie

StockSharp.Algo

Security trie collection.

Implements: ICollection<Security>, IEnumerable<Security>, IEnumerable

Constructors

SecurityTrie
public SecurityTrie()
securityTrie = SecurityTrie()

Initializes a new instance of the SecurityTrie.

Properties

Count
public int Count { get; }
value = securityTrie.Count

Gets the number of instruments contained in the SecurityTrie.

IsReadOnly
public bool IsReadOnly { get; }
value = securityTrie.IsReadOnly

Gets a value indicating whether the ICollection is read-only.

Returns: if the ICollection is read-only; otherwise, .

Methods

Add
public void Add(Security security)
securityTrie.Add(security)

Add new instrument.

security
New instrument.
Clear
public virtual void Clear()
securityTrie.Clear()

Remove all instruments.

Contains
public bool Contains(Security item)
result = securityTrie.Contains(item)

Determines whether the ICollection contains a specific value.

item
The object to locate in the ICollection.

Returns: if is found in the ICollection; otherwise, .

CopyTo
public void CopyTo(Security[] array, int arrayIndex)
securityTrie.CopyTo(array, arrayIndex)

Copies the elements of the ICollection to an Array, starting at a particular Array index.

array
Destination array.
arrayIndex
Start index.
GetById
public Security GetById(SecurityId id)
result = securityTrie.GetById(id)

To get the instrument by the identifier.

id
Security ID.

Returns: The got instrument. If there is no instrument by given criteria, is returned.

GetEnumerator
public IEnumerator<Security> GetEnumerator()
result = securityTrie.GetEnumerator()

Returns an enumerator that iterates through the collection.

Returns: A IEnumerator that can be used to iterate through the collection.

Remove
public bool Remove(Security security)
result = securityTrie.Remove(security)

Remove the instrument.

security
The instrument.

Returns: if was successfully removed from the SecurityTrie; otherwise, .

RemoveRange
public void RemoveRange(IEnumerable<Security> securities)
securityTrie.RemoveRange(securities)

Remove the instruments.

securities
The instruments.
Retrieve
public IEnumerable<Security> Retrieve(string filter)
result = securityTrie.Retrieve(filter)

Find all instrument by filter.

filter
Filter

Returns: Found instruments.

System#Collections#IEnumerable#GetEnumerator()

Returns an enumerator that iterates through a collection.

Returns: An IEnumerator object that can be used to iterate through the collection.