utils: Fix AnnotatedTopologyReader to process customized LossRate or Queue models
Refs: #2354
diff --git a/utils/topology/annotated-topology-reader.cpp b/utils/topology/annotated-topology-reader.cpp
index f608610..a10cf2f 100644
--- a/utils/topology/annotated-topology-reader.cpp
+++ b/utils/topology/annotated-topology-reader.cpp
@@ -345,7 +345,8 @@
}
catch (...) {
typedef boost::tokenizer<boost::escaped_list_separator<char>> tokenizer;
- tokenizer tok(link.GetAttribute("MaxPackets"));
+ std::string value = link.GetAttribute("MaxPackets");
+ tokenizer tok(value);
tokenizer::iterator token = tok.begin();
p2p.SetQueue(*token);
@@ -390,7 +391,8 @@
NS_LOG_INFO("LinkError = " + link.GetAttribute("LossRate"));
typedef boost::tokenizer<boost::escaped_list_separator<char>> tokenizer;
- tokenizer tok(link.GetAttribute("LossRate"));
+ std::string value = link.GetAttribute("LossRate");
+ tokenizer tok(value);
tokenizer::iterator token = tok.begin();
ObjectFactory factory(*token);