From bbe7457049cd16eabe8272ab8a67ba5e60fa755c Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 4 Dec 2015 15:13:04 -0500 Subject: [PATCH] Make SHMapSyncFilter virtual functions const --- src/ripple/app/ledger/AccountStateSF.cpp | 4 ++-- src/ripple/app/ledger/AccountStateSF.h | 4 ++-- src/ripple/app/ledger/ConsensusTransSetSF.cpp | 4 ++-- src/ripple/app/ledger/ConsensusTransSetSF.h | 4 ++-- src/ripple/app/ledger/TransactionStateSF.cpp | 4 ++-- src/ripple/app/ledger/TransactionStateSF.h | 4 ++-- src/ripple/shamap/SHAMapSyncFilter.h | 4 ++-- src/ripple/shamap/tests/FetchPack.test.cpp | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/ripple/app/ledger/AccountStateSF.cpp b/src/ripple/app/ledger/AccountStateSF.cpp index 5dbf46857..f1691e3fc 100644 --- a/src/ripple/app/ledger/AccountStateSF.cpp +++ b/src/ripple/app/ledger/AccountStateSF.cpp @@ -37,7 +37,7 @@ void AccountStateSF::gotNode (bool fromFilter, SHAMapNodeID const& id, SHAMapHash const& nodeHash, Blob& nodeData, - SHAMapTreeNode::TNType) + SHAMapTreeNode::TNType) const { // VFALCO SHAMapSync filters should be passed the SHAMap, the // SHAMap should provide an accessor to get the injected Database, @@ -48,7 +48,7 @@ void AccountStateSF::gotNode (bool fromFilter, bool AccountStateSF::haveNode (SHAMapNodeID const& id, SHAMapHash const& nodeHash, - Blob& nodeData) + Blob& nodeData) const { return app_.getLedgerMaster ().getFetchPack (nodeHash.as_uint256(), nodeData); } diff --git a/src/ripple/app/ledger/AccountStateSF.h b/src/ripple/app/ledger/AccountStateSF.h index 48fd7b2a5..7b690b089 100644 --- a/src/ripple/app/ledger/AccountStateSF.h +++ b/src/ripple/app/ledger/AccountStateSF.h @@ -42,11 +42,11 @@ public: SHAMapNodeID const& id, SHAMapHash const& nodeHash, Blob& nodeData, - SHAMapTreeNode::TNType) override; + SHAMapTreeNode::TNType) const override; bool haveNode (SHAMapNodeID const& id, SHAMapHash const& nodeHash, - Blob& nodeData) override; + Blob& nodeData) const override; }; } // ripple diff --git a/src/ripple/app/ledger/ConsensusTransSetSF.cpp b/src/ripple/app/ledger/ConsensusTransSetSF.cpp index 82222db13..8bc7a4700 100644 --- a/src/ripple/app/ledger/ConsensusTransSetSF.cpp +++ b/src/ripple/app/ledger/ConsensusTransSetSF.cpp @@ -40,7 +40,7 @@ ConsensusTransSetSF::ConsensusTransSetSF (Application& app, NodeCache& nodeCache void ConsensusTransSetSF::gotNode ( bool fromFilter, const SHAMapNodeID& id, SHAMapHash const& nodeHash, - Blob& nodeData, SHAMapTreeNode::TNType type) + Blob& nodeData, SHAMapTreeNode::TNType type) const { if (fromFilter) return; @@ -76,7 +76,7 @@ void ConsensusTransSetSF::gotNode ( } bool ConsensusTransSetSF::haveNode ( - const SHAMapNodeID& id, SHAMapHash const& nodeHash, Blob& nodeData) + const SHAMapNodeID& id, SHAMapHash const& nodeHash, Blob& nodeData) const { if (m_nodeCache.retrieve (nodeHash, nodeData)) return true; diff --git a/src/ripple/app/ledger/ConsensusTransSetSF.h b/src/ripple/app/ledger/ConsensusTransSetSF.h index 6390f6ae9..4542aecc9 100644 --- a/src/ripple/app/ledger/ConsensusTransSetSF.h +++ b/src/ripple/app/ledger/ConsensusTransSetSF.h @@ -43,11 +43,11 @@ public: SHAMapNodeID const& id, SHAMapHash const& nodeHash, Blob& nodeData, - SHAMapTreeNode::TNType) override; + SHAMapTreeNode::TNType) const override; bool haveNode (SHAMapNodeID const& id, SHAMapHash const& nodeHash, - Blob& nodeData) override; + Blob& nodeData) const override; private: Application& app_; diff --git a/src/ripple/app/ledger/TransactionStateSF.cpp b/src/ripple/app/ledger/TransactionStateSF.cpp index 1baeba0f8..122683e04 100644 --- a/src/ripple/app/ledger/TransactionStateSF.cpp +++ b/src/ripple/app/ledger/TransactionStateSF.cpp @@ -38,7 +38,7 @@ void TransactionStateSF::gotNode (bool fromFilter, SHAMapNodeID const& id, SHAMapHash const& nodeHash, Blob& nodeData, - SHAMapTreeNode::TNType type) + SHAMapTreeNode::TNType type) const { // VFALCO SHAMapSync filters should be passed the SHAMap, the // SHAMap should provide an accessor to get the injected Database, @@ -52,7 +52,7 @@ void TransactionStateSF::gotNode (bool fromFilter, bool TransactionStateSF::haveNode (SHAMapNodeID const& id, SHAMapHash const& nodeHash, - Blob& nodeData) + Blob& nodeData) const { return app_.getLedgerMaster ().getFetchPack (nodeHash.as_uint256(), nodeData); } diff --git a/src/ripple/app/ledger/TransactionStateSF.h b/src/ripple/app/ledger/TransactionStateSF.h index f5336d977..1c68a69b6 100644 --- a/src/ripple/app/ledger/TransactionStateSF.h +++ b/src/ripple/app/ledger/TransactionStateSF.h @@ -43,11 +43,11 @@ public: SHAMapNodeID const& id, SHAMapHash const& nodeHash, Blob& nodeData, - SHAMapTreeNode::TNType) override; + SHAMapTreeNode::TNType) const override; bool haveNode (SHAMapNodeID const& id, SHAMapHash const& nodeHash, - Blob& nodeData) override; + Blob& nodeData) const override; }; } // ripple diff --git a/src/ripple/shamap/SHAMapSyncFilter.h b/src/ripple/shamap/SHAMapSyncFilter.h index a7d2a948a..cc6404f7a 100644 --- a/src/ripple/shamap/SHAMapSyncFilter.h +++ b/src/ripple/shamap/SHAMapSyncFilter.h @@ -39,11 +39,11 @@ public: SHAMapNodeID const& id, SHAMapHash const& nodeHash, Blob& nodeData, - SHAMapTreeNode::TNType type) = 0; + SHAMapTreeNode::TNType type) const = 0; virtual bool haveNode (SHAMapNodeID const& id, SHAMapHash const& nodeHash, - Blob& nodeData) = 0; + Blob& nodeData) const = 0; }; } diff --git a/src/ripple/shamap/tests/FetchPack.test.cpp b/src/ripple/shamap/tests/FetchPack.test.cpp index 5c4ee597a..c8fcd0109 100644 --- a/src/ripple/shamap/tests/FetchPack.test.cpp +++ b/src/ripple/shamap/tests/FetchPack.test.cpp @@ -62,12 +62,12 @@ public: void gotNode (bool fromFilter, SHAMapNodeID const& id, SHAMapHash const& nodeHash, - Blob& nodeData, SHAMapTreeNode::TNType type) override + Blob& nodeData, SHAMapTreeNode::TNType type) const override { } bool haveNode (SHAMapNodeID const& id, - SHAMapHash const& nodeHash, Blob& nodeData) override + SHAMapHash const& nodeHash, Blob& nodeData) const override { Map::iterator it = mMap.find (nodeHash); if (it == mMap.end ())