-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLocalStorage_Service.h
More file actions
38 lines (31 loc) · 937 Bytes
/
LocalStorage_Service.h
File metadata and controls
38 lines (31 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#ifndef LOCALSTORAGE_SERVICE_H
#define LOCALSTORAGE_SERVICE_H
#include <QObject>
#include <QMutex>
#include <QMap>
#include <QDir>
#include <plog/Log.h>
#include "DB/JSONS/messages.h"
class LocalStorage_Service :
public QObject
{
Q_OBJECT
private:
static LocalStorage_Service* instance;
static QMutex mutex;
explicit LocalStorage_Service(QObject* object_ = nullptr);
QMap<QUuid, QList<QSharedPointer<DBEntity::DBMessage>>> message_storage;
public:
static LocalStorage_Service* getInstance();
LocalStorage_Service& operator=(const LocalStorage_Service&) = delete;
LocalStorage_Service(const LocalStorage_Service&) = delete;
signals:
void messageRetrieved(QList<DBEntity::DBMessage*> message_);
void close();
public slots:
void addMessages(DBEntity::DBMessage* message_, QUuid room_id_);
void saveAllMessages();
void safeExit();
};
#endif //LOCALSTORAGE_SERVICE_H