-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
49 lines (45 loc) · 1.53 KB
/
main.cc
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
// Copyright 2021 Optiver Asia Pacific Pty. Ltd.
//
// This file is part of Ready Trader Go.
//
// Ready Trader Go is free software: you can redistribute it and/or
// modify it under the terms of the GNU Affero General Public License
// as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// Ready Trader Go is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public
// License along with Ready Trader Go. If not, see
// <https://www.gnu.org/licenses/>.
#include <cstdlib>
#include <iostream>
#include <ready_trader_go/application.h>
#include <ready_trader_go/autotraderapphandler.h>
#include <ready_trader_go/error.h>
#include "autotrader.h"
int main(int argc, char* argv[])
{
try
{
ReadyTraderGo::Application app;
AutoTrader trader{app.GetContext()};
ReadyTraderGo::AutoTraderAppHandler appHandler{app, trader};
app.Run(argc, argv);
}
catch (const ReadyTraderGo::ReadyTraderGoError& e)
{
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}
catch (...)
{
// Catch block added so the Application object gets destructed
// and the log gets flushed.
throw;
}
return EXIT_SUCCESS;
}