-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathuserlogmanager.h
More file actions
40 lines (28 loc) · 943 Bytes
/
userlogmanager.h
File metadata and controls
40 lines (28 loc) · 943 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
39
40
#ifndef USERLOGMANAGER_H
#define USERLOGMANAGER_H
#include <boost/lockfree/queue.hpp>
#include <boost/noncopyable.hpp>
#include "common.h"
#include "protocol.h"
#include "network/clientsession.h"
class UserLogManager;
using UserLogManagerPtr = std::shared_ptr<UserLogManager>;
//用户日志管理器,所有的用户日志,需要记录数据库
//对日志要发布给订阅日志的用户
class UserLogManager : public boost::noncopyable, public std::enable_shared_from_this<UserLogManager>
{
public:
static UserLogManagerPtr getInstance()
{
static UserLogManagerPtr m_inst = UserLogManagerPtr(new UserLogManager());
return m_inst;
}
void init();
void push(const std::string &s);
void interLogDuring(ClientSessionPtr conn, const Json::Value &request);
private:
UserLogManager();
void checkTable();
boost::lockfree::queue<USER_LOG> logQueue;
};
#endif // USERLOGMANAGER_H