-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathControlPimpl.h
More file actions
28 lines (22 loc) · 843 Bytes
/
ControlPimpl.h
File metadata and controls
28 lines (22 loc) · 843 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
// ===========================================================================
// ControlPimpl.h - Pimpl Idiom with separate header file
// ===========================================================================
namespace PimplVariantWithSeparateHeaderFile {
class ControlPimpl {
private:
std::string m_text;
int m_width;
int m_height;
bool m_visible;
void draw();
public:
ControlPimpl() : m_text(""), m_width(0), m_height(0), m_visible(true) {}
void setText(const std::string& text);
void resize(const int width, const int height);
void show();
void hide();
};
}
// ===========================================================================
// End-of-File
// ===========================================================================