Wt examples  3.3.0
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 
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();
45  static const std::vector<const Wt::Auth::OAuthService *>& oAuth();
46 
47 private:
48  Wt::Dbo::backend::Sqlite3 sqlite3_;
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 doxygen 1.8.3.1