replace new/delete with sp

This commit is contained in:
4ertus2 2024-10-20 08:24:09 +03:00
parent e32731b60b
commit ab5be0b773
71 changed files with 271 additions and 387 deletions

View file

@ -30,7 +30,7 @@
#include "interfaces/IJobResultListener.h"
#include <vector>
#include <memory>
namespace xmrig {
@ -49,7 +49,7 @@ public:
Network(Controller *controller);
~Network() override;
inline IStrategy *strategy() const { return m_strategy; }
inline IStrategy *strategy() const { return m_strategy.get(); }
void connect();
void execCommand(char command);
@ -64,15 +64,13 @@ protected:
void onLogin(IStrategy *strategy, IClient *client, rapidjson::Document &doc, rapidjson::Value &params) override;
void onPause(IStrategy *strategy) override;
void onResultAccepted(IStrategy *strategy, IClient *client, const SubmitResult &result, const char *error) override;
void onVerifyAlgorithm(IStrategy *strategy, const IClient *client, const Algorithm &algorithm, bool *ok) override;
void onVerifyAlgorithm(IStrategy *strategy, const IClient *client, const Algorithm &algorithm, bool *ok) override;
# ifdef XMRIG_FEATURE_API
void onRequest(IApiRequest &request) override;
# endif
private:
constexpr static int kTickInterval = 1 * 1000;
void setJob(IClient *client, const Job &job, bool donate);
void tick();
@ -82,10 +80,10 @@ private:
# endif
Controller *m_controller;
IStrategy *m_donate = nullptr;
IStrategy *m_strategy = nullptr;
NetworkState *m_state = nullptr;
Timer *m_timer = nullptr;
std::shared_ptr<IStrategy> m_donate;
std::shared_ptr<IStrategy> m_strategy;
std::shared_ptr<NetworkState> m_state;
std::shared_ptr<Timer> m_timer;
};