Move Pool.h/Pool.cpp.

This commit is contained in:
XMRig 2019-02-16 09:56:08 +07:00
parent 4f188a2cd8
commit dbdcc14672
13 changed files with 99 additions and 18 deletions

View file

@ -28,6 +28,8 @@ set(HEADERS
src/base/kernel/Entry.h
src/base/kernel/Process.h
src/base/kernel/Signals.h
src/base/net/Pool.h
src/base/net/Pools.h
src/base/tools/Arguments.h
src/base/tools/Handle.h
src/base/tools/String.h
@ -54,7 +56,6 @@ set(HEADERS
src/common/net/Client.h
src/common/net/Id.h
src/common/net/Job.h
src/common/net/Pool.h
src/common/net/Storage.h
src/common/net/strategies/FailoverStrategy.h
src/common/net/strategies/SinglePoolStrategy.h
@ -112,6 +113,8 @@ set(SOURCES
src/base/kernel/Entry.cpp
src/base/kernel/Process.cpp
src/base/kernel/Signals.cpp
src/base/net/Pool.cpp
src/base/net/Pools.cpp
src/base/tools/Arguments.cpp
src/base/tools/Handle.cpp
src/base/tools/String.cpp
@ -127,7 +130,6 @@ set(SOURCES
src/common/log/Log.cpp
src/common/net/Client.cpp
src/common/net/Job.cpp
src/common/net/Pool.cpp
src/common/net/strategies/FailoverStrategy.cpp
src/common/net/strategies/SinglePoolStrategy.cpp
src/common/net/SubmitResult.cpp

View file

@ -28,9 +28,9 @@
#include <uv.h>
#include "base/net/Pool.h"
#include "common/cpu/Cpu.h"
#include "common/log/Log.h"
#include "common/net/Pool.h"
#include "core/Config.h"
#include "core/Controller.h"
#include "crypto/Asm.h"

View file

@ -29,7 +29,7 @@
#include <stdio.h>
#include "common/net/Pool.h"
#include "base/net/Pool.h"
#include "rapidjson/document.h"

View file

@ -111,6 +111,6 @@ private:
};
typedef std::vector<Pool> Pools;
//typedef std::vector<Pool> Pools;
#endif /* XMRIG_POOL_H */

32
src/base/net/Pools.cpp Normal file
View file

@ -0,0 +1,32 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* 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 2018-2019 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "base/net/Pools.h"
xmrig::Pools::Pools()
{
}

51
src/base/net/Pools.h Normal file
View file

@ -0,0 +1,51 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* 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 2018-2019 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_POOLS_H
#define XMRIG_POOLS_H
#include <vector>
#include "base/net/Pool.h"
namespace xmrig {
class Pools
{
public:
Pools();
private:
std::vector<Pool> m_data;
};
} /* namespace xmrig */
#endif /* XMRIG_POOLS_H */

View file

@ -109,19 +109,19 @@ void xmrig::CommonConfig::printPools()
{
for (size_t i = 0; i < m_activePools.size(); ++i) {
if (!isColors()) {
Log::i()->text(" * POOL #%-7zu%s variant=%s, TLS=%d",
Log::i()->text(" * POOL #%-7zu%s algo=%s, TLS=%d",
i + 1,
m_activePools[i].url(),
m_activePools[i].algorithm().variantName(),
m_activePools[i].algorithm().shortName(),
static_cast<int>(m_activePools[i].isTLS())
);
}
else {
Log::i()->text(GREEN_BOLD(" * ") WHITE_BOLD("POOL #%-7zu") "\x1B[1;%dm%s\x1B[0m variant " WHITE_BOLD("%s"),
Log::i()->text(GREEN_BOLD(" * ") WHITE_BOLD("POOL #%-7zu") "\x1B[1;%dm%s\x1B[0m algo " WHITE_BOLD("%s"),
i + 1,
m_activePools[i].isTLS() ? 32 : 36,
m_activePools[i].url(),
m_activePools[i].algorithm().variantName()
m_activePools[i].algorithm().shortName()
);
}
}

View file

@ -26,12 +26,9 @@
#define XMRIG_COMMONCONFIG_H
#include <vector>
#include "base/net/Pools.h"
#include "base/tools/String.h"
#include "common/interfaces/IConfig.h"
#include "common/net/Pool.h"
#include "common/xmrig.h"

View file

@ -45,12 +45,12 @@
#include "common/config/ConfigLoader.h"
#include "common/config/ConfigWatcher.h"
#include "common/interfaces/IConfig.h"
#include "common/net/Pool.h"
#include "common/Platform.h"
#include "core/ConfigCreator.h"
#include "core/ConfigLoader_platform.h"
#include "rapidjson/document.h"
#include "rapidjson/error/en.h"
#include "rapidjson/fwd.h"
xmrig::ConfigWatcher *xmrig::ConfigLoader::m_watcher = nullptr;

View file

@ -30,10 +30,10 @@
#include <vector>
#include "base/net/Pool.h"
#include "common/crypto/Algorithm.h"
#include "common/net/Id.h"
#include "common/net/Job.h"
#include "common/net/Pool.h"
#include "common/net/Storage.h"
#include "common/net/SubmitResult.h"
#include "rapidjson/fwd.h"

View file

@ -29,9 +29,9 @@
#include <vector>
#include "base/net/Pool.h"
#include "common/interfaces/IClientListener.h"
#include "common/interfaces/IStrategy.h"
#include "common/net/Pool.h"
class Client;

View file

@ -30,7 +30,7 @@
#include <vector>
#include "common/net/Pool.h"
#include "base/net/Pool.h"
#include "common/interfaces/IClientListener.h"
#include "common/interfaces/IStrategy.h"
#include "common/interfaces/IStrategyListener.h"

View file

@ -27,7 +27,6 @@
#include "common/cpu/Cpu.h"
#include "common/log/Log.h"
#include "common/net/Pool.h"
#include "crypto/Asm.h"
#include "Mem.h"
#include "rapidjson/document.h"