Wt examples
3.3.0
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
build
buildd
witty-3.3.0
examples
hangman
Session.h
Go to the documentation of this file.
1
// This may look like C code, but it's really -*- C++ -*-
2
/*
3
* Copyright (C) 2011 Emweb bvba, Heverlee, Belgium.
4
*
5
* See the LICENSE file for terms of use.
6
*/
7
8
#ifndef SESSION_H_
9
#define SESSION_H_
10
11
#include <vector>
12
13
#include <Wt/Auth/Login>
14
15
#include <Wt/Dbo/Session>
16
#include <Wt/Dbo/ptr>
17
#include <Wt/Dbo/backend/Sqlite3>
18
19
#include "
User.h
"
20
21
typedef
Wt::Auth::Dbo::UserDatabase<AuthInfo>
UserDatabase
;
22
23
class
Session
24
{
25
public
:
26
static
void
configureAuth
();
27
28
Session
();
29
~Session
();
30
31
Wt::Auth::AbstractUserDatabase
&
users
();
32
Wt::Auth::Login
&
login
() {
return
login_
; }
33
34
std::vector<User>
topUsers
(
int
limit);
35
36
/*
37
* These methods deal with the currently logged in user
38
*/
39
std::string
userName
()
const
;
40
int
findRanking
();
41
void
addToScore
(
int
s);
42
43
static
const
Wt::Auth::AuthService
&
auth
();
44
static
const
Wt::Auth::AbstractPasswordService
&
passwordAuth
();
45
static
const
std::vector<const Wt::Auth::OAuthService *>&
oAuth
();
46
47
private
:
48
Wt::Dbo::backend::Sqlite3
sqlite3_
;
49
mutable
Wt::Dbo::Session
session_
;
50
UserDatabase
*
users_
;
51
Wt::Auth::Login
login_
;
52
53
Wt::Dbo::ptr<User>
user
()
const
;
54
};
55
56
#endif //SESSION_H_
Generated on Fri May 31 2013 for
the C++ Web Toolkit (Wt)
by
1.8.3.1