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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef CVVISUAL_DATA_CONTROLLER_HPP
#define CVVISUAL_DATA_CONTROLLER_HPP
#include <memory>
#include <vector>
#include "opencv2/core.hpp"
#include "call.hpp"
#include "../controller/view_controller.hpp"
namespace cvv
{
namespace impl
{
/**
* @brief The central controller of the debug-framework that owns all the
* calldata.
*/
class DataController
{
public:
DataController() = default;
~DataController()
{
}
/**
* Add a new call to the calls-list.
*/
void addCall(std::unique_ptr<Call> call);
/**
* Remove a call.
* @throws std::invalid_argument if no such call exists
*/
void removeCall(size_t Id);
/**
* Get read-access to a certain call.
*/
const Call &getCall(size_t Id) const;
/**
* Get read/write-access to a certain call.
*/
Call &getCall(size_t Id);
bool hasCall(size_t Id);
/**
* Get the number of currently managed calls.
*/
size_t numCalls() const;
/**
* Passes control to the View-controller.
*
* Returns when the ViewController signals that normal program-execution
*shall continue.
*
*/
void callUI();
/**
* @brief Replace the continue-buttons with close-buttons and show the
*UI.
*
* This function is intended to be called directly before main returns
*after all the actual
* work is done.
*/
void lastCall();
private:
std::vector<std::unique_ptr<Call>> calls;
controller::ViewController viewController;
};
/**
* @brief Destructs the global Singleton.
*/
void deleteDataController();
/**
* Provides access to a global DataController that is created upon the first
* call.
*/
DataController &dataController();
}
} // namespaces cvv::impl
#endif