Wt examples  3.3.0
User.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 USER_H_
9 #define USER_H_
10 
11 #include <Wt/WDateTime>
12 #include <Wt/Dbo/Types>
13 #include <Wt/Dbo/WtSqlTraits>
14 #include <Wt/Auth/Dbo/AuthInfo>
15 
16 #include <string>
17 
18 class User;
19 typedef Wt::Auth::Dbo::AuthInfo<User> AuthInfo;
21 
22 class User : public Wt::Dbo::Dbo<User>
23 {
24 public:
25  User();
26 
27  std::string name; /* a copy of auth info's user name */
29  long long score;
32 
33  template<class Action>
34  void persist(Action& a)
35  {
36  Wt::Dbo::field(a, gamesPlayed, "gamesPlayed");
37  Wt::Dbo::field(a, score, "score");
38  Wt::Dbo::field(a, lastGame, "lastGame");
39 
41  }
42 };
43 
45 
46 #endif // USER_H_

Generated on Fri May 31 2013 for the C++ Web Toolkit (Wt) by doxygen 1.8.3.1