/* * @Author: your name * @Date: 2021-11-18 22:53:19 * @LastEditTime: 2021-11-19 11:39:00 * @LastEditors: lishengyin * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: /MIVA/modules/dataType/include/SendPassengerFlow.h */ #pragma once #include using namespace std; #include #include #include #include #include class PassengerFlow { public: // 检测设备 std::string deviceIp; // 车辆编号 std::string carCode; // 车厢编号 std::string carriageCode; // 拥挤度检测值 int crNum = 0; // 拥挤度,1/2/3 int crType; // 车厢人数 int personNum; // 检测时间 std::string detectionTime; // 流播放地址 std::string detectionVideo; // 备注 std::string remark; // 扩展字段 std::string attr1; std::string attr2; std::string attr3; public: PassengerFlow() {} ~PassengerFlow() {} void objectToJson(rapidjson::Writer& writer) { writer.StartObject(); writer.Key("deviceIp"); writer.String(deviceIp.c_str()); writer.Key("carCode"); writer.String(carCode.c_str()); writer.Key("carriageCode"); writer.String(carriageCode.c_str()); writer.Key("crNum"); writer.Int(crNum); writer.Key("crType"); writer.Int(crType); writer.Key("personNum"); writer.Int(personNum); writer.Key("detectionTime"); writer.String(detectionTime.c_str()); writer.Key("detectionVideo"); writer.String(detectionVideo.c_str()); writer.Key("remark"); writer.String(remark.c_str()); writer.Key("attr1"); writer.String(attr1.c_str()); writer.Key("attr2"); writer.String(attr2.c_str()); writer.Key("attr3"); writer.String(attr3.c_str()); writer.EndObject(); } }; class SendPassengerFlow { public: vector PassengerFlows; public: SendPassengerFlow() {} ~SendPassengerFlow() {} void objectToJson(rapidjson::Writer& writer) { writer.StartArray(); for(auto& passengerFlow: PassengerFlows){ passengerFlow.objectToJson(writer); } writer.EndArray(); } };