forked from dedis/Dissent
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSessionService.hpp
42 lines (33 loc) · 1.01 KB
/
SessionService.hpp
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
41
42
#ifndef DISSENT_WEB_SESSION_SERVICE_GUARD
#define DISSENT_WEB_SESSION_SERVICE_GUARD
#include <QSharedPointer>
#include "Anonymity/Sessions/Session.hpp"
#include "Anonymity/Sessions/SessionManager.hpp"
#include "WebService.hpp"
namespace Dissent {
namespace Web {
/**
* A WebService that has access to the anonymity Session object
*/
class SessionService : public WebService {
public:
typedef Anonymity::Sessions::Session Session;
typedef Anonymity::Sessions::SessionManager SessionManager;
explicit SessionService(SessionManager &sm);
/**
* Called to handle the incoming request
* @param request the incoming request
* @param response used to respond to the rqeuest
*/
virtual void HandleRequest(QHttpRequest *request, QHttpResponse *response);
protected:
/**
* Return the monitored session
*/
QSharedPointer<Session> GetSession() { return m_sm.GetDefaultSession(); }
private:
SessionManager &m_sm;
};
}
}
#endif