Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TEditorEvent.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <Common/assertion.h>
6#include <Utility/utility.h>
7
8namespace ph::editor
9{
10
11class Editor;
12
13template<bool CAN_POST>
14class TEditorEvent : public Event
15{
16// Hide special members as this class is not intended to be used polymorphically.
17// It is derived class's choice to expose them (by defining them in public) or not.
18protected:
20
21public:
22 inline static constexpr bool canPost = CAN_POST;
23
24 explicit TEditorEvent(Editor* editor);
25
26 Editor& getEditor() const;
27
28private:
29 Editor* m_editor;
30};
31
32template<bool CAN_POST>
34 : Event()
35 , m_editor(editor)
36{}
37
38template<bool CAN_POST>
40{
41 PH_ASSERT(m_editor);
42 return *m_editor;
43}
44
45}// end namespace ph::editor
Definition Editor.h:45
Base of all event types. Derived classes should strive to keep the size of the object small,...
Definition Event.h:59
Definition TEditorEvent.h:15
PH_DEFINE_INLINE_RULE_OF_5_MEMBERS(TEditorEvent)
Editor & getEditor() const
Definition TEditorEvent.h:39
TEditorEvent(Editor *editor)
Definition TEditorEvent.h:33
static constexpr bool canPost
Definition TEditorEvent.h:22
Definition ph_editor.h:10