From 021eb94cb1c78c59461e3b62ca5d6ba8a735f57c Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 22 May 2013 17:06:15 -0700 Subject: [PATCH] Remove unused PathDB --- newcoin.vcxproj | 2 - newcoin.vcxproj.filters | 6 --- src/cpp/ripple/PathDB.cpp | 1 - src/cpp/ripple/PathDB.h | 87 --------------------------------------- 4 files changed, 96 deletions(-) delete mode 100644 src/cpp/ripple/PathDB.cpp delete mode 100644 src/cpp/ripple/PathDB.h diff --git a/newcoin.vcxproj b/newcoin.vcxproj index 4a74fa42a..083a8c3e8 100644 --- a/newcoin.vcxproj +++ b/newcoin.vcxproj @@ -806,7 +806,6 @@ true true - true @@ -1520,7 +1519,6 @@ - diff --git a/newcoin.vcxproj.filters b/newcoin.vcxproj.filters index 13b408e7c..452e2b9a4 100644 --- a/newcoin.vcxproj.filters +++ b/newcoin.vcxproj.filters @@ -403,9 +403,6 @@ Unsorted Sources - - Unsorted Sources - Unsorted Sources @@ -1038,9 +1035,6 @@ Unsorted Sources - - Unsorted Sources - Unsorted Sources diff --git a/src/cpp/ripple/PathDB.cpp b/src/cpp/ripple/PathDB.cpp deleted file mode 100644 index 4c9f8a47d..000000000 --- a/src/cpp/ripple/PathDB.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "PathDB.h" diff --git a/src/cpp/ripple/PathDB.h b/src/cpp/ripple/PathDB.h deleted file mode 100644 index 0cc1effe1..000000000 --- a/src/cpp/ripple/PathDB.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef PATHDB__H -#define PATHBD__H - -#include - -#include "uint256.h" -#include "TaggedCache.h" - -typedef std::pair currencyIssuer_t; - -#ifdef C11X -typedef std::pair currencyIssuer_ct; -#else -typedef std::pair currencyIssuer_ct; -#endif - -class PathDBEntry -{ -public: - typedef boost::shared_ptr pointer; - typedef const pointer& ref; - - static const unsigned int sIsExchange = 0x00001; - static const unsigned int sIsOffer = 0x00002; - static const unsigned int sIsDirty = 0x10000; - -protected: - currencyIssuer_t mIn; - currencyIssuer_t mOut; - uint32 mLastSeq; - int mUseCount; - unsigned mFlags; - std::size_t mHash; - -public: - - void updateSeq(uint32); - - const uint160& getCurrencyIn() const { return mIn.first; } - const uint160& getIssuerIn() const { return mIn.second; } - const uint160& getCurrencyOut() const { return mOut.first; } - const uint160& getIssuerOut() const { return mOut.second; } - - bool isExchange() const; - bool isOffer() const; - bool isDirty() const; -}; - -class PathDB -{ -protected: - boost::recursive_mutex mLock; - TaggedCache mFromCache; - TaggedCache mToCache; -// std::set mDirtyPaths; - -public: - - PathDB(); - - std::vector getPathsFrom(const uint160& currency, const uint160& issuer, - int maxBestPaths = 10, int maxRandPaths = 10); - - std::vector getPathsTo(const uint160& currency, const uint160& issuer, - int maxBestPaths = 10, int maxRandPaths = 10); - - void usedLine(const uint160& currency, const uint160& accountIn, const uint160& accountOut); - void usedExchange(const uint160& currencyFrom, const uint160& issuerFrom, - const uint160& currencyTo, const uint160& issuerTo); -}; - -#ifdef C11X -extern std::size_t hash_value(const currencyIssuer_ct& ci) -{ - std::size_t r = hash_value(ci.second); - return ci.first.hash_combine(r); -} -#endif - -static inline std::size_t hash_value(const currencyIssuer_t& ci) -{ - std::size_t r = hash_value(ci.second); - return ci.first.hash_combine(r); -} - - -#endif