ttcn3_drb_interface: remove use of GetArray()

unfortunately, the rapidjson version shipped with Ubuntu 16.04
doesn't support the GetArray() API so we need to use
normal iterator to loop over the array
master
Andre Puschmann 5 years ago
parent bf6ddbe976
commit 2c5e159420

@ -100,20 +100,18 @@ private:
assert(uplane["SubframeDataList"].IsArray()); assert(uplane["SubframeDataList"].IsArray());
uint32_t lcid = document["Common"]["RoutingInfo"]["RadioBearerId"]["Drb"].GetInt() + 2; uint32_t lcid = document["Common"]["RoutingInfo"]["RadioBearerId"]["Drb"].GetInt() + 2;
for (Value::ConstValueIterator itr = uplane["SubframeDataList"].Begin(); itr != uplane["SubframeDataList"].End();
for (auto& sfdata : uplane["SubframeDataList"].GetArray()) { ++itr) {
assert(sfdata.HasMember("PduSduList")); assert(itr->HasMember("PduSduList"));
assert(sfdata["PduSduList"].IsObject()); assert((*itr)["PduSduList"].IsObject());
assert(sfdata["PduSduList"].HasMember("PdcpSdu")); assert((*itr)["PduSduList"].HasMember("PdcpSdu"));
assert(sfdata["PduSduList"]["PdcpSdu"].IsArray()); assert((*itr)["PduSduList"]["PdcpSdu"].IsArray());
const Value& sdulist = (*itr)["PduSduList"]["PdcpSdu"];
const Value& sdulist = sfdata["PduSduList"]["PdcpSdu"]; for (Value::ConstValueIterator sdu_itr = sdulist.Begin(); sdu_itr != sdulist.End(); ++sdu_itr) {
for (auto& sdu : sdulist.GetArray()) { assert(sdu_itr->IsString());
assert(sdu.IsString()); string sdustr = sdu_itr->GetString();
string sdustr = sdu.GetString();
asn1::dyn_octstring octstr(sdustr.size()); asn1::dyn_octstring octstr(sdustr.size());
octstr.from_string(sdustr); octstr.from_string(sdustr);
handle_sdu(document, lcid, octstr.data(), octstr.size(), ttcn3_helpers::get_follow_on_flag(document)); handle_sdu(document, lcid, octstr.data(), octstr.size(), ttcn3_helpers::get_follow_on_flag(document));
} }
} }

Loading…
Cancel
Save