IParentChildMap

StockSharp.Algo.Basket

Maps parent subscription IDs to child subscription IDs (for multi-adapter routing).

Methods

AddMapping
public void AddMapping(long childId, ISubscriptionMessage parentMsg, IMessageAdapter adapter)
iParentChildMap.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()
iParentChildMap.Clear()

Clear all mappings.

GetChild
public IDictionary<long, IMessageAdapter> GetChild(long parentId)
result = iParentChildMap.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 = iParentChildMap.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 = iParentChildMap.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 = iParentChildMap.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 = iParentChildMap.RemoveMapping(childId)

Remove a child mapping.

childId
Child subscription ID to remove.

Returns: if removed.

RemoveMappings
public int RemoveMappings(long parentId)
result = iParentChildMap.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 = iParentChildMap.TryGetParent(childId, parentId)

Try get parent ID for a child subscription.

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

Returns: if found.