Add external libraries

This commit is contained in:
sylvieee-iot 2024-05-02 20:28:41 +03:00 committed by GitHub
parent 70f443b06e
commit e8dc11cc31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 2010 additions and 0 deletions

31
third_party/open-bp-cpp/include/log.h vendored Normal file
View file

@ -0,0 +1,31 @@
#include <fstream>
#include <vector>
#include <chrono>
class RequestQueue {
public:
unsigned int id = 1;
std::string requestType;
};
class Logger {
public:
Logger() {
start = std::chrono::system_clock::now();
}
~Logger() {
logFile.close();
}
void init(std::string filename);
void logSentMessage(std::string rqType, unsigned int id);
void logReceivedMessage(std::string repType, unsigned int id);
private:
std::fstream logFile;
std::vector<RequestQueue> rQueue;
// Using time point and system_clock
std::chrono::time_point<std::chrono::system_clock> start, end;
};