1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #ifndef CUMSGBUFFER_H
- #define CUMSGBUFFER_H
- #include <QDateTime>
- #include <QMutex>
- #include <string>
- #include <iostream>
- #include <vector>
- #include <memory>
- namespace iv {
- struct cumsg
- {
- int id;
- qint64 ntime;
- std::string strVIN;
- std::string strqueryMD5;
- std::string strctrlMD5;
- std::vector<char> xdata;
- qint64 mlastuptime; //更新时间
- bool mbImportant = false;
- int mkeeptime;
- bool mbhavequery = false;
- };
- }
- class cumsgbuffer
- {
- public:
- cumsgbuffer();
- private:
- std::vector<iv::cumsg> mvectormsg;
- QMutex mMutex;
- public:
- void addmsg(int id,qint64 ntime,std::string strVIN,std::string strqueryMD5,
- std::string strctrlMD5,std::vector<char> * 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<char> * pxdata);
- };
- #endif // CUMSGBUFFER_H
|