Numworks Epsilon  1.4.1
Graphing Calculator Operating System
dynamic_view_controller.cpp
Go to the documentation of this file.
2 #include <escher/app.h>
3 #include <assert.h>
4 
6  ViewController(parentResponder),
7  m_view(nullptr)
8 {
9 }
10 
12  assert(m_view == nullptr);
13 }
14 
16  loadViewIfNeeded();
17  return m_view;
18 }
19 
21  loadViewIfNeeded();
22 }
23 
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(Responder *parentResponder)
#define assert(e)
Definition: assert.h:9
Definition: view.h:23