-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.h
66 lines (47 loc) · 1.47 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
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include <Defines.h>
#include <boost/shared_ptr.hpp>
#include <map>
class User;
typedef boost::shared_ptr<User> UserPtr; //!< Smart pointer to a user
/**
* @brief A user has all the properties needed for defining a training plan.
*/
class User {
public:
User();
User::User(UserPtr pOther);
//! The distance unit
PTUnit unit;
//! The training level
PTLevel level;
//! The competition distance
PTDistance distance;
//! The lactate threshold pulse
int pulse;
//! True if pace is set
bool use_pace;
//! Date of competition
wxDateTime raceDate;
int calculatorSpeedMin;
int calculatorSpeedSec;
//! Returns references to all users by name
static std::map<wxString,UserPtr>& GetUsers();
/** Get a named user.
\param name The name of the user
*/
static UserPtr GetUser(wxString const &name);
/** Add a named user and get a User structure back.
\return The user attributes for the created user.*/
static UserPtr AddUser(wxString const &name);
/** Returns name of a user.
\param pUser User to get name for.*/
static wxString GetName(UserPtr pUser);
/** Get the active / current user*/
static UserPtr GetUser();
/** Set the active / current user.*/
static void SetCurrentUser( UserPtr pUser );
private:
static std::map<wxString,UserPtr> cUserMap;
static UserPtr cpCurrentUser;
};