Refactor View classes:

The View hierarchy of classes is reorganized to include new
classes with member functions moved and renamed, to solve
defects in the original design:

OpenView accumulates raw state and tx changes and
can be applied to the base. ApplyView accumulates changes
for a single transaction, including metadata, and can be
applied to an OpenView. The Sandbox allows changes with
the option to apply or throw them out. The PaymentSandbox
provides a sandbox with account credit deferral.

Call sites are changed to use the class appropriate for
the task.
This commit is contained in:
Vinnie Falco
2015-07-04 10:55:07 -07:00
parent f3b172b0c9
commit 367c3a5bfc
116 changed files with 4392 additions and 3565 deletions

View File

@@ -31,7 +31,7 @@ namespace ripple {
Get the correct ledger to use.
*/
RippleLineCache::pointer PathRequests::getLineCache (
std::shared_ptr <BasicView const> const& ledger, bool authoritative)
std::shared_ptr <ReadView const> const& ledger, bool authoritative)
{
ScopedLockType sl (mLock);
@@ -49,7 +49,7 @@ RippleLineCache::pointer PathRequests::getLineCache (
return mLineCache;
}
void PathRequests::updateAll (std::shared_ptr <BasicView const> const& inLedger,
void PathRequests::updateAll (std::shared_ptr <ReadView const> const& inLedger,
Job::CancelCallback shouldCancel)
{
std::vector<PathRequest::wptr> requests;
@@ -192,7 +192,7 @@ void PathRequests::insertPathRequest (PathRequest::pointer const& req)
// Make a new-style path_find request
Json::Value PathRequests::makePathRequest(
std::shared_ptr <InfoSub> const& subscriber,
std::shared_ptr<BasicView const> const& inLedger,
std::shared_ptr<ReadView const> const& inLedger,
Json::Value const& requestJson)
{
PathRequest::pointer req = std::make_shared<PathRequest> (
@@ -221,7 +221,7 @@ Json::Value PathRequests::makePathRequest(
Json::Value PathRequests::makeLegacyPathRequest(
PathRequest::pointer& req,
std::function <void (void)> completion,
std::shared_ptr<BasicView const> const& inLedger,
std::shared_ptr<ReadView const> const& inLedger,
Json::Value const& request)
{
// This assignment must take place before the