Add CMEConnection information to parse_channels for emumba
This commit is contained in:
1 parent
85b4ae091e
commit
ca4a2b9bd1
2 files changed
+21
No files matched your search
@@ -142,6 +142,19 @@ const vector<CMEChannel> parse_channels(const vector<UserSymbol>& symbols) {
|
||||
}
|
||||
}
|
||||
if (!channel.symbols.empty()) {
|
||||
auto connections = chan.child("connections").children("connection");
|
||||
for (const auto& srccon : connections) {
|
||||
std::string id = srccon.attribute("id").as_string();
|
||||
if (!id.empty()) {
|
||||
CMEConnection connection;
|
||||
connection.feed_type = srccon.child("type").attribute("feed-type").as_string()[0];
|
||||
connection.ip = srccon.child_value("ip");
|
||||
connection.port = srccon.child("port").text().as_uint();
|
||||
connection.feed = srccon.child_value("feed")[0];
|
||||
channel.connections.insert(std::make_pair(id, connection));
|
||||
}
|
||||
}
|
||||
|
||||
result.push_back(channel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,17 @@
|
||||
namespace bts {
|
||||
namespace md {
|
||||
|
||||
struct CMEConnection {
|
||||
char feed_type;
|
||||
std::string ip;
|
||||
uint port;
|
||||
char feed;
|
||||
};
|
||||
|
||||
struct CMEChannel {
|
||||
std::string id;
|
||||
std::set<UserSymbol> symbols;
|
||||
std::map<std::string, CMEConnection> connections;
|
||||
};
|
||||
|
||||
void await_cme_config();
|
||||
|
||||
Reference in new issue
Block a user