/* * * REPLY: * { * fileName: "gather.out", * units: ["Ir", "Dr"], * } * * // The type is defined in the request handler class to be: * NewStringField(fileName); * NewStringArrayField(units); * NewStringArrayField(path); * SimpleParsedJSON<fileName,units,path> reply;*/// Build up the reply in the handler...
std::string ReqGetGraphDetails::OnRequest(constchar* JSON) {
reply.Clear();
reply.Get<fileName>() = parent->FileName();
LookupUnits();
// Convert the stored native types to a valid JSON object...return reply.GetJSONString();
}
// Array types are stored in a std::vector...voidReqGetGraphDetails::LookupUnits() {
for ( constsize_t& i : NodeConfig::Instance().DisplayIdxs() ) {
reply.Get<units>().push_back(GetUnit(i));
}
}