Numworks Epsilon
1.4.1
Graphing Calculator Operating System
dynamic_view_controller.cpp
Go to the documentation of this file.
1
#include <
escher/dynamic_view_controller.h
>
2
#include <
escher/app.h
>
3
#include <
assert.h
>
4
5
DynamicViewController::DynamicViewController
(
Responder
* parentResponder) :
6
ViewController
(parentResponder),
7
m_view(nullptr)
8
{
9
}
10
11
DynamicViewController::~DynamicViewController
() {
12
assert
(m_view ==
nullptr
);
13
}
14
15
View
*
DynamicViewController::view
() {
16
loadViewIfNeeded();
17
return
m_view;
18
}
19
20
void
DynamicViewController::viewWillAppear
() {
21
loadViewIfNeeded();
22
}
23
24
void
DynamicViewController::viewDidDisappear
() {
25
unloadViewIfNeeded();
26
}
27
28
void
DynamicViewController::loadViewIfNeeded() {
29
if
(m_view ==
nullptr
) {
30
m_view = loadView();
31
assert
(m_view !=
nullptr
);
32
}
33
}
34
35
void
DynamicViewController::unloadViewIfNeeded() {
36
if
(m_view !=
nullptr
) {
37
unloadView(m_view);
38
m_view =
nullptr
;
39
}
40
}
DynamicViewController::DynamicViewController
DynamicViewController(Responder *parentResponder)
Definition:
dynamic_view_controller.cpp:5
assert
#define assert(e)
Definition:
assert.h:9
app.h
DynamicViewController::~DynamicViewController
~DynamicViewController()
Definition:
dynamic_view_controller.cpp:11
assert.h
Responder
Definition:
responder.h:9
dynamic_view_controller.h
View
Definition:
view.h:23
DynamicViewController::viewDidDisappear
void viewDidDisappear() override
Definition:
dynamic_view_controller.cpp:24
ViewController
Definition:
view_controller.h:30
DynamicViewController::view
View * view() override
Definition:
dynamic_view_controller.cpp:15
DynamicViewController::viewWillAppear
void viewWillAppear() override
Definition:
dynamic_view_controller.cpp:20
epsilon
escher
src
dynamic_view_controller.cpp
Generated by
1.8.14