本文整理汇总了C++中ledger::ref::getSLEi方法的典型用法代码示例。如果您正苦于以下问题:C++ ref::getSLEi方法的具体用法?C++ ref::getSLEi怎么用?C++ ref::getSLEi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ledger::ref
的用法示例。
在下文中一共展示了ref::getSLEi方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillItems
void AccountItems::fillItems (const uint160& accountID, Ledger::ref ledger)
{
uint256 const rootIndex = Ledger::getOwnerDirIndex (accountID);
uint256 currentIndex = rootIndex;
// VFALCO TODO Rewrite all infinite loops to have clear terminating
// conditions defined in one location.
//
while (1)
{
SLE::pointer ownerDir = ledger->getDirNode (currentIndex);
// VFALCO TODO Rewrite to not return from the middle of the function
if (!ownerDir)
return;
BOOST_FOREACH (uint256 const & uNode, ownerDir->getFieldV256 (sfIndexes).peekValue ())
{
// VFALCO TODO rename getSLEi() to something legible.
SLE::pointer sleCur = ledger->getSLEi (uNode);
if (!sleCur)
{
// item in directory not in ledger
}
else
{
AccountItem::pointer item = mOfType->makeItem (accountID, sleCur);
// VFALCO NOTE Under what conditions would makeItem() return nullptr?
// DJS NOTE If the item wasn't one this particular AccountItems was interested in
// (For example, if the owner is only interested in ripple lines and this is an offer)
if (item)
{
mItems.push_back (item);
}
}
}
std::uint64_t uNodeNext = ownerDir->getFieldU64 (sfIndexNext);
// VFALCO TODO Rewrite to not return from the middle of the function
if (!uNodeNext)
return;
currentIndex = Ledger::getDirNodeIndex (rootIndex, uNodeNext);
}
}
示例2: fillItems
void AccountItems::fillItems (Account const& accountID, Ledger::ref ledger)
{
uint256 const rootIndex = Ledger::getOwnerDirIndex (accountID);
uint256 currentIndex = rootIndex;
// VFALCO TODO Rewrite all infinite loops to have clear terminating
// conditions defined in one location.
//
while (1)
{
SLE::pointer ownerDir = ledger->getDirNode (currentIndex);
// VFALCO TODO Rewrite to not return from the middle of the function
if (!ownerDir)
return;
for (auto const& uNode: ownerDir->getFieldV256 (sfIndexes).peekValue ())
{
// VFALCO TODO rename getSLEi() to something legible.
SLE::pointer sleCur = ledger->getSLEi (uNode);
if (sleCur)
{
// The item in the directory is in ledger
auto item = mOfType->makeItem (accountID, sleCur);
// makeItem() returns nullptr if the item wasn't one this
// particular AccountItems was interested in - for example, if
// the owner is only interested in ripple lines and this is an
// offer.
if (item)
mItems.push_back (item);
}
}
std::uint64_t uNodeNext = ownerDir->getFieldU64 (sfIndexNext);
if (!uNodeNext)
return;
currentIndex = Ledger::getDirNodeIndex (rootIndex, uNodeNext);
}
}