#ifndef CUMSGBUFFER_H #define CUMSGBUFFER_H #include #include #include #include #include #include #include #include "clientime.h" #ifndef CAM_NUM #define CAM_NUM 4 #endif namespace iv { struct cumsg { public: 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; PicBuf mpicbuf[CAM_NUM]; }; } class cumsgbuffer { public: cumsgbuffer(); private: std::vector mvectormsg; clientime mclienttime; 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); //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); void addPicData(std::string strVIN,const char * strdata,const unsigned int ndatasize,qint64 npictime,int nCamPos,qint64 nLatency); int getPicData(std::string strVIN,std::string strqueryMD5,std::shared_ptr & pdata_ptr,unsigned int & ndatasize, std::string strclientid,int nCamPos,qint64 & nPicTime,qint64 & nPicLatency,int & nFrameRate); }; #endif // CUMSGBUFFER_H