当前位置: 首页>>代码示例>>C++>>正文


C++ pointer::visitStateItems方法代码示例

本文整理汇总了C++中ledger::pointer::visitStateItems方法的典型用法代码示例。如果您正苦于以下问题:C++ pointer::visitStateItems方法的具体用法?C++ pointer::visitStateItems怎么用?C++ pointer::visitStateItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ledger::pointer的用法示例。


在下文中一共展示了pointer::visitStateItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update

void OrderBookDB::update (Ledger::pointer ledger)
{
    boost::unordered_set< uint256 > seen;
    boost::unordered_map< currencyIssuer_t, std::vector<OrderBook::pointer> > destMap;
    boost::unordered_map< currencyIssuer_t, std::vector<OrderBook::pointer> > sourceMap;
    boost::unordered_set< currencyIssuer_t > XRPBooks;

    WriteLog (lsDEBUG, OrderBookDB) << "OrderBookDB::update>";

    // walk through the entire ledger looking for orderbook entries
    int books = 0;

    try
    {
        ledger->visitStateItems(BIND_TYPE(&updateHelper, P_1, boost::ref(seen), boost::ref(destMap),
            boost::ref(sourceMap), boost::ref(XRPBooks), boost::ref(books)));
    }
    catch (const SHAMapMissingNode&)
    {
        WriteLog (lsINFO, OrderBookDB) << "OrderBookDB::update encountered a missing node";
        ScopedLockType sl (mLock, __FILE__, __LINE__);
        mSeq = 0;
        return;
    }

    WriteLog (lsDEBUG, OrderBookDB) << "OrderBookDB::update< " << books << " books found";
    {
        ScopedLockType sl (mLock, __FILE__, __LINE__);

        mXRPBooks.swap(XRPBooks);
        mSourceMap.swap(sourceMap);
        mDestMap.swap(destMap);
    }
    getApp().getLedgerMaster().newOrderBookDB();
}
开发者ID:DaiLiRong,项目名称:rippled,代码行数:35,代码来源:OrderBookDB.cpp

示例2: update

void OrderBookDB::update (Ledger::pointer ledger)
{
    hash_set< uint256 > seen;
    OrderBookDB::IssueToOrderBook destMap;
    OrderBookDB::IssueToOrderBook sourceMap;
    hash_set< Issue > XDVBooks;

    WriteLog (lsDEBUG, OrderBookDB) << "OrderBookDB::update>";

    // walk through the entire ledger looking for orderbook entries
    int books = 0;

    try
    {
        ledger->visitStateItems(std::bind(&updateHelper, std::placeholders::_1,
                                          std::ref(seen), std::ref(destMap),
            std::ref(sourceMap), std::ref(XDVBooks), std::ref(books)));
    }
    catch (const SHAMapMissingNode&)
    {
        WriteLog (lsINFO, OrderBookDB)
            << "OrderBookDB::update encountered a missing node";
        ScopedLockType sl (mLock);
        mSeq = 0;
        return;
    }

    WriteLog (lsDEBUG, OrderBookDB)
        << "OrderBookDB::update< " << books << " books found";
    {
        ScopedLockType sl (mLock);

        mXDVBooks.swap(XDVBooks);
        mSourceMap.swap(sourceMap);
        mDestMap.swap(destMap);
    }
    getApp().getLedgerMaster().newOrderBookDB();
}
开发者ID:xdv,项目名称:divvyd,代码行数:38,代码来源:OrderBookDB.cpp


注:本文中的ledger::pointer::visitStateItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。