#ifndef CUMSGBUFFER_H #define CUMSGBUFFER_H #include #include #include #include #include #include namespace iv { struct cumsg { int id; qint64 ntime; std::string strVIN; std::string strqueryMD5; std::string strctrlMD5; std::vector xdata; qint64 mlastuptime; //更新时间 bool mbImportant = false; int mkeeptime; bool mbhavequery = false; qint64 mnlatency; }; } class cumsgbuffer { public: cumsgbuffer(); private: std::vector mvectormsg; QMutex mMutex; public: void addmsg(int id,qint64 ntime,std::string strVIN,std::string strqueryMD5, std::string strctrlMD5,std::vector * pxdata,bool bImportant,int nkeeptime,qint64 nculatency); //if no new msg return 0 // -1 no this vin // -2 queryMD5 error int getmsg(std::string strVIN,std::string strqueryMD5,qint64 nlasttime, int & id,qint64 & ntime, std::vector * pxdata,qint64 * pnculatency); }; #endif // CUMSGBUFFER_H