ParentChildMap

StockSharp.Algo.Basket

Default implementation of IParentChildMap. Maps parent subscription IDs to child subscription IDs.

Implements: IParentChildMap

Methods

AddMapping
public void AddMapping(long childId, ISubscriptionMessage parentMsg, IMessageAdapter adapter)
parentChildMap.AddMapping(childId, parentMsg, adapter)

Add parent-child mapping.

childId
Child subscription ID.
parentMsg
Parent subscription message.
adapter
The adapter assigned to this child.
Clear
public void Clear()
parentChildMap.Clear()

Clear all mappings.

GetChild
public IDictionary<long, IMessageAdapter> GetChild(long parentId)
result = parentChildMap.GetChild(parentId)

Get all active child subscriptions for a parent.

parentId
Parent subscription ID.

Returns: Dictionary of childId → adapter.

ProcessChildFinish
public long? ProcessChildFinish(long childId, bool needParentResponse)
result = parentChildMap.ProcessChildFinish(childId, needParentResponse)

Process a child subscription finish.

childId
Child subscription ID.
needParentResponse
Whether a response should be sent for the parent.

Returns: Parent subscription ID, or null if not found.

ProcessChildOnline
public long? ProcessChildOnline(long childId, bool needParentResponse)
result = parentChildMap.ProcessChildOnline(childId, needParentResponse)

Process a child subscription online notification.

childId
Child subscription ID.
needParentResponse
Whether a response should be sent for the parent.

Returns: Parent subscription ID, or null if not found.

ProcessChildResponse
public long? ProcessChildResponse(long childId, Exception error, bool needParentResponse, bool allError, IEnumerable<Exception> innerErrors)
result = parentChildMap.ProcessChildResponse(childId, error, needParentResponse, allError, innerErrors)

Process a child subscription response.

childId
Child subscription ID.
error
Error if any.
needParentResponse
Whether a response should be sent for the parent.
allError
Whether all children have errors.
innerErrors
All collected errors.

Returns: Parent subscription ID, or null if not found.

RemoveMapping
public bool RemoveMapping(long childId)
result = parentChildMap.RemoveMapping(childId)

Remove a child mapping.

childId
Child subscription ID to remove.

Returns: if removed.

RemoveMappings
public int RemoveMappings(long parentId)
result = parentChildMap.RemoveMappings(parentId)

Remove all child mappings for the specified parent.

parentId
Parent subscription ID.

Returns: Number of removed mappings.

TryGetParent
public bool TryGetParent(long childId, long parentId)
result = parentChildMap.TryGetParent(childId, parentId)

Try get parent ID for a child subscription.

childId
Child subscription ID.
parentId
Parent subscription ID if found.

Returns: if found.