cleanup: Fix numerous build warnings in DataStreamSuite

Nearly all warnings were due to nullability issues, since the concept of
nullable reference types did not exist when the DataStream code was
originally written.

* Compression related files
  - BZip2InputStream  (disable nullability warnings)
  - BZip2OutputStream (disable nullability warnings)
  - DeflaterHuffman   (disable nullability warnings)
  - Inflater          (disable nullability warnings)
  - InflaterDynHeader (disable nullability warnings)
  - ParallelJoinTest  (disable nullability warnings)
  - TarHeader
  - TarInputStream    (disable nullability warnings)
  - ZipEntry
  - ZipFile
  - ZipInputStream

* AsyncTCPConnection_APM
* AsyncTCPConnection_APM
* InflaterHuffmanTree
* ManagedSubscriber
* ManagedTCPMessageHub
* MapStream
* PubSubClientMessage
  - Normalize indentation/whitespace
  - Fix some typos
  - Address nullability issues to fix build warnings
  - Modernize code
* PubSubMessageReactor
* PubSubServerManagedTCPConnection
* PubSubSingleTagStateEvent
* PubSubState
* PublisherCore
* PubsubDeserializationController
* RemoteMessage
  - make 'message' nullable to resolve warnings elsewhere (in calling code)
* SharedStreamConfig
* SingleTagData
* SubscriberCore
* SuperMapStream
* SystemHeartbeatPublisher
* SystemStatsPublisher
* SystemSubscriptionMapPublisher
* ThreadSafeQueue
* TradeBarsStream

Only use Registry on windows.
This commit is contained in:
John Colvin committed 2025-12-30 11:38:20 -05:00
1 parent 02f566a970
commit 7d6e4efa4f
45 files changed
+859 -828

No files matched your search

+7 -15
View File
@@ -10,29 +10,21 @@ namespace bts {
public class PublishedCache {
private Dictionary<string, SingleTagData> _data_map = new Dictionary<string, SingleTagData>();
public PublishedCache() { }
public void publish(PublishMsg msg) {
Log.Gen.info($"PublishedCache.publish msg: {msg}");
SingleTagData tag_data = null;
if (!_data_map.TryGetValue(msg.tag, out tag_data)) {
ArgumentException.ThrowIfNullOrEmpty(msg.tag);
if (!_data_map.TryGetValue(msg.tag, out var tag_data)) {
ArgumentException.ThrowIfNullOrEmpty(msg.tag_type);
tag_data = new SingleTagData(msg.tag, msg.tag_type);
_data_map.Add(msg.tag, tag_data);
}
tag_data.handle_publish(msg);
}
public Tuple<string, byte[]> get_content(string tag) {
SingleTagData tag_data;
byte[] rv = new byte[] { };
if (_data_map.TryGetValue(tag, out tag_data)) {
string tag_type = tag_data.tag_type;
byte[] data = tag_data.get_current_content();
return new Tuple<string, byte[]>(tag_type, data);
}
return new Tuple<string, byte[]>(String.Empty, new byte[] { });
}
public Tuple<string, byte[]> get_content(string tag) =>
_data_map.TryGetValue(tag, out var tag_data)
? new(tag_data.tag_type, tag_data.get_current_content())
: new(string.Empty, Array.Empty<byte>());
public void clear(string tag) {
if (_data_map.ContainsKey(tag)) {