mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Refactor Ledger and LedgerEntrySet:
Member functions and free functions on Ledger and LedgerEntrySet are rewritten in terms of new abstract interfaces `BasicView` and `View`, representing the set of non-decomposable primitives necessary to read and write state map items in a ledger, and to overlay a discardable view onto a Ledger that can calculate metadata during transaction processing. const-correctness is enforced through the parameter and return types. The MetaView now supports multi-level stacking: A MetaView can be stacked on top of either a Ledger or another MetaView, up to any number of levels. The getSLEi member function is removed. The CachedView wrapper replaces it, wrapping a View such that any function called with a CachedView will go through the SLECache. * Add BasicView, View, CachedView * Rename LedgerEntrySet to MetaView * Factor out free functions * Consolidate free functions in ViewAPI * Remove unused class members and free functions
This commit is contained in:
@@ -39,7 +39,7 @@ getAccountObjects (Ledger const& ledger, AccountID const& account,
|
||||
found = true;
|
||||
}
|
||||
|
||||
auto dir = fetch(ledger, dirIndex,
|
||||
auto dir = cachedRead(ledger, dirIndex,
|
||||
getApp().getSLECache(), ltDIR_NODE);
|
||||
if (! dir)
|
||||
return false;
|
||||
@@ -62,7 +62,7 @@ getAccountObjects (Ledger const& ledger, AccountID const& account,
|
||||
|
||||
for (; iter != entries.end (); ++iter)
|
||||
{
|
||||
auto const sleNode = fetch(ledger, *iter,
|
||||
auto const sleNode = cachedRead(ledger, *iter,
|
||||
getApp().getSLECache());
|
||||
if (type == ltINVALID || sleNode->getType () == type)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ getAccountObjects (Ledger const& ledger, AccountID const& account,
|
||||
return true;
|
||||
|
||||
dirIndex = getDirNodeIndex (rootDirIndex, nodeIndex);
|
||||
dir = fetch(ledger, dirIndex,
|
||||
dir = cachedRead(ledger, dirIndex,
|
||||
getApp().getSLECache(), ltDIR_NODE);
|
||||
if (! dir)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user