Wt examples 3.3.12
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
18class User;
21
22class User
23{
24public:
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_
Wt::Auth::Dbo::AuthInfo< User > AuthInfo
Definition User.h:19
Wt::Dbo::collection< Wt::Dbo::ptr< User > > Users
Definition User.h:20
DBO_EXTERN_TEMPLATES(User)
Definition User.h:23
std::string name
Definition User.h:27
long long score
Definition User.h:29
User()
Definition User.C:17
void persist(Action &a)
Definition User.h:34
Wt::WDateTime lastGame
Definition User.h:30
int gamesPlayed
Definition User.h:28
Wt::Dbo::collection< Wt::Dbo::ptr< AuthInfo > > authInfos
Definition User.h:31
void hasMany(Action &action, collection< ptr< C > > &value, RelationType type, const std::string &name=std::string())
void field(Action &action, V &value, const std::string &name, int size=-1)

Generated on Fri May 17 2024 for the C++ Web Toolkit (Wt) by doxygen 1.9.8