Reorganize all includes in ripple_main.cpp

This commit is contained in:
Vinnie Falco
2013-06-03 17:38:28 -07:00
parent 34cb5c6569
commit 045c3cc01f
20 changed files with 503 additions and 535 deletions

View File

@@ -9,8 +9,6 @@
#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include "../ripple/JobQueue.h"
SETUP_LOG (SqliteDatabase)
using namespace std;

View File

@@ -16,7 +16,6 @@
#include "NetworkOPs.h"
#include "WSDoor.h"
#include "SNTPClient.h"
#include "JobQueue.h"
#include "RPCHandler.h"
#include "ProofOfWork.h"
#include "LoadManager.h"

View File

@@ -1,4 +1,3 @@
#include "JobQueue.h"
#include <boost/foreach.hpp>
#include <boost/bind.hpp>

View File

@@ -1,26 +1,11 @@
#ifndef JOB_QUEUE__H
#define JOB_QUEUE__H
#include <map>
#include <set>
#include <vector>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/make_shared.hpp>
#include <boost/asio.hpp>
#include <boost/ref.hpp>
// VFALCO: Does this belong here?
#include "ripple_LoadEvent.h"
#include "LoadMonitor.h"
// Note that this queue should only be used for CPU-bound jobs
// It is primarily intended for signature checking
enum JobType
{ // must be in priority order, low to high
{
// must be in priority order, low to high
jtINVALID = -1,
jtPACK = 1, // Make a fetch pack for a peer
jtPUBOLDLEDGER = 2, // An old ledger has been accepted
@@ -50,7 +35,9 @@ enum JobType
jtHO_READ = 30,
jtHO_WRITE = 31,
}; // CAUTION: If you add new types, add them to JobType.cpp too
#define NUM_JOB_TYPES 48
// VFALCO: TODO, move this into the enum so it calculates itself?
#define NUM_JOB_TYPES 48 // why 48 and not 32?
class Job
{
@@ -77,7 +64,7 @@ public:
bool operator<=(const Job& j) const;
bool operator>=(const Job& j) const;
static const char* toString(JobType);
static const char* toString (JobType);
protected:
JobType mType;
@@ -123,8 +110,8 @@ private:
boost::condition_variable mJobCond;
uint64 mLastJob;
std::set<Job> mJobSet;
LoadMonitor mJobLoads[NUM_JOB_TYPES];
std::set <Job> mJobSet;
LoadMonitor mJobLoads [NUM_JOB_TYPES];
int mThreadCount;
bool mShuttingDown;

View File

@@ -14,8 +14,6 @@
#include "AccountState.h"
#include "NicknameState.h"
#include "SHAMap.h"
#include "LoadMonitor.h"
#include "JobQueue.h"
enum LedgerStateParms
{

View File

@@ -14,7 +14,6 @@
#include "Peer.h"
#include "CanonicalTXSet.h"
#include "TransactionEngine.h"
#include "LoadMonitor.h"
DEFINE_INSTANCE(LedgerConsensus);
DEFINE_INSTANCE(TransactionAcquire);

View File

@@ -13,7 +13,6 @@
#include "SerializedValidation.h"
#include "LedgerAcquire.h"
#include "LedgerProposal.h"
#include "JobQueue.h"
#include "AcceptedLedger.h"
// Operations that clients may wish to perform against the network

View File

@@ -11,7 +11,6 @@
#include "PackedMessage.h"
#include "Ledger.h"
#include "Transaction.h"
#include "JobQueue.h"
#include "ProofOfWork.h"
#include "LoadManager.h"

View File

@@ -26,10 +26,12 @@ enum PathFlags
PF_ISSUE = 0x80,
};
// VFALCO: TODO, make these non static or otherwise clean constants.
static const uint160 u160_zero(0), u160_one(1);
static inline const uint160& get_u160_zero() { return u160_zero; }
static inline const uint160& get_u160_one() { return u160_one; }
// VFALCO: TODO, replace these with language constructs, gah!
#define CURRENCY_XRP get_u160_zero()
#define CURRENCY_ONE get_u160_one() // Used as a place holder.
#define CURRENCY_BAD uint160(0x5852500000000000) // Do not allow XRP as an IOU currency.
@@ -39,10 +41,11 @@ static inline const uint160& get_u160_one() { return u160_one; }
class SerializedType
{
public:
SerializedType() : fName(&sfGeneric) { ; }
SerializedType(SField::ref n) : fName(&n) { assert(fName); }
virtual ~SerializedType() { ; }
explicit SerializedType (SField::ref n) : fName(&n) { assert(fName); }
virtual ~SerializedType() { }
static UPTR_T<SerializedType> deserialize(SField::ref name)
{ return UPTR_T<SerializedType>(new SerializedType(name)); }
@@ -472,6 +475,7 @@ private:
}
};
// VFALCO: TODO Make static member accessors for these in STAmount
extern const STAmount saZero;
extern const STAmount saOne;

View File

@@ -1,4 +1,7 @@
#ifndef RIPPLE_WSCONNECTION_H
#define RIPPLE_WSCONNECTION_H
#include "../websocketpp/src/sockets/autotls.hpp"
#include "../websocketpp/src/websocketpp.hpp"
@@ -255,4 +258,6 @@ private:
bool mDead;
};
#endif
// vim:ts=4

View File

@@ -1,20 +1,3 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, 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.
*/
//==============================================================================
std::size_t hash_value(const uint256& u)
{

View File

@@ -1,20 +1,3 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, 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_HASH_VALUE_H
#define RIPPLE_HASH_VALUE_H

View File

@@ -1,13 +1,6 @@
#ifndef RIPPLE_IVALIDATIONS_H
#define RIPPLE_IVALIDATIONS_H
//#include <vector>
//#include <boost/unordered_map.hpp>
//#include <boost/thread/mutex.hpp>
//#include "SerializedValidation.h"
//#include "JobQueue.h"
// VFALCO: TODO rename and move these typedefs into the IValidations interface
typedef boost::unordered_map<uint160, SerializedValidation::pointer> ValidationSet;
typedef std::pair<int, uint160> currentValidationCount; // nodes validating and highest node ID validating

View File

@@ -1,5 +1,3 @@
#include "LoadMonitor.h"
SETUP_LOG (LoadMonitor)
LoadMonitor::LoadMonitor ()
@@ -48,7 +46,8 @@ void LoadMonitor::update ()
mLatencyEvents -= ((mLatencyEvents + 3) / 4);
mLatencyMSAvg -= (mLatencyMSAvg / 4);
mLatencyMSPeak -= (mLatencyMSPeak / 4);
} while (mLastUpdate < now);
}
while (mLastUpdate < now);
}
void LoadMonitor::addCount ()

View File

@@ -1,11 +1,5 @@
#ifndef LOADMONITOR__H_
#define LOADMONITOR__H_
#include <string>
#include <boost/thread/mutex.hpp>
#include <boost/shared_ptr.hpp>
#ifndef RIPPLE_LOADMONITOR_H
#define RIPPLE_LOADMONITOR_H
// Monitors load levels and response times