Tidy up compilation units

This commit is contained in:
Vinnie Falco
2015-07-12 10:35:49 -07:00
parent 94235d4b4f
commit 30e068ae17
11 changed files with 5 additions and 171 deletions

View File

@@ -3257,8 +3257,6 @@
<ClCompile Include="..\..\src\ripple\rpc\impl\Coroutine.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\rpc\impl\DoPrint.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\rpc\impl\GetAccountObjects.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
@@ -3284,9 +3282,6 @@
</ClCompile>
<ClInclude Include="..\..\src\ripple\rpc\impl\LookupLedger.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\rpc\impl\Manager.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\rpc\impl\ParseAccountIds.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
@@ -3318,10 +3313,6 @@
</ClCompile>
<ClInclude Include="..\..\src\ripple\rpc\InternalHandler.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\rpc\Manager.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\rpc\Request.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\rpc\RipplePathFind.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\rpc\RPCHandler.h">

View File

@@ -3978,9 +3978,6 @@
<ClCompile Include="..\..\src\ripple\rpc\impl\Coroutine.cpp">
<Filter>ripple\rpc\impl</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\rpc\impl\DoPrint.h">
<Filter>ripple\rpc\impl</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\rpc\impl\GetAccountObjects.cpp">
<Filter>ripple\rpc\impl</Filter>
</ClCompile>
@@ -4011,9 +4008,6 @@
<ClInclude Include="..\..\src\ripple\rpc\impl\LookupLedger.h">
<Filter>ripple\rpc\impl</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\rpc\impl\Manager.cpp">
<Filter>ripple\rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\rpc\impl\ParseAccountIds.cpp">
<Filter>ripple\rpc\impl</Filter>
</ClCompile>
@@ -4050,12 +4044,6 @@
<ClInclude Include="..\..\src\ripple\rpc\InternalHandler.h">
<Filter>ripple\rpc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\rpc\Manager.h">
<Filter>ripple\rpc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\rpc\Request.h">
<Filter>ripple\rpc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\rpc\RipplePathFind.h">
<Filter>ripple\rpc</Filter>
</ClInclude>

View File

@@ -61,7 +61,6 @@
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/STParsedJSON.h>
#include <ripple/protocol/types.h>
#include <ripple/rpc/Manager.h>
#include <ripple/server/make_ServerHandler.h>
#include <ripple/shamap/Family.h>
#include <ripple/validators/make_Manager.h>
@@ -277,7 +276,6 @@ public:
// These are Stoppable-related
std::unique_ptr <JobQueue> m_jobQueue;
std::unique_ptr <RPC::Manager> m_rpcManager;
// VFALCO TODO Make OrderBookDB abstract
OrderBookDB m_orderBookDB;
std::unique_ptr <PathRequests> m_pathRequests;
@@ -365,8 +363,6 @@ public:
// Anything which calls addJob must be a descendant of the JobQueue
//
, m_rpcManager (RPC::make_Manager (m_logs.journal("RPCManager")))
, m_orderBookDB (*m_jobQueue)
, m_pathRequests (new PathRequests (
@@ -473,11 +469,6 @@ public:
return *m_jobQueue;
}
RPC::Manager& getRPCManager ()
{
return *m_rpcManager;
}
LocalCredentials& getLocalCredentials ()
{
return m_localCredentials ;

View File

@@ -34,7 +34,6 @@ namespace ripple {
namespace Validators { class Manager; }
namespace Resource { class Manager; }
namespace NodeStore { class Database; }
namespace RPC { class Manager; }
// VFALCO TODO Fix forward declares required for header dependency loops
class AmendmentTable;
@@ -95,7 +94,6 @@ public:
virtual CollectorManager& getCollectorManager () = 0;
virtual shamap::Family& family() = 0;
virtual JobQueue& getJobQueue () = 0;
virtual RPC::Manager& getRPCManager () = 0;
virtual NodeCache& getTempNodeCache () = 0;
virtual CachedSLEs& cachedSLEs() = 0;
virtual Validators::Manager& getValidators () = 0;

View File

@@ -44,8 +44,7 @@ public:
CachedSLEs (std::chrono::duration<
Rep, Period> const& timeToLive,
Stopwatch& clock)
: clock_ (clock)
, timeToLive_ (timeToLive)
: timeToLive_ (timeToLive)
, map_ (clock)
{
}
@@ -102,7 +101,6 @@ public:
private:
std::size_t hit_ = 0;
std::size_t miss_ = 0;
Stopwatch const& clock_;
std::mutex mutable mutex_;
Stopwatch::duration timeToLive_;
beast::aged_unordered_map <digest_type,

View File

@@ -1,62 +0,0 @@
//------------------------------------------------------------------------------
/*
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.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_RPC_MANAGER_H_INCLUDED
#define RIPPLE_RPC_MANAGER_H_INCLUDED
#include <ripple/rpc/Request.h>
#include <memory>
namespace ripple {
namespace RPC {
/** Processes RPC commands. */
class Manager
{
public:
using handler_type = std::function <void (Request&)>;
virtual ~Manager () = 0;
/** Add a handler for the specified JSON-RPC command. */
template <class Handler>
void add (std::string const& method)
{
add (method, handler_type (
[](Request& req)
{
Handler h;
h (req);
}));
}
virtual void add (std::string const& method, handler_type&& handler) = 0;
/** Dispatch the JSON-RPC request.
@return `true` if the command was found.
*/
virtual bool dispatch (Request& req) = 0;
};
std::unique_ptr <Manager> make_Manager (beast::Journal journal);
} // RPC
} // ripple
#endif

View File

@@ -21,6 +21,7 @@
#include <ripple/app/main/Application.h>
#include <ripple/rpc/impl/Tuning.h>
#include <ripple/app/paths/RippleState.h>
#include <ripple/resource/Fees.h>
namespace ripple {

View File

@@ -18,6 +18,7 @@
//==============================================================================
#include <BeastConfig.h>
#include <ripple/json/JsonPropertyStream.h>
namespace ripple {

View File

@@ -1,73 +0,0 @@
//------------------------------------------------------------------------------
/*
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.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <BeastConfig.h>
#include <ripple/rpc/Manager.h>
#include <ripple/rpc/impl/DoPrint.h>
#include <beast/cxx14/memory.h>
namespace ripple {
namespace RPC {
class ManagerImp : public Manager
{
public:
using Map = hash_map <std::string, handler_type>;
beast::Journal m_journal;
Map m_map;
ManagerImp (beast::Journal journal)
: m_journal (journal)
{
}
void add (std::string const& method, handler_type&& handler)
{
m_map.emplace (std::piecewise_construct,
std::forward_as_tuple (method),
std::forward_as_tuple (std::move (handler)));
}
bool dispatch (Request& req)
{
Map::const_iterator const iter (m_map.find (req.method));
if (iter == m_map.end())
return false;
iter->second (req);
return true;
}
};
//------------------------------------------------------------------------------
Manager::~Manager ()
{
}
std::unique_ptr <Manager> make_Manager (beast::Journal journal)
{
std::unique_ptr <Manager> m (std::make_unique <ManagerImp> (journal));
m->add <DoPrint> ("print");
return m;
}
}
}

View File

@@ -22,6 +22,7 @@
#include <ripple/rpc/Yield.h>
#include <ripple/rpc/impl/Tuning.h>
#include <ripple/rpc/impl/Handler.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/misc/NetworkOPs.h>
#include <ripple/basics/Log.h>
@@ -33,6 +34,7 @@
#include <ripple/net/RPCErr.h>
#include <ripple/protocol/JsonFields.h>
#include <ripple/server/Role.h>
#include <ripple/resource/Fees.h>
namespace ripple {
namespace RPC {

View File

@@ -27,7 +27,6 @@
#include <ripple/rpc/RPCHandler.h>
#include <ripple/rpc/impl/Coroutine.cpp>
#include <ripple/rpc/impl/Manager.cpp>
#include <ripple/rpc/impl/RPCHandler.cpp>
#include <ripple/rpc/impl/Status.cpp>
#include <ripple/rpc/impl/Yield.cpp>