-
Notifications
You must be signed in to change notification settings - Fork 1
/
user.h
53 lines (42 loc) · 1.03 KB
/
user.h
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
43
44
45
46
47
48
49
50
51
52
53
/******************************************************
FileName: session.h
*
Description: File for creating a presistence class for User and mapping authinfo with user.
*
Authors: Gauravjeet Singh, Shaina Sabarwal, Inderpreet Singh
*
License: GNU GPL V3
*
******************************************************/
#ifndef USER_H_
#define USER_H_
#include <Wt/Dbo/Dbo>
#include <Wt/Auth/Dbo/AuthInfo>
/**
Wt::Dbo is a C++ ORM for making database driven applications with Witty
*/
namespace dbo = Wt::Dbo;
class User;
/**
mapping AuthInfo with our User Class and for the ease referring it to as AuthInfo
*/
typedef Wt::Auth::Dbo::AuthInfo<User> AuthInfo;
/**
Definition of class User
*/
class User {
public:
/**
adding a persist function, persist function is used to create tables in database,
*/
User();
std::string name, title, tagline, category;
template <class Action>
void persist(Action& a)
{
dbo::field(a, name, "name" );
dbo::field(a, title, "title");
dbo::field(a, tagline,"tagline");
}
};
#endif