feat: Add live bbo stream

This commit is contained in:
John Colvin committed 2025-11-19 10:33:31 -05:00
1 parent aa740e786c
commit 2014931653
22 files changed
+792 -23

No files matched your search

@@ -8,8 +8,10 @@ namespace BCG {
using System.Collections;
using System.Reflection;
using System.IO;
using Bts.DataStreamCore;
public class PrimitiveManager {
static MarketDataStreamFactory mdStreamFactory;
private IDictionary myTypeLookupTable = new Hashtable();
private static PrimitiveManager mySelf;
private ArrayList myAssemblyNames = new ArrayList();
@@ -99,6 +101,11 @@ namespace BCG {
get { return mySelf = mySelf == null ? new PrimitiveManager() : mySelf; }
}
public static void SetMarketDataClient(object value) {
Log.isnull(mdStreamFactory);
mdStreamFactory = new(value);
}
/// <summary>
/// Returns the Type name corresponding to the primitive name
/// </summary>
@@ -123,12 +130,19 @@ namespace BCG {
constructorArgs = new object[args.Count];
args.CopyTo(constructorArgs, 0);
}
if (myTypeLookupTable[friendlyName] == null)
throw new ApplicationException(friendlyName + " is not the friendly name of any of the loaded types");
var type = myTypeLookupTable[friendlyName] as Type
?? throw new ApplicationException(friendlyName + " is not the friendly name of any of the loaded types");
if (type.HasCustomAttribute<LiveMarketDataStreamAttribute>()) {
if (mdStreamFactory is null) {
Log.Gen.error("Live md not available for streams");
return null;
}
return mdStreamFactory.Create(type, constructorArgs);
}
return
constructorArgs == null ?
Activator.CreateInstance(myTypeLookupTable[friendlyName] as Type) as ViewStream :
Activator.CreateInstance(myTypeLookupTable[friendlyName] as Type, constructorArgs) as ViewStream;
Activator.CreateInstance(type) as ViewStream :
Activator.CreateInstance(type, constructorArgs) as ViewStream;
}
/// <summary>