-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
52 lines (42 loc) · 1.14 KB
/
main.cpp
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
/*
* main.cpp
*
* Created on: Aug 28, 2014
* Author: wilhelma
*/
#include <boost/log/trivial.hpp>
#include "SAAPRunner.h"
#include "EventService.h"
#include "DBInterpreter.h"
#include "RaceDetectionTool.h"
#include "LockSetChecker.h"
#include "LockMgr.h"
#include "ThreadMgr.h"
int main(int argc, char* argv[]) {
// check arguments
if (argc < 2) {
BOOST_LOG_TRIVIAL(fatal) << "No database name provided!";
return 1;
}
// create interpreter, event service, and saap runner
EventService *service = new EventService();
LockMgr *lockMgr = new LockMgr();
ThreadMgr *threadMgr = new ThreadMgr();
DBInterpreter *interpreter = new DBInterpreter(argv[1],
"SAAP.log",
service,
lockMgr,
threadMgr);
SAAPRunner *runner = new SAAPRunner(interpreter);
// create and register tools
//RaceDetectionTool *raceTool = new RaceDetectionTool("races.json");
LockSetChecker *raceTool = new LockSetChecker("races.json");
runner->registerTool(raceTool, NULL, ALL);
// Start interpretation
runner->interpret();
delete interpreter;
delete service;
delete runner;
delete raceTool;
return 0;
}