In BLPAPI is there a more efficient way to find the security for a subscription?

StackOverflow https://stackoverflow.com/questions/20962160

  •  25-09-2022
  •  | 
  •  

문제

When you make a subscription, you pass in a correlationID and use that to reference the security for the fields that come back

So you can have a counter that increments every subscription and use that as the correlationID, and then keep a map from that counter value to the security object

Is there a more efficient way to do this?

도움이 되었습니까?

해결책

In stead of passing a number and keeping a map, you can use the security object as the correlationID

Then, when you get a tick, instead of getting the counter and looking up the mapped security, you can just cast the correlationID pointer to the security object's type and directly apply any changes to the security object

No lookups needed, and there are no concerns about synchronization on the map.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top