Add override keyword on all derived functions:

This silences warnings on latest clang compiler.
This commit is contained in:
Howard Hinnant
2015-09-17 15:37:48 -04:00
committed by Edward Hennis
parent b2cf1e4c65
commit e1fc81f66f
22 changed files with 164 additions and 150 deletions

View File

@@ -441,6 +441,8 @@ def config_env(toolchain, variant, env):
env.Append(CXXFLAGS=[ env.Append(CXXFLAGS=[
'-Wno-mismatched-tags', '-Wno-mismatched-tags',
'-Wno-deprecated-register', '-Wno-deprecated-register',
'-Wno-unused-local-typedefs',
'-Wno-unknown-warning-option',
]) ])
elif toolchain == 'gcc': elif toolchain == 'gcc':

View File

@@ -117,7 +117,7 @@ public:
capacity off the block, so that its length matches the amount of actual data that capacity off the block, so that its length matches the amount of actual data that
has been written so far. has been written so far.
*/ */
void flush(); void flush() override;
bool write (const void*, size_t) override; bool write (const void*, size_t) override;
std::int64_t getPosition() override { return position; } std::int64_t getPosition() override { return position; }

View File

@@ -69,17 +69,17 @@ public:
} }
beast::Journal::Severity beast::Journal::Severity
severity() const severity() const override
{ {
return sink_.severity(); return sink_.severity();
} }
void severity (beast::Journal::Severity level) void severity (beast::Journal::Severity level) override
{ {
sink_.severity (level); sink_.severity (level);
} }
void write (beast::Journal::Severity level, std::string const& text) void write (beast::Journal::Severity level, std::string const& text) override
{ {
using beast::Journal; using beast::Journal;
sink_.write (level, prefix_ + text); sink_.write (level, prefix_ + text);

View File

@@ -137,7 +137,7 @@ public:
// //
LedgerInfo const& LedgerInfo const&
info() const info() const override
{ {
return info_; return info_;
} }

View File

@@ -179,18 +179,18 @@ public:
{ {
} }
LedgerIndex getCurrentLedgerIndex () LedgerIndex getCurrentLedgerIndex () override
{ {
return mCurrentLedger.get ()->info().seq; return mCurrentLedger.get ()->info().seq;
} }
LedgerIndex getValidLedgerIndex () LedgerIndex getValidLedgerIndex () override
{ {
return mValidLedgerSeq; return mValidLedgerSeq;
} }
bool isCompatible (Ledger::pointer ledger, bool isCompatible (Ledger::pointer ledger,
beast::Journal::Stream s, const char* reason) beast::Journal::Stream s, const char* reason) override
{ {
auto validLedger = getValidatedLedger(); auto validLedger = getValidatedLedger();
@@ -214,7 +214,7 @@ public:
return true; return true;
} }
int getPublishedLedgerAge () int getPublishedLedgerAge () override
{ {
std::uint32_t pubClose = mPubLedgerClose.load(); std::uint32_t pubClose = mPubLedgerClose.load();
if (!pubClose) if (!pubClose)
@@ -232,7 +232,7 @@ public:
return static_cast<int> (ret); return static_cast<int> (ret);
} }
int getValidatedLedgerAge () int getValidatedLedgerAge () override
{ {
std::uint32_t valClose = mValidLedgerSign.load(); std::uint32_t valClose = mValidLedgerSign.load();
if (!valClose) if (!valClose)
@@ -249,7 +249,7 @@ public:
return static_cast<int> (ret); return static_cast<int> (ret);
} }
bool isCaughtUp(std::string& reason) bool isCaughtUp(std::string& reason) override
{ {
if (getPublishedLedgerAge() > 180) if (getPublishedLedgerAge() > 180)
{ {
@@ -306,14 +306,14 @@ public:
mPubLedgerSeq = l->info().seq; mPubLedgerSeq = l->info().seq;
} }
void addHeldTransaction (Transaction::ref transaction) void addHeldTransaction (Transaction::ref transaction) override
{ {
// returns true if transaction was added // returns true if transaction was added
ScopedLockType ml (m_mutex); ScopedLockType ml (m_mutex);
mHeldTransactions.insert (transaction->getSTransaction ()); mHeldTransactions.insert (transaction->getSTransaction ());
} }
void pushLedger (Ledger::pointer newLedger) void pushLedger (Ledger::pointer newLedger) override
{ {
// Caller should already have properly assembled this ledger into // Caller should already have properly assembled this ledger into
// "ready-to-close" form -- all candidate transactions must already be // "ready-to-close" form -- all candidate transactions must already be
@@ -344,7 +344,7 @@ public:
checkAccept(newLedger); checkAccept(newLedger);
} }
void pushLedger (Ledger::pointer newLCL, Ledger::pointer newOL) void pushLedger (Ledger::pointer newLCL, Ledger::pointer newOL) override
{ {
assert (! newLCL->info().open); assert (! newLCL->info().open);
assert (newOL->info().open); assert (newOL->info().open);
@@ -366,7 +366,7 @@ public:
} }
} }
void switchLedgers (Ledger::pointer lastClosed, Ledger::pointer current) void switchLedgers (Ledger::pointer lastClosed, Ledger::pointer current) override
{ {
assert (lastClosed && current); assert (lastClosed && current);
@@ -384,18 +384,18 @@ public:
checkAccept (lastClosed); checkAccept (lastClosed);
} }
bool fixIndex (LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) bool fixIndex (LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) override
{ {
return mLedgerHistory.fixIndex (ledgerIndex, ledgerHash); return mLedgerHistory.fixIndex (ledgerIndex, ledgerHash);
} }
bool storeLedger (Ledger::pointer ledger) bool storeLedger (Ledger::pointer ledger) override
{ {
// Returns true if we already had the ledger // Returns true if we already had the ledger
return mLedgerHistory.addLedger (ledger, false); return mLedgerHistory.addLedger (ledger, false);
} }
void forceValid (Ledger::pointer ledger) void forceValid (Ledger::pointer ledger) override
{ {
ledger->setValidated(); ledger->setValidated();
setFullLedger(ledger, true, false); setFullLedger(ledger, true, false);
@@ -406,7 +406,7 @@ public:
The open ledger remains open to handle new transactions The open ledger remains open to handle new transactions
until a new open ledger is built. until a new open ledger is built.
*/ */
void applyHeldTransactions () void applyHeldTransactions () override
{ {
ScopedLockType sl (m_mutex); ScopedLockType sl (m_mutex);
@@ -473,31 +473,31 @@ public:
mCurrentLedger.set (newOL); mCurrentLedger.set (newOL);
} }
LedgerIndex getBuildingLedger () LedgerIndex getBuildingLedger () override
{ {
// The ledger we are currently building, 0 of none // The ledger we are currently building, 0 of none
return mBuildingLedgerSeq.load (); return mBuildingLedgerSeq.load ();
} }
void setBuildingLedger (LedgerIndex i) void setBuildingLedger (LedgerIndex i) override
{ {
mBuildingLedgerSeq.store (i); mBuildingLedgerSeq.store (i);
} }
bool haveLedger (std::uint32_t seq) bool haveLedger (std::uint32_t seq) override
{ {
ScopedLockType sl (mCompleteLock); ScopedLockType sl (mCompleteLock);
return mCompleteLedgers.hasValue (seq); return mCompleteLedgers.hasValue (seq);
} }
void clearLedger (std::uint32_t seq) void clearLedger (std::uint32_t seq) override
{ {
ScopedLockType sl (mCompleteLock); ScopedLockType sl (mCompleteLock);
return mCompleteLedgers.clearValue (seq); return mCompleteLedgers.clearValue (seq);
} }
// returns Ledgers we have all the nodes for // returns Ledgers we have all the nodes for
bool getFullValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) bool getFullValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) override
{ {
maxVal = mPubLedgerSeq.load(); maxVal = mPubLedgerSeq.load();
@@ -518,7 +518,7 @@ public:
} }
// Returns Ledgers we have all the nodes for and are indexed // Returns Ledgers we have all the nodes for and are indexed
bool getValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) bool getValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) override
{ {
maxVal = mPubLedgerSeq.load(); maxVal = mPubLedgerSeq.load();
@@ -571,7 +571,7 @@ public:
} }
// Get the earliest ledger we will let peers fetch // Get the earliest ledger we will let peers fetch
std::uint32_t getEarliestFetch () std::uint32_t getEarliestFetch () override
{ {
// The earliest ledger we will let people fetch is ledger zero, // The earliest ledger we will let people fetch is ledger zero,
// unless that creates a larger range than allowed // unless that creates a larger range than allowed
@@ -692,7 +692,7 @@ public:
WriteLog (lsDEBUG, LedgerMaster) << "No peer for fetch pack"; WriteLog (lsDEBUG, LedgerMaster) << "No peer for fetch pack";
} }
void fixMismatch (Ledger::ref ledger) void fixMismatch (Ledger::ref ledger) override
{ {
int invalidate = 0; int invalidate = 0;
boost::optional<uint256> hash; boost::optional<uint256> hash;
@@ -739,7 +739,7 @@ public:
} }
void setFullLedger ( void setFullLedger (
Ledger::pointer ledger, bool isSynchronous, bool isCurrent) Ledger::pointer ledger, bool isSynchronous, bool isCurrent) override
{ {
// A new ledger has been accepted as part of the trusted chain // A new ledger has been accepted as part of the trusted chain
WriteLog (lsDEBUG, LedgerMaster) << "Ledger " << ledger->info().seq WriteLog (lsDEBUG, LedgerMaster) << "Ledger " << ledger->info().seq
@@ -797,7 +797,7 @@ public:
} }
} }
void failedSave(std::uint32_t seq, uint256 const& hash) void failedSave(std::uint32_t seq, uint256 const& hash) override
{ {
clearLedger(seq); clearLedger(seq);
app_.getInboundLedgers().acquire( app_.getInboundLedgers().acquire(
@@ -806,7 +806,7 @@ public:
// Check if the specified ledger can become the new last fully-validated // Check if the specified ledger can become the new last fully-validated
// ledger. // ledger.
void checkAccept (uint256 const& hash, std::uint32_t seq) void checkAccept (uint256 const& hash, std::uint32_t seq) override
{ {
int valCount; int valCount;
@@ -889,7 +889,7 @@ public:
return minVal; return minVal;
} }
void checkAccept (Ledger::ref ledger) void checkAccept (Ledger::ref ledger) override
{ {
if (ledger->info().seq <= mValidLedgerSeq) if (ledger->info().seq <= mValidLedgerSeq)
return; return;
@@ -1192,7 +1192,7 @@ public:
return ret; return ret;
} }
void tryAdvance() void tryAdvance() override
{ {
ScopedLockType ml (m_mutex); ScopedLockType ml (m_mutex);
@@ -1210,7 +1210,7 @@ public:
// Return the hash of the valid ledger with a particular sequence, given a // Return the hash of the valid ledger with a particular sequence, given a
// subsequent ledger known valid. // subsequent ledger known valid.
// VFALCO NOTE This should return boost::optional<uint256> // VFALCO NOTE This should return boost::optional<uint256>
uint256 getLedgerHash(std::uint32_t desiredSeq, Ledger::ref knownGoodLedger) uint256 getLedgerHash(std::uint32_t desiredSeq, Ledger::ref knownGoodLedger) override
{ {
assert(desiredSeq < knownGoodLedger->info().seq); assert(desiredSeq < knownGoodLedger->info().seq);
@@ -1310,7 +1310,7 @@ public:
} }
} }
void newPathRequest () void newPathRequest () override
{ {
ScopedLockType ml (m_mutex); ScopedLockType ml (m_mutex);
mPathFindNewRequest = true; mPathFindNewRequest = true;
@@ -1318,7 +1318,7 @@ public:
newPFWork("pf:newRequest"); newPFWork("pf:newRequest");
} }
bool isNewPathRequest () bool isNewPathRequest () override
{ {
ScopedLockType ml (m_mutex); ScopedLockType ml (m_mutex);
if (!mPathFindNewRequest) if (!mPathFindNewRequest)
@@ -1329,7 +1329,7 @@ public:
// If the order book is radically updated, we need to reprocess all // If the order book is radically updated, we need to reprocess all
// pathfinding requests. // pathfinding requests.
void newOrderBookDB () void newOrderBookDB () override
{ {
ScopedLockType ml (m_mutex); ScopedLockType ml (m_mutex);
mPathLedger.reset(); mPathLedger.reset();
@@ -1350,13 +1350,13 @@ public:
} }
} }
LockType& peekMutex () LockType& peekMutex () override
{ {
return m_mutex; return m_mutex;
} }
// The current ledger is the ledger we believe new transactions should go in // The current ledger is the ledger we believe new transactions should go in
Ledger::pointer getCurrentLedger () Ledger::pointer getCurrentLedger () override
{ {
return mCurrentLedger.get (); return mCurrentLedger.get ();
} }
@@ -1367,18 +1367,18 @@ public:
} }
// The finalized ledger is the last closed/accepted ledger // The finalized ledger is the last closed/accepted ledger
Ledger::pointer getClosedLedger () Ledger::pointer getClosedLedger () override
{ {
return mClosedLedger.get (); return mClosedLedger.get ();
} }
// The validated ledger is the last fully validated ledger // The validated ledger is the last fully validated ledger
Ledger::pointer getValidatedLedger () Ledger::pointer getValidatedLedger () override
{ {
return mValidLedger.get (); return mValidLedger.get ();
} }
Rules getValidatedRules () Rules getValidatedRules () override
{ {
// Once we have a guarantee that there's always a last validated // Once we have a guarantee that there's always a last validated
// ledger then we can dispense with the if. // ledger then we can dispense with the if.
@@ -1392,7 +1392,7 @@ public:
// This is the last ledger we published to clients and can lag the validated // This is the last ledger we published to clients and can lag the validated
// ledger. // ledger.
Ledger::ref getPublishedLedger () Ledger::ref getPublishedLedger () override
{ {
return mPubLedger; return mPubLedger;
} }
@@ -1427,24 +1427,24 @@ public:
return true; return true;
} }
int getMinValidations () int getMinValidations () override
{ {
return mMinValidations; return mMinValidations;
} }
void setMinValidations (int v) void setMinValidations (int v) override
{ {
WriteLog (lsINFO, LedgerMaster) << "Validation quorum: " << v; WriteLog (lsINFO, LedgerMaster) << "Validation quorum: " << v;
mMinValidations = v; mMinValidations = v;
} }
std::string getCompleteLedgers () std::string getCompleteLedgers () override
{ {
ScopedLockType sl (mCompleteLock); ScopedLockType sl (mCompleteLock);
return mCompleteLedgers.toString (); return mCompleteLedgers.toString ();
} }
uint256 getHashBySeq (std::uint32_t index) uint256 getHashBySeq (std::uint32_t index) override
{ {
uint256 hash = mLedgerHistory.getLedgerHash (index); uint256 hash = mLedgerHistory.getLedgerHash (index);
@@ -1455,7 +1455,7 @@ public:
} }
// VFALCO NOTE This should return boost::optional<uint256> // VFALCO NOTE This should return boost::optional<uint256>
uint256 walkHashBySeq (std::uint32_t index) uint256 walkHashBySeq (std::uint32_t index) override
{ {
uint256 ledgerHash; uint256 ledgerHash;
Ledger::pointer referenceLedger; Ledger::pointer referenceLedger;
@@ -1474,7 +1474,7 @@ public:
in the node store. in the node store.
*/ */
// VFALCO NOTE This should return boost::optional<uint256> // VFALCO NOTE This should return boost::optional<uint256>
uint256 walkHashBySeq (std::uint32_t index, Ledger::ref referenceLedger) uint256 walkHashBySeq (std::uint32_t index, Ledger::ref referenceLedger) override
{ {
if (!referenceLedger || (referenceLedger->info().seq < index)) if (!referenceLedger || (referenceLedger->info().seq < index))
{ {
@@ -1524,7 +1524,7 @@ public:
return ledgerHash ? *ledgerHash : zero; // kludge return ledgerHash ? *ledgerHash : zero; // kludge
} }
Ledger::pointer getLedgerBySeq (std::uint32_t index) Ledger::pointer getLedgerBySeq (std::uint32_t index) override
{ {
if (index <= mValidLedgerSeq) if (index <= mValidLedgerSeq)
{ {
@@ -1564,7 +1564,7 @@ public:
return Ledger::pointer(); return Ledger::pointer();
} }
Ledger::pointer getLedgerByHash (uint256 const& hash) Ledger::pointer getLedgerByHash (uint256 const& hash) override
{ {
if (hash.isZero ()) if (hash.isZero ())
return mCurrentLedger.get (); return mCurrentLedger.get ();
@@ -1584,33 +1584,33 @@ public:
return Ledger::pointer (); return Ledger::pointer ();
} }
void doLedgerCleaner(Json::Value const& parameters) void doLedgerCleaner(Json::Value const& parameters) override
{ {
mLedgerCleaner->doClean (parameters); mLedgerCleaner->doClean (parameters);
} }
void setLedgerRangePresent (std::uint32_t minV, std::uint32_t maxV) void setLedgerRangePresent (std::uint32_t minV, std::uint32_t maxV) override
{ {
ScopedLockType sl (mCompleteLock); ScopedLockType sl (mCompleteLock);
mCompleteLedgers.setRange (minV, maxV); mCompleteLedgers.setRange (minV, maxV);
} }
void tune (int size, int age) void tune (int size, int age) override
{ {
mLedgerHistory.tune (size, age); mLedgerHistory.tune (size, age);
} }
void sweep () void sweep () override
{ {
mLedgerHistory.sweep (); mLedgerHistory.sweep ();
fetch_packs_.sweep (); fetch_packs_.sweep ();
} }
float getCacheHitRate () float getCacheHitRate () override
{ {
return mLedgerHistory.getCacheHitRate (); return mLedgerHistory.getCacheHitRate ();
} }
beast::PropertyStream::Source& getPropertySource () beast::PropertyStream::Source& getPropertySource () override
{ {
return *mLedgerCleaner; return *mLedgerCleaner;
} }
@@ -1649,7 +1649,7 @@ public:
uint256 haveLedgerHash, uint256 haveLedgerHash,
std::uint32_t uUptime) override; std::uint32_t uUptime) override;
std::size_t getFetchPackCacheSize () const; std::size_t getFetchPackCacheSize () const override;
}; };
bool LedgerMasterImp::shouldAcquire ( bool LedgerMasterImp::shouldAcquire (

View File

@@ -479,34 +479,34 @@ public:
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
CollectorManager& getCollectorManager () CollectorManager& getCollectorManager () override
{ {
return *m_collectorManager; return *m_collectorManager;
} }
Family& Family&
family() family() override
{ {
return family_; return family_;
} }
TimeKeeper& TimeKeeper&
timeKeeper() timeKeeper() override
{ {
return *timeKeeper_; return *timeKeeper_;
} }
JobQueue& getJobQueue () JobQueue& getJobQueue () override
{ {
return *m_jobQueue; return *m_jobQueue;
} }
LocalCredentials& getLocalCredentials () LocalCredentials& getLocalCredentials () override
{ {
return m_localCredentials ; return m_localCredentials ;
} }
NetworkOPs& getOPs () NetworkOPs& getOPs () override
{ {
return *m_networkOPs; return *m_networkOPs;
} }
@@ -517,34 +517,34 @@ public:
return config_; return config_;
} }
boost::asio::io_service& getIOService () boost::asio::io_service& getIOService () override
{ {
return get_io_service(); return get_io_service();
} }
std::chrono::milliseconds getIOLatency () std::chrono::milliseconds getIOLatency () override
{ {
std::unique_lock <std::mutex> m_IOLatencyLock; std::unique_lock <std::mutex> m_IOLatencyLock;
return m_io_latency_sampler.get (); return m_io_latency_sampler.get ();
} }
LedgerMaster& getLedgerMaster () LedgerMaster& getLedgerMaster () override
{ {
return *m_ledgerMaster; return *m_ledgerMaster;
} }
InboundLedgers& getInboundLedgers () InboundLedgers& getInboundLedgers () override
{ {
return *m_inboundLedgers; return *m_inboundLedgers;
} }
InboundTransactions& getInboundTransactions () InboundTransactions& getInboundTransactions () override
{ {
return *m_inboundTransactions; return *m_inboundTransactions;
} }
TaggedCache <uint256, AcceptedLedger>& getAcceptedLedgerCache () TaggedCache <uint256, AcceptedLedger>& getAcceptedLedgerCache () override
{ {
return m_acceptedLedgerCache; return m_acceptedLedgerCache;
} }
@@ -554,73 +554,73 @@ public:
m_networkOPs->mapComplete (setHash, set); m_networkOPs->mapComplete (setHash, set);
} }
TransactionMaster& getMasterTransaction () TransactionMaster& getMasterTransaction () override
{ {
return m_txMaster; return m_txMaster;
} }
NodeCache& getTempNodeCache () NodeCache& getTempNodeCache () override
{ {
return m_tempNodeCache; return m_tempNodeCache;
} }
NodeStore::Database& getNodeStore () NodeStore::Database& getNodeStore () override
{ {
return *m_nodeStore; return *m_nodeStore;
} }
Application::MutexType& getMasterMutex () Application::MutexType& getMasterMutex () override
{ {
return m_masterMutex; return m_masterMutex;
} }
LoadManager& getLoadManager () LoadManager& getLoadManager () override
{ {
return *m_loadManager; return *m_loadManager;
} }
Resource::Manager& getResourceManager () Resource::Manager& getResourceManager () override
{ {
return *m_resourceManager; return *m_resourceManager;
} }
OrderBookDB& getOrderBookDB () OrderBookDB& getOrderBookDB () override
{ {
return m_orderBookDB; return m_orderBookDB;
} }
PathRequests& getPathRequests () PathRequests& getPathRequests () override
{ {
return *m_pathRequests; return *m_pathRequests;
} }
CachedSLEs& CachedSLEs&
cachedSLEs() cachedSLEs() override
{ {
return cachedSLEs_; return cachedSLEs_;
} }
AmendmentTable& getAmendmentTable() AmendmentTable& getAmendmentTable() override
{ {
return *m_amendmentTable; return *m_amendmentTable;
} }
LoadFeeTrack& getFeeTrack () LoadFeeTrack& getFeeTrack () override
{ {
return *mFeeTrack; return *mFeeTrack;
} }
HashRouter& getHashRouter () HashRouter& getHashRouter () override
{ {
return *mHashRouter; return *mHashRouter;
} }
Validations& getValidations () Validations& getValidations () override
{ {
return *mValidations; return *mValidations;
} }
UniqueNodeList& getUNL () UniqueNodeList& getUNL () override
{ {
return *m_deprecatedUNL; return *m_deprecatedUNL;
} }
@@ -647,34 +647,34 @@ public:
return *openLedger_; return *openLedger_;
} }
Overlay& overlay () Overlay& overlay () override
{ {
return *m_overlay; return *m_overlay;
} }
// VFALCO TODO Move these to the .cpp // VFALCO TODO Move these to the .cpp
bool running () bool running () override
{ {
return mTxnDB != nullptr; return mTxnDB != nullptr;
} }
DatabaseCon& getTxnDB () DatabaseCon& getTxnDB () override
{ {
assert (mTxnDB.get() != nullptr); assert (mTxnDB.get() != nullptr);
return *mTxnDB; return *mTxnDB;
} }
DatabaseCon& getLedgerDB () DatabaseCon& getLedgerDB () override
{ {
assert (mLedgerDB.get() != nullptr); assert (mLedgerDB.get() != nullptr);
return *mLedgerDB; return *mLedgerDB;
} }
DatabaseCon& getWalletDB () DatabaseCon& getWalletDB () override
{ {
assert (mWalletDB.get() != nullptr); assert (mWalletDB.get() != nullptr);
return *mWalletDB; return *mWalletDB;
} }
bool isShutdown () bool isShutdown () override
{ {
// from Stoppable mixin // from Stoppable mixin
return isStopped(); return isStopped();
@@ -726,7 +726,7 @@ public:
// Or better yet refactor these initializations into RAII classes // Or better yet refactor these initializations into RAII classes
// which are members of the Application object. // which are members of the Application object.
// //
void setup () void setup () override
{ {
// VFALCO NOTE: 0 means use heuristics to determine the thread count. // VFALCO NOTE: 0 means use heuristics to determine the thread count.
m_jobQueue->setThreadCount (0, config_.RUN_STANDALONE); m_jobQueue->setThreadCount (0, config_.RUN_STANDALONE);
@@ -909,7 +909,7 @@ public:
{ {
} }
void onStart () void onStart () override
{ {
m_journal.info << "Application starting. Build is " << gitCommitID(); m_journal.info << "Application starting. Build is " << gitCommitID();
@@ -922,7 +922,7 @@ public:
} }
// Called to indicate shutdown. // Called to indicate shutdown.
void onStop () void onStop () override
{ {
m_journal.debug << "Application stopping"; m_journal.debug << "Application stopping";
@@ -959,13 +959,13 @@ public:
// PropertyStream // PropertyStream
// //
void onWrite (beast::PropertyStream::Map& stream) void onWrite (beast::PropertyStream::Map& stream) override
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void run () void run () override
{ {
// VFALCO NOTE I put this here in the hopes that when unit tests run (which // VFALCO NOTE I put this here in the hopes that when unit tests run (which
// tragically require an Application object to exist or else they // tragically require an Application object to exist or else they
@@ -1004,14 +1004,14 @@ public:
std::exit(code); std::exit(code);
} }
void signalStop () void signalStop () override
{ {
// Unblock the main thread (which is sitting in run()). // Unblock the main thread (which is sitting in run()).
// //
m_stop.signal(); m_stop.signal();
} }
void onDeadlineTimer (beast::DeadlineTimer& timer) void onDeadlineTimer (beast::DeadlineTimer& timer) override
{ {
if (timer == m_entropyTimer) if (timer == m_entropyTimer)
{ {

View File

@@ -40,9 +40,9 @@ public:
// //
void setJobQueue (JobQueue& jobQueue); void setJobQueue (JobQueue& jobQueue);
void onStop (); void onStop () override;
void onChildrenStopped (); void onChildrenStopped () override;
void scheduleTask (NodeStore::Task& task); void scheduleTask (NodeStore::Task& task) override;
void onFetch (NodeStore::FetchReport const& report) override; void onFetch (NodeStore::FetchReport const& report) override;
void onBatchWrite (NodeStore::BatchWriteReport const& report) override; void onBatchWrite (NodeStore::BatchWriteReport const& report) override;

View File

@@ -350,14 +350,14 @@ public:
void unsubAccount ( void unsubAccount (
InfoSub::ref ispListener, InfoSub::ref ispListener,
hash_set<AccountID> const& vnaAccountIDs, hash_set<AccountID> const& vnaAccountIDs,
bool rt); bool rt) override;
// Just remove the subscription from the tracking // Just remove the subscription from the tracking
// not from the InfoSub. Needed for InfoSub destruction // not from the InfoSub. Needed for InfoSub destruction
void unsubAccountInternal ( void unsubAccountInternal (
std::uint64_t seq, std::uint64_t seq,
hash_set<AccountID> const& vnaAccountIDs, hash_set<AccountID> const& vnaAccountIDs,
bool rt); bool rt) override;
bool subLedger (InfoSub::ref ispListener, Json::Value& jvResult) override; bool subLedger (InfoSub::ref ispListener, Json::Value& jvResult) override;
bool unsubLedger (std::uint64_t uListener) override; bool unsubLedger (std::uint64_t uListener) override;

View File

@@ -82,7 +82,7 @@ public:
} }
private: private:
bool addValidation (STValidation::ref val, std::string const& source) bool addValidation (STValidation::ref val, std::string const& source) override
{ {
RippleAddress signer = val->getSignerPublic (); RippleAddress signer = val->getSignerPublic ();
bool isCurrent = false; bool isCurrent = false;
@@ -154,13 +154,13 @@ private:
return false; return false;
} }
void tune (int size, int age) void tune (int size, int age) override
{ {
mValidations.setTargetSize (size); mValidations.setTargetSize (size);
mValidations.setTargetAge (age); mValidations.setTargetAge (age);
} }
ValidationSet getValidations (uint256 const& ledger) ValidationSet getValidations (uint256 const& ledger) override
{ {
{ {
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -172,7 +172,8 @@ private:
return ValidationSet (); return ValidationSet ();
} }
void getValidationCount (uint256 const& ledger, bool currentOnly, int& trusted, int& untrusted) void getValidationCount (uint256 const& ledger, bool currentOnly,
int& trusted, int& untrusted) override
{ {
trusted = untrusted = 0; trusted = untrusted = 0;
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -208,7 +209,7 @@ private:
WriteLog (lsTRACE, Validations) << "VC: " << ledger << "t:" << trusted << " u:" << untrusted; WriteLog (lsTRACE, Validations) << "VC: " << ledger << "t:" << trusted << " u:" << untrusted;
} }
void getValidationTypes (uint256 const& ledger, int& full, int& partial) void getValidationTypes (uint256 const& ledger, int& full, int& partial) override
{ {
full = partial = 0; full = partial = 0;
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -232,7 +233,7 @@ private:
} }
int getTrustedValidationCount (uint256 const& ledger) int getTrustedValidationCount (uint256 const& ledger) override
{ {
int trusted = 0; int trusted = 0;
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -273,7 +274,7 @@ private:
return result; return result;
} }
int getNodesAfter (uint256 const& ledger) int getNodesAfter (uint256 const& ledger) override
{ {
// Number of trusted nodes that have moved past this ledger // Number of trusted nodes that have moved past this ledger
int count = 0; int count = 0;
@@ -286,7 +287,7 @@ private:
return count; return count;
} }
int getLoadRatio (bool overLoaded) int getLoadRatio (bool overLoaded) override
{ {
// how many trusted nodes are able to keep up, higher is better // how many trusted nodes are able to keep up, higher is better
int goodNodes = overLoaded ? 1 : 0; int goodNodes = overLoaded ? 1 : 0;
@@ -307,7 +308,7 @@ private:
return (goodNodes * 100) / (goodNodes + badNodes); return (goodNodes * 100) / (goodNodes + badNodes);
} }
std::list<STValidation::pointer> getCurrentTrustedValidations () std::list<STValidation::pointer> getCurrentTrustedValidations () override
{ {
// VFALCO LEDGER_VAL_INTERVAL should be a NetClock::duration // VFALCO LEDGER_VAL_INTERVAL should be a NetClock::duration
auto const cutoff = app_.timeKeeper().now().time_since_epoch().count() - LEDGER_VAL_INTERVAL; auto const cutoff = app_.timeKeeper().now().time_since_epoch().count() - LEDGER_VAL_INTERVAL;
@@ -343,7 +344,7 @@ private:
} }
LedgerToValidationCounter getCurrentValidations ( LedgerToValidationCounter getCurrentValidations (
uint256 currentLedger, uint256 priorLedger) uint256 currentLedger, uint256 priorLedger) override
{ {
auto const cutoff = app_.timeKeeper().now().time_since_epoch().count() - LEDGER_VAL_INTERVAL; auto const cutoff = app_.timeKeeper().now().time_since_epoch().count() - LEDGER_VAL_INTERVAL;
bool valCurrentLedger = currentLedger.isNonZero (); bool valCurrentLedger = currentLedger.isNonZero ();
@@ -394,7 +395,7 @@ private:
} }
std::vector<uint32_t> std::vector<uint32_t>
getValidationTimes (uint256 const& hash) getValidationTimes (uint256 const& hash) override
{ {
std::vector <std::uint32_t> times; std::vector <std::uint32_t> times;
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -405,7 +406,7 @@ private:
return times; return times;
} }
void flush () void flush () override
{ {
bool anyNew = false; bool anyNew = false;
@@ -483,7 +484,7 @@ private:
mWriting = false; mWriting = false;
} }
void sweep () void sweep () override
{ {
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
mValidations.sweep (); mValidations.sweep ();

View File

@@ -143,7 +143,7 @@ public:
*/ */
void gotData (LedgerHash const& hash, void gotData (LedgerHash const& hash,
std::shared_ptr<Peer> peer, std::shared_ptr<Peer> peer,
std::shared_ptr<protocol::TMLedgerData> packet_ptr) std::shared_ptr<protocol::TMLedgerData> packet_ptr) override
{ {
protocol::TMLedgerData& packet = *packet_ptr; protocol::TMLedgerData& packet = *packet_ptr;

View File

@@ -553,7 +553,7 @@ private:
// Invariants: // Invariants:
// <none> // <none>
// //
void processTask () void processTask () override
{ {
Job job; Job job;
@@ -624,7 +624,7 @@ private:
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
void onStop () void onStop () override
{ {
// VFALCO NOTE I wanted to remove all the jobs that are skippable // VFALCO NOTE I wanted to remove all the jobs that are skippable
// but then the Workers count of tasks to process // but then the Workers count of tasks to process
@@ -676,7 +676,7 @@ private:
*/ */
} }
void onChildrenStopped () void onChildrenStopped () override
{ {
ScopedLock lock (m_mutex); ScopedLock lock (m_mutex);

View File

@@ -31,7 +31,7 @@ class DummyScheduler : public Scheduler
public: public:
DummyScheduler (); DummyScheduler ();
~DummyScheduler (); ~DummyScheduler ();
void scheduleTask (Task& task); void scheduleTask (Task& task) override;
void scheduledTasksStopped (); void scheduledTasksStopped ();
void onFetch (FetchReport const& report) override; void onFetch (FetchReport const& report) override;
void onBatchWrite (BatchWriteReport const& report) override; void onBatchWrite (BatchWriteReport const& report) override;

View File

@@ -98,7 +98,7 @@ public:
} }
std::string std::string
getName () getName () override
{ {
return name_; return name_;
} }
@@ -112,7 +112,7 @@ public:
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
Status Status
fetch (void const* key, std::shared_ptr<NodeObject>* pObject) fetch (void const* key, std::shared_ptr<NodeObject>* pObject) override
{ {
uint256 const hash (uint256::fromVoid (key)); uint256 const hash (uint256::fromVoid (key));
@@ -142,28 +142,28 @@ public:
} }
void void
store (std::shared_ptr<NodeObject> const& object) store (std::shared_ptr<NodeObject> const& object) override
{ {
std::lock_guard<std::mutex> _(db_->mutex); std::lock_guard<std::mutex> _(db_->mutex);
db_->table.emplace (object->getHash(), object); db_->table.emplace (object->getHash(), object);
} }
void void
storeBatch (Batch const& batch) storeBatch (Batch const& batch) override
{ {
for (auto const& e : batch) for (auto const& e : batch)
store (e); store (e);
} }
void void
for_each (std::function <void(std::shared_ptr<NodeObject>)> f) for_each (std::function <void(std::shared_ptr<NodeObject>)> f) override
{ {
for (auto const& e : db_->table) for (auto const& e : db_->table)
f (e.second); f (e.second);
} }
int int
getWriteLoad() getWriteLoad() override
{ {
return 0; return 0;
} }

View File

@@ -107,7 +107,7 @@ public:
} }
std::string std::string
getName() getName() override
{ {
return name_; return name_;
} }
@@ -126,7 +126,7 @@ public:
} }
Status Status
fetch (void const* key, std::shared_ptr<NodeObject>* pno) fetch (void const* key, std::shared_ptr<NodeObject>* pno) override
{ {
Status status; Status status;
pno->reset(); pno->reset();
@@ -201,7 +201,7 @@ public:
} }
void void
for_each (std::function <void(std::shared_ptr<NodeObject>)> f) for_each (std::function <void(std::shared_ptr<NodeObject>)> f) override
{ {
auto const dp = db_.dat_path(); auto const dp = db_.dat_path();
auto const kp = db_.key_path(); auto const kp = db_.key_path();
@@ -224,7 +224,7 @@ public:
} }
int int
getWriteLoad () getWriteLoad () override
{ {
return 0; return 0;
} }

View File

@@ -37,7 +37,7 @@ public:
} }
std::string std::string
getName() getName() override
{ {
return std::string (); return std::string ();
} }
@@ -48,7 +48,7 @@ public:
} }
Status Status
fetch (void const*, std::shared_ptr<NodeObject>*) fetch (void const*, std::shared_ptr<NodeObject>*) override
{ {
return notFound; return notFound;
} }
@@ -67,22 +67,22 @@ public:
} }
void void
store (std::shared_ptr<NodeObject> const& object) store (std::shared_ptr<NodeObject> const& object) override
{ {
} }
void void
storeBatch (Batch const& batch) storeBatch (Batch const& batch) override
{ {
} }
void void
for_each (std::function <void(std::shared_ptr<NodeObject>)> f) for_each (std::function <void(std::shared_ptr<NodeObject>)> f) override
{ {
} }
int int
getWriteLoad () getWriteLoad () override
{ {
return 0; return 0;
} }

View File

@@ -119,7 +119,7 @@ public:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool asyncFetch (uint256 const& hash, std::shared_ptr<NodeObject>& object) bool asyncFetch (uint256 const& hash, std::shared_ptr<NodeObject>& object) override
{ {
// See if the object is in cache // See if the object is in cache
object = m_cache.fetch (hash); object = m_cache.fetch (hash);
@@ -150,7 +150,7 @@ public:
} }
int getDesiredAsyncReadCount () int getDesiredAsyncReadCount () override
{ {
// We prefer a client not fill our cache // We prefer a client not fill our cache
// We don't want to push data out of the cache // We don't want to push data out of the cache
@@ -306,12 +306,12 @@ public:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
float getCacheHitRate () float getCacheHitRate () override
{ {
return m_cache.getHitRate (); return m_cache.getHitRate ();
} }
void tune (int size, int age) void tune (int size, int age) override
{ {
m_cache.setTargetSize (size); m_cache.setTargetSize (size);
m_cache.setTargetAge (age); m_cache.setTargetAge (age);
@@ -319,7 +319,7 @@ public:
m_negCache.setTargetAge (age); m_negCache.setTargetAge (age);
} }
void sweep () void sweep () override
{ {
m_cache.sweep (); m_cache.sweep ();
m_negCache.sweep (); m_negCache.sweep ();
@@ -381,7 +381,7 @@ public:
m_backend->for_each (f); m_backend->for_each (f);
} }
void import (Database& source) void import (Database& source) override
{ {
importInternal (source, *m_backend.get()); importInternal (source, *m_backend.get());
} }

View File

@@ -319,7 +319,7 @@ private:
// //
void void
onWrite (beast::PropertyStream::Map& stream); onWrite (beast::PropertyStream::Map& stream) override;
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------

View File

@@ -219,18 +219,18 @@ public:
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
void void
onPrepare () onPrepare () override
{ {
m_store.open (m_sociConfig); m_store.open (m_sociConfig);
m_logic.load (); m_logic.load ();
} }
void void
onStart() onStart() override
{ {
} }
void onStop () void onStop () override
{ {
close(); close();
stopped(); stopped();
@@ -242,7 +242,7 @@ public:
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
void onWrite (beast::PropertyStream::Map& map) void onWrite (beast::PropertyStream::Map& map) override
{ {
m_logic.onWrite (map); m_logic.onWrite (map);
} }

View File

@@ -137,7 +137,7 @@ public:
} }
void void
onStopped (Server& server) onStopped (Server& server) override
{ {
} }
}; };

View File

@@ -22,6 +22,14 @@
#include <beast/Config.h> #include <beast/Config.h>
#ifdef __clang_major__
#if __clang_major__ >= 7
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Winconsistent-missing-override"
# pragma clang diagnostic ignored "-Wuninitialized"
#endif
#endif
#ifndef RIPPLE_ROCKSDB_AVAILABLE #ifndef RIPPLE_ROCKSDB_AVAILABLE
#if BEAST_WIN32 #if BEAST_WIN32
# define ROCKSDB_PLATFORM_WINDOWS # define ROCKSDB_PLATFORM_WINDOWS

View File

@@ -457,17 +457,17 @@ public:
} }
boost::asio::ssl::context& boost::asio::ssl::context&
get_ssl_context () get_ssl_context () override
{ {
return *port().context; return *port().context;
} }
bool plain_only() bool plain_only() override
{ {
return port().protocol.count("wss") == 0; return port().protocol.count("wss") == 0;
} }
bool secure_only() bool secure_only() override
{ {
return port().protocol.count("ws") == 0; return port().protocol.count("ws") == 0;
} }

View File

@@ -48,6 +48,9 @@ struct WebSocket04
virtual void on_message (ConnectionPtr, MessagePtr) = 0; virtual void on_message (ConnectionPtr, MessagePtr) = 0;
// This is a new method added by Ripple. // This is a new method added by Ripple.
virtual void on_send_empty (ConnectionPtr) = 0; virtual void on_send_empty (ConnectionPtr) = 0;
virtual boost::asio::ssl::context& get_ssl_context() = 0;
virtual bool plain_only() = 0;
virtual bool secure_only() = 0;
}; };
using HandlerPtr = std::shared_ptr<Handler>; using HandlerPtr = std::shared_ptr<Handler>;