123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #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;
- qint64 mnlatency;
- };
- }
- 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,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<char> * pxdata,qint64 * pnculatency);
- };
- #endif // CUMSGBUFFER_H
|