refactor: Only support 1 tag type in IPubSubServerTagHandler
This commit is contained in:
1 parent
f2ace4ae32
commit
41cd59e6f9
2 files changed
+8
-14
No files matched your search
+7
-14
@@ -13,6 +13,9 @@ namespace bts {
|
||||
public PubsubServerGenericDataHandler() {
|
||||
_bw = new BinaryWriter(_str);
|
||||
}
|
||||
|
||||
public string TagType => "*";
|
||||
|
||||
public void update(string tag, byte[] msg) {
|
||||
_str.Position = 0;
|
||||
_bw.Write(msg);
|
||||
@@ -25,7 +28,6 @@ namespace bts {
|
||||
Log.Gen.info($"PubsubServerGenericDataHandler.get_content tag: {tag} rv: {rv.Length}");
|
||||
return rv;
|
||||
}
|
||||
public string[] supportedTagTypes { get; }
|
||||
}
|
||||
|
||||
// This class is created by the SingleTagData for stream tag_type. Every pub
|
||||
@@ -38,6 +40,7 @@ namespace bts {
|
||||
// this is where the state of the table is kept.
|
||||
BlueTable _state = null;
|
||||
|
||||
public string TagType => DSTagManager.DataStreamTagType;
|
||||
|
||||
public void update(string tag, byte[] msg) {
|
||||
StreamIOMessage str_msg = _deser.deserialize(msg);
|
||||
@@ -72,11 +75,6 @@ namespace bts {
|
||||
Log.Gen.info($"PubsubServerSingleStreamTagHandler.get_content rv: {rv_txt}");
|
||||
return rv;
|
||||
}
|
||||
public string[] supportedTagTypes {
|
||||
get {
|
||||
return new string[] { "DS" };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PubsubServerStreamTagHandler : IPubSubServerTagHandler {
|
||||
@@ -86,6 +84,9 @@ namespace bts {
|
||||
|
||||
public PubsubServerStreamTagHandler() {
|
||||
}
|
||||
|
||||
public string TagType => DSTagManager.DataStreamTagType;
|
||||
|
||||
public void update(string tag, byte[] msg) {
|
||||
BCG.IPubSubServerTagHandler rv = _get_handler(tag);
|
||||
rv.update(tag, msg);
|
||||
@@ -94,14 +95,6 @@ namespace bts {
|
||||
BCG.IPubSubServerTagHandler rv = _get_handler(tag);
|
||||
return rv.get_content(tag);
|
||||
}
|
||||
public string[] supportedTagTypes {
|
||||
get {
|
||||
List<string> rv = new List<string>();
|
||||
foreach (var h in _handler_map.Values)
|
||||
rv.AddRange(h.supportedTagTypes);
|
||||
return rv.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
private BCG.IPubSubServerTagHandler _get_handler(string tag) {
|
||||
PubsubServerSingleStreamTagHandler rv = null;
|
||||
|
||||
Reference in new issue
Block a user