cleanup: Fix a ton of build warnings (cs)

All these warnings have been bothering me for a while. The work isn't done, but
this commit chops them down from ~1000 to ~600.

* AppendCollection.cs
* AppendStreamModified.cs
* BenzingaNewsStream.cs
* BenzingaNewsSymbolStateStream.cs
* BookStream.cs
* CSVSaverStream.cs
* ChartsUtils.cs
* ColumnInfo.cs
* ContractUtils.cs
* ContractUtils.cs
* DiffStream.cs
* FuturesActiveContractStream.cs
* FuzzyJoinOverTimeStream.cs
* HistoricalBarsStream.cs
* HistoricalBarsStream.cs
* InstrumentsStream.cs
* JoinOperandRowIndex.cs
* JoinRow.cs
* JoinStream.cs
* JoinTable.cs
* JoinTableSchema.cs
* LatencyStream.cs
* LeftInternalJoinStream.cs
* LightForeignJoinRow.cs
* LightForeignJoinRowList.cs
* LightLeftForeignJoinRow.cs
* LiteralStream.cs
* NLStream.cs
* NLToDSLStream.cs
* NLToIndexedFewShotPromptStream.cs
* NonIncGroupByStream.cs
* NonIncJoinBookkeeper.cs
* NonIncJoinSpec.cs
* OHLCVStream.cs
* OpenAIPromptStream.cs
* PriceStatsStream.cs
* PriceStatsStream.cs
* ProjectHelper.cs
* ProjectStream.cs
* PubSubServerStateStream.cs
* PubsubHeartbeatStream.cs
* SimpleNode.cs
* SortRow.cs
* SpatialArbStatsStream.cs
* SpatialFuturePairsStream.cs
* SpreadPerformanceEvaluator.cs
* SpreadPerformanceStream.cs
* StreamIOCommon.cs
* SuperJoinStream.cs
* TableMetaDataStream.cs
* TextWriterStream.cs
* TimeAverageStream.cs
This commit is contained in:
John Colvin committed 2025-11-19 13:57:47 -05:00
1 parent 7418f5b5a1
commit a4efaa0089
48 files changed
+610 -590

No files matched your search

@@ -4,8 +4,12 @@ namespace bts.BlueOrb {
using bts;
using bts.api;
using bts.md;
using BCG;
using mbts.utils;
using Spark.Core;
using Spark.Core.Disposables;
using Spark.Core.Reactive;
@@ -13,18 +17,14 @@ namespace bts.BlueOrb {
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using SecurityKey = System.UInt32;
[DataStreamUserRespresentation("InstrumentsStream")]
public class InstrumentsStream : ViewStream, IWorker {
private readonly TimeSpan _poll_period = TimeSpan.FromMilliseconds(500);
private DateTime _last_poll_time = DateTime.MinValue;
private ViewStreamDatabase _vsd;
private int _id = 0;
IReadOnlyDictionary<uint, SecurityImmutable> _cached_state = null;
IReadOnlyDictionary<uint, SecurityImmutable>? _cached_state;
MarketDataClient _md_client;
private bool _dirty = false;
private readonly IBlueTableSchema _instrument_schema = BlueDataUtility.form_schema("instruments",
@@ -68,7 +68,7 @@ namespace bts.BlueOrb {
_dirty = true;
//_log_updates(state);
// just cacching in here, will populate the rows in _poll_scan and fire the datapacket
bts.Log.Gen.info($"InstrumentsStream._on_instruments state: {state.Count()}");
bts.Log.Gen.info($"InstrumentsStream._on_instruments state: {state.Count}");
_cached_state = state;
}
@@ -85,13 +85,13 @@ namespace bts.BlueOrb {
return;
BlueTable new_state = new BlueTable(_instrument_schema);
foreach (var kv in _cached_state) {
SecurityKey skey = kv.Key;
var skey = kv.Key;
int id = Convert.ToInt32(skey);
SecurityImmutable sec = kv.Value;
bts.api.SecurityType sec_type = sec.security_type();
object exp = DBNull.Value;
if (sec_type == bts.api.SecurityType.Future || sec_type == bts.api.SecurityType.Option)
exp = sec.security_expiration();
exp = sec.security_expiration().assert_value();
object strike = DBNull.Value;
if (sec_type == bts.api.SecurityType.Option)
strike = sec.strike();
@@ -101,11 +101,11 @@ namespace bts.BlueOrb {
IBlueRow r = new BlueRow(_instrument_schema, id, skey, sec.security_desc(), sec.security_type().ToString(), sec.display_exchange().ToString(), sec.Symbol, sec.Currency, sec.ContractSpec.CashPerPoint, exp, strike, cp);
new_state.addRow(r);
}
DataPacket dp = null;
DataPacket? dp;
if (myLastValue == null) {
dp = new DataPacket(new_state, new_state, new BlueTable(_instrument_schema));
} else {
DataPacket old_dp = myLastValue as DataPacket;
var old_dp = ExceptionAssert.of_type<DataPacket>(myLastValue);
IBlueRowCollection added_rows, del_rows;
BlueDataUtility.compute_differences_fast(new_state, old_dp.newRows, out del_rows, out added_rows);
dp = new DataPacket(new_state, added_rows, del_rows);