OXYGENHUB
◆ main openmsx / src / imgui / ImGuiPart.hh
648 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef IMGUI_PART_HH
2
#define IMGUI_PART_HH
3
4
#include "ImGuiManager.hh"
5
#include "ImGuiPartInterface.hh"
6
7
namespace openmsx {
8
9
class ImGuiPart : public ImGuiPartInterface
10
{
11
public:
12
	explicit ImGuiPart(ImGuiManager& manager_)
13
		: manager(manager_)
14
	{
15
		manager.registerPart(this);
16
	}
17
18
	~ImGuiPart()
19
	{
20
		manager.unregisterPart(this);
21
	}
22
23
	// disallow copy/move, the address of this object should remain stable
24
	ImGuiPart(const ImGuiPart&) = delete;
25
	ImGuiPart(ImGuiPart&&) = delete;
26
	ImGuiPart& operator=(const ImGuiPart&) = delete;
27
	ImGuiPart& operator=(ImGuiPart&&) = delete;
28
29
protected:
30
	ImGuiManager& manager;
31
};
32
33
} // namespace openmsx
34
35
#endif