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:
Nik Bougalis
2014-12-31 22:02:14 -08:00
parent e742da73bd
commit 47593730d6
43 changed files with 638 additions and 547 deletions

View File

@@ -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]