18 lines
351 B
C++
18 lines
351 B
C++
#pragma once
|
|
#include <cstdio>
|
|
#include <string>
|
|
#include <mutex>
|
|
|
|
class OrderLog {
|
|
public:
|
|
void open(const std::string& path);
|
|
void close();
|
|
void log_order(const std::string& order_json, const std::string& external_id = "");
|
|
private:
|
|
FILE* fp_ = nullptr;
|
|
std::mutex mutex_;
|
|
int sequence_ = 0;
|
|
};
|
|
|
|
extern OrderLog g_order_log;
|