forked from CPP-Final-Project/Chat_Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRatingCounter_Service.h
More file actions
38 lines (27 loc) · 830 Bytes
/
RatingCounter_Service.h
File metadata and controls
38 lines (27 loc) · 830 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 RATINGCOUNTER_SERVICE_H
#define RATINGCOUNTER_SERVICE_H
#include <QObject>
#include <QMutex>
#include <QString>
#include <QMap>
#include <QSharedPointer>
#include <plog/Log.h>
class RatingCounter_Service :
public QObject
{
Q_OBJECT
private:
static QSharedPointer<RatingCounter_Service> shp_instance;
static QMutex mutex;
explicit RatingCounter_Service(QObject* parent = nullptr);
QMap<QString, qint32> rating_storage;
public:
static QSharedPointer<RatingCounter_Service> getInstance();
RatingCounter_Service(const RatingCounter_Service&) = delete;
RatingCounter_Service& operator=(const RatingCounter_Service&) = delete;
public slots:
void addRating(const QString user_login_, bool like_or_dis);
void updateRating();
};
#endif // !RATINGCOUNTER_SERVICE_H