mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove unused or obsolete classes and files
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/basics/impl/CheckLibraryVersionsImpl.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <beast/module/core/diagnostic/SemanticVersion.h>
|
||||
#include <ripple/beast/core/SemanticVersion.h>
|
||||
#include <boost/version.hpp>
|
||||
#include <openssl/opensslv.h>
|
||||
#include <sstream>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/RangeSet.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <beast/module/core/text/LexicalCast.h>
|
||||
#include <ripple/beast/core/LexicalCast.h>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/basics/ResolverAsio.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <beast/asio/IPAddressConversion.h>
|
||||
#include <ripple/beast/net/IPAddressConversion.h>
|
||||
#include <beast/asio/placeholders.h>
|
||||
#include <beast/module/asio/AsyncObject.h>
|
||||
#include <beast/threads/WaitableEvent.h>
|
||||
#include <ripple/beast/core/WaitableEvent.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include <atomic>
|
||||
#include <cassert>
|
||||
@@ -33,9 +32,75 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** Mix-in to track when all pending I/O is complete.
|
||||
Derived classes must be callable with this signature:
|
||||
void asyncHandlersComplete()
|
||||
*/
|
||||
template <class Derived>
|
||||
class AsyncObject
|
||||
{
|
||||
protected:
|
||||
AsyncObject ()
|
||||
: m_pending (0)
|
||||
{ }
|
||||
|
||||
public:
|
||||
~AsyncObject ()
|
||||
{
|
||||
// Destroying the object with I/O pending? Not a clean exit!
|
||||
assert (m_pending.load () == 0);
|
||||
}
|
||||
|
||||
/** RAII container that maintains the count of pending I/O.
|
||||
Bind this into the argument list of every handler passed
|
||||
to an initiating function.
|
||||
*/
|
||||
class CompletionCounter
|
||||
{
|
||||
public:
|
||||
explicit CompletionCounter (Derived* owner)
|
||||
: m_owner (owner)
|
||||
{
|
||||
++m_owner->m_pending;
|
||||
}
|
||||
|
||||
CompletionCounter (CompletionCounter const& other)
|
||||
: m_owner (other.m_owner)
|
||||
{
|
||||
++m_owner->m_pending;
|
||||
}
|
||||
|
||||
~CompletionCounter ()
|
||||
{
|
||||
if (--m_owner->m_pending == 0)
|
||||
m_owner->asyncHandlersComplete ();
|
||||
}
|
||||
|
||||
CompletionCounter& operator= (CompletionCounter const&) = delete;
|
||||
|
||||
private:
|
||||
Derived* m_owner;
|
||||
};
|
||||
|
||||
void addReference ()
|
||||
{
|
||||
++m_pending;
|
||||
}
|
||||
|
||||
void removeReference ()
|
||||
{
|
||||
if (--m_pending == 0)
|
||||
(static_cast<Derived*>(this))->asyncHandlersComplete();
|
||||
}
|
||||
|
||||
private:
|
||||
// The number of handlers pending.
|
||||
std::atomic <int> m_pending;
|
||||
};
|
||||
|
||||
class ResolverAsioImpl
|
||||
: public ResolverAsio
|
||||
, public beast::asio::AsyncObject <ResolverAsioImpl>
|
||||
, public AsyncObject <ResolverAsioImpl>
|
||||
{
|
||||
public:
|
||||
using HostAndPort = std::pair <std::string, std::string>;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/basics/ToString.h>
|
||||
#include <beast/module/core/text/LexicalCast.h>
|
||||
#include <ripple/beast/core/LexicalCast.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/basics/UptimeTimer.h>
|
||||
#include <beast/threads/Thread.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/basics/make_SSLContext.h>
|
||||
#include <beast/container/aged_unordered_set.h>
|
||||
#include <beast/module/core/diagnostic/FatalError.h>
|
||||
#include <ripple/beast/container/aged_unordered_set.h>
|
||||
#include <ripple/beast/core/FatalError.h>
|
||||
#include <cstdint>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
||||
Reference in New Issue
Block a user