#ifndef LOGWRITER_H #define LOGWRITER_H #include #include #include #include #include #include #include #include "Mutex/Cond.h" #define LOGSTR_MAX_LENGTH 512 /** * @brief The LogWriter class * дÈÕÖ¾Àà ¸ºÔð¶¨Ê±½«ÈÕÖ¾ÐÅϢдÈëÎļþ ²¢¹ÜÀíÈÕÖ¾Îļþ */ class LogWriter { public: struct LogInfoNode { int cameraId; uint64_t mCreateTime; //´´½¨µÄʱ¼ä(ÓÃÀ´ÅжϹýÁ˶à¾Ã) std::string logStr; LogInfoNode() { cameraId = 0; // memset(time, 0x0, 32); // memset(logStr, 0x0, LOGSTR_MAX_LENGTH); } }; LogWriter(); ~LogWriter(); void writeLog(int cameraId, const std::string &str); void run(); private: char fileName[20]; char *mTmpBuffer; void addLogNode(const LogInfoNode &node); std::list mLogNodeList; //Êý¾Ý¶ÓÁÐ Cond *mCondition; }; #endif // LOGWRITER_H