Added classes Process and Arguments.
This commit is contained in:
parent
0450c31449
commit
f4d2dec628
18 changed files with 373 additions and 82 deletions
24
src/App.cpp
24
src/App.cpp
|
@ -5,7 +5,9 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -47,18 +49,18 @@
|
|||
#endif
|
||||
|
||||
|
||||
App *App::m_self = nullptr;
|
||||
xmrig::App *xmrig::App::m_self = nullptr;
|
||||
|
||||
|
||||
|
||||
App::App(int argc, char **argv) :
|
||||
xmrig::App::App(Process *process) :
|
||||
m_console(nullptr),
|
||||
m_httpd(nullptr)
|
||||
{
|
||||
m_self = this;
|
||||
|
||||
m_controller = new xmrig::Controller();
|
||||
if (m_controller->init(argc, argv) != 0) {
|
||||
m_controller = new xmrig::Controller(process);
|
||||
if (m_controller->init() != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -72,7 +74,7 @@ App::App(int argc, char **argv) :
|
|||
}
|
||||
|
||||
|
||||
App::~App()
|
||||
xmrig::App::~App()
|
||||
{
|
||||
uv_tty_reset_mode();
|
||||
|
||||
|
@ -85,7 +87,7 @@ App::~App()
|
|||
}
|
||||
|
||||
|
||||
int App::exec()
|
||||
int xmrig::App::exec()
|
||||
{
|
||||
if (m_controller->isDone()) {
|
||||
return 0;
|
||||
|
@ -139,7 +141,7 @@ int App::exec()
|
|||
}
|
||||
|
||||
|
||||
void App::onConsoleCommand(char command)
|
||||
void xmrig::App::onConsoleCommand(char command)
|
||||
{
|
||||
switch (command) {
|
||||
case 'h':
|
||||
|
@ -174,7 +176,7 @@ void App::onConsoleCommand(char command)
|
|||
}
|
||||
|
||||
|
||||
void App::close()
|
||||
void xmrig::App::close()
|
||||
{
|
||||
m_controller->network()->stop();
|
||||
Workers::stop();
|
||||
|
@ -183,12 +185,12 @@ void App::close()
|
|||
}
|
||||
|
||||
|
||||
void App::release()
|
||||
void xmrig::App::release()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void App::onSignal(uv_signal_t *handle, int signum)
|
||||
void xmrig::App::onSignal(uv_signal_t *handle, int signum)
|
||||
{
|
||||
switch (signum)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue