From 4362cb660bc72500a2f3a64849563fd30a116250 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 5 Jun 2014 10:50:08 -0700 Subject: [PATCH] Replace boost::shared_ptr with std::shared_ptr --- src/ripple/common/TaggedCache.h | 10 +- src/ripple/common/impl/TaggedCache.cpp | 4 +- src/ripple/module/app/consensus/DisputedTx.h | 2 +- .../module/app/consensus/LedgerConsensus.cpp | 56 +++--- .../module/app/consensus/LedgerConsensus.h | 2 +- src/ripple/module/app/contracts/ScriptData.h | 2 +- .../module/app/ledger/AcceptedLedger.cpp | 2 +- src/ripple/module/app/ledger/AcceptedLedger.h | 2 +- .../module/app/ledger/AcceptedLedgerTx.cpp | 4 +- .../module/app/ledger/AcceptedLedgerTx.h | 2 +- .../module/app/ledger/InboundLedger.cpp | 20 +-- src/ripple/module/app/ledger/InboundLedger.h | 12 +- .../module/app/ledger/InboundLedgers.cpp | 12 +- src/ripple/module/app/ledger/InboundLedgers.h | 6 +- src/ripple/module/app/ledger/Ledger.cpp | 62 +++---- src/ripple/module/app/ledger/Ledger.h | 6 +- .../module/app/ledger/LedgerEntrySet.cpp | 6 +- .../module/app/ledger/LedgerHistory.cpp | 4 +- src/ripple/module/app/ledger/LedgerHolder.h | 4 +- src/ripple/module/app/ledger/LedgerMaster.cpp | 2 +- src/ripple/module/app/ledger/LedgerProposal.h | 2 +- src/ripple/module/app/ledger/OrderBookDB.cpp | 6 +- src/ripple/module/app/ledger/OrderBookDB.h | 2 +- .../module/app/ledger/SerializedValidation.h | 4 +- src/ripple/module/app/main/Application.cpp | 10 +- src/ripple/module/app/main/ParameterTable.cpp | 2 +- src/ripple/module/app/main/ParameterTable.h | 6 +- src/ripple/module/app/misc/AccountItem.h | 2 +- src/ripple/module/app/misc/AccountItems.h | 2 +- src/ripple/module/app/misc/AccountState.cpp | 2 +- src/ripple/module/app/misc/AccountState.h | 2 +- .../module/app/misc/AmendmentTableImpl.cpp | 2 +- src/ripple/module/app/misc/FeeVoteImpl.cpp | 2 +- src/ripple/module/app/misc/NetworkOPs.cpp | 50 +++--- src/ripple/module/app/misc/NetworkOPs.h | 12 +- src/ripple/module/app/misc/NicknameState.h | 2 +- src/ripple/module/app/misc/OrderBook.h | 4 +- src/ripple/module/app/misc/ProofOfWork.h | 2 +- .../module/app/misc/SerializedLedger.cpp | 2 +- src/ripple/module/app/misc/SerializedLedger.h | 4 +- .../module/app/misc/SerializedTransaction.h | 4 +- src/ripple/module/app/misc/Validations.cpp | 8 +- src/ripple/module/app/paths/PathRequest.cpp | 2 +- src/ripple/module/app/paths/PathRequest.h | 14 +- src/ripple/module/app/paths/PathRequests.cpp | 10 +- src/ripple/module/app/paths/PathRequests.h | 6 +- src/ripple/module/app/paths/Pathfinder.h | 4 +- .../module/app/paths/RippleLineCache.cpp | 2 +- src/ripple/module/app/paths/RippleLineCache.h | 2 +- src/ripple/module/app/paths/RippleState.h | 2 +- src/ripple/module/app/peers/PeerSet.cpp | 10 +- src/ripple/module/app/peers/PeerSet.h | 6 +- .../module/app/shamap/FetchPackTests.cpp | 8 +- src/ripple/module/app/shamap/RadixMapTest.cpp | 6 +- src/ripple/module/app/shamap/RadixMapTest.h | 2 +- src/ripple/module/app/shamap/SHAMap.cpp | 42 ++--- src/ripple/module/app/shamap/SHAMap.h | 8 +- src/ripple/module/app/shamap/SHAMapItem.h | 4 +- src/ripple/module/app/shamap/SHAMapSync.cpp | 8 +- .../module/app/shamap/SHAMapSyncFilters.cpp | 2 +- .../module/app/shamap/SHAMapTreeNode.cpp | 12 +- src/ripple/module/app/shamap/SHAMapTreeNode.h | 4 +- src/ripple/module/app/tx/Transaction.cpp | 16 +- src/ripple/module/app/tx/Transaction.h | 4 +- .../module/app/tx/TransactionAcquire.cpp | 6 +- src/ripple/module/app/tx/TransactionAcquire.h | 6 +- src/ripple/module/app/tx/TransactionEngine.h | 2 +- .../module/app/tx/TransactionMaster.cpp | 4 +- src/ripple/module/app/tx/TransactionMeta.h | 2 +- src/ripple/module/app/tx/TxQueueEntry.h | 4 +- .../module/app/websocket/WSConnection.cpp | 2 +- .../module/app/websocket/WSConnection.h | 4 +- src/ripple/module/app/websocket/WSDoor.cpp | 6 +- .../module/app/websocket/WSServerHandler.h | 6 +- src/ripple/module/basics/log/LoggedTimings.h | 6 +- .../module/basics/system/BoostIncludes.h | 3 - src/ripple/module/core/functional/Job.cpp | 2 +- .../module/core/functional/JobQueue.cpp | 4 +- src/ripple/module/core/functional/LoadEvent.h | 2 +- .../module/core/nodestore/api/NodeObject.h | 4 +- .../core/nodestore/impl/BatchWriter.cpp | 2 +- .../module/core/nodestore/impl/NodeObject.cpp | 2 +- src/ripple/module/data/crypto/CKey.h | 2 +- src/ripple/module/data/protocol/Serializer.h | 2 +- src/ripple/module/net/basics/HTTPClient.cpp | 59 ++++--- src/ripple/module/net/basics/RPCDoor.cpp | 11 +- .../module/net/basics/impl/RPCServerImp.h | 58 +++--- src/ripple/module/net/rpc/InfoSub.cpp | 4 +- src/ripple/module/net/rpc/InfoSub.h | 12 +- src/ripple/module/net/rpc/RPCSub.cpp | 2 +- src/ripple/module/net/rpc/RPCSub.h | 2 +- src/ripple/module/overlay/api/Message.h | 7 +- src/ripple/module/overlay/api/Peer.h | 2 +- .../module/overlay/impl/OverlayImpl.cpp | 6 +- src/ripple/module/overlay/impl/OverlayImpl.h | 2 +- src/ripple/module/overlay/impl/PeerImp.h | 167 +++++++++--------- .../module/rpc/handlers/RipplePathFind.cpp | 4 +- src/ripple/module/rpc/handlers/Submit.cpp | 4 +- src/ripple/module/rpc/handlers/Subscribe.cpp | 2 +- .../module/rpc/impl/TransactionSign.cpp | 8 +- .../module/websocket/autosocket/AutoSocket.h | 6 +- src/ripple/testoverlay/impl/TestOverlay.cpp | 4 - src/websocket/src/roles/server.hpp | 2 + 103 files changed, 477 insertions(+), 482 deletions(-) diff --git a/src/ripple/common/TaggedCache.h b/src/ripple/common/TaggedCache.h index 8cdd7b108..e2e1ff0e5 100644 --- a/src/ripple/common/TaggedCache.h +++ b/src/ripple/common/TaggedCache.h @@ -68,8 +68,8 @@ public: typedef Key key_type; typedef T mapped_type; // VFALCO TODO Use std::shared_ptr, std::weak_ptr - typedef boost::weak_ptr weak_mapped_ptr; - typedef boost::shared_ptr mapped_ptr; + typedef std::weak_ptr weak_mapped_ptr; + typedef std::shared_ptr mapped_ptr; typedef beast::abstract_clock clock_type; public: @@ -294,7 +294,7 @@ public: @return `true` If the key already existed. */ - bool canonicalize (const key_type& key, boost::shared_ptr& data, bool replace = false) + bool canonicalize (const key_type& key, std::shared_ptr& data, bool replace = false) { // Return canonical value, store if needed, refresh in cache // Return values: true=we had the data already @@ -353,7 +353,7 @@ public: return false; } - boost::shared_ptr fetch (const key_type& key) + std::shared_ptr fetch (const key_type& key) { // fetch us a shared pointer to the stored data object lock_guard lock (m_mutex); @@ -395,7 +395,7 @@ public: */ bool insert (key_type const& key, T const& value) { - mapped_ptr p (boost::make_shared ( + mapped_ptr p (std::make_shared ( std::cref (value))); return canonicalize (key, p); } diff --git a/src/ripple/common/impl/TaggedCache.cpp b/src/ripple/common/impl/TaggedCache.cpp index 6fccc5dc8..a2f00ea45 100644 --- a/src/ripple/common/impl/TaggedCache.cpp +++ b/src/ripple/common/impl/TaggedCache.cpp @@ -99,7 +99,7 @@ public: { Cache::mapped_ptr const p1 (c.fetch (3)); - Cache::mapped_ptr p2 (boost::make_shared ("three")); + Cache::mapped_ptr p2 (std::make_shared ("three")); c.canonicalize (3, p2); expect (p1.get() == p2.get()); } @@ -130,7 +130,7 @@ public: expect (c.getCacheSize() == 0); expect (c.getTrackSize() == 1); // Canonicalize a new object with the same key - Cache::mapped_ptr p2 (boost::make_shared ("four")); + Cache::mapped_ptr p2 (std::make_shared ("four")); expect (c.canonicalize (4, p2, false)); expect (c.getCacheSize() == 1); expect (c.getTrackSize() == 1); diff --git a/src/ripple/module/app/consensus/DisputedTx.h b/src/ripple/module/app/consensus/DisputedTx.h index 9d6c5ca46..35c9de5e3 100644 --- a/src/ripple/module/app/consensus/DisputedTx.h +++ b/src/ripple/module/app/consensus/DisputedTx.h @@ -33,7 +33,7 @@ namespace ripple { class DisputedTx { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; DisputedTx (uint256 const& txID, Blob const& tx, diff --git a/src/ripple/module/app/consensus/LedgerConsensus.cpp b/src/ripple/module/app/consensus/LedgerConsensus.cpp index a1c3df1c3..8313f87a0 100644 --- a/src/ripple/module/app/consensus/LedgerConsensus.cpp +++ b/src/ripple/module/app/consensus/LedgerConsensus.cpp @@ -27,7 +27,7 @@ SETUP_LOG (LedgerConsensus) class LedgerConsensusImp : public LedgerConsensus - , public boost::enable_shared_from_this + , public std::enable_shared_from_this , public CountedObject { public: @@ -273,13 +273,13 @@ public: { if (hash.isZero ()) { - SHAMap::pointer empty = boost::make_shared ( + SHAMap::pointer empty = std::make_shared ( smtTRANSACTION, std::ref (getApp().getFullBelowCache())); mapComplete (hash, empty, false); return empty; } - acquiring = boost::make_shared (hash, std::ref (m_clock)); + acquiring = std::make_shared (hash, std::ref (m_clock)); startAcquiring (acquiring); } } @@ -780,8 +780,8 @@ public: if (status != protocol::tsHAVE) // Indirect requests for future support return true; - std::vector< boost::weak_ptr >& set = mPeerData[hashSet]; - for (boost::weak_ptr& iit : set) + std::vector< std::weak_ptr >& set = mPeerData[hashSet]; + for (std::weak_ptr& iit : set) if (iit.lock () == peer) return false; set.push_back (peer); @@ -874,7 +874,7 @@ private: CanonicalTXSet failedTransactions (set->getHash ()); Ledger::pointer newLCL - = boost::make_shared (false + = std::make_shared (false , boost::ref (*mPreviousLedger)); // Set up to write SHAMap changes to our database, @@ -887,9 +887,9 @@ private: applyTransactions (set, newLCL, newLCL, failedTransactions, false); newLCL->updateSkipList (); newLCL->setClosed (); - boost::shared_ptr acctNodes + std::shared_ptr acctNodes = newLCL->peekAccountStateMap ()->disarmDirty (); - boost::shared_ptr txnNodes + std::shared_ptr txnNodes = newLCL->peekTransactionMap ()->disarmDirty (); // write out dirty nodes (temporarily done here) @@ -932,7 +932,7 @@ private: { uint256 signingHash; SerializedValidation::pointer v = - boost::make_shared + std::make_shared (newLCLHash, getApp().getOPs ().getValidationTimeNC () , mValPublic, mProposing); v->setFieldU32 (sfLedgerSequence, newLCL->getLedgerSeq ()); @@ -955,7 +955,7 @@ private: protocol::TMValidation val; val.set_validation (&validation[0], validation.size ()); getApp ().overlay ().foreach (send_always ( - boost::make_shared ( + std::make_shared ( val, protocol::mtVALIDATION))); WriteLog (lsINFO, LedgerConsensus) << "CNF Val " << newLCLHash; @@ -967,7 +967,7 @@ private: // See if we can accept a ledger as fully-validated getApp().getLedgerMaster().consensusBuilt (newLCL); - Ledger::pointer newOL = boost::make_shared + Ledger::pointer newOL = std::make_shared (true, boost::ref (*newLCL)); LedgerMaster::ScopedLockType sl (getApp().getLedgerMaster ().peekMutex ()); @@ -986,7 +986,7 @@ private: << " not get in"; SerializerIterator sit (it.second->peekTransaction ()); SerializedTransaction::pointer txn - = boost::make_shared + = std::make_shared (boost::ref (sit)); if (applyTransaction (engine, txn, newOL, true, false)) @@ -1062,8 +1062,8 @@ private: if (it != mPeerData.end ()) { // Add any peers we already know have his transaction set - std::vector< boost::weak_ptr >& peerList = it->second; - std::vector< boost::weak_ptr >::iterator pit + std::vector< std::weak_ptr >& peerList = it->second; + std::vector< std::weak_ptr >::iterator pit = peerList.begin (); while (pit != peerList.end ()) @@ -1168,7 +1168,7 @@ private: assert (false); // We don't have our own position? } - DisputedTx::pointer txn = boost::make_shared + DisputedTx::pointer txn = std::make_shared (txID, tx, ourVote); mDisputes[txID] = txn; @@ -1190,7 +1190,7 @@ private: msg.set_status (protocol::tsNEW); msg.set_receivetimestamp (getApp().getOPs ().getNetworkTimeNC ()); getApp ().overlay ().foreach (send_always ( - boost::make_shared ( + std::make_shared ( msg, protocol::mtTRANSACTION))); } } @@ -1230,7 +1230,7 @@ private: prop.set_nodepubkey (&pubKey[0], pubKey.size ()); prop.set_signature (&sig[0], sig.size ()); getApp ().overlay ().foreach (send_always ( - boost::make_shared ( + std::make_shared ( prop, protocol::mtPROPOSE_LEDGER))); } @@ -1243,7 +1243,7 @@ private: msg.set_hash (hash.begin (), 256 / 8); msg.set_status (direct ? protocol::tsHAVE : protocol::tsCAN_GET); getApp ().overlay ().foreach (send_always ( - boost::make_shared ( + std::make_shared ( msg, protocol::mtHAVE_SET))); } @@ -1268,7 +1268,7 @@ private: #endif SerializerIterator sit (item->peekSerializer ()); SerializedTransaction::pointer txn - = boost::make_shared + = std::make_shared (boost::ref (sit)); if (applyTransaction (engine, txn, @@ -1448,7 +1448,7 @@ private: s.set_firstseq (uMin); s.set_lastseq (uMax); getApp ().overlay ().foreach (send_always ( - boost::make_shared ( + std::make_shared ( s, protocol::mtSTATUS_CHANGE))); WriteLog (lsTRACE, LedgerConsensus) << "send status change to peer"; } @@ -1482,7 +1482,7 @@ private: if (mValidating) { - mOurPosition = boost::make_shared + mOurPosition = std::make_shared (mValPublic, mValPrivate , initialLedger.getParentHash () , txSet, mCloseTime); @@ -1490,7 +1490,7 @@ private: else { mOurPosition - = boost::make_shared + = std::make_shared (initialLedger.getParentHash (), txSet, mCloseTime); } @@ -1743,7 +1743,7 @@ private: nodepubkey signature getApp ().overlay ().foreach (send_if_not ( - boost::make_shared ( + std::make_shared ( set, protocol::mtPROPOSE_LEDGER), peer_in_set(peers))); } @@ -1795,7 +1795,7 @@ private: uint256 signingHash; SerializedValidation::pointer v - = boost::make_shared + = std::make_shared (mPreviousLedger->getHash () , getApp().getOPs ().getValidationTimeNC (), mValPublic, false); addLoad(v); @@ -1809,7 +1809,7 @@ private: val.set_validation (&validation[0], validation.size ()); #if 0 getApp ().overlay ().visit (RelayMessage ( - boost::make_shared ( + std::make_shared ( val, protocol::mtVALIDATION))); #endif getApp().getOPs ().setLastValidation (v); @@ -1899,7 +1899,7 @@ private: // Peer sets ripple::unordered_map > > mPeerData; + , std::vector< std::weak_ptr > > mPeerData; // Disputed transactions ripple::unordered_map mDisputes; @@ -1918,12 +1918,12 @@ LedgerConsensus::~LedgerConsensus () { } -boost::shared_ptr +std::shared_ptr make_LedgerConsensus (LedgerConsensus::clock_type& clock, LocalTxs& localtx, LedgerHash const &prevLCLHash, Ledger::ref previousLedger, std::uint32_t closeTime, FeeVote& feeVote) { - return boost::make_shared (clock, localtx, + return std::make_shared (clock, localtx, prevLCLHash, previousLedger, closeTime, feeVote); } diff --git a/src/ripple/module/app/consensus/LedgerConsensus.h b/src/ripple/module/app/consensus/LedgerConsensus.h index ee61e9b0e..213cd643d 100644 --- a/src/ripple/module/app/consensus/LedgerConsensus.h +++ b/src/ripple/module/app/consensus/LedgerConsensus.h @@ -80,7 +80,7 @@ public: virtual void simulate () = 0; }; -boost::shared_ptr +std::shared_ptr make_LedgerConsensus (LedgerConsensus::clock_type& clock, LocalTxs& localtx, LedgerHash const & prevLCLHash, Ledger::ref previousLedger, std::uint32_t closeTime, FeeVote& feeVote); diff --git a/src/ripple/module/app/contracts/ScriptData.h b/src/ripple/module/app/contracts/ScriptData.h index 703afe361..0fbd6cd65 100644 --- a/src/ripple/module/app/contracts/ScriptData.h +++ b/src/ripple/module/app/contracts/ScriptData.h @@ -27,7 +27,7 @@ namespace Script class Data { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; virtual ~Data () { diff --git a/src/ripple/module/app/ledger/AcceptedLedger.cpp b/src/ripple/module/app/ledger/AcceptedLedger.cpp index 51563383d..65d0cf0a7 100644 --- a/src/ripple/module/app/ledger/AcceptedLedger.cpp +++ b/src/ripple/module/app/ledger/AcceptedLedger.cpp @@ -33,7 +33,7 @@ AcceptedLedger::AcceptedLedger (Ledger::ref ledger) : mLedger (ledger) for (SHAMapItem::pointer item = txSet.peekFirstItem (); !!item; item = txSet.peekNextItem (item->getTag ())) { SerializerIterator sit (item->peekSerializer ()); - insert (boost::make_shared (ledger->getLedgerSeq (), boost::ref (sit))); + insert (std::make_shared (ledger->getLedgerSeq (), boost::ref (sit))); } } diff --git a/src/ripple/module/app/ledger/AcceptedLedger.h b/src/ripple/module/app/ledger/AcceptedLedger.h index ac526ea0d..25bf4638f 100644 --- a/src/ripple/module/app/ledger/AcceptedLedger.h +++ b/src/ripple/module/app/ledger/AcceptedLedger.h @@ -41,7 +41,7 @@ namespace ripple { class AcceptedLedger { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef const pointer& ret; typedef std::map map_t; // Must be an ordered map! typedef map_t::value_type value_type; diff --git a/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp b/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp index a83de3dde..2118612c0 100644 --- a/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp +++ b/src/ripple/module/app/ledger/AcceptedLedgerTx.cpp @@ -24,9 +24,9 @@ AcceptedLedgerTx::AcceptedLedgerTx (std::uint32_t seq, SerializerIterator& sit) Serializer txnSer (sit.getVL ()); SerializerIterator txnIt (txnSer); - mTxn = boost::make_shared (boost::ref (txnIt)); + mTxn = std::make_shared (boost::ref (txnIt)); mRawMeta = sit.getVL (); - mMeta = boost::make_shared (mTxn->getTransactionID (), seq, mRawMeta); + mMeta = std::make_shared (mTxn->getTransactionID (), seq, mRawMeta); mAffected = mMeta->getAffectedAccounts (); mResult = mMeta->getResultTER (); buildJson (); diff --git a/src/ripple/module/app/ledger/AcceptedLedgerTx.h b/src/ripple/module/app/ledger/AcceptedLedgerTx.h index 80c1f6885..87f8036a2 100644 --- a/src/ripple/module/app/ledger/AcceptedLedgerTx.h +++ b/src/ripple/module/app/ledger/AcceptedLedgerTx.h @@ -44,7 +44,7 @@ namespace ripple { class AcceptedLedgerTx { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef const pointer& ref; public: diff --git a/src/ripple/module/app/ledger/InboundLedger.cpp b/src/ripple/module/app/ledger/InboundLedger.cpp index 6ca5657be..8bf641910 100644 --- a/src/ripple/module/app/ledger/InboundLedger.cpp +++ b/src/ripple/module/app/ledger/InboundLedger.cpp @@ -129,13 +129,13 @@ bool InboundLedger::tryLocal () if (m_journal.trace) m_journal.trace << "Ledger base found in fetch pack"; - mLedger = boost::make_shared (data, true); + mLedger = std::make_shared (data, true); getApp().getNodeStore ().store (hotLEDGER, mLedger->getLedgerSeq (), std::move (data), mHash); } else { - mLedger = boost::make_shared ( + mLedger = std::make_shared ( strCopy (node->getData ()), true); } @@ -340,9 +340,9 @@ void InboundLedger::addPeers () } } -boost::weak_ptr InboundLedger::pmDowncast () +std::weak_ptr InboundLedger::pmDowncast () { - return boost::dynamic_pointer_cast (shared_from_this ()); + return std::dynamic_pointer_cast (shared_from_this ()); } /** Dispatch acquire completion @@ -487,7 +487,7 @@ void InboundLedger::trigger (Peer::ptr const& peer) } } - Message::pointer packet (boost::make_shared ( + Message::pointer packet (std::make_shared ( tmBH, protocol::mtGET_OBJECTS)); { ScopedLockType sl (mLock); @@ -778,7 +778,7 @@ bool InboundLedger::takeBase (const std::string& data) if (mComplete || mFailed || mHaveBase) return true; - mLedger = boost::make_shared (data, false); + mLedger = std::make_shared (data, false); if (mLedger->getHash () != mHash) { @@ -1040,8 +1040,8 @@ std::vector InboundLedger::getNeededHashes () Returns 'true' if we need to dispatch */ // VFALCO TODO Why isn't the shared_ptr passed by const& ? -bool InboundLedger::gotData (boost::weak_ptr peer, - boost::shared_ptr data) +bool InboundLedger::gotData (std::weak_ptr peer, + std::shared_ptr data) { ScopedLockType sl (mReceivedDataLock); @@ -1062,7 +1062,7 @@ bool InboundLedger::gotData (boost::weak_ptr peer, // // TODO Change peer to Consumer // -int InboundLedger::processData (boost::shared_ptr peer, +int InboundLedger::processData (std::shared_ptr peer, protocol::TMLedgerData& packet) { ScopedLockType sl (mLock); @@ -1180,7 +1180,7 @@ int InboundLedger::processData (boost::shared_ptr peer, */ void InboundLedger::runData () { - boost::shared_ptr chosenPeer; + std::shared_ptr chosenPeer; int chosenPeerCount = -1; std::vector data; diff --git a/src/ripple/module/app/ledger/InboundLedger.h b/src/ripple/module/app/ledger/InboundLedger.h index f278140a6..8f10325b4 100644 --- a/src/ripple/module/app/ledger/InboundLedger.h +++ b/src/ripple/module/app/ledger/InboundLedger.h @@ -26,14 +26,14 @@ namespace ripple { // A ledger we are trying to acquire class InboundLedger : public PeerSet - , public boost::enable_shared_from_this + , public std::enable_shared_from_this , public CountedObject { public: static char const* getCountedObjectName () { return "InboundLedger"; } - typedef boost::shared_ptr pointer; - typedef std::pair < boost::weak_ptr, boost::shared_ptr > PeerDataPairType; + typedef std::shared_ptr pointer; + typedef std::pair < std::weak_ptr, std::shared_ptr > PeerDataPairType; // These are the reasons we might acquire a ledger enum fcReason @@ -88,7 +88,7 @@ public: bool checkLocal (); void init (ScopedLockType& collectionLock); - bool gotData (boost::weak_ptr, boost::shared_ptr); + bool gotData (std::weak_ptr, std::shared_ptr); typedef std::pair neededHash_t; @@ -111,9 +111,9 @@ private: trigger (peer); } - boost::weak_ptr pmDowncast (); + std::weak_ptr pmDowncast (); - int processData (boost::shared_ptr peer, protocol::TMLedgerData& data); + int processData (std::shared_ptr peer, protocol::TMLedgerData& data); bool takeBase (const std::string& data); bool takeTxNode (const std::list& IDs, const std::list& data, diff --git a/src/ripple/module/app/ledger/InboundLedgers.cpp b/src/ripple/module/app/ledger/InboundLedgers.cpp index eb714db2f..36a3d49bb 100644 --- a/src/ripple/module/app/ledger/InboundLedgers.cpp +++ b/src/ripple/module/app/ledger/InboundLedgers.cpp @@ -90,7 +90,7 @@ public: } else { - ret = boost::make_shared (hash, seq, reason, std::ref (m_clock)); + ret = std::make_shared (hash, seq, reason, std::ref (m_clock)); assert (ret); mLedgers.insert (std::make_pair (hash, ret)); ret->init (sl); @@ -154,8 +154,8 @@ public: /** We received a TMLedgerData from a peer. */ bool gotLedgerData (LedgerHash const& hash, - boost::shared_ptr peer, - boost::shared_ptr packet_ptr) + std::shared_ptr peer, + std::shared_ptr packet_ptr) { protocol::TMLedgerData& packet = *packet_ptr; @@ -178,7 +178,7 @@ public: } // Stash the data for later processing and see if we need to dispatch - if (ledger->gotData(boost::weak_ptr(peer), packet_ptr)) + if (ledger->gotData(std::weak_ptr(peer), packet_ptr)) getApp().getJobQueue().addJob (jtLEDGER_DATA, "processLedgerData", std::bind (&InboundLedgers::doLedgerData, this, std::placeholders::_1, hash)); @@ -236,7 +236,7 @@ public: Since we paid the price to receive it, we might as well stash it in case we need it. Nodes are received in wire format and must be stashed/hashed in prefix format */ - void gotStaleData (boost::shared_ptr packet_ptr) + void gotStaleData (std::shared_ptr packet_ptr) { const uint256 uZero; try @@ -255,7 +255,7 @@ public: 0, snfWIRE, uZero, false); newNode.addRaw(s, snfPREFIX); - boost::shared_ptr blob = boost::make_shared (s.begin(), s.end()); + std::shared_ptr blob = std::make_shared (s.begin(), s.end()); getApp().getOPs().addFetchPack (newNode.getNodeHash(), blob); } diff --git a/src/ripple/module/app/ledger/InboundLedgers.h b/src/ripple/module/app/ledger/InboundLedgers.h index e72415021..b37188cf5 100644 --- a/src/ripple/module/app/ledger/InboundLedgers.h +++ b/src/ripple/module/app/ledger/InboundLedgers.h @@ -55,13 +55,13 @@ public: // VFALCO TODO Remove the dependency on the Peer object. // virtual bool gotLedgerData (LedgerHash const& ledgerHash, - boost::shared_ptr, - boost::shared_ptr ) = 0; + std::shared_ptr, + std::shared_ptr ) = 0; virtual void doLedgerData (Job&, LedgerHash hash) = 0; virtual void gotStaleData ( - boost::shared_ptr packet) = 0; + std::shared_ptr packet) = 0; virtual int getFetchCount (int& timeoutCount) = 0; diff --git a/src/ripple/module/app/ledger/Ledger.cpp b/src/ripple/module/app/ledger/Ledger.cpp index 4d28f50f1..890a8351c 100644 --- a/src/ripple/module/app/ledger/Ledger.cpp +++ b/src/ripple/module/app/ledger/Ledger.cpp @@ -41,13 +41,13 @@ Ledger::Ledger (const RippleAddress& masterID, std::uint64_t startAmount) , mValidHash (false) , mAccepted (false) , mImmutable (false) - , mTransactionMap (boost::make_shared (smtTRANSACTION, + , mTransactionMap (std::make_shared (smtTRANSACTION, std::ref (getApp().getFullBelowCache()))) - , mAccountStateMap (boost::make_shared (smtSTATE, + , mAccountStateMap (std::make_shared (smtSTATE, std::ref (getApp().getFullBelowCache()))) { // special case: put coins in root account - AccountState::pointer startAccount = boost::make_shared (masterID); + AccountState::pointer startAccount = std::make_shared (masterID); startAccount->peekSLE ().setFieldAmount (sfBalance, startAmount); @@ -89,9 +89,9 @@ Ledger::Ledger (uint256 const& parentHash, , mValidHash (false) , mAccepted (false) , mImmutable (true) - , mTransactionMap (boost::make_shared ( + , mTransactionMap (std::make_shared ( smtTRANSACTION, transHash, std::ref (getApp().getFullBelowCache()))) - , mAccountStateMap (boost::make_shared (smtSTATE, accountHash, + , mAccountStateMap (std::make_shared (smtSTATE, accountHash, std::ref (getApp().getFullBelowCache()))) { updateHash (); @@ -150,7 +150,7 @@ Ledger::Ledger (bool /* dummy */, , mValidHash (false) , mAccepted (false) , mImmutable (false) - , mTransactionMap (boost::make_shared (smtTRANSACTION, + , mTransactionMap (std::make_shared (smtTRANSACTION, std::ref (getApp().getFullBelowCache()))) , mAccountStateMap (prevLedger.mAccountStateMap->snapShot (true)) { @@ -217,9 +217,9 @@ Ledger::Ledger (std::uint32_t ledgerSeq, std::uint32_t closeTime) mValidHash (false), mAccepted (false), mImmutable (false), - mTransactionMap (boost::make_shared ( + mTransactionMap (std::make_shared ( smtTRANSACTION, std::ref (getApp().getFullBelowCache()))), - mAccountStateMap (boost::make_shared ( + mAccountStateMap (std::make_shared ( smtSTATE, std::ref (getApp().getFullBelowCache()))) { initializeFees (); @@ -300,9 +300,9 @@ void Ledger::setRaw (Serializer& s, bool hasPrefix) if (mValidHash) { - mTransactionMap = boost::make_shared (smtTRANSACTION, mTransHash, + mTransactionMap = std::make_shared (smtTRANSACTION, mTransHash, std::ref (getApp().getFullBelowCache())); - mAccountStateMap = boost::make_shared (smtSTATE, mAccountHash, + mAccountStateMap = std::make_shared (smtSTATE, mAccountHash, std::ref (getApp().getFullBelowCache())); } } @@ -374,7 +374,7 @@ AccountState::pointer Ledger::getAccountState (const RippleAddress& accountID) if (sle->getType () != ltACCOUNT_ROOT) return AccountState::pointer (); - return boost::make_shared (sle, accountID); + return std::make_shared (sle, accountID); } NicknameState::pointer Ledger::getNicknameState (uint256 const& uNickname) @@ -387,17 +387,17 @@ NicknameState::pointer Ledger::getNicknameState (uint256 const& uNickname) } SerializedLedgerEntry::pointer sle = - boost::make_shared (item->peekSerializer (), item->getTag ()); + std::make_shared (item->peekSerializer (), item->getTag ()); if (sle->getType () != ltNICKNAME) return NicknameState::pointer (); - return boost::make_shared (sle); + return std::make_shared (sle); } bool Ledger::addTransaction (uint256 const& txID, const Serializer& txn) { // low-level - just add to table - SHAMapItem::pointer item = boost::make_shared (txID, txn.peekData ()); + SHAMapItem::pointer item = std::make_shared (txID, txn.peekData ()); if (!mTransactionMap->addGiveItem (item, true, false)) { @@ -415,7 +415,7 @@ bool Ledger::addTransaction (uint256 const& txID, const Serializer& txn, const S Serializer s (txn.getDataLength () + md.getDataLength () + 16); s.addVL (txn.peekData ()); s.addVL (md.peekData ()); - SHAMapItem::pointer item = boost::make_shared (txID, s.peekData ()); + SHAMapItem::pointer item = std::make_shared (txID, s.peekData ()); if (!mTransactionMap->addGiveItem (item, true, true)) { @@ -469,12 +469,12 @@ SerializedTransaction::pointer Ledger::getSTransaction (SHAMapItem::ref item, SH SerializerIterator sit (item->peekSerializer ()); if (type == SHAMapTreeNode::tnTRANSACTION_NM) - return boost::make_shared (boost::ref (sit)); + return std::make_shared (boost::ref (sit)); else if (type == SHAMapTreeNode::tnTRANSACTION_MD) { Serializer sTxn (sit.getVL ()); SerializerIterator tSit (sTxn); - return boost::make_shared (boost::ref (tSit)); + return std::make_shared (boost::ref (tSit)); } return SerializedTransaction::pointer (); @@ -488,15 +488,15 @@ SerializedTransaction::pointer Ledger::getSMTransaction (SHAMapItem::ref item, S if (type == SHAMapTreeNode::tnTRANSACTION_NM) { txMeta.reset (); - return boost::make_shared (boost::ref (sit)); + return std::make_shared (boost::ref (sit)); } else if (type == SHAMapTreeNode::tnTRANSACTION_MD) { Serializer sTxn (sit.getVL ()); SerializerIterator tSit (sTxn); - txMeta = boost::make_shared (item->getTag (), mLedgerSeq, sit.getVL ()); - return boost::make_shared (boost::ref (tSit)); + txMeta = std::make_shared (item->getTag (), mLedgerSeq, sit.getVL ()); + return std::make_shared (boost::ref (tSit)); } txMeta.reset (); @@ -531,7 +531,7 @@ bool Ledger::getTransaction (uint256 const& txID, Transaction::pointer& txn, Tra else it.getVL (); // skip transaction - meta = boost::make_shared (txID, mLedgerSeq, it.getVL ()); + meta = std::make_shared (txID, mLedgerSeq, it.getVL ()); } else return false; @@ -556,7 +556,7 @@ bool Ledger::getTransactionMeta (uint256 const& txID, TransactionMetaSet::pointe SerializerIterator it (item->peekSerializer ()); it.getVL (); // skip transaction - meta = boost::make_shared (txID, mLedgerSeq, it.getVL ()); + meta = std::make_shared (txID, mLedgerSeq, it.getVL ()); return true; } @@ -1209,7 +1209,7 @@ LedgerStateParms Ledger::writeBack (LedgerStateParms parms, SLE::ref entry) create = true; } - SHAMapItem::pointer item = boost::make_shared (entry->getIndex ()); + SHAMapItem::pointer item = std::make_shared (entry->getIndex ()); entry->add (item->peekSerializer ()); if (create) @@ -1241,7 +1241,7 @@ SLE::pointer Ledger::getSLE (uint256 const& uHash) if (!node) return SLE::pointer (); - return boost::make_shared (node->peekSerializer (), node->getTag ()); + return std::make_shared (node->peekSerializer (), node->getTag ()); } SLE::pointer Ledger::getSLEi (uint256 const& uId) @@ -1257,7 +1257,7 @@ SLE::pointer Ledger::getSLEi (uint256 const& uId) if (!ret) { - ret = boost::make_shared (node->peekSerializer (), node->getTag ()); + ret = std::make_shared (node->peekSerializer (), node->getTag ()); ret->setImmutable (); getApp().getSLECache ().canonicalize (hash, ret); } @@ -1295,7 +1295,7 @@ void Ledger::visitAccountItems (const uint160& accountID, std::function& function, SHAMapItem::ref item) { - function (boost::make_shared (item->peekSerializer (), item->getTag ())); + function (std::make_shared (item->peekSerializer (), item->getTag ())); } void Ledger::visitStateItems (std::function function) @@ -1353,7 +1353,7 @@ private: SerializedLedgerEntry::pointer m_currentEntry; } -// typedef const boost::shared_ptr& ref; +// typedef const std::shared_ptr& ref; */ @@ -1426,13 +1426,13 @@ SLE::pointer Ledger::getASNode (LedgerStateParms& parms, uint256 const& nodeID, } parms = parms | lepCREATED | lepOKAY; - SLE::pointer sle = boost::make_shared (let, nodeID); + SLE::pointer sle = std::make_shared (let, nodeID); return sle; } SLE::pointer sle = - boost::make_shared (account->peekSerializer (), nodeID); + std::make_shared (account->peekSerializer (), nodeID); if (sle->getType () != let) { @@ -1881,7 +1881,7 @@ void Ledger::updateSkipList () // VFALCO TODO Document this skip list concept if (!skipList) - skipList = boost::make_shared (ltLEDGER_HASHES, hash); + skipList = std::make_shared (ltLEDGER_HASHES, hash); else hashes = skipList->getFieldV256 (sfHashes).peekValue (); @@ -1905,7 +1905,7 @@ void Ledger::updateSkipList () if (!skipList) { - skipList = boost::make_shared (ltLEDGER_HASHES, hash); + skipList = std::make_shared (ltLEDGER_HASHES, hash); } else { diff --git a/src/ripple/module/app/ledger/Ledger.h b/src/ripple/module/app/ledger/Ledger.h index 671dca57b..162520076 100644 --- a/src/ripple/module/app/ledger/Ledger.h +++ b/src/ripple/module/app/ledger/Ledger.h @@ -72,7 +72,7 @@ protected: the object holds references to. */ class Ledger - : public boost::enable_shared_from_this + : public std::enable_shared_from_this , public LedgerBase , public CountedObject , public beast::Uncopyable @@ -80,8 +80,8 @@ class Ledger public: static char const* getCountedObjectName () { return "Ledger"; } - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; enum TransResult { diff --git a/src/ripple/module/app/ledger/LedgerEntrySet.cpp b/src/ripple/module/app/ledger/LedgerEntrySet.cpp index 90d4d65e0..2baf4ed1d 100644 --- a/src/ripple/module/app/ledger/LedgerEntrySet.cpp +++ b/src/ripple/module/app/ledger/LedgerEntrySet.cpp @@ -82,7 +82,7 @@ SLE::pointer LedgerEntrySet::getEntry (uint256 const& index, LedgerEntryAction& if (it->second.mSeq != mSeq) { assert (it->second.mSeq < mSeq); - it->second.mEntry = boost::make_shared (*it->second.mEntry); + it->second.mEntry = std::make_shared (*it->second.mEntry); it->second.mSeq = mSeq; } @@ -93,7 +93,7 @@ SLE::pointer LedgerEntrySet::getEntry (uint256 const& index, LedgerEntryAction& SLE::pointer LedgerEntrySet::entryCreate (LedgerEntryType letType, uint256 const& index) { assert (index.isNonZero ()); - SLE::pointer sleNew = boost::make_shared (letType, index); + SLE::pointer sleNew = std::make_shared (letType, index); entryCreate (sleNew); return sleNew; } @@ -373,7 +373,7 @@ SLE::pointer LedgerEntrySet::getForMod (uint256 const& node, Ledger::ref ledger, if (it->second.mSeq != mSeq) { - it->second.mEntry = boost::make_shared (*it->second.mEntry); + it->second.mEntry = std::make_shared (*it->second.mEntry); it->second.mSeq = mSeq; } diff --git a/src/ripple/module/app/ledger/LedgerHistory.cpp b/src/ripple/module/app/ledger/LedgerHistory.cpp index 4791d7a08..847948fbd 100644 --- a/src/ripple/module/app/ledger/LedgerHistory.cpp +++ b/src/ripple/module/app/ledger/LedgerHistory.cpp @@ -128,7 +128,7 @@ void LedgerHistory::builtLedger (Ledger::ref ledger) ConsensusValidated::ScopedLockType sl ( m_consensus_validated.peekMutex()); - auto entry = boost::make_shared>(); + auto entry = std::make_shared>(); m_consensus_validated.canonicalize(index, entry, false); if (entry->first != hash) @@ -153,7 +153,7 @@ void LedgerHistory::validatedLedger (Ledger::ref ledger) ConsensusValidated::ScopedLockType sl ( m_consensus_validated.peekMutex()); - boost::shared_ptr< std::pair< LedgerHash, LedgerHash > > entry = boost::make_shared>(); + std::shared_ptr< std::pair< LedgerHash, LedgerHash > > entry = std::make_shared>(); m_consensus_validated.canonicalize(index, entry, false); if (entry->second != hash) diff --git a/src/ripple/module/app/ledger/LedgerHolder.h b/src/ripple/module/app/ledger/LedgerHolder.h index 41c6dce2e..5699c7294 100644 --- a/src/ripple/module/app/ledger/LedgerHolder.h +++ b/src/ripple/module/app/ledger/LedgerHolder.h @@ -37,7 +37,7 @@ public: { // The held ledger must always be immutable if (ledger && !ledger->isImmutable ()) - ledger = boost::make_shared (*ledger, false); + ledger = std::make_shared (*ledger, false); { ScopedLockType sl (m_lock); @@ -58,7 +58,7 @@ public: Ledger::pointer getMutable () { Ledger::pointer ret = get (); - return ret ? boost::make_shared (*ret, true) : ret; + return ret ? std::make_shared (*ret, true) : ret; } diff --git a/src/ripple/module/app/ledger/LedgerMaster.cpp b/src/ripple/module/app/ledger/LedgerMaster.cpp index 048d83c92..672cb993f 100644 --- a/src/ripple/module/app/ledger/LedgerMaster.cpp +++ b/src/ripple/module/app/ledger/LedgerMaster.cpp @@ -547,7 +547,7 @@ public: tmBH.set_query (true); tmBH.set_type (protocol::TMGetObjectByHash::otFETCH_PACK); tmBH.set_ledgerhash (nextLedger->getHash().begin (), 32); - Message::pointer packet = boost::make_shared (tmBH, protocol::mtGET_OBJECTS); + Message::pointer packet = std::make_shared (tmBH, protocol::mtGET_OBJECTS); target->sendPacket (packet, false); WriteLog (lsTRACE, LedgerMaster) << "Requested fetch pack for " << nextLedger->getLedgerSeq() - 1; diff --git a/src/ripple/module/app/ledger/LedgerProposal.h b/src/ripple/module/app/ledger/LedgerProposal.h index 823858c31..58e215b5c 100644 --- a/src/ripple/module/app/ledger/LedgerProposal.h +++ b/src/ripple/module/app/ledger/LedgerProposal.h @@ -30,7 +30,7 @@ public: static const std::uint32_t seqLeave = 0xffffffff; // leaving the consensus process - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef const pointer& ref; // proposal from peer diff --git a/src/ripple/module/app/ledger/OrderBookDB.cpp b/src/ripple/module/app/ledger/OrderBookDB.cpp index c34afbb07..1b8f77d31 100644 --- a/src/ripple/module/app/ledger/OrderBookDB.cpp +++ b/src/ripple/module/app/ledger/OrderBookDB.cpp @@ -82,7 +82,7 @@ static void updateHelper (SLE::ref entry, if (seen.insert (index).second) { // VFALCO TODO Reduce the clunkiness of these parameter wrappers - OrderBook::pointer book = boost::make_shared (boost::cref (index), + OrderBook::pointer book = std::make_shared (boost::cref (index), boost::cref (ci), boost::cref (co), boost::cref (ii), boost::cref (io)); sourceMap[RippleAssetRef (ci, ii)].push_back (book); @@ -155,7 +155,7 @@ void OrderBookDB::addOrderBook(const uint160& ci, const uint160& co, } uint256 index = Ledger::getBookBase(ci, ii, co, io); - OrderBook::pointer book = boost::make_shared (boost::cref (index), + OrderBook::pointer book = std::make_shared (boost::cref (index), boost::cref (ci), boost::cref (co), boost::cref (ii), boost::cref (io)); mSourceMap[RippleAssetRef (ci, ii)].push_back (book); @@ -205,7 +205,7 @@ BookListeners::pointer OrderBookDB::makeBookListeners (RippleCurrency const& cur if (!ret) { - ret = boost::make_shared (); + ret = std::make_shared (); mListeners [RippleBookRef ( RippleAssetRef (currencyPays, issuerPays), diff --git a/src/ripple/module/app/ledger/OrderBookDB.h b/src/ripple/module/app/ledger/OrderBookDB.h index f05bad579..6cb74c743 100644 --- a/src/ripple/module/app/ledger/OrderBookDB.h +++ b/src/ripple/module/app/ledger/OrderBookDB.h @@ -26,7 +26,7 @@ namespace ripple { class BookListeners { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; BookListeners (); void addSubscriber (InfoSub::ref sub); diff --git a/src/ripple/module/app/ledger/SerializedValidation.h b/src/ripple/module/app/ledger/SerializedValidation.h index 5989b8faf..146e0957d 100644 --- a/src/ripple/module/app/ledger/SerializedValidation.h +++ b/src/ripple/module/app/ledger/SerializedValidation.h @@ -32,8 +32,8 @@ class SerializedValidation public: static char const* getCountedObjectName () { return "SerializedValidation"; } - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; enum { diff --git a/src/ripple/module/app/main/Application.cpp b/src/ripple/module/app/main/Application.cpp index b4ecfdfed..26c2a43f4 100644 --- a/src/ripple/module/app/main/Application.cpp +++ b/src/ripple/module/app/main/Application.cpp @@ -1126,7 +1126,7 @@ void ApplicationImp::startNewLedger () m_journal.info << "Root account: " << rootAddress.humanAccountID (); { - Ledger::pointer firstLedger = boost::make_shared (rootAddress, SYSTEM_CURRENCY_START); + Ledger::pointer firstLedger = std::make_shared (rootAddress, SYSTEM_CURRENCY_START); assert (!!firstLedger->getAccountState (rootAddress)); // TODO(david): Add any default amendments // TODO(david): Set default fee/reserve @@ -1135,10 +1135,10 @@ void ApplicationImp::startNewLedger () firstLedger->setAccepted (); m_ledgerMaster->pushLedger (firstLedger); - Ledger::pointer secondLedger = boost::make_shared (true, boost::ref (*firstLedger)); + Ledger::pointer secondLedger = std::make_shared (true, boost::ref (*firstLedger)); secondLedger->setClosed (); secondLedger->setAccepted (); - m_ledgerMaster->pushLedger (secondLedger, boost::make_shared (true, boost::ref (*secondLedger))); + m_ledgerMaster->pushLedger (secondLedger, std::make_shared (true, boost::ref (*secondLedger))); assert (!!secondLedger->getAccountState (rootAddress)); m_networkOPs->setLastCloseTime (secondLedger->getCloseTimeNC ()); } @@ -1203,7 +1203,7 @@ bool ApplicationImp::loadOldLedger ( } else { - loadLedger = boost::make_shared (seq, closeTime); + loadLedger = std::make_shared (seq, closeTime); loadLedger->setTotalCoins(totalCoins); for (Json::UInt index = 0; index < ledger.get().size(); ++index) @@ -1298,7 +1298,7 @@ bool ApplicationImp::loadOldLedger ( m_ledgerMaster->setLedgerRangePresent (loadLedger->getLedgerSeq (), loadLedger->getLedgerSeq ()); - Ledger::pointer openLedger = boost::make_shared (false, boost::ref (*loadLedger)); + Ledger::pointer openLedger = std::make_shared (false, boost::ref (*loadLedger)); m_ledgerMaster->switchLedgers (loadLedger, openLedger); m_ledgerMaster->forceValid(loadLedger); m_networkOPs->setLastCloseTime (loadLedger->getCloseTimeNC ()); diff --git a/src/ripple/module/app/main/ParameterTable.cpp b/src/ripple/module/app/main/ParameterTable.cpp index 9f3c0acae..465d56698 100644 --- a/src/ripple/module/app/main/ParameterTable.cpp +++ b/src/ripple/module/app/main/ParameterTable.cpp @@ -90,7 +90,7 @@ bool ParameterNode::addNode (const std::string& name, Parameter::ref node) if (it == mChildren.end ()) { // create a new inner node - ParameterNode::pointer node = boost::make_shared (getShared (), name.substr (0, dot)); + ParameterNode::pointer node = std::make_shared (getShared (), name.substr (0, dot)); n = dynamic_cast (node.get ()); assert (n); mChildren[name] = node; diff --git a/src/ripple/module/app/main/ParameterTable.h b/src/ripple/module/app/main/ParameterTable.h index d5de9fc54..8360e3451 100644 --- a/src/ripple/module/app/main/ParameterTable.h +++ b/src/ripple/module/app/main/ParameterTable.h @@ -22,12 +22,12 @@ namespace ripple { -class Parameter : public boost::enable_shared_from_this +class Parameter : public std::enable_shared_from_this { // abstract base class parameters are derived from public: - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; public: Parameter (Parameter::ref parent, const std::string& name) : mParent (parent), mName (name) diff --git a/src/ripple/module/app/misc/AccountItem.h b/src/ripple/module/app/misc/AccountItem.h index 7e8adafff..33c578307 100644 --- a/src/ripple/module/app/misc/AccountItem.h +++ b/src/ripple/module/app/misc/AccountItem.h @@ -38,7 +38,7 @@ namespace ripple { class AccountItem { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef const pointer& ref; public: diff --git a/src/ripple/module/app/misc/AccountItems.h b/src/ripple/module/app/misc/AccountItems.h index 4f5b183da..d63593c7b 100644 --- a/src/ripple/module/app/misc/AccountItems.h +++ b/src/ripple/module/app/misc/AccountItems.h @@ -26,7 +26,7 @@ namespace ripple { class AccountItems : beast::LeakChecked { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef std::vector Container; diff --git a/src/ripple/module/app/misc/AccountState.cpp b/src/ripple/module/app/misc/AccountState.cpp index d0b46b529..9e1c588b8 100644 --- a/src/ripple/module/app/misc/AccountState.cpp +++ b/src/ripple/module/app/misc/AccountState.cpp @@ -27,7 +27,7 @@ AccountState::AccountState (RippleAddress const& naAccountID) { mValid = true; - mLedgerEntry = boost::make_shared ( + mLedgerEntry = std::make_shared ( ltACCOUNT_ROOT, Ledger::getAccountRootIndex (naAccountID)); mLedgerEntry->setFieldAccount (sfAccount, naAccountID.getAccountID ()); diff --git a/src/ripple/module/app/misc/AccountState.h b/src/ripple/module/app/misc/AccountState.h index 7804ba6f8..cbd38140e 100644 --- a/src/ripple/module/app/misc/AccountState.h +++ b/src/ripple/module/app/misc/AccountState.h @@ -29,7 +29,7 @@ namespace ripple { class AccountState : beast::LeakChecked { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; public: // For new accounts diff --git a/src/ripple/module/app/misc/AmendmentTableImpl.cpp b/src/ripple/module/app/misc/AmendmentTableImpl.cpp index 3b8800f6b..23287a18f 100644 --- a/src/ripple/module/app/misc/AmendmentTableImpl.cpp +++ b/src/ripple/module/app/misc/AmendmentTableImpl.cpp @@ -487,7 +487,7 @@ AmendmentTableImpl::doVoting (Ledger::ref lastClosedLedger, Serializer s; trans.add (s, true); #if RIPPLE_PROPOSE_AMENDMENTS - SHAMapItem::pointer tItem = boost::make_shared (txID, s.peekData ()); + SHAMapItem::pointer tItem = std::make_shared (txID, s.peekData ()); if (!initialPosition->addGiveItem (tItem, true, false)) { if (m_journal.warning) m_journal.warning << diff --git a/src/ripple/module/app/misc/FeeVoteImpl.cpp b/src/ripple/module/app/misc/FeeVoteImpl.cpp index 2e5344fc2..a8006697b 100644 --- a/src/ripple/module/app/misc/FeeVoteImpl.cpp +++ b/src/ripple/module/app/misc/FeeVoteImpl.cpp @@ -203,7 +203,7 @@ public: Serializer s; trans.add (s, true); - SHAMapItem::pointer tItem = boost::make_shared (txID, s.peekData ()); + SHAMapItem::pointer tItem = std::make_shared (txID, s.peekData ()); if (!initialPosition->addGiveItem (tItem, true, false)) { diff --git a/src/ripple/module/app/misc/NetworkOPs.cpp b/src/ripple/module/app/misc/NetworkOPs.cpp index 412764183..2b04c1d99 100644 --- a/src/ripple/module/app/misc/NetworkOPs.cpp +++ b/src/ripple/module/app/misc/NetworkOPs.cpp @@ -232,21 +232,21 @@ public: Json::Value& jvResult); // ledger proposal/close functions - void processTrustedProposal (LedgerProposal::pointer proposal, boost::shared_ptr set, + void processTrustedProposal (LedgerProposal::pointer proposal, std::shared_ptr set, RippleAddress nodePublic, uint256 checkLedger, bool sigGood); - SHAMapAddNode gotTXData (const boost::shared_ptr& peer, uint256 const& hash, + SHAMapAddNode gotTXData (const std::shared_ptr& peer, uint256 const& hash, const std::list& nodeIDs, const std::list< Blob >& nodeData); bool recvValidation (SerializedValidation::ref val, const std::string& source); void takePosition (int seq, SHAMap::ref position); SHAMap::pointer getTXMap (uint256 const& hash); - bool hasTXSet (const boost::shared_ptr& peer, uint256 const& set, protocol::TxSetStatus status); + bool hasTXSet (const std::shared_ptr& peer, uint256 const& set, protocol::TxSetStatus status); void mapComplete (uint256 const& hash, SHAMap::ref map); bool stillNeedTXSet (uint256 const& hash); - void makeFetchPack (Job&, boost::weak_ptr peer, boost::shared_ptr request, + void makeFetchPack (Job&, std::weak_ptr peer, std::shared_ptr request, uint256 haveLedger, std::uint32_t uUptime); bool shouldFetchPack (std::uint32_t seq); void gotFetchPack (bool progress, std::uint32_t seq); - void addFetchPack (uint256 const& hash, boost::shared_ptr< Blob >& data); + void addFetchPack (uint256 const& hash, std::shared_ptr< Blob >& data); bool getFetchPack (uint256 const& hash, Blob& data); int getFetchSize (); void sweepFetchPack (); @@ -474,7 +474,7 @@ private: boost::posix_time::ptime mConnectTime; beast::DeadlineTimer m_heartbeatTimer; beast::DeadlineTimer m_clusterTimer; - boost::shared_ptr mConsensus; + std::shared_ptr mConsensus; ripple::unordered_map < uint160, std::list > mStoredProposals; @@ -628,7 +628,7 @@ void NetworkOPsImp::processClusterTimer () node.set_cost (item.balance); } getApp ().overlay ().foreach (send_if ( - boost::make_shared(cluster, protocol::mtCLUSTER), + std::make_shared(cluster, protocol::mtCLUSTER), peer_in_cluster ())); setClusterTimer (); } @@ -757,7 +757,7 @@ void NetworkOPsImp::submitTransaction (Job&, SerializedTransaction::pointer iTra iTrans->add (s); SerializerIterator sit (s); - SerializedTransaction::pointer trans = boost::make_shared (boost::ref (sit)); + SerializedTransaction::pointer trans = std::make_shared (boost::ref (sit)); uint256 suppress = trans->getTransactionID (); int flags; @@ -796,7 +796,7 @@ void NetworkOPsImp::submitTransaction (Job&, SerializedTransaction::pointer iTra getApp().getJobQueue().addJob (jtTRANSACTION, "submitTxn", std::bind (&NetworkOPsImp::processTransactionCbVoid, this, - boost::make_shared (trans, false), false, false, false, callback)); + std::make_shared (trans, false), false, false, false, callback)); } // Sterilize transaction through serialization. @@ -903,7 +903,7 @@ void NetworkOPsImp::runTransactionQueue () tx.set_status (protocol::tsCURRENT); tx.set_receivetimestamp (getNetworkTimeNC ()); // FIXME: This should be when we received it getApp ().overlay ().foreach (send_if_not ( - boost::make_shared (tx, protocol::mtTRANSACTION), + std::make_shared (tx, protocol::mtTRANSACTION), peer_in_set(peers))); } else @@ -1034,7 +1034,7 @@ Transaction::pointer NetworkOPsImp::processTransactionCb ( tx.set_status (protocol::tsCURRENT); tx.set_receivetimestamp (getNetworkTimeNC ()); // FIXME: This should be when we received it getApp ().overlay ().foreach (send_if_not ( - boost::make_shared (tx, protocol::mtTRANSACTION), + std::make_shared (tx, protocol::mtTRANSACTION), peer_in_set(peers))); } } @@ -1431,7 +1431,7 @@ void NetworkOPsImp::switchLastClosedLedger (Ledger::pointer newLedger, bool duri clearNeedNetworkLedger (); newLedger->setClosed (); - Ledger::pointer openLedger = boost::make_shared (false, boost::ref (*newLedger)); + Ledger::pointer openLedger = std::make_shared (false, boost::ref (*newLedger)); m_ledgerMaster.switchLedgers (newLedger, openLedger); protocol::TMStatusChange s; @@ -1444,7 +1444,7 @@ void NetworkOPsImp::switchLastClosedLedger (Ledger::pointer newLedger, bool duri s.set_ledgerhash (hash.begin (), hash.size ()); getApp ().overlay ().foreach (send_always ( - boost::make_shared (s, protocol::mtSTATUS_CHANGE))); + std::make_shared (s, protocol::mtSTATUS_CHANGE))); } int NetworkOPsImp::beginConsensus (uint256 const& networkClosed, Ledger::pointer closingLedger) @@ -1519,7 +1519,7 @@ uint256 NetworkOPsImp::getConsensusLCL () } void NetworkOPsImp::processTrustedProposal (LedgerProposal::pointer proposal, - boost::shared_ptr set, RippleAddress nodePublic, uint256 checkLedger, bool sigGood) + std::shared_ptr set, RippleAddress nodePublic, uint256 checkLedger, bool sigGood) { { Application::ScopedLockType lock (getApp().getMasterLock ()); @@ -1563,7 +1563,7 @@ void NetworkOPsImp::processTrustedProposal (LedgerProposal::pointer proposal, proposal->getSuppressionID (), peers, SF_RELAYED)) { getApp ().overlay ().foreach (send_if_not ( - boost::make_shared (*set, protocol::mtPROPOSE_LEDGER), + std::make_shared (*set, protocol::mtPROPOSE_LEDGER), peer_in_set(peers))); } } @@ -1611,7 +1611,7 @@ void NetworkOPsImp::takePosition (int seq, SHAMap::ref position) } // Call with the master lock for now -SHAMapAddNode NetworkOPsImp::gotTXData (const boost::shared_ptr& peer, uint256 const& hash, +SHAMapAddNode NetworkOPsImp::gotTXData (const std::shared_ptr& peer, uint256 const& hash, const std::list& nodeIDs, const std::list< Blob >& nodeData) { @@ -1624,7 +1624,7 @@ SHAMapAddNode NetworkOPsImp::gotTXData (const boost::shared_ptr& peer, uin return mConsensus->peerGaveNodes (peer, hash, nodeIDs, nodeData); } -bool NetworkOPsImp::hasTXSet (const boost::shared_ptr& peer, uint256 const& set, protocol::TxSetStatus status) +bool NetworkOPsImp::hasTXSet (const std::shared_ptr& peer, uint256 const& set, protocol::TxSetStatus status) { if (mConsensus == nullptr) { @@ -1664,7 +1664,7 @@ void NetworkOPsImp::endConsensus (bool correctLCL) } } - mConsensus = boost::shared_ptr (); + mConsensus = std::shared_ptr (); } void NetworkOPsImp::consensusViewChange () @@ -1849,7 +1849,7 @@ NetworkOPsImp::getAccountTxs (const RippleAddress& account, std::int32_t minLedg ledger->pendSaveValidated(false, false); } - TransactionMetaSet::pointer meta = boost::make_shared (txn->getID (), txn->getLedger (), rawMeta.getData ()); + TransactionMetaSet::pointer meta = std::make_shared (txn->getID (), txn->getLedger (), rawMeta.getData ()); // VFALCO NOTE Use emplace instead. ret.push_back (std::pair (txn, meta)); @@ -2011,7 +2011,7 @@ NetworkOPsImp::getTxsAccount (const RippleAddress& account, std::int32_t minLedg } --numberOfResults; - TransactionMetaSet::pointer meta = boost::make_shared (txn->getID (), txn->getLedger (), rawMeta.getData ()); + TransactionMetaSet::pointer meta = std::make_shared (txn->getID (), txn->getLedger (), rawMeta.getData ()); ret.push_back (std::pair (txn, meta)); } @@ -2523,7 +2523,7 @@ void NetworkOPsImp::pubValidatedTransaction (Ledger::ref alAccepted, const Accep void NetworkOPsImp::pubAccountTransaction (Ledger::ref lpCurrent, const AcceptedLedgerTx& alTx, bool bAccepted) { - boost::unordered_set notify; + std::unordered_set notify; int iProposed = 0; int iAccepted = 0; @@ -3191,8 +3191,8 @@ static void fpAppender (protocol::TMGetObjectByHash* reply, std::uint32_t ledger newObj.set_data (&blob[0], blob.size ()); } -void NetworkOPsImp::makeFetchPack (Job&, boost::weak_ptr wPeer, - boost::shared_ptr request, +void NetworkOPsImp::makeFetchPack (Job&, std::weak_ptr wPeer, + std::shared_ptr request, uint256 haveLedgerHash, std::uint32_t uUptime) { if (UptimeTimer::getInstance ().getElapsedSeconds () > (uUptime + 1)) @@ -3292,7 +3292,7 @@ void NetworkOPsImp::makeFetchPack (Job&, boost::weak_ptr wPeer, while (wantLedger && (UptimeTimer::getInstance ().getElapsedSeconds () <= (uUptime + 1))); m_journal.info << "Built fetch pack with " << reply.objects ().size () << " nodes"; - Message::pointer msg = boost::make_shared (reply, protocol::mtGET_OBJECTS); + Message::pointer msg = std::make_shared (reply, protocol::mtGET_OBJECTS); peer->sendPacket (msg, false); } catch (...) @@ -3306,7 +3306,7 @@ void NetworkOPsImp::sweepFetchPack () mFetchPack.sweep (); } -void NetworkOPsImp::addFetchPack (uint256 const& hash, boost::shared_ptr< Blob >& data) +void NetworkOPsImp::addFetchPack (uint256 const& hash, std::shared_ptr< Blob >& data) { mFetchPack.canonicalize (hash, data); } diff --git a/src/ripple/module/app/misc/NetworkOPs.h b/src/ripple/module/app/misc/NetworkOPs.h index 402a5f71a..a84fb8422 100644 --- a/src/ripple/module/app/misc/NetworkOPs.h +++ b/src/ripple/module/app/misc/NetworkOPs.h @@ -204,10 +204,10 @@ public: // ledger proposal/close functions virtual void processTrustedProposal (LedgerProposal::pointer proposal, - boost::shared_ptr set, RippleAddress nodePublic, + std::shared_ptr set, RippleAddress nodePublic, uint256 checkLedger, bool sigGood) = 0; - virtual SHAMapAddNode gotTXData (const boost::shared_ptr& peer, + virtual SHAMapAddNode gotTXData (const std::shared_ptr& peer, uint256 const& hash, const std::list& nodeIDs, const std::list< Blob >& nodeData) = 0; @@ -218,7 +218,7 @@ public: virtual SHAMap::pointer getTXMap (uint256 const& hash) = 0; - virtual bool hasTXSet (const boost::shared_ptr& peer, + virtual bool hasTXSet (const std::shared_ptr& peer, uint256 const& set, protocol::TxSetStatus status) = 0; virtual void mapComplete (uint256 const& hash, SHAMap::ref map) = 0; @@ -226,13 +226,13 @@ public: virtual bool stillNeedTXSet (uint256 const& hash) = 0; // Fetch packs - virtual void makeFetchPack (Job&, boost::weak_ptr peer, - boost::shared_ptr request, + virtual void makeFetchPack (Job&, std::weak_ptr peer, + std::shared_ptr request, uint256 wantLedger, std::uint32_t uUptime) = 0; virtual bool shouldFetchPack (std::uint32_t seq) = 0; virtual void gotFetchPack (bool progress, std::uint32_t seq) = 0; - virtual void addFetchPack (uint256 const& hash, boost::shared_ptr< Blob >& data) = 0; + virtual void addFetchPack (uint256 const& hash, std::shared_ptr< Blob >& data) = 0; virtual bool getFetchPack (uint256 const& hash, Blob& data) = 0; virtual int getFetchSize () = 0; virtual void sweepFetchPack () = 0; diff --git a/src/ripple/module/app/misc/NicknameState.h b/src/ripple/module/app/misc/NicknameState.h index e61311556..e79c534a8 100644 --- a/src/ripple/module/app/misc/NicknameState.h +++ b/src/ripple/module/app/misc/NicknameState.h @@ -30,7 +30,7 @@ namespace ripple { class NicknameState { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; public: explicit NicknameState (SerializedLedgerEntry::pointer ledgerEntry); // For accounts in a ledger diff --git a/src/ripple/module/app/misc/OrderBook.h b/src/ripple/module/app/misc/OrderBook.h index b4d475d73..d484f66fa 100644 --- a/src/ripple/module/app/misc/OrderBook.h +++ b/src/ripple/module/app/misc/OrderBook.h @@ -26,9 +26,9 @@ namespace ripple { class OrderBook : beast::LeakChecked { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; - typedef boost::shared_ptr const& ref; + typedef std::shared_ptr const& ref; public: /** Construct from a currency specification. diff --git a/src/ripple/module/app/misc/ProofOfWork.h b/src/ripple/module/app/misc/ProofOfWork.h index 87c39a248..1a54fdf1d 100644 --- a/src/ripple/module/app/misc/ProofOfWork.h +++ b/src/ripple/module/app/misc/ProofOfWork.h @@ -32,7 +32,7 @@ public: kMaxIterations = (1 << 23) }; - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; ProofOfWork (const std::string& token, int iterations, diff --git a/src/ripple/module/app/misc/SerializedLedger.cpp b/src/ripple/module/app/misc/SerializedLedger.cpp index c784b0c3e..90b362808 100644 --- a/src/ripple/module/app/misc/SerializedLedger.cpp +++ b/src/ripple/module/app/misc/SerializedLedger.cpp @@ -86,7 +86,7 @@ SerializedLedgerEntry::SerializedLedgerEntry (LedgerEntryType type, uint256 cons SerializedLedgerEntry::pointer SerializedLedgerEntry::getMutable () const { - SerializedLedgerEntry::pointer ret = boost::make_shared (boost::cref (*this)); + SerializedLedgerEntry::pointer ret = std::make_shared (boost::cref (*this)); ret->mMutable = true; return ret; } diff --git a/src/ripple/module/app/misc/SerializedLedger.h b/src/ripple/module/app/misc/SerializedLedger.h index 6c8cc30dc..710856d32 100644 --- a/src/ripple/module/app/misc/SerializedLedger.h +++ b/src/ripple/module/app/misc/SerializedLedger.h @@ -44,8 +44,8 @@ class SerializedLedgerEntry public: static char const* getCountedObjectName () { return "SerializedLedgerEntry"; } - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; public: SerializedLedgerEntry (const Serializer & s, uint256 const & index); diff --git a/src/ripple/module/app/misc/SerializedTransaction.h b/src/ripple/module/app/misc/SerializedTransaction.h index 8a1ba4e48..7b067b13b 100644 --- a/src/ripple/module/app/misc/SerializedTransaction.h +++ b/src/ripple/module/app/misc/SerializedTransaction.h @@ -38,8 +38,8 @@ class SerializedTransaction public: static char const* getCountedObjectName () { return "SerializedTransaction"; } - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; public: SerializedTransaction (SerializerIterator & sit); diff --git a/src/ripple/module/app/misc/Validations.cpp b/src/ripple/module/app/misc/Validations.cpp index 5bb75a8f3..53cd09fb9 100644 --- a/src/ripple/module/app/misc/Validations.cpp +++ b/src/ripple/module/app/misc/Validations.cpp @@ -24,7 +24,7 @@ class ValidationsImp; SETUP_LOG (Validations) typedef std::map::value_type u160_val_pair; -typedef boost::shared_ptr VSpointer; +typedef std::shared_ptr VSpointer; class ValidationsImp : public Validations { @@ -41,20 +41,20 @@ private: bool mWriting; private: - boost::shared_ptr findCreateSet (uint256 const& ledgerHash) + std::shared_ptr findCreateSet (uint256 const& ledgerHash) { VSpointer j = mValidations.fetch (ledgerHash); if (!j) { - j = boost::make_shared (); + j = std::make_shared (); mValidations.canonicalize (ledgerHash, j); } return j; } - boost::shared_ptr findSet (uint256 const& ledgerHash) + std::shared_ptr findSet (uint256 const& ledgerHash) { return mValidations.fetch (ledgerHash); } diff --git a/src/ripple/module/app/paths/PathRequest.cpp b/src/ripple/module/app/paths/PathRequest.cpp index e4ff78743..c06418acb 100644 --- a/src/ripple/module/app/paths/PathRequest.cpp +++ b/src/ripple/module/app/paths/PathRequest.cpp @@ -26,7 +26,7 @@ namespace ripple { SETUP_LOG (PathRequest) PathRequest::PathRequest ( -const boost::shared_ptr& subscriber, int id, PathRequests& owner, +const std::shared_ptr& subscriber, int id, PathRequests& owner, beast::Journal journal) : m_journal (journal) , mOwner (owner) diff --git a/src/ripple/module/app/paths/PathRequest.h b/src/ripple/module/app/paths/PathRequest.h index e1a93fbce..8520fcbab 100644 --- a/src/ripple/module/app/paths/PathRequest.h +++ b/src/ripple/module/app/paths/PathRequest.h @@ -34,21 +34,21 @@ class PathRequests; #define PFR_PJ_CHANGE 1 class PathRequest : - public boost::enable_shared_from_this , + public std::enable_shared_from_this , public CountedObject { public: static char const* getCountedObjectName () { return "PathRequest"; } - typedef boost::weak_ptr wptr; - typedef boost::shared_ptr pointer; + typedef std::weak_ptr wptr; + typedef std::shared_ptr pointer; typedef const pointer& ref; typedef const wptr& wref; typedef std::pair currIssuer_t; public: // VFALCO TODO Break the cyclic dependency on InfoSub - PathRequest (boost::shared_ptr const& subscriber, + PathRequest (std::shared_ptr const& subscriber, int id, PathRequests&, beast::Journal journal); ~PathRequest (); @@ -60,11 +60,11 @@ public: void updateComplete (); Json::Value getStatus (); - Json::Value doCreate (const boost::shared_ptr&, const RippleLineCache::pointer&, + Json::Value doCreate (const std::shared_ptr&, const RippleLineCache::pointer&, const Json::Value&, bool&); Json::Value doClose (const Json::Value&); Json::Value doStatus (const Json::Value&); - Json::Value doUpdate (const boost::shared_ptr&, bool fast); // update jvStatus + Json::Value doUpdate (const std::shared_ptr&, bool fast); // update jvStatus InfoSub::pointer getSubscriber (); private: @@ -80,7 +80,7 @@ private: PathRequests& mOwner; - boost::weak_ptr wpSubscriber; // Who this request came from + std::weak_ptr wpSubscriber; // Who this request came from Json::Value jvId; Json::Value jvStatus; // Last result diff --git a/src/ripple/module/app/paths/PathRequests.cpp b/src/ripple/module/app/paths/PathRequests.cpp index 629568f86..ae8156cb7 100644 --- a/src/ripple/module/app/paths/PathRequests.cpp +++ b/src/ripple/module/app/paths/PathRequests.cpp @@ -34,8 +34,8 @@ RippleLineCache::pointer PathRequests::getLineCache (Ledger::pointer& ledger, bo (authoritative && ((lgrSeq + 8) < lineSeq)) || // we jumped way back for some reason (lgrSeq > (lineSeq + 8))) // we jumped way forward for some reason { - ledger = boost::make_shared(*ledger, false); // Take a snapshot of the ledger - mLineCache = boost::make_shared (ledger); + ledger = std::make_shared(*ledger, false); // Take a snapshot of the ledger + mLineCache = std::make_shared (ledger); } else { @@ -161,11 +161,11 @@ void PathRequests::updateAll (Ledger::ref inLedger, CancelCallback shouldCancel) } Json::Value PathRequests::makePathRequest( - boost::shared_ptr const& subscriber, - const boost::shared_ptr& inLedger, + std::shared_ptr const& subscriber, + const std::shared_ptr& inLedger, const Json::Value& requestJson) { - PathRequest::pointer req = boost::make_shared ( + PathRequest::pointer req = std::make_shared ( subscriber, ++mLastIdentifier, *this, mJournal); Ledger::pointer ledger = inLedger; diff --git a/src/ripple/module/app/paths/PathRequests.h b/src/ripple/module/app/paths/PathRequests.h index 4ca9c364d..6a6a16508 100644 --- a/src/ripple/module/app/paths/PathRequests.h +++ b/src/ripple/module/app/paths/PathRequests.h @@ -33,13 +33,13 @@ public: mFull = collector->make_event ("pathfind_full"); } - void updateAll (const boost::shared_ptr& ledger, CancelCallback shouldCancel); + void updateAll (const std::shared_ptr& ledger, CancelCallback shouldCancel); RippleLineCache::pointer getLineCache (Ledger::pointer& ledger, bool authoritative); Json::Value makePathRequest ( - boost::shared_ptr const& subscriber, - const boost::shared_ptr& ledger, + std::shared_ptr const& subscriber, + const std::shared_ptr& ledger, const Json::Value& request); void reportFast (int milliseconds) diff --git a/src/ripple/module/app/paths/Pathfinder.h b/src/ripple/module/app/paths/Pathfinder.h index 8366d8954..ff0ca2c02 100644 --- a/src/ripple/module/app/paths/Pathfinder.h +++ b/src/ripple/module/app/paths/Pathfinder.h @@ -33,8 +33,8 @@ be to flood from both directions. class PathOption { public: - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; STPath mPath; bool mCorrectCurrency; // for the sorting diff --git a/src/ripple/module/app/paths/RippleLineCache.cpp b/src/ripple/module/app/paths/RippleLineCache.cpp index acae22b51..3717d49f0 100644 --- a/src/ripple/module/app/paths/RippleLineCache.cpp +++ b/src/ripple/module/app/paths/RippleLineCache.cpp @@ -31,7 +31,7 @@ AccountItems& RippleLineCache::getRippleLines (const uint160& accountID) ripple::unordered_map ::iterator it = mRLMap.find (accountID); if (it == mRLMap.end ()) - it = mRLMap.insert (std::make_pair (accountID, boost::make_shared + it = mRLMap.insert (std::make_pair (accountID, std::make_shared (boost::cref (accountID), boost::cref (mLedger), AccountItem::pointer (new RippleState ())))).first; return *it->second; diff --git a/src/ripple/module/app/paths/RippleLineCache.h b/src/ripple/module/app/paths/RippleLineCache.h index 19782652a..c255da8ed 100644 --- a/src/ripple/module/app/paths/RippleLineCache.h +++ b/src/ripple/module/app/paths/RippleLineCache.h @@ -26,7 +26,7 @@ namespace ripple { class RippleLineCache { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef pointer const& ref; explicit RippleLineCache (Ledger::ref l); diff --git a/src/ripple/module/app/paths/RippleState.h b/src/ripple/module/app/paths/RippleState.h index 44a50ef61..fca59a727 100644 --- a/src/ripple/module/app/paths/RippleState.h +++ b/src/ripple/module/app/paths/RippleState.h @@ -30,7 +30,7 @@ namespace ripple { class RippleState : public AccountItem { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; public: RippleState () { } diff --git a/src/ripple/module/app/peers/PeerSet.cpp b/src/ripple/module/app/peers/PeerSet.cpp index 50bf57c9b..ad19e03b8 100644 --- a/src/ripple/module/app/peers/PeerSet.cpp +++ b/src/ripple/module/app/peers/PeerSet.cpp @@ -98,12 +98,12 @@ void PeerSet::invokeOnTimer () setTimer (); } -void PeerSet::TimerEntry (boost::weak_ptr wptr, const boost::system::error_code& result) +void PeerSet::TimerEntry (std::weak_ptr wptr, const boost::system::error_code& result) { if (result == boost::asio::error::operation_aborted) return; - boost::shared_ptr ptr = wptr.lock (); + std::shared_ptr ptr = wptr.lock (); if (ptr) { @@ -134,7 +134,7 @@ void PeerSet::TimerEntry (boost::weak_ptr wptr, const boost::system::er } } -void PeerSet::TimerJobEntry (Job&, boost::shared_ptr ptr) +void PeerSet::TimerJobEntry (Job&, std::shared_ptr ptr) { ptr->invokeOnTimer (); } @@ -150,7 +150,7 @@ void PeerSet::sendRequest (const protocol::TMGetLedger& tmGL, Peer::ptr const& p if (!peer) sendRequest (tmGL); else - peer->sendPacket (boost::make_shared (tmGL, protocol::mtGET_LEDGER), false); + peer->sendPacket (std::make_shared (tmGL, protocol::mtGET_LEDGER), false); } void PeerSet::sendRequest (const protocol::TMGetLedger& tmGL) @@ -161,7 +161,7 @@ void PeerSet::sendRequest (const protocol::TMGetLedger& tmGL) return; Message::pointer packet ( - boost::make_shared (tmGL, protocol::mtGET_LEDGER)); + std::make_shared (tmGL, protocol::mtGET_LEDGER)); for (auto const& p : mPeers) { diff --git a/src/ripple/module/app/peers/PeerSet.h b/src/ripple/module/app/peers/PeerSet.h index 3a2eff389..e995a87ac 100644 --- a/src/ripple/module/app/peers/PeerSet.h +++ b/src/ripple/module/app/peers/PeerSet.h @@ -103,8 +103,8 @@ public: } private: - static void TimerEntry (boost::weak_ptr, const boost::system::error_code& result); - static void TimerJobEntry (Job&, boost::shared_ptr); + static void TimerEntry (std::weak_ptr, const boost::system::error_code& result); + static void TimerJobEntry (Job&, std::shared_ptr); protected: // VFALCO TODO try to make some of these private @@ -117,7 +117,7 @@ protected: virtual void newPeer (Peer::ptr const&) = 0; virtual void onTimer (bool progress, ScopedLockType&) = 0; - virtual boost::weak_ptr pmDowncast () = 0; + virtual std::weak_ptr pmDowncast () = 0; void setComplete () { diff --git a/src/ripple/module/app/shamap/FetchPackTests.cpp b/src/ripple/module/app/shamap/FetchPackTests.cpp index ebea80bda..135f576a6 100644 --- a/src/ripple/module/app/shamap/FetchPackTests.cpp +++ b/src/ripple/module/app/shamap/FetchPackTests.cpp @@ -78,14 +78,14 @@ public: FullBelowCache fullBelowCache ("test.full_below", get_seconds_clock ()); - boost::shared_ptr t1 (boost::make_shared
( + std::shared_ptr
t1 (std::make_shared
( smtFREE, fullBelowCache)); pass (); // beast::Random r; // add_random_items (tableItems, *t1, r); -// boost::shared_ptr
t2 (t1->snapShot (true)); +// std::shared_ptr
t2 (t1->snapShot (true)); // // add_random_items (tableItemsExtra, *t1, r); // add_random_items (tableItemsExtra, *t2, r); @@ -98,12 +98,12 @@ public: // &FetchPack_test::on_fetch, this, std::ref (map), std::placeholders::_1, std::placeholders::_2)); // try to rebuild t2 from the fetch pack -// boost::shared_ptr
t3; +// std::shared_ptr
t3; // try // { // TestFilter filter (map, beast::Journal()); // -// t3 = boost::make_shared
(smtFREE, t2->getHash (), +// t3 = std::make_shared
(smtFREE, t2->getHash (), // fullBelowCache); // // expect (t3->fetchRoot (t2->getHash (), &filter), "unable to get root"); diff --git a/src/ripple/module/app/shamap/RadixMapTest.cpp b/src/ripple/module/app/shamap/RadixMapTest.cpp index 290fc2d9d..dd1b79516 100644 --- a/src/ripple/module/app/shamap/RadixMapTest.cpp +++ b/src/ripple/module/app/shamap/RadixMapTest.cpp @@ -22,12 +22,12 @@ namespace ripple { namespace RadixMap { -boost::shared_ptr make_random_item (beast::Random& r) +std::shared_ptr make_random_item (beast::Random& r) { Serializer s; for (int d = 0; d < 3; ++d) s.add32 (r.nextInt ()); - return boost::make_shared ( + return std::make_shared ( to256(s.getRIPEMD160()), s.peekData ()); } @@ -37,7 +37,7 @@ void add_random_items (std::size_t n, Table& t, beast::Random& r) { while (n--) { - boost::shared_ptr item ( + std::shared_ptr item ( make_random_item (r)); auto const result (t.addItem (*item, false, false)); assert (result); diff --git a/src/ripple/module/app/shamap/RadixMapTest.h b/src/ripple/module/app/shamap/RadixMapTest.h index f0ccc9370..69ccbdf02 100644 --- a/src/ripple/module/app/shamap/RadixMapTest.h +++ b/src/ripple/module/app/shamap/RadixMapTest.h @@ -28,7 +28,7 @@ typedef SHAMapItem Item; // Utility functions for RadixMap::Table (a.k.a. SHAMap) unit tests /** Returns a pseudo random Table item. */ -boost::shared_ptr make_random_item (beast::Random& r); +std::shared_ptr make_random_item (beast::Random& r); /** Adds a set of random items to the Table. @param n The number of items to add. diff --git a/src/ripple/module/app/shamap/SHAMap.cpp b/src/ripple/module/app/shamap/SHAMap.cpp index 197458ae0..6bdd8e2bd 100644 --- a/src/ripple/module/app/shamap/SHAMap.cpp +++ b/src/ripple/module/app/shamap/SHAMap.cpp @@ -44,7 +44,7 @@ SHAMap::SHAMap (SHAMapType t, FullBelowCache& fullBelowCache, std::uint32_t seq, if (t == smtSTATE) mTNByID.rehash (STATE_MAP_BUCKETS); - root = boost::make_shared (mSeq, SHAMapNode (0, uint256 ())); + root = std::make_shared (mSeq, SHAMapNode (0, uint256 ())); root->makeInner (); mTNByID.replace(*root, root); } @@ -62,7 +62,7 @@ SHAMap::SHAMap (SHAMapType t, uint256 const& hash, FullBelowCache& fullBelowCach if (t == smtSTATE) mTNByID.rehash (STATE_MAP_BUCKETS); - root = boost::make_shared (mSeq, SHAMapNode (0, uint256 ())); + root = std::make_shared (mSeq, SHAMapNode (0, uint256 ())); root->makeInner (); mTNByID.replace(*root, root); } @@ -116,7 +116,7 @@ std::size_t hash_value (const SHAMapNode& mn) SHAMap::pointer SHAMap::snapShot (bool isMutable) { - SHAMap::pointer ret = boost::make_shared (mType, + SHAMap::pointer ret = std::make_shared (mType, std::ref (m_fullBelowCache)); SHAMap& newMap = *ret; @@ -138,7 +138,7 @@ SHAMap::pointer SHAMap::snapShot (bool isMutable) { if (nodeIt.second->getSeq() == mSeq) { // We might modify this node, so duplicate it in the snapShot - SHAMapTreeNode::pointer newNode = boost::make_shared (*nodeIt.second, mSeq); + SHAMapTreeNode::pointer newNode = std::make_shared (*nodeIt.second, mSeq); newMap.mTNByID.replace (*newNode, newNode); if (newNode->isRoot ()) newMap.root = newNode; @@ -343,7 +343,7 @@ SHAMapTreeNode* SHAMap::getNodePointerNT (const SHAMapNode& id, uint256 const& h if (filter->haveNode (id, hash, nodeData)) { - SHAMapTreeNode::pointer node = boost::make_shared ( + SHAMapTreeNode::pointer node = std::make_shared ( boost::cref (id), boost::cref (nodeData), 0, snfPREFIX, boost::cref (hash), true); canonicalize (hash, node); @@ -372,7 +372,7 @@ void SHAMap::returnNode (SHAMapTreeNode::pointer& node, bool modify) assert (node->getSeq () < mSeq); assert (mState != smsImmutable); - node = boost::make_shared (*node, mSeq); // here's to the new node, same as the old node + node = std::make_shared (*node, mSeq); // here's to the new node, same as the old node assert (node->isValid ()); mTNByID.replace (*node, node); @@ -785,7 +785,7 @@ bool SHAMap::addGiveItem (SHAMapItem::ref item, bool isTransaction, bool hasMeta int branch = node->selectBranch (tag); assert (node->isEmptyBranch (branch)); SHAMapTreeNode::pointer newNode = - boost::make_shared (node->getChildNodeID (branch), item, type, mSeq); + std::make_shared (node->getChildNodeID (branch), item, type, mSeq); if (!mTNByID.peekMap().emplace (SHAMapNode (*newNode), newNode).second) { @@ -813,7 +813,7 @@ bool SHAMap::addGiveItem (SHAMapItem::ref item, bool isTransaction, bool hasMeta { // we need a new inner node, since both go on same branch at this level SHAMapTreeNode::pointer newNode = - boost::make_shared (mSeq, node->getChildNodeID (b1)); + std::make_shared (mSeq, node->getChildNodeID (b1)); newNode->makeInner (); if (!mTNByID.peekMap().emplace (SHAMapNode (*newNode), newNode).second) @@ -827,7 +827,7 @@ bool SHAMap::addGiveItem (SHAMapItem::ref item, bool isTransaction, bool hasMeta // we can add the two leaf nodes here assert (node->isInner ()); SHAMapTreeNode::pointer newNode = - boost::make_shared (node->getChildNodeID (b1), item, type, mSeq); + std::make_shared (node->getChildNodeID (b1), item, type, mSeq); assert (newNode->isValid () && newNode->isLeaf ()); if (!mTNByID.peekMap().emplace (SHAMapNode (*newNode), newNode).second) @@ -836,7 +836,7 @@ bool SHAMap::addGiveItem (SHAMapItem::ref item, bool isTransaction, bool hasMeta node->setChildHash (b1, newNode->getNodeHash ()); // OPTIMIZEME hash op not needed trackNewNode (newNode); - newNode = boost::make_shared (node->getChildNodeID (b2), otherItem, type, mSeq); + newNode = std::make_shared (node->getChildNodeID (b2), otherItem, type, mSeq); assert (newNode->isValid () && newNode->isLeaf ()); if (!mTNByID.peekMap().emplace (SHAMapNode (*newNode), newNode).second) @@ -852,7 +852,7 @@ bool SHAMap::addGiveItem (SHAMapItem::ref item, bool isTransaction, bool hasMeta bool SHAMap::addItem (const SHAMapItem& i, bool isTransaction, bool hasMetaData) { - return addGiveItem (boost::make_shared (i), isTransaction, hasMetaData); + return addGiveItem (std::make_shared (i), isTransaction, hasMetaData); } bool SHAMap::updateGiveItem (SHAMapItem::ref item, bool isTransaction, bool hasMeta) @@ -931,7 +931,7 @@ SHAMapTreeNode* SHAMap::getNodeAsync ( Blob nodeData; if (filter->haveNode (id, hash, nodeData)) { - ptr = boost::make_shared ( + ptr = std::make_shared ( boost::cref (id), boost::cref (nodeData), 0, snfPREFIX, boost::cref (hash), true); filter->gotNode (true, id, hash, nodeData, ptr->getType ()); } @@ -957,7 +957,7 @@ SHAMapTreeNode* SHAMap::getNodeAsync ( if (!obj) return nullptr; - ptr = boost::make_shared (id, obj->getData(), 0, snfPREFIX, hash, true); + ptr = std::make_shared (id, obj->getData(), 0, snfPREFIX, hash, true); if (id != *ptr) { assert (false); @@ -1019,7 +1019,7 @@ SHAMapTreeNode::pointer SHAMap::fetchNodeExternalNT (const SHAMapNode& id, uint2 { // We make this node immutable (seq == 0) so that it can be shared // CoW is needed if it is modified - ret = boost::make_shared (id, obj->getData (), 0, snfPREFIX, hash, true); + ret = std::make_shared (id, obj->getData (), 0, snfPREFIX, hash, true); if (id != *ret) { @@ -1083,7 +1083,7 @@ bool SHAMap::fetchRoot (uint256 const& hash, SHAMapSyncFilter* filter) if (!filter || !filter->haveNode (SHAMapNode (), hash, nodeData)) return false; - root = boost::make_shared (SHAMapNode (), nodeData, + root = std::make_shared (SHAMapNode (), nodeData, mSeq - 1, snfPREFIX, hash, true); mTNByID.replace(*root, root); filter->gotNode (true, SHAMapNode (), hash, nodeData, root->getType ()); @@ -1096,7 +1096,7 @@ bool SHAMap::fetchRoot (uint256 const& hash, SHAMapSyncFilter* filter) /** Begin saving dirty nodes to be written later */ int SHAMap::armDirty () { - mDirtyNodes = boost::make_shared (); + mDirtyNodes = std::make_shared (); return ++mSeq; } @@ -1137,7 +1137,7 @@ int SHAMap::flushDirty (DirtySet& set, int maxNodes, NodeObjectType t, std::uint { // Node is not shareable // Make and share a shareable copy - node = boost::make_shared (*node, 0); + node = std::make_shared (*node, 0); canonicalize (node->getNodeHash(), node); mTNByID.replace (*node, node); } @@ -1152,11 +1152,11 @@ int SHAMap::flushDirty (DirtySet& set, int maxNodes, NodeObjectType t, std::uint } /** Stop saving dirty nodes */ -boost::shared_ptr SHAMap::disarmDirty () +std::shared_ptr SHAMap::disarmDirty () { ScopedWriteLockType sl (mLock); - boost::shared_ptr ret; + std::shared_ptr ret; ret.swap (mDirtyNodes); return ret; } @@ -1294,7 +1294,7 @@ SHAMapTreeNode::pointer SHAMap::getCache (uint256 const& hash, SHAMapNode const& { // We have the data, but with a different node ID WriteLog (lsTRACE, SHAMap) << "ID mismatch: " << id << " != " << *ret; - ret = boost::make_shared (*ret, 0); + ret = std::make_shared (*ret, 0); ret->set(id); // Future fetches are likely to use the "new" ID @@ -1317,7 +1317,7 @@ void SHAMap::canonicalize (uint256 const& hash, SHAMapTreeNode::pointer& node) if (id != *node) { // The cache has the node with a different ID - node = boost::make_shared (*node, 0); + node = std::make_shared (*node, 0); node->set (id); // Future fetches are likely to use the newer ID diff --git a/src/ripple/module/app/shamap/SHAMap.h b/src/ripple/module/app/shamap/SHAMap.h index 2f3f057ee..070ed8b30 100644 --- a/src/ripple/module/app/shamap/SHAMap.h +++ b/src/ripple/module/app/shamap/SHAMap.h @@ -106,8 +106,8 @@ public: static char const* getCountedObjectName () { return "SHAMap"; } - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; typedef std::pair DeltaItem; typedef std::pair DeltaRef; @@ -233,7 +233,7 @@ public: int armDirty (); int flushDirty (DirtySet & dirtySet, int maxNodes, NodeObjectType t, std::uint32_t seq); - boost::shared_ptr disarmDirty (); + std::shared_ptr disarmDirty (); void setSeq (std::uint32_t seq) { @@ -349,7 +349,7 @@ private: std::uint32_t mSeq; std::uint32_t mLedgerSeq; // sequence number of ledger this is part of SyncUnorderedMapType< SHAMapNode, SHAMapTreeNode::pointer, SHAMapNode_hash > mTNByID; - boost::shared_ptr mDirtyNodes; + std::shared_ptr mDirtyNodes; SHAMapTreeNode::pointer root; SHAMapState mState; SHAMapType mType; diff --git a/src/ripple/module/app/shamap/SHAMapItem.h b/src/ripple/module/app/shamap/SHAMapItem.h index 56adfc23f..ff4194404 100644 --- a/src/ripple/module/app/shamap/SHAMapItem.h +++ b/src/ripple/module/app/shamap/SHAMapItem.h @@ -29,8 +29,8 @@ class SHAMapItem public: static char const* getCountedObjectName () { return "SHAMapItem"; } - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; public: explicit SHAMapItem (uint256 const & tag) : mTag (tag) diff --git a/src/ripple/module/app/shamap/SHAMapSync.cpp b/src/ripple/module/app/shamap/SHAMapSync.cpp index 35109b961..67bb4a39b 100644 --- a/src/ripple/module/app/shamap/SHAMapSync.cpp +++ b/src/ripple/module/app/shamap/SHAMapSync.cpp @@ -355,7 +355,7 @@ SHAMapAddNode SHAMap::addRootNode (Blob const& rootNode, SHANodeFormat format, assert (mSeq >= 1); SHAMapTreeNode::pointer node = - boost::make_shared (SHAMapNode (), rootNode, mSeq - 1, format, uZero, false); + std::make_shared (SHAMapNode (), rootNode, mSeq - 1, format, uZero, false); if (!node) return SHAMapAddNode::invalid (); @@ -395,7 +395,7 @@ SHAMapAddNode SHAMap::addRootNode (uint256 const& hash, Blob const& rootNode, SH assert (mSeq >= 1); SHAMapTreeNode::pointer node = - boost::make_shared (SHAMapNode (), rootNode, mSeq - 1, format, uZero, false); + std::make_shared (SHAMapNode (), rootNode, mSeq - 1, format, uZero, false); if (!node || node->getNodeHash () != hash) return SHAMapAddNode::invalid (); @@ -462,7 +462,7 @@ SHAMapAddNode SHAMap::addKnownNode (const SHAMapNode& node, Blob const& rawNode, } SHAMapTreeNode::pointer newNode = - boost::make_shared (node, rawNode, 0, snfWIRE, uZero, false); + std::make_shared (node, rawNode, 0, snfWIRE, uZero, false); if (iNode->getChildHash (branch) != newNode->getNodeHash ()) { @@ -750,7 +750,7 @@ public: for (int d = 0; d < 3; ++d) s.add32 (rand ()); - return boost::make_shared (to256 (s.getRIPEMD160 ()), s.peekData ()); + return std::make_shared (to256 (s.getRIPEMD160 ()), s.peekData ()); } bool confuseMap (SHAMap& map, int count) diff --git a/src/ripple/module/app/shamap/SHAMapSyncFilters.cpp b/src/ripple/module/app/shamap/SHAMapSyncFilters.cpp index 817265cbb..917c00121 100644 --- a/src/ripple/module/app/shamap/SHAMapSyncFilters.cpp +++ b/src/ripple/module/app/shamap/SHAMapSyncFilters.cpp @@ -41,7 +41,7 @@ void ConsensusTransSetSF::gotNode (bool fromFilter, const SHAMapNode& id, uint25 { Serializer s (nodeData.begin () + 4, nodeData.end ()); // skip prefix SerializerIterator sit (s); - SerializedTransaction::pointer stx = boost::make_shared (boost::ref (sit)); + SerializedTransaction::pointer stx = std::make_shared (boost::ref (sit)); assert (stx->getTransactionID () == nodeHash); getApp().getJobQueue ().addJob ( jtTRANSACTION, "TXS->TXN", diff --git a/src/ripple/module/app/shamap/SHAMapTreeNode.cpp b/src/ripple/module/app/shamap/SHAMapTreeNode.cpp index 5c34ba353..321f954c4 100644 --- a/src/ripple/module/app/shamap/SHAMapTreeNode.cpp +++ b/src/ripple/module/app/shamap/SHAMapTreeNode.cpp @@ -70,7 +70,7 @@ SHAMapTreeNode::SHAMapTreeNode (const SHAMapNode& id, Blob const& rawNode, std:: if (type == 0) { // transaction - mItem = boost::make_shared (s.getPrefixHash (HashPrefix::transactionID), s.peekData ()); + mItem = std::make_shared (s.getPrefixHash (HashPrefix::transactionID), s.peekData ()); mType = tnTRANSACTION_NM; } else if (type == 1) @@ -85,7 +85,7 @@ SHAMapTreeNode::SHAMapTreeNode (const SHAMapNode& id, Blob const& rawNode, std:: if (u.isZero ()) throw std::runtime_error ("invalid AS node"); - mItem = boost::make_shared (u, s.peekData ()); + mItem = std::make_shared (u, s.peekData ()); mType = tnACCOUNT_STATE; } else if (type == 2) @@ -135,7 +135,7 @@ SHAMapTreeNode::SHAMapTreeNode (const SHAMapNode& id, Blob const& rawNode, std:: if (u.isZero ()) throw std::runtime_error ("invalid TM node"); - mItem = boost::make_shared (u, s.peekData ()); + mItem = std::make_shared (u, s.peekData ()); mType = tnTRANSACTION_MD; } } @@ -159,7 +159,7 @@ SHAMapTreeNode::SHAMapTreeNode (const SHAMapNode& id, Blob const& rawNode, std:: if (prefix == HashPrefix::transactionID) { - mItem = boost::make_shared (Serializer::getSHA512Half (rawNode), s.peekData ()); + mItem = std::make_shared (Serializer::getSHA512Half (rawNode), s.peekData ()); mType = tnTRANSACTION_NM; } else if (prefix == HashPrefix::leafNode) @@ -177,7 +177,7 @@ SHAMapTreeNode::SHAMapTreeNode (const SHAMapNode& id, Blob const& rawNode, std:: throw std::runtime_error ("invalid PLN node"); } - mItem = boost::make_shared (u, s.peekData ()); + mItem = std::make_shared (u, s.peekData ()); mType = tnACCOUNT_STATE; } else if (prefix == HashPrefix::innerNode) @@ -204,7 +204,7 @@ SHAMapTreeNode::SHAMapTreeNode (const SHAMapNode& id, Blob const& rawNode, std:: uint256 txID; s.get256 (txID, s.getLength () - 32); s.chop (32); - mItem = boost::make_shared (txID, s.peekData ()); + mItem = std::make_shared (txID, s.peekData ()); mType = tnTRANSACTION_MD; } else diff --git a/src/ripple/module/app/shamap/SHAMapTreeNode.h b/src/ripple/module/app/shamap/SHAMapTreeNode.h index 2e5119c94..bb6050246 100644 --- a/src/ripple/module/app/shamap/SHAMapTreeNode.h +++ b/src/ripple/module/app/shamap/SHAMapTreeNode.h @@ -38,8 +38,8 @@ class SHAMapTreeNode public: static char const* getCountedObjectName () { return "SHAMapTreeNode"; } - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; enum TNType { diff --git a/src/ripple/module/app/tx/Transaction.cpp b/src/ripple/module/app/tx/Transaction.cpp index 71ccbefe5..838bafee2 100644 --- a/src/ripple/module/app/tx/Transaction.cpp +++ b/src/ripple/module/app/tx/Transaction.cpp @@ -44,14 +44,14 @@ Transaction::pointer Transaction::sharedTransaction (Blob const& vucTransaction, Serializer s (vucTransaction); SerializerIterator sit (s); - SerializedTransaction::pointer st = boost::make_shared (boost::ref (sit)); + SerializedTransaction::pointer st = std::make_shared (boost::ref (sit)); - return boost::make_shared (st, bValidate); + return std::make_shared (st, bValidate); } catch (...) { Log (lsWARNING) << "Exception constructing transaction"; - return boost::shared_ptr (); + return std::shared_ptr (); } } @@ -70,7 +70,7 @@ Transaction::Transaction ( { assert (mFromPubKey.isValid ()); - mTransaction = boost::make_shared (ttKind); + mTransaction = std::make_shared (ttKind); // Log(lsINFO) << str(boost::format("Transaction: account: %s") % naSourceAccount.humanAccountID()); // Log(lsINFO) << str(boost::format("Transaction: mAccountFrom: %s") % mAccountFrom.humanAccountID()); @@ -158,8 +158,8 @@ Transaction::pointer Transaction::transactionFromSQL (Database* db, bool bValida rawTxn.resize (txSize); SerializerIterator it (rawTxn); - SerializedTransaction::pointer txn = boost::make_shared (boost::ref (it)); - Transaction::pointer tr = boost::make_shared (txn, bValidate); + SerializedTransaction::pointer txn = std::make_shared (boost::ref (it)); + Transaction::pointer tr = std::make_shared (txn, bValidate); TransStatus st (INVALID); @@ -229,8 +229,8 @@ Transaction::pointer Transaction::transactionFromSQL (const std::string& sql) rawTxn.resize (txSize); SerializerIterator it (rawTxn); - SerializedTransaction::pointer txn = boost::make_shared (boost::ref (it)); - Transaction::pointer tr = boost::make_shared (txn, true); + SerializedTransaction::pointer txn = std::make_shared (boost::ref (it)); + Transaction::pointer tr = std::make_shared (txn, true); TransStatus st (INVALID); diff --git a/src/ripple/module/app/tx/Transaction.h b/src/ripple/module/app/tx/Transaction.h index 7489fcfa9..7df6ed8c7 100644 --- a/src/ripple/module/app/tx/Transaction.h +++ b/src/ripple/module/app/tx/Transaction.h @@ -43,13 +43,13 @@ enum TransStatus // This class is for constructing and examining transactions. Transactions are static so manipulation functions are unnecessary. class Transaction - : public boost::enable_shared_from_this + : public std::enable_shared_from_this , public CountedObject { public: static char const* getCountedObjectName () { return "Transaction"; } - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef const pointer& ref; public: diff --git a/src/ripple/module/app/tx/TransactionAcquire.cpp b/src/ripple/module/app/tx/TransactionAcquire.cpp index 9d3fb63ba..40d8a93da 100644 --- a/src/ripple/module/app/tx/TransactionAcquire.cpp +++ b/src/ripple/module/app/tx/TransactionAcquire.cpp @@ -39,7 +39,7 @@ TransactionAcquire::TransactionAcquire (uint256 const& hash, clock_type& clock) LogPartition::getJournal ()) , mHaveRoot (false) { - mMap = boost::make_shared (smtTRANSACTION, hash, + mMap = std::make_shared (smtTRANSACTION, hash, std::ref (getApp().getFullBelowCache ())); mMap->setTXMap (); } @@ -132,9 +132,9 @@ void TransactionAcquire::onTimer (bool progress, ScopedLockType& psl) trigger (Peer::ptr ()); } -boost::weak_ptr TransactionAcquire::pmDowncast () +std::weak_ptr TransactionAcquire::pmDowncast () { - return boost::dynamic_pointer_cast (shared_from_this ()); + return std::dynamic_pointer_cast (shared_from_this ()); } void TransactionAcquire::trigger (Peer::ptr const& peer) diff --git a/src/ripple/module/app/tx/TransactionAcquire.h b/src/ripple/module/app/tx/TransactionAcquire.h index e4c4cfaff..0bcbd2d4e 100644 --- a/src/ripple/module/app/tx/TransactionAcquire.h +++ b/src/ripple/module/app/tx/TransactionAcquire.h @@ -26,13 +26,13 @@ namespace ripple { // A transaction set we are trying to acquire class TransactionAcquire : public PeerSet - , public boost::enable_shared_from_this + , public std::enable_shared_from_this , public CountedObject { public: static char const* getCountedObjectName () { return "TransactionAcquire"; } - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; public: TransactionAcquire (uint256 const& hash, clock_type& clock); @@ -58,7 +58,7 @@ private: void done (); void trigger (Peer::ptr const&); - boost::weak_ptr pmDowncast (); + std::weak_ptr pmDowncast (); }; } // ripple diff --git a/src/ripple/module/app/tx/TransactionEngine.h b/src/ripple/module/app/tx/TransactionEngine.h index b218414f5..a56909031 100644 --- a/src/ripple/module/app/tx/TransactionEngine.h +++ b/src/ripple/module/app/tx/TransactionEngine.h @@ -59,7 +59,7 @@ protected: void txnWrite (); public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; TransactionEngine () : mTxnSeq (0) { diff --git a/src/ripple/module/app/tx/TransactionMaster.cpp b/src/ripple/module/app/tx/TransactionMaster.cpp index 00e69bdf2..8eed7494c 100644 --- a/src/ripple/module/app/tx/TransactionMaster.cpp +++ b/src/ripple/module/app/tx/TransactionMaster.cpp @@ -66,7 +66,7 @@ SerializedTransaction::pointer TransactionMaster::fetch (SHAMapItem::ref item, if (type == SHAMapTreeNode::tnTRANSACTION_NM) { SerializerIterator sit (item->peekSerializer ()); - txn = boost::make_shared (boost::ref (sit)); + txn = std::make_shared (boost::ref (sit)); } else if (type == SHAMapTreeNode::tnTRANSACTION_MD) { @@ -75,7 +75,7 @@ SerializedTransaction::pointer TransactionMaster::fetch (SHAMapItem::ref item, item->peekSerializer ().getVL (s.modData (), 0, length); SerializerIterator sit (s); - txn = boost::make_shared (boost::ref (sit)); + txn = std::make_shared (boost::ref (sit)); } } else diff --git a/src/ripple/module/app/tx/TransactionMeta.h b/src/ripple/module/app/tx/TransactionMeta.h index 317c17116..3970705a3 100644 --- a/src/ripple/module/app/tx/TransactionMeta.h +++ b/src/ripple/module/app/tx/TransactionMeta.h @@ -25,7 +25,7 @@ namespace ripple { class TransactionMetaSet : beast::LeakChecked { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef const pointer& ref; public: diff --git a/src/ripple/module/app/tx/TxQueueEntry.h b/src/ripple/module/app/tx/TxQueueEntry.h index 20b856924..999ae9e59 100644 --- a/src/ripple/module/app/tx/TxQueueEntry.h +++ b/src/ripple/module/app/tx/TxQueueEntry.h @@ -26,8 +26,8 @@ namespace ripple { class TxQueueEntry { public: - typedef boost::shared_ptr pointer; - typedef const boost::shared_ptr& ref; + typedef std::shared_ptr pointer; + typedef const std::shared_ptr& ref; typedef std::function stCallback; // must complete immediately public: diff --git a/src/ripple/module/app/websocket/WSConnection.cpp b/src/ripple/module/app/websocket/WSConnection.cpp index d19769e33..860ef54ae 100644 --- a/src/ripple/module/app/websocket/WSConnection.cpp +++ b/src/ripple/module/app/websocket/WSConnection.cpp @@ -152,7 +152,7 @@ Json::Value WSConnection::invokeCommand (Json::Value& jvRequest) } Resource::Charge loadType = Resource::feeReferenceRPC; - RPCHandler mRPCHandler (&this->m_netOPs, boost::dynamic_pointer_cast (this->shared_from_this ())); + RPCHandler mRPCHandler (&this->m_netOPs, std::dynamic_pointer_cast (this->shared_from_this ())); Json::Value jvResult (Json::objectValue); Config::Role const role = m_isPublic diff --git a/src/ripple/module/app/websocket/WSConnection.h b/src/ripple/module/app/websocket/WSConnection.h index a3c536034..87b50f574 100644 --- a/src/ripple/module/app/websocket/WSConnection.h +++ b/src/ripple/module/app/websocket/WSConnection.h @@ -26,7 +26,7 @@ namespace ripple { This handles everything that is independent of the endpint_type. */ class WSConnection - : public boost::enable_shared_from_this + : public std::enable_shared_from_this , public InfoSub , public CountedObject , public beast::Uncopyable @@ -119,7 +119,7 @@ public: } } - static void destroy (boost::shared_ptr >) + static void destroy (std::shared_ptr >) { // Just discards the reference } diff --git a/src/ripple/module/app/websocket/WSDoor.cpp b/src/ripple/module/app/websocket/WSDoor.cpp index c05f97156..5990b4929 100644 --- a/src/ripple/module/app/websocket/WSDoor.cpp +++ b/src/ripple/module/app/websocket/WSDoor.cpp @@ -80,7 +80,7 @@ private: { ScopedLockType lock (m_endpointLock); - m_endpoint = boost::make_shared (handler); + m_endpoint = std::make_shared (handler); } // Call the main-event-loop of the websocket server. @@ -121,7 +121,7 @@ private: void onStop () { - boost::shared_ptr endpoint; + std::shared_ptr endpoint; { ScopedLockType lock (m_endpointLock); @@ -147,7 +147,7 @@ private: boost::asio::ssl::context& m_ssl_context; LockType m_endpointLock; - boost::shared_ptr m_endpoint; + std::shared_ptr m_endpoint; bool mPublic; bool mProxy; std::string mIp; diff --git a/src/ripple/module/app/websocket/WSServerHandler.h b/src/ripple/module/app/websocket/WSServerHandler.h index 8e284934f..0606d4a2c 100644 --- a/src/ripple/module/app/websocket/WSServerHandler.h +++ b/src/ripple/module/app/websocket/WSServerHandler.h @@ -48,7 +48,7 @@ class WSServerHandler public: typedef typename endpoint_type::handler::connection_ptr connection_ptr; typedef typename endpoint_type::handler::message_ptr message_ptr; - typedef boost::shared_ptr< WSConnectionType > wsc_ptr; + typedef std::shared_ptr< WSConnectionType > wsc_ptr; // Private reasons to close. enum @@ -72,7 +72,7 @@ private: protected: // For each connection maintain an associated object to track subscriptions. typedef ripple::unordered_map > > MapType; + std::shared_ptr > > MapType; MapType mMap; bool const mPublic; bool const mProxy; @@ -194,7 +194,7 @@ public: { std::pair const result ( mMap.emplace (cpClient, - boost::make_shared < WSConnectionType > (boost::ref(m_resourceManager), + std::make_shared < WSConnectionType > (boost::ref(m_resourceManager), boost::ref (m_source), boost::ref(*this), boost::cref(cpClient)))); assert (result.second); WriteLog (lsDEBUG, WSServerHandlerLog) << diff --git a/src/ripple/module/basics/log/LoggedTimings.h b/src/ripple/module/basics/log/LoggedTimings.h index c904b23a8..9eb62e010 100644 --- a/src/ripple/module/basics/log/LoggedTimings.h +++ b/src/ripple/module/basics/log/LoggedTimings.h @@ -35,12 +35,12 @@ namespace detail { template struct Destroyer; -/** Specialization for boost::shared_ptr. +/** Specialization for std::shared_ptr. */ template -struct Destroyer > +struct Destroyer > { - static void destroy (boost::shared_ptr & p) + static void destroy (std::shared_ptr & p) { p.reset (); } diff --git a/src/ripple/module/basics/system/BoostIncludes.h b/src/ripple/module/basics/system/BoostIncludes.h index be7d8fc7f..416e231e1 100644 --- a/src/ripple/module/basics/system/BoostIncludes.h +++ b/src/ripple/module/basics/system/BoostIncludes.h @@ -33,14 +33,11 @@ #include #include -#include #include #include #include #include -#include #include -#include #include #include diff --git a/src/ripple/module/core/functional/Job.cpp b/src/ripple/module/core/functional/Job.cpp index 7b9d1fa31..e9dc254e6 100644 --- a/src/ripple/module/core/functional/Job.cpp +++ b/src/ripple/module/core/functional/Job.cpp @@ -44,7 +44,7 @@ Job::Job (JobType type, , mName (name) , m_queue_time (clock_type::now ()) { - m_loadEvent = boost::make_shared (boost::ref (lm), name, false); + m_loadEvent = std::make_shared (boost::ref (lm), name, false); } JobType Job::getType () const diff --git a/src/ripple/module/core/functional/JobQueue.cpp b/src/ripple/module/core/functional/JobQueue.cpp index 3f5a2fc2f..32f424670 100644 --- a/src/ripple/module/core/functional/JobQueue.cpp +++ b/src/ripple/module/core/functional/JobQueue.cpp @@ -249,9 +249,9 @@ public: assert (iter != m_jobData.end ()); if (iter == m_jobData.end ()) - return boost::shared_ptr (); + return std::shared_ptr (); - return boost::make_shared ( + return std::make_shared ( boost::ref (iter-> second.load ()), name, true); } diff --git a/src/ripple/module/core/functional/LoadEvent.h b/src/ripple/module/core/functional/LoadEvent.h index 0f1609ef9..821a313bb 100644 --- a/src/ripple/module/core/functional/LoadEvent.h +++ b/src/ripple/module/core/functional/LoadEvent.h @@ -40,7 +40,7 @@ public: // // Why both kinds of containers? // - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef std::unique_ptr autoptr; public: diff --git a/src/ripple/module/core/nodestore/api/NodeObject.h b/src/ripple/module/core/nodestore/api/NodeObject.h index 30a09070f..28f598477 100644 --- a/src/ripple/module/core/nodestore/api/NodeObject.h +++ b/src/ripple/module/core/nodestore/api/NodeObject.h @@ -60,10 +60,10 @@ public: }; // Please use this one. For a reference use Ptr const& - typedef boost::shared_ptr Ptr; + typedef std::shared_ptr Ptr; // These are DEPRECATED, type names are capitalized. - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef pointer const& ref; private: diff --git a/src/ripple/module/core/nodestore/impl/BatchWriter.cpp b/src/ripple/module/core/nodestore/impl/BatchWriter.cpp index 3a9eead91..4419331d7 100644 --- a/src/ripple/module/core/nodestore/impl/BatchWriter.cpp +++ b/src/ripple/module/core/nodestore/impl/BatchWriter.cpp @@ -68,7 +68,7 @@ BatchWriter::writeBatch () { for (;;) { - std::vector< boost::shared_ptr > set; + std::vector< std::shared_ptr > set; set.reserve (batchWritePreallocationSize); diff --git a/src/ripple/module/core/nodestore/impl/NodeObject.cpp b/src/ripple/module/core/nodestore/impl/NodeObject.cpp index cf5b3f19e..6d5a90ae5 100644 --- a/src/ripple/module/core/nodestore/impl/NodeObject.cpp +++ b/src/ripple/module/core/nodestore/impl/NodeObject.cpp @@ -42,7 +42,7 @@ NodeObject::Ptr NodeObject::createObject ( Blob&& data, uint256 const & hash) { - return boost::make_shared ( + return std::make_shared ( type, ledgerIndex, std::move (data), hash, PrivateAccess ()); } diff --git a/src/ripple/module/data/crypto/CKey.h b/src/ripple/module/data/crypto/CKey.h index 6e18841af..9c3283d18 100644 --- a/src/ripple/module/data/crypto/CKey.h +++ b/src/ripple/module/data/crypto/CKey.h @@ -90,7 +90,7 @@ protected: public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; CKey () { diff --git a/src/ripple/module/data/protocol/Serializer.h b/src/ripple/module/data/protocol/Serializer.h index f91a246bf..f8e870a73 100644 --- a/src/ripple/module/data/protocol/Serializer.h +++ b/src/ripple/module/data/protocol/Serializer.h @@ -29,7 +29,7 @@ class CKey; // forward declaration class Serializer { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; protected: Blob mData; diff --git a/src/ripple/module/net/basics/HTTPClient.cpp b/src/ripple/module/net/basics/HTTPClient.cpp index 298d4e5bd..6897da4f9 100644 --- a/src/ripple/module/net/basics/HTTPClient.cpp +++ b/src/ripple/module/net/basics/HTTPClient.cpp @@ -18,7 +18,8 @@ //============================================================================== #include - +#include + namespace ripple { // @@ -82,7 +83,7 @@ void HTTPClient::initializeSSLContext () //------------------------------------------------------------------------------ class HTTPClientImp - : public boost::enable_shared_from_this + : public std::enable_shared_from_this , public HTTPClient , beast::LeakChecked { @@ -163,7 +164,7 @@ public: { WriteLog (lsTRACE, HTTPClient) << "Fetch: " << mDeqSites[0]; - boost::shared_ptr query ( + std::shared_ptr query ( new boost::asio::ip::tcp::resolver::query ( mDeqSites[0], beast::lexicalCast (mPort), @@ -177,10 +178,10 @@ public: if (!mShutdown) { mDeadline.async_wait ( - boost::bind ( + std::bind ( &HTTPClientImp::handleDeadline, shared_from_this (), - boost::asio::placeholders::error)); + beast::asio::placeholders::error)); } if (!mShutdown) @@ -188,11 +189,11 @@ public: WriteLog (lsTRACE, HTTPClient) << "Resolving: " << mDeqSites[0]; mResolver.async_resolve (*mQuery, - boost::bind ( + std::bind ( &HTTPClientImp::handleResolve, shared_from_this (), - boost::asio::placeholders::error, - boost::asio::placeholders::iterator)); + beast::asio::placeholders::error, + beast::asio::placeholders::iterator)); } if (mShutdown) @@ -227,10 +228,10 @@ public: mResolver.cancel (); // Stop the transaction. - mSocket.async_shutdown (boost::bind ( + mSocket.async_shutdown (std::bind ( &HTTPClientImp::handleShutdown, shared_from_this (), - boost::asio::placeholders::error)); + beast::asio::placeholders::error)); } } @@ -266,10 +267,10 @@ public: boost::asio::async_connect ( mSocket.lowest_layer (), itrEndpoint, - boost::bind ( + std::bind ( &HTTPClientImp::handleConnect, shared_from_this (), - boost::asio::placeholders::error)); + beast::asio::placeholders::error)); } } @@ -306,10 +307,10 @@ public: { mSocket.async_handshake ( AutoSocket::ssl_socket::client, - boost::bind ( + std::bind ( &HTTPClientImp::handleRequest, shared_from_this (), - boost::asio::placeholders::error)); + beast::asio::placeholders::error)); } else { @@ -336,10 +337,10 @@ public: mSocket.async_write ( mRequest, - boost::bind (&HTTPClientImp::handleWrite, + std::bind (&HTTPClientImp::handleWrite, shared_from_this (), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred)); } } @@ -361,10 +362,10 @@ public: mSocket.async_read_until ( mHeader, "\r\n\r\n", - boost::bind (&HTTPClientImp::handleHeader, + std::bind (&HTTPClientImp::handleHeader, shared_from_this (), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred)); } } @@ -417,10 +418,10 @@ public: mSocket.async_read ( mResponse.prepare (mResponseMax - mBody.size ()), boost::asio::transfer_all (), - boost::bind (&HTTPClientImp::handleData, + std::bind (&HTTPClientImp::handleData, shared_from_this (), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred)); } } @@ -495,12 +496,12 @@ public: } private: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; bool mSSL; AutoSocket mSocket; boost::asio::ip::tcp::resolver mResolver; - boost::shared_ptr mQuery; + std::shared_ptr mQuery; boost::asio::streambuf mRequest; boost::asio::streambuf mHeader; boost::asio::streambuf mResponse; @@ -533,7 +534,7 @@ void HTTPClient::get ( std::function complete) { - boost::shared_ptr client ( + std::shared_ptr client ( new HTTPClientImp (io_service, port, responseMax)); client->get (bSSL, deqSites, strPath, timeout, complete); @@ -552,7 +553,7 @@ void HTTPClient::get ( { std::deque deqSites (1, strSite); - boost::shared_ptr client ( + std::shared_ptr client ( new HTTPClientImp (io_service, port, responseMax)); client->get (bSSL, deqSites, strPath, timeout, complete); @@ -571,7 +572,7 @@ void HTTPClient::request ( { std::deque deqSites (1, strSite); - boost::shared_ptr client ( + std::shared_ptr client ( new HTTPClientImp (io_service, port, responseMax)); client->request (bSSL, deqSites, setRequest, timeout, complete); @@ -608,7 +609,7 @@ void HTTPClient::sendSMS (boost::asio::io_service& io_service, const std::string if (iPort < 0) iPort = bSSL ? 443 : 80; - boost::shared_ptr client ( + std::shared_ptr client ( new HTTPClientImp (io_service, iPort, maxClientHeaderBytes)); client->get (bSSL, deqSites, strURI, boost::posix_time::seconds (smsTimeoutSeconds), diff --git a/src/ripple/module/net/basics/RPCDoor.cpp b/src/ripple/module/net/basics/RPCDoor.cpp index 83cb1c53c..7946c5287 100644 --- a/src/ripple/module/net/basics/RPCDoor.cpp +++ b/src/ripple/module/net/basics/RPCDoor.cpp @@ -2,7 +2,6 @@ /* This file is part of rippled: https://github.com/ripple/rippled Copyright (c) 2012, 2013 Ripple Labs Inc. - Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. @@ -56,7 +55,7 @@ public: void startListening () { - RPCServerImp::pointer new_connection (boost::make_shared ( + RPCServerImp::pointer new_connection (std::make_shared ( boost::ref (mAcceptor.get_io_service ()), boost::ref (m_sslContext->get ()), boost::ref (m_rpcServerHandler))); @@ -65,8 +64,8 @@ public: mAcceptor.async_accept (new_connection->getRawSocket (), new_connection->getRemoteEndpoint (), - boost::bind (&RPCDoorImp::handleConnect, this, - new_connection, boost::asio::placeholders::error)); + std::bind (&RPCDoorImp::handleConnect, this, + new_connection, beast::asio::placeholders::error)); } //-------------------------------------------------------------------------- @@ -104,7 +103,7 @@ public: } new_connection->getSocket ().async_handshake (AutoSocket::ssl_socket::server, - boost::bind (&RPCServer::connected, new_connection)); + std::bind (&RPCServer::connected, new_connection)); } else { @@ -117,7 +116,7 @@ public: if (delay) { mDelayTimer.expires_from_now (boost::posix_time::milliseconds (1000)); - mDelayTimer.async_wait (boost::bind (&RPCDoorImp::startListening, this)); + mDelayTimer.async_wait (std::bind (&RPCDoorImp::startListening, this)); } else { diff --git a/src/ripple/module/net/basics/impl/RPCServerImp.h b/src/ripple/module/net/basics/impl/RPCServerImp.h index 74dcfc103..f92f3b96a 100644 --- a/src/ripple/module/net/basics/impl/RPCServerImp.h +++ b/src/ripple/module/net/basics/impl/RPCServerImp.h @@ -25,11 +25,11 @@ SETUP_LOG (RPCServer) class RPCServerImp : public RPCServer - , public boost::enable_shared_from_this + , public std::enable_shared_from_this , public beast::LeakChecked { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; RPCServerImp ( boost::asio::io_service& io_service, @@ -54,10 +54,10 @@ public: mSocket, mLineBuffer, "\r\n", - mStrand.wrap (boost::bind ( + mStrand.wrap (std::bind ( &RPCServerImp::handle_read_line, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } //-------------------------------------------------------------------------- @@ -70,10 +70,10 @@ public: if (action == HTTPRequest::haCLOSE_CONN) { - mSocket.async_shutdown (mStrand.wrap (boost::bind ( + mSocket.async_shutdown (mStrand.wrap (std::bind ( &RPCServerImp::handle_shutdown, - boost::static_pointer_cast (shared_from_this()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this()), + beast::asio::placeholders::error))); } else { @@ -81,10 +81,10 @@ public: mSocket, mLineBuffer, "\r\n", - mStrand.wrap (boost::bind ( + mStrand.wrap (std::bind ( &RPCServerImp::handle_read_line, - boost::static_pointer_cast (shared_from_this()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this()), + beast::asio::placeholders::error))); } } @@ -109,10 +109,10 @@ public: // request with no body WriteLog (lsWARNING, RPCServer) << "RPC HTTP request with no body"; - mSocket.async_shutdown (mStrand.wrap (boost::bind ( + mSocket.async_shutdown (mStrand.wrap (std::bind ( &RPCServerImp::handle_shutdown, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } else if (action == HTTPRequest::haREAD_LINE) { @@ -120,10 +120,10 @@ public: mSocket, mLineBuffer, "\r\n", - mStrand.wrap (boost::bind ( + mStrand.wrap (std::bind ( &RPCServerImp::handle_read_line, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } else if (action == HTTPRequest::haREAD_RAW) { @@ -133,10 +133,10 @@ public: { WriteLog (lsWARNING, RPCServer) << "Illegal RPC request length " << rLen; - mSocket.async_shutdown (mStrand.wrap (boost::bind ( + mSocket.async_shutdown (mStrand.wrap (std::bind ( &RPCServerImp::handle_shutdown, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } else { @@ -149,10 +149,10 @@ public: boost::asio::async_read ( mSocket, boost::asio::buffer (mQueryVec), - mStrand.wrap (boost::bind ( + mStrand.wrap (std::bind ( &RPCServerImp::handle_read_req, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); WriteLog (lsTRACE, RPCServer) << "Waiting for completed request: " << rLen; } @@ -167,10 +167,10 @@ public: } else { - mSocket.async_shutdown (mStrand.wrap (boost::bind ( + mSocket.async_shutdown (mStrand.wrap (std::bind ( &RPCServerImp::handle_shutdown, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } } } @@ -202,10 +202,10 @@ public: boost::asio::async_write ( mSocket, boost::asio::buffer (mReplyStr), - mStrand.wrap (boost::bind ( + mStrand.wrap (std::bind ( &RPCServerImp::handle_write, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } //-------------------------------------------------------------------------- diff --git a/src/ripple/module/net/rpc/InfoSub.cpp b/src/ripple/module/net/rpc/InfoSub.cpp index 1c0963a1a..de2b4f3a7 100644 --- a/src/ripple/module/net/rpc/InfoSub.cpp +++ b/src/ripple/module/net/rpc/InfoSub.cpp @@ -88,12 +88,12 @@ void InfoSub::clearPathRequest () mPathRequest.reset (); } -void InfoSub::setPathRequest (const boost::shared_ptr& req) +void InfoSub::setPathRequest (const std::shared_ptr& req) { mPathRequest = req; } -const boost::shared_ptr& InfoSub::getPathRequest () +const std::shared_ptr& InfoSub::getPathRequest () { return mPathRequest; } diff --git a/src/ripple/module/net/rpc/InfoSub.h b/src/ripple/module/net/rpc/InfoSub.h index 039db5694..6e32e97cd 100644 --- a/src/ripple/module/net/rpc/InfoSub.h +++ b/src/ripple/module/net/rpc/InfoSub.h @@ -35,12 +35,12 @@ class InfoSub public: static char const* getCountedObjectName () { return "InfoSub"; } - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; // VFALCO TODO Standardize on the names of weak / strong pointer typedefs. - typedef boost::weak_ptr wptr; + typedef std::weak_ptr wptr; - typedef const boost::shared_ptr& ref; + typedef const std::shared_ptr& ref; typedef Resource::Consumer Consumer; @@ -118,9 +118,9 @@ public: void clearPathRequest (); - void setPathRequest (const boost::shared_ptr& req); + void setPathRequest (const std::shared_ptr& req); - boost::shared_ptr const& getPathRequest (); + std::shared_ptr const& getPathRequest (); protected: typedef RippleMutex LockType; @@ -132,7 +132,7 @@ private: Source& m_source; boost::unordered_set mSubAccountInfo; boost::unordered_set mSubAccountTransaction; - boost::shared_ptr mPathRequest; + std::shared_ptr mPathRequest; std::uint64_t mSeq; }; diff --git a/src/ripple/module/net/rpc/RPCSub.cpp b/src/ripple/module/net/rpc/RPCSub.cpp index eb1ef5261..1cd641d80 100644 --- a/src/ripple/module/net/rpc/RPCSub.cpp +++ b/src/ripple/module/net/rpc/RPCSub.cpp @@ -205,7 +205,7 @@ RPCSub::pointer RPCSub::New (InfoSub::Source& source, const std::string& strUrl, const std::string& strUsername, const std::string& strPassword) { - return boost::make_shared (boost::ref (source), + return std::make_shared (boost::ref (source), boost::ref (io_service), boost::ref (jobQueue), strUrl, strUsername, strPassword); } diff --git a/src/ripple/module/net/rpc/RPCSub.h b/src/ripple/module/net/rpc/RPCSub.h index 4690bdee0..26f26bf8e 100644 --- a/src/ripple/module/net/rpc/RPCSub.h +++ b/src/ripple/module/net/rpc/RPCSub.h @@ -26,7 +26,7 @@ namespace ripple { class RPCSub : public InfoSub { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; typedef pointer const& ref; static pointer New (InfoSub::Source& source, diff --git a/src/ripple/module/overlay/api/Message.h b/src/ripple/module/overlay/api/Message.h index b3ff8f03c..44d55b2fc 100644 --- a/src/ripple/module/overlay/api/Message.h +++ b/src/ripple/module/overlay/api/Message.h @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace ripple { @@ -42,10 +41,10 @@ namespace ripple { // MessageType should be a Message class generated by the protobuf compiler. // -class Message : public boost::enable_shared_from_this +class Message : public std::enable_shared_from_this { public: - typedef boost::shared_ptr pointer; + typedef std::shared_ptr pointer; public: /** Number of bytes in a message header. diff --git a/src/ripple/module/overlay/api/Peer.h b/src/ripple/module/overlay/api/Peer.h index c020da574..d8c86a258 100644 --- a/src/ripple/module/overlay/api/Peer.h +++ b/src/ripple/module/overlay/api/Peer.h @@ -38,7 +38,7 @@ class Charge; class Peer { public: - typedef boost::shared_ptr ptr; + typedef std::shared_ptr ptr; /** Uniquely identifies a particular connection of a peer. */ typedef std::uint32_t ShortId; diff --git a/src/ripple/module/overlay/impl/OverlayImpl.cpp b/src/ripple/module/overlay/impl/OverlayImpl.cpp index a1ee59b31..09eda877d 100644 --- a/src/ripple/module/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/module/overlay/impl/OverlayImpl.cpp @@ -141,7 +141,7 @@ OverlayImpl::accept (bool proxyHandshake, socket_type&& socket) if (proxyHandshake) flags = flags.with (MultiSocket::Flag::proxy); - PeerImp::ptr const peer (boost::make_shared ( + PeerImp::ptr const peer (std::make_shared ( std::move (socket), remote_endpoint, *this, m_resourceManager, *m_peerFinder, slot, m_ssl_context, flags)); @@ -180,7 +180,7 @@ OverlayImpl::connect (beast::IP::Endpoint const& remote_endpoint) MultiSocket::Flag const flags ( MultiSocket::Flag::client_role | MultiSocket::Flag::ssl); - PeerImp::ptr const peer (boost::make_shared ( + PeerImp::ptr const peer (std::make_shared ( remote_endpoint, m_io_service, *this, m_resourceManager, *m_peerFinder, slot, m_ssl_context, flags)); @@ -297,7 +297,7 @@ OverlayImpl::send (PeerFinder::Slot::ptr const& slot, tm.set_version (1); Message::pointer msg ( - boost::make_shared ( + std::make_shared ( tm, protocol::mtENDPOINTS)); { diff --git a/src/ripple/module/overlay/impl/OverlayImpl.h b/src/ripple/module/overlay/impl/OverlayImpl.h index 5398daae3..52c16164e 100644 --- a/src/ripple/module/overlay/impl/OverlayImpl.h +++ b/src/ripple/module/overlay/impl/OverlayImpl.h @@ -51,7 +51,7 @@ public: typedef boost::asio::ip::tcp::socket socket_type; typedef std::unordered_map > PeersBySlot; + std::weak_ptr > PeersBySlot; typedef boost::unordered_map < RippleAddress, Peer::ptr> PeerByPublicKey; diff --git a/src/ripple/module/overlay/impl/PeerImp.h b/src/ripple/module/overlay/impl/PeerImp.h index 8dac79bb9..06aa0fdb0 100644 --- a/src/ripple/module/overlay/impl/PeerImp.h +++ b/src/ripple/module/overlay/impl/PeerImp.h @@ -34,7 +34,8 @@ #include #include - +#include + #include namespace ripple { @@ -59,7 +60,7 @@ std::ostream& operator<< (std::ostream& os, PeerImp const* peer); class PeerImp : public Peer - , public boost::enable_shared_from_this + , public std::enable_shared_from_this , private beast::LeakChecked { private: @@ -85,10 +86,10 @@ private: m_socket->set_verify_mode (boost::asio::ssl::verify_none); m_socket->async_handshake ( boost::asio::ssl::stream_base::server, - m_strand.wrap (boost::bind ( + m_strand.wrap (std::bind ( &PeerImp::handleStart, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } /** Attempt an outbound connection. @@ -107,9 +108,9 @@ private: m_timer.expires_from_now (nodeVerifySeconds, err); - m_timer.async_wait (m_strand.wrap (boost::bind ( + m_timer.async_wait (m_strand.wrap (std::bind ( &PeerImp::handleVerifyTimer, - shared_from_this (), boost::asio::placeholders::error))); + shared_from_this (), beast::asio::placeholders::error))); if (err) { @@ -120,8 +121,8 @@ private: m_socket->next_layer ().async_connect ( beast::IPAddressConversion::to_asio_endpoint (m_remoteAddress), - m_strand.wrap (boost::bind (&PeerImp::onConnect, - shared_from_this (), boost::asio::placeholders::error))); + m_strand.wrap (std::bind (&PeerImp::onConnect, + shared_from_this (), beast::asio::placeholders::error))); } public: @@ -144,7 +145,7 @@ public: ,stateGracefulClose }; - typedef boost::shared_ptr ptr; + typedef std::shared_ptr ptr; NativeSocketType m_owned_socket; @@ -352,10 +353,10 @@ public: if (graceful) { m_socket->async_shutdown ( - m_strand.wrap ( boost::bind( + m_strand.wrap ( std::bind( &PeerImp::handleShutdown, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } else { @@ -419,9 +420,9 @@ public: m_socket->set_verify_mode (boost::asio::ssl::verify_none); m_socket->async_handshake ( boost::asio::ssl::stream_base::client, - m_strand.wrap (boost::bind (&PeerImp::handleStart, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error))); + m_strand.wrap (std::bind (&PeerImp::handleStart, + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error))); } /** Indicates that the peer must be activated. @@ -483,7 +484,7 @@ public: msg.set_doweneedthis (1); - Message::pointer packet = boost::make_shared ( + Message::pointer packet = std::make_shared ( msg, protocol::mtGET_PEERS); sendPacket (packet, true); @@ -495,7 +496,7 @@ public: detach ("resource"); } - static void charge (boost::weak_ptr & peer, Resource::Charge const& fee) + static void charge (std::weak_ptr & peer, Resource::Charge const& fee) { Peer::ptr p (peer.lock()); @@ -1031,8 +1032,8 @@ private: case protocol::mtPROPOSE_LEDGER: { event->reName ("Peer::propose"); - boost::shared_ptr msg ( - boost::make_shared ()); + std::shared_ptr msg ( + std::make_shared ()); if (msg->ParseFromArray (&m_readBuffer[Message::kHeaderBytes], msgLen)) @@ -1045,8 +1046,8 @@ private: case protocol::mtGET_LEDGER: { event->reName ("Peer::getledger"); - boost::shared_ptr msg ( - boost::make_shared ()); + std::shared_ptr msg ( + std::make_shared ()); if (msg->ParseFromArray (&m_readBuffer[Message::kHeaderBytes], msgLen)) @@ -1059,8 +1060,8 @@ private: case protocol::mtLEDGER_DATA: { event->reName ("Peer::ledgerdata"); - boost::shared_ptr msg ( - boost::make_shared ()); + std::shared_ptr msg ( + std::make_shared ()); if (msg->ParseFromArray (&m_readBuffer[Message::kHeaderBytes], msgLen)) @@ -1086,8 +1087,8 @@ private: case protocol::mtVALIDATION: { event->reName ("Peer::validation"); - boost::shared_ptr msg ( - boost::make_shared ()); + std::shared_ptr msg ( + std::make_shared ()); if (msg->ParseFromArray (&m_readBuffer[Message::kHeaderBytes], msgLen)) @@ -1114,8 +1115,8 @@ private: case protocol::mtGET_OBJECTS: { event->reName ("Peer::getobjects"); - boost::shared_ptr msg = - boost::make_shared (); + std::shared_ptr msg = + std::make_shared (); if (msg->ParseFromArray (&m_readBuffer[Message::kHeaderBytes], msgLen)) @@ -1156,10 +1157,10 @@ private: boost::asio::async_read (getStream (), boost::asio::buffer (m_readBuffer), - m_strand.wrap (boost::bind (&PeerImp::handleReadHeader, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred))); + m_strand.wrap (std::bind (&PeerImp::handleReadHeader, + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred))); } } @@ -1176,11 +1177,11 @@ private: boost::asio::async_read (getStream (), boost::asio::buffer ( &m_readBuffer [Message::kHeaderBytes], msg_len), - m_strand.wrap (boost::bind ( + m_strand.wrap (std::bind ( &PeerImp::handleReadBody, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred))); } } @@ -1193,11 +1194,11 @@ private: boost::asio::async_write (getStream (), boost::asio::buffer (packet->getBuffer ()), - m_strand.wrap (boost::bind ( + m_strand.wrap (std::bind ( &PeerImp::handleWrite, - boost::static_pointer_cast (shared_from_this ()), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred))); + std::static_pointer_cast (shared_from_this ()), + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred))); } } @@ -1333,7 +1334,7 @@ private: h.set_ledgerprevious (hash.begin (), hash.size ()); } - Message::pointer packet = boost::make_shared ( + Message::pointer packet = std::make_shared ( h, protocol::mtHELLO); sendPacket (packet, true); @@ -1507,7 +1508,7 @@ private: { #endif SerializerIterator sit (s); - SerializedTransaction::pointer stx = boost::make_shared (boost::ref (sit)); + SerializedTransaction::pointer stx = std::make_shared (boost::ref (sit)); uint256 txID = stx->getTransactionID(); int flags; @@ -1540,7 +1541,7 @@ private: std::bind ( &PeerImp::checkTransaction, std::placeholders::_1, flags, stx, - boost::weak_ptr (shared_from_this ()))); + std::weak_ptr (shared_from_this ()))); #ifndef TRUST_NETWORK } @@ -1552,7 +1553,7 @@ private: #endif } - void recvValidation (const boost::shared_ptr& packet) + void recvValidation (const std::shared_ptr& packet) { std::uint32_t closeTime = getApp().getOPs().getCloseTimeNC(); @@ -1570,7 +1571,7 @@ private: { Serializer s (packet->validation ()); SerializerIterator sit (s); - SerializedValidation::pointer val = boost::make_shared (boost::ref (sit), false); + SerializedValidation::pointer val = std::make_shared (boost::ref (sit), false); if (closeTime > (120 + val->getFieldU32(sfSigningTime))) { @@ -1594,7 +1595,7 @@ private: std::bind ( &PeerImp::checkValidation, std::placeholders::_1, &m_overlay, val, isTrusted, m_clusterNode, packet, - boost::weak_ptr (shared_from_this ()))); + std::weak_ptr (shared_from_this ()))); } else m_journal.debug << "Dropping UNTRUSTED validation due to load"; @@ -1633,7 +1634,7 @@ private: // response with some data here anyways, and send if non-empty. sendPacket ( - boost::make_shared (peers, protocol::mtPEERS), + std::make_shared (peers, protocol::mtPEERS), true); #endif } @@ -1701,7 +1702,7 @@ private: m_peerFinder.on_endpoints (m_slot, endpoints); } - void recvGetObjectByHash (const boost::shared_ptr& ptr) + void recvGetObjectByHash (const std::shared_ptr& ptr) { protocol::TMGetObjectByHash& packet = *ptr; @@ -1756,7 +1757,7 @@ private: " of " << packet.objects_size () << " for " << to_string (this); sendPacket ( - boost::make_shared (reply, protocol::mtGET_OBJECTS), + std::make_shared (reply, protocol::mtGET_OBJECTS), true); } else @@ -1796,8 +1797,8 @@ private: uint256 hash; memcpy (hash.begin (), obj.hash ().data (), 256 / 8); - boost::shared_ptr< Blob > data ( - boost::make_shared< Blob > ( + std::shared_ptr< Blob > data ( + std::make_shared< Blob > ( obj.data ().begin (), obj.data ().end ())); getApp().getOPs ().addFetchPack (hash, data); @@ -1819,7 +1820,7 @@ private: if (packet.type () == protocol::TMPing::ptPING) { packet.set_type (protocol::TMPing::ptPONG); - sendPacket (boost::make_shared (packet, protocol::mtPING), true); + sendPacket (std::make_shared (packet, protocol::mtPING), true); } } @@ -1839,20 +1840,20 @@ private: { } - void recvGetLedger (boost::shared_ptr const& packet) + void recvGetLedger (std::shared_ptr const& packet) { getApp().getJobQueue().addJob (jtPACK, "recvGetLedger", - std::bind (&sGetLedger, boost::weak_ptr (shared_from_this ()), packet)); + std::bind (&sGetLedger, std::weak_ptr (shared_from_this ()), packet)); } /** A peer has sent us transaction set data */ static void peerTXData (Job&, - boost::weak_ptr wPeer, + std::weak_ptr wPeer, uint256 const& hash, - boost::shared_ptr pPacket, + std::shared_ptr pPacket, beast::Journal journal) { - boost::shared_ptr peer = wPeer.lock (); + std::shared_ptr peer = wPeer.lock (); if (!peer) return; @@ -1889,7 +1890,7 @@ private: } - void recvLedger (boost::shared_ptr const& packet_ptr) + void recvLedger (std::shared_ptr const& packet_ptr) { protocol::TMLedgerData& packet = *packet_ptr; @@ -1906,7 +1907,7 @@ private: if (target) { packet.clear_requestcookie (); - target->sendPacket (boost::make_shared (packet, protocol::mtLEDGER_DATA), false); + target->sendPacket (std::make_shared (packet, protocol::mtLEDGER_DATA), false); } else { @@ -1934,7 +1935,7 @@ private: getApp().getJobQueue().addJob (jtTXN_DATA, "recvPeerData", std::bind (&PeerImp::peerTXData, std::placeholders::_1, - boost::weak_ptr (shared_from_this ()), + std::weak_ptr (shared_from_this ()), hash, packet_ptr, m_journal)); return; @@ -2011,7 +2012,7 @@ private: } } - void recvPropose (const boost::shared_ptr& packet) + void recvPropose (const std::shared_ptr& packet) { assert (packet); protocol::TMProposeSet& set = *packet; @@ -2076,7 +2077,7 @@ private: consensusLCL = getApp().getOPs ().getConsensusLCL (); } - LedgerProposal::pointer proposal = boost::make_shared ( + LedgerProposal::pointer proposal = std::make_shared ( prevLedger.isNonZero () ? prevLedger : consensusLCL, set.proposeseq (), proposeHash, set.closetime (), signerPublic, suppression); @@ -2084,7 +2085,7 @@ private: "recvPropose->checkPropose", std::bind ( &PeerImp::checkPropose, std::placeholders::_1, &m_overlay, packet, proposal, consensusLCL, m_nodePublicKey, - boost::weak_ptr (shared_from_this ()), m_clusterNode)); + std::weak_ptr (shared_from_this ()), m_clusterNode)); } void recvHaveTxSet (protocol::TMHaveTransactionSet& packet) @@ -2170,7 +2171,7 @@ private: memcpy (challenge.begin (), packet.challenge ().data (), 256 / 8); memcpy (target.begin (), packet.target ().data (), 256 / 8); - ProofOfWork::pointer pow = boost::make_shared (packet.token (), packet.iterations (), + ProofOfWork::pointer pow = std::make_shared (packet.token (), packet.iterations (), challenge, target); if (!pow->isValid ()) @@ -2184,7 +2185,7 @@ private: jtPROOFWORK, "recvProof->doProof", std::bind (&PeerImp::doProofOfWork, std::placeholders::_1, - boost::weak_ptr (shared_from_this ()), pow)); + std::weak_ptr (shared_from_this ()), pow)); #endif return; @@ -2281,7 +2282,7 @@ private: Peer::ptr const& selectedPeer = usablePeers[rand () % usablePeers.size ()]; packet.set_requestcookie (getShortId ()); selectedPeer->sendPacket ( - boost::make_shared (packet, protocol::mtGET_LEDGER), + std::make_shared (packet, protocol::mtGET_LEDGER), false); return; } @@ -2355,7 +2356,7 @@ private: Peer::ptr const& selectedPeer = usablePeers[rand () % usablePeers.size ()]; packet.set_requestcookie (getShortId ()); selectedPeer->sendPacket ( - boost::make_shared (packet, protocol::mtGET_LEDGER), false); + std::make_shared (packet, protocol::mtGET_LEDGER), false); m_journal.debug << "Ledger request routed"; return; } @@ -2445,7 +2446,7 @@ private: } } - Message::pointer oPacket = boost::make_shared (reply, protocol::mtLEDGER_DATA); + Message::pointer oPacket = std::make_shared (reply, protocol::mtLEDGER_DATA); sendPacket (oPacket, false); return; } @@ -2529,17 +2530,17 @@ private: } } - Message::pointer oPacket = boost::make_shared (reply, protocol::mtLEDGER_DATA); + Message::pointer oPacket = std::make_shared (reply, protocol::mtLEDGER_DATA); sendPacket (oPacket, false); } // This is dispatched by the job queue static void - sGetLedger (boost::weak_ptr wPeer, - boost::shared_ptr packet) + sGetLedger (std::weak_ptr wPeer, + std::shared_ptr packet) { - boost::shared_ptr peer = wPeer.lock (); + std::shared_ptr peer = wPeer.lock (); if (peer) peer->getLedger (*packet); @@ -2558,7 +2559,7 @@ private: m_recentTxSets.push_back (hash); } - void doFetchPack (const boost::shared_ptr& packet) + void doFetchPack (const std::shared_ptr& packet) { // VFALCO TODO Invert this dependency using an observer and shared state object. // Don't queue fetch pack jobs if we're under load or we already have @@ -2583,11 +2584,11 @@ private: getApp().getJobQueue ().addJob (jtPACK, "MakeFetchPack", std::bind (&NetworkOPs::makeFetchPack, &getApp().getOPs (), std::placeholders::_1, - boost::weak_ptr (shared_from_this ()), packet, + std::weak_ptr (shared_from_this ()), packet, hash, UptimeTimer::getInstance ().getElapsedSeconds ())); } - void doProofOfWork (Job&, boost::weak_ptr peer, ProofOfWork::pointer pow) + void doProofOfWork (Job&, std::weak_ptr peer, ProofOfWork::pointer pow) { if (peer.expired ()) return; @@ -2607,7 +2608,7 @@ private: protocol::TMProofWork reply; reply.set_token (pow->getToken ()); reply.set_response (solution.begin (), solution.size ()); - pptr->sendPacket (boost::make_shared (reply, protocol::mtPROOFOFWORK), false); + pptr->sendPacket (std::make_shared (reply, protocol::mtPROOFOFWORK), false); } else { @@ -2616,7 +2617,7 @@ private: } } - static void checkTransaction (Job&, int flags, SerializedTransaction::pointer stx, boost::weak_ptr peer) + static void checkTransaction (Job&, int flags, SerializedTransaction::pointer stx, std::weak_ptr peer) { #ifndef TRUST_NETWORK try @@ -2634,7 +2635,7 @@ private: bool needCheck = ! is_bit_set (flags, SF_SIGGOOD); Transaction::pointer tx = - boost::make_shared (stx, needCheck); + std::make_shared (stx, needCheck); if (tx->getStatus () == INVALID) { @@ -2659,9 +2660,9 @@ private: } // Called from our JobQueue - static void checkPropose (Job& job, Overlay* pPeers, boost::shared_ptr packet, + static void checkPropose (Job& job, Overlay* pPeers, std::shared_ptr packet, LedgerProposal::pointer proposal, uint256 consensusLCL, RippleAddress nodePublic, - boost::weak_ptr peer, bool fromCluster) + std::weak_ptr peer, bool fromCluster) { bool sigGood = false; bool isTrusted = (job.getType () == jtPROPOSAL_t); @@ -2721,7 +2722,7 @@ private: proposal->getSuppressionID (), peers, SF_RELAYED)) { pPeers->foreach (send_if_not ( - boost::make_shared (set, protocol::mtPROPOSE_LEDGER), + std::make_shared (set, protocol::mtPROPOSE_LEDGER), peer_in_set(peers))); } } @@ -2732,7 +2733,7 @@ private: } static void checkValidation (Job&, Overlay* pPeers, SerializedValidation::pointer val, bool isTrusted, bool isCluster, - boost::shared_ptr packet, boost::weak_ptr peer) + std::shared_ptr packet, std::weak_ptr peer) { #ifndef TRUST_NETWORK @@ -2773,7 +2774,7 @@ private: getApp().getHashRouter ().swapSet (signingHash, peers, SF_RELAYED)) { pPeers->foreach (send_if_not ( - boost::make_shared (*packet, protocol::mtVALIDATION), + std::make_shared (*packet, protocol::mtVALIDATION), peer_in_set(peers))); } } diff --git a/src/ripple/module/rpc/handlers/RipplePathFind.cpp b/src/ripple/module/rpc/handlers/RipplePathFind.cpp index 25bd5f11c..4e0f86f8a 100644 --- a/src/ripple/module/rpc/handlers/RipplePathFind.cpp +++ b/src/ripple/module/rpc/handlers/RipplePathFind.cpp @@ -94,8 +94,8 @@ Json::Value RPCHandler::doRipplePathFind ( if (lpLedger) { // The caller specified a ledger - lpLedger = boost::make_shared (boost::ref (*lpLedger), false); - cache = boost::make_shared(lpLedger); + lpLedger = std::make_shared (boost::ref (*lpLedger), false); + cache = std::make_shared(lpLedger); } else { diff --git a/src/ripple/module/rpc/handlers/Submit.cpp b/src/ripple/module/rpc/handlers/Submit.cpp index 2ebab2399..baa9a8d66 100644 --- a/src/ripple/module/rpc/handlers/Submit.cpp +++ b/src/ripple/module/rpc/handlers/Submit.cpp @@ -50,7 +50,7 @@ Json::Value RPCHandler::doSubmit (Json::Value params, Resource::Charge& loadType try { - stpTrans = boost::make_shared (boost::ref (sitTrans)); + stpTrans = std::make_shared (boost::ref (sitTrans)); } catch (std::exception& e) { @@ -64,7 +64,7 @@ Json::Value RPCHandler::doSubmit (Json::Value params, Resource::Charge& loadType try { - tpTrans = boost::make_shared (stpTrans, false); + tpTrans = std::make_shared (stpTrans, false); } catch (std::exception& e) { diff --git a/src/ripple/module/rpc/handlers/Subscribe.cpp b/src/ripple/module/rpc/handlers/Subscribe.cpp index b03d89b50..1a7addd03 100644 --- a/src/ripple/module/rpc/handlers/Subscribe.cpp +++ b/src/ripple/module/rpc/handlers/Subscribe.cpp @@ -65,7 +65,7 @@ Json::Value RPCHandler::doSubscribe (Json::Value params, Resource::Charge& loadT RPCSub::pointer rspSub = RPCSub::New (getApp ().getOPs (), getApp ().getIOService (), getApp ().getJobQueue (), strUrl, strUsername, strPassword); - ispSub = mNetOps->addRpcSub (strUrl, boost::dynamic_pointer_cast (rspSub)); + ispSub = mNetOps->addRpcSub (strUrl, std::dynamic_pointer_cast (rspSub)); } else { diff --git a/src/ripple/module/rpc/impl/TransactionSign.cpp b/src/ripple/module/rpc/impl/TransactionSign.cpp index 3b35259b0..c1ca12811 100644 --- a/src/ripple/module/rpc/impl/TransactionSign.cpp +++ b/src/ripple/module/rpc/impl/TransactionSign.cpp @@ -148,7 +148,7 @@ static Json::Value signPayment( return rpcError (rpcTOO_BUSY); bool bValid; - auto cache = boost::make_shared (lSnapshot); + auto cache = std::make_shared (lSnapshot); Pathfinder pf (cache, raSrcAddressID, dstAccountID, saSendMax.getCurrency (), saSendMax.getIssuer (), amount, bValid); @@ -328,7 +328,7 @@ Json::Value transactionSign ( try { - stpTrans = boost::make_shared (*sopTrans); + stpTrans = std::make_shared (*sopTrans); } catch (std::exception&) { @@ -357,7 +357,7 @@ Json::Value transactionSign ( try { - tpTrans = boost::make_shared (stpTrans, false); + tpTrans = std::make_shared (stpTrans, false); } catch (std::exception&) { @@ -419,7 +419,7 @@ public: RippleAddress rootGeneratorMaster = RippleAddress::createGeneratorPublic (rootSeedMaster); RippleAddress rootAddress = RippleAddress::createAccountPublic (rootGeneratorMaster, 0); std::uint64_t startAmount (100000); - Ledger::pointer ledger (boost::make_shared ( + Ledger::pointer ledger (std::make_shared ( rootAddress, startAmount)); { diff --git a/src/ripple/module/websocket/autosocket/AutoSocket.h b/src/ripple/module/websocket/autosocket/AutoSocket.h index 6cebf6426..966161137 100644 --- a/src/ripple/module/websocket/autosocket/AutoSocket.h +++ b/src/ripple/module/websocket/autosocket/AutoSocket.h @@ -32,7 +32,7 @@ class AutoSocket public: typedef boost::asio::ssl::stream ssl_socket; typedef boost::asio::ip::tcp::socket::endpoint_type endpoint_type; - typedef boost::shared_ptr socket_ptr; + typedef std::shared_ptr socket_ptr; typedef ssl_socket::next_layer_type plain_socket; typedef ssl_socket::lowest_layer_type lowest_layer_type; typedef ssl_socket::handshake_type handshake_type; @@ -44,14 +44,14 @@ public: : mSecure (false) , mBuffer (4) { - mSocket = boost::make_shared (boost::ref (s), boost::ref (c)); + mSocket = std::make_shared (boost::ref (s), boost::ref (c)); } AutoSocket (boost::asio::io_service& s, boost::asio::ssl::context& c, bool secureOnly, bool plainOnly) : mSecure (secureOnly) , mBuffer ((plainOnly || secureOnly) ? 0 : 4) { - mSocket = boost::make_shared (boost::ref (s), boost::ref (c)); + mSocket = std::make_shared (boost::ref (s), boost::ref (c)); } boost::asio::io_service& get_io_service () noexcept diff --git a/src/ripple/testoverlay/impl/TestOverlay.cpp b/src/ripple/testoverlay/impl/TestOverlay.cpp index 3f44ed487..144287bf2 100644 --- a/src/ripple/testoverlay/impl/TestOverlay.cpp +++ b/src/ripple/testoverlay/impl/TestOverlay.cpp @@ -21,10 +21,6 @@ #include -#include -#include -#include - namespace ripple { namespace TestOverlay { diff --git a/src/websocket/src/roles/server.hpp b/src/websocket/src/roles/server.hpp index 2ce45d924..f7f4e45f3 100644 --- a/src/websocket/src/roles/server.hpp +++ b/src/websocket/src/roles/server.hpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include #include