40 lines
737 B
C++

//
// Created by dongl on 23-5-29.
//
#ifndef IM2_STORAGE_H
#define IM2_STORAGE_H
#include "db_base.h"
#include "../TimeLine.h"
namespace MSGFormat {
struct Storage {
mp::MP_SUB_TYPE msg_type;
mp::MP_SUB_TYPE session_type;
uint64_t message_id;
time_t msg_time;
uint64_t account;
std::string msg_data;
};
}
namespace MSG {
class Storage {
public:
explicit Storage(TimeLine<MSGFormat::Storage *> *timeLine, db_base* db);
Storage();
public:
void push(MSGFormat::Storage* msg);
void pull();
private:
db_base* m_db = nullptr;
TimeLine<MSGFormat::Storage*> * m_timeLine = nullptr;
};
}
#endif //IM2_STORAGE_H