mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
Modernize code:
* Clean STBase-derived class creation interfaces * Annotate overriden STBase virtual functions * Optimize path deserialization * Prefer range-based for * Prefer std::unique_ptr * Remove BOOST_FOREACH
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <beast/cxx14/iterator.h> // <iterator>
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
#include <iostream>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -35,6 +37,9 @@ static const std::uint64_t tenTo14 = 100000000000000ull;
|
||||
static const std::uint64_t tenTo14m1 = tenTo14 - 1;
|
||||
static const std::uint64_t tenTo17 = tenTo14 * 1000;
|
||||
|
||||
STAmount const saZero (noIssue(), 0u);
|
||||
STAmount const saOne (noIssue(), 1u);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
STAmount::STAmount (SField::ref name, Issue const& issue,
|
||||
@@ -494,14 +499,6 @@ std::string STAmount::getHumanCurrency () const
|
||||
return to_string (mIssue.currency);
|
||||
}
|
||||
|
||||
void
|
||||
STAmount::setNValue (std::uint64_t v)
|
||||
{
|
||||
if (!mIsNative)
|
||||
throw std::runtime_error ("not native");
|
||||
mValue = v;
|
||||
}
|
||||
|
||||
void
|
||||
STAmount::setSNValue (std::int64_t v)
|
||||
{
|
||||
@@ -752,12 +749,6 @@ STAmount::isEquivalent (const STBase& t) const
|
||||
return v && (*v == *this);
|
||||
}
|
||||
|
||||
STAmount*
|
||||
STAmount::duplicate () const
|
||||
{
|
||||
return new STAmount (*this);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// amount = value * [10 ^ offset]
|
||||
|
||||
Reference in New Issue
Block a user