Move network classes into xmrig namespace.

This commit is contained in:
XMRig 2019-02-17 06:59:19 +07:00
parent dbdcc14672
commit ee667144e8
42 changed files with 481 additions and 332 deletions

View file

@ -4,8 +4,9 @@
* 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 2016-2017 XMRig <support@xmrig.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
@ -21,22 +22,27 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ICLIENTLISTENER_H__
#define __ICLIENTLISTENER_H__
#ifndef XMRIG_ICLIENTLISTENER_H
#define XMRIG_ICLIENTLISTENER_H
#include <stdint.h>
class Client;
class Job;
class SubmitResult;
namespace xmrig {
class Client;
class IClientListener
{
public:
virtual ~IClientListener() {}
virtual ~IClientListener() = default;
virtual void onClose(Client *client, int failures) = 0;
virtual void onJobReceived(Client *client, const Job &job) = 0;
@ -45,4 +51,7 @@ public:
};
#endif // __ICLIENTLISTENER_H__
} /* namespace xmrig */
#endif // XMRIG_ICLIENTLISTENER_H

View file

@ -33,23 +33,27 @@ class JobResult;
namespace xmrig {
class Algorithm;
}
class Algorithm;
class IStrategy
{
public:
virtual ~IStrategy() {}
virtual ~IStrategy() = default;
virtual bool isActive() const = 0;
virtual int64_t submit(const JobResult &result) = 0;
virtual void connect() = 0;
virtual void resume() = 0;
virtual void setAlgo(const xmrig::Algorithm &algo) = 0;
virtual void setAlgo(const Algorithm &algo) = 0;
virtual void stop() = 0;
virtual void tick(uint64_t now) = 0;
};
} /* namespace xmrig */
#endif // XMRIG_ISTRATEGY_H

View file

@ -5,7 +5,8 @@
* 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-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
@ -21,13 +22,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ISTRATEGYLISTENER_H__
#define __ISTRATEGYLISTENER_H__
#ifndef XMRIG_ISTRATEGYLISTENER_H
#define XMRIG_ISTRATEGYLISTENER_H
#include <stdint.h>
namespace xmrig {
class Client;
class IStrategy;
class Job;
@ -37,7 +41,7 @@ class SubmitResult;
class IStrategyListener
{
public:
virtual ~IStrategyListener() {}
virtual ~IStrategyListener() = default;
virtual void onActive(IStrategy *strategy, Client *client) = 0;
virtual void onJob(IStrategy *strategy, Client *client, const Job &job) = 0;
@ -46,4 +50,7 @@ public:
};
#endif // __ISTRATEGYLISTENER_H__
} /* namespace xmrig */
#endif // XMRIG_ISTRATEGYLISTENER_H