This commit is contained in:
XMRig 2020-07-22 21:27:40 +07:00
parent 109c088e8a
commit 1acd88ed39
No known key found for this signature in database
GPG key ID: 446A53638BE94409
15 changed files with 135 additions and 101 deletions

View file

@ -135,6 +135,12 @@ static AlgoName const algorithm_names[] = {
} /* namespace xmrig */
xmrig::Algorithm::Algorithm(const rapidjson::Value &value) :
m_id(parse(value.GetString()))
{
}
rapidjson::Value xmrig::Algorithm::toJSON() const
{
using namespace rapidjson;
@ -143,6 +149,12 @@ rapidjson::Value xmrig::Algorithm::toJSON() const
}
rapidjson::Value xmrig::Algorithm::toJSON(rapidjson::Document &) const
{
return toJSON();
}
size_t xmrig::Algorithm::l2() const
{
# ifdef XMRIG_ALGO_RANDOMX

View file

@ -92,6 +92,7 @@ public:
inline Algorithm() = default;
inline Algorithm(const char *algo) : m_id(parse(algo)) {}
inline Algorithm(Id id) : m_id(id) {}
Algorithm(const rapidjson::Value &value);
inline bool isCN() const { auto f = family(); return f == CN || f == CN_LITE || f == CN_HEAVY || f == CN_PICO; }
inline bool isEqual(const Algorithm &other) const { return m_id == other.m_id; }
@ -108,6 +109,7 @@ public:
inline operator Algorithm::Id() const { return m_id; }
rapidjson::Value toJSON() const;
rapidjson::Value toJSON(rapidjson::Document &doc) const;
size_t l2() const;
size_t l3() const;
uint32_t maxIntensity() const;