-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUser.h
More file actions
40 lines (30 loc) · 912 Bytes
/
User.h
File metadata and controls
40 lines (30 loc) · 912 Bytes
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
// ===========================================================================
// User.h
// ===========================================================================
#pragma once
// https://www.geeksforgeeks.org/pimpl-idiom-in-c-with-examples/
/* |INTERFACE| User.h file */
#include <memory>
#include <string>
class User
{
public:
// c'tor / d'tor
User(std::string&& name);
~User();
// assignment operator and copy constructor
// note: assignment operator uses swap idiom
User(const User& other);
User& operator=(User rhs);
// getter / setter
int getAge();
void setAge(int);
private:
// internal implementation class
class UserImpl;
// pointer to the internal implementation
std::unique_ptr<UserImpl> m_pimpl;
};
// ===========================================================================
// End-of-File
// ===========================================================================