-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (37 loc) · 1.01 KB
/
main.cpp
File metadata and controls
47 lines (37 loc) · 1.01 KB
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
/*
(c) Matthew Slocum 2015
main.cpp bootstraps the program.
loads up all the comonents of the program
links the components together
starts the program in either the menu or messenger depending on command line options
DEPENDENCIES:
boost::asio [sudo apt-get install libboost-all-dev]
*/
#include <iostream>
#include <stdio.h>
#include <string.h>
#include "regComponent.h"
#include "uiComponent.h"
#include "msgComponent.h"
#include "secComponent.h"
using namespace std;
msgComponent * msg = new msgComponent();
regComponent * reg = new regComponent();
secComponent * sec = new secComponent();
uiComponent * ui = new uiComponent();
int main(int argc, char *argv[]) {
msg->bind_regComponent(reg);
msg->bind_secComponent(sec);
reg->bind_msgComponent(msg);
ui->bind_regComponent(reg);
if(argc > 1 && string(argv[1])=="-msg") {
msg->run();
} else {
ui->run();
}
delete msg;
delete reg;
delete sec;
delete ui;
return 1;
}