Ripple calc

* New uint160 tagged type NodeID.
* Categorize *all* non-generic instances of uint160 as Account, Currency or NodeID.
* Move conversions to and from strings to central .h file.
* Extract macro constants to be functions.
* Get rid of constructors and comparators between tagged uint types.
* New base_uint::copyFrom() allows explicit copying between any uint types
  of the same size.
* And lots of incidental cleaning and removal of unused code.
Because I wanted to make it very obvious that the copy was happening.  As
Nik pointed out, the copy can be (and will later be) removed - but if it's
a copy constructor, it'll be hard to notice...!


On Mon, Jun 23, 2014 at 9:57 AM, Vinnie Falco <notifications@github.com>
wrote:

> In src/ripple/module/app/ledger/OrderBookDB.cpp:
>
> > @@ -72,10 +71,13 @@ static void updateHelper (SLE::ref entry,
> >      if ((entry->getType () == ltDIR_NODE) && (entry->isFieldPresent (sfExchangeRate)) &&
> >              (entry->getFieldH256 (sfRootIndex) == entry->getIndex()))
> >      {
> > -        const uint160& ci = entry->getFieldH160 (sfTakerPaysCurrency);
> > -        const uint160& co = entry->getFieldH160 (sfTakerGetsCurrency);
> > -        const uint160& ii = entry->getFieldH160 (sfTakerPaysIssuer);
> > -        const uint160& io = entry->getFieldH160 (sfTakerGetsIssuer);
> > +        Currency ci, co;
> > +        ci.copyFrom (entry->getFieldH160 (sfTakerPaysCurrency));
> > +        co.copyFrom (entry->getFieldH160 (sfTakerGetsCurrency));
> > +
> > +        Account ii, io;
> > +        ii.copyFrom (entry->getFieldH160 (sfTakerPaysIssuer));
> > +        io.copyFrom (entry->getFieldH160 (sfTakerGetsIssuer));
>
> Why copyFrom and not a copy construction? e.g.
>
> Currency const ci (entry->getFieldH160(sfTakerPaysCurrency);
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ripple/rippled/pull/410/files#r14076065>.
>