Strip includes from module sources and move them into unity .cpp file

This commit is contained in:
Vinnie Falco
2013-05-22 13:54:27 -07:00
parent 75907d3140
commit 5615bd230d
43 changed files with 87 additions and 308 deletions

View File

@@ -22,8 +22,6 @@
@ingroup ripple_ledger @ingroup ripple_ledger
*/ */
#include "ripple_ledger.h"
// VFALCO: TODO, fix these warnings! // VFALCO: TODO, fix these warnings!
#ifdef _MSC_VER #ifdef _MSC_VER
//#pragma warning (push) // Causes spurious C4503 "decorated name exceeds maximum length" //#pragma warning (push) // Causes spurious C4503 "decorated name exceeds maximum length"
@@ -31,6 +29,93 @@
#pragma warning (disable: 4244) // conversion, possible loss of data #pragma warning (disable: 4244) // conversion, possible loss of data
#endif #endif
#include "ripple_ledger.h"
#include <algorithm>
#include <cassert>
#include <fstream>
#include <iostream>
#include <openssl/ripemd.h>
#include <openssl/sha.h>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/make_shared.hpp>
#include <boost/pointer_cast.hpp>
#include <boost/ref.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/unordered_set.hpp>
#include "src/cpp/database/SqliteDatabase.h"
#include "src/cpp/json/writer.h"
#include "src/cpp/ripple/AcceptedLedger.h"
#include "src/cpp/ripple/AccountItems.h"
#include "src/cpp/ripple/AccountSetTransactor.h"
#include "src/cpp/ripple/AccountState.h"
#include "src/cpp/ripple/Application.h"
#include "src/cpp/ripple/BitcoinUtil.h"
#include "src/cpp/ripple/ChangeTransactor.h"
#include "src/cpp/ripple/Config.h"
#include "src/cpp/ripple/Contract.h"
#include "src/cpp/ripple/FeatureTable.h"
#include "src/cpp/ripple/FieldNames.h"
#include "src/cpp/ripple/HashPrefixes.h"
#include "src/cpp/ripple/Interpreter.h"
#include "src/cpp/ripple/key.h"
#include "src/cpp/ripple/Ledger.h"
#include "src/cpp/ripple/LedgerAcquire.h"
#include "src/cpp/ripple/LedgerConsensus.h"
#include "src/cpp/ripple/LedgerEntrySet.h"
#include "src/cpp/ripple/LedgerFormats.h"
#include "src/cpp/ripple/LedgerHistory.h"
#include "src/cpp/ripple/LedgerMaster.h"
#include "src/cpp/ripple/LedgerProposal.h"
#include "src/cpp/ripple/LedgerTiming.h"
#include "src/cpp/ripple/Log.h"
#include "src/cpp/ripple/NetworkOPs.h"
#include "src/cpp/ripple/Offer.h"
#include "src/cpp/ripple/OfferCancelTransactor.h"
#include "src/cpp/ripple/OfferCreateTransactor.h"
#include "src/cpp/ripple/Operation.h"
#include "src/cpp/ripple/OrderBook.h"
#include "src/cpp/ripple/OrderBookDB.h"
#include "src/cpp/ripple/PackedMessage.h"
#include "src/cpp/ripple/PaymentTransactor.h"
#include "src/cpp/ripple/PFRequest.h"
#include "src/cpp/ripple/RegularKeySetTransactor.h"
#include "src/cpp/ripple/ripple.pb.h"
#include "src/cpp/ripple/RippleAddress.h"
#include "src/cpp/ripple/RippleCalc.h"
#include "src/cpp/ripple/RippleState.h"
#include "src/cpp/ripple/SerializedLedger.h"
#include "src/cpp/ripple/SerializedObject.h"
#include "src/cpp/ripple/SerializedTransaction.h"
#include "src/cpp/ripple/SerializedTypes.h"
#include "src/cpp/ripple/SerializedValidation.h"
#include "src/cpp/ripple/Serializer.h"
#include "src/cpp/ripple/SHAMapSync.h"
#include "src/cpp/ripple/Transaction.h"
#include "src/cpp/ripple/TransactionEngine.h"
#include "src/cpp/ripple/TransactionErr.h"
#include "src/cpp/ripple/TransactionFormats.h"
#include "src/cpp/ripple/TransactionMaster.h"
#include "src/cpp/ripple/TransactionMeta.h"
#include "src/cpp/ripple/TransactionQueue.h"
#include "src/cpp/ripple/Transactor.h"
#include "src/cpp/ripple/TrustSetTransactor.h"
#include "src/cpp/ripple/utils.h"
#include "src/cpp/ripple/ValidationCollection.h"
#include "src/cpp/ripple/Wallet.h"
#include "src/cpp/ripple/WalletAddTransactor.h"
// contracts // contracts
#include "src/cpp/ripple/Contract.cpp" // no log #include "src/cpp/ripple/Contract.cpp" // no log
#include "src/cpp/ripple/Operation.cpp" // no log #include "src/cpp/ripple/Operation.cpp" // no log

View File

@@ -1,6 +1,3 @@
#include "AcceptedLedger.h"
#include <boost/foreach.hpp>
TaggedCache<uint256, AcceptedLedger> AcceptedLedger::ALCache("AcceptedLedger", 4, 60); TaggedCache<uint256, AcceptedLedger> AcceptedLedger::ALCache("AcceptedLedger", 4, 60);

View File

@@ -1,11 +1,3 @@
#include "AccountItems.h"
#include <boost/foreach.hpp>
#include "Application.h"
#include "Log.h"
SETUP_LOG();
AccountItem::AccountItem(SerializedLedgerEntry::ref ledger) : mLedgerEntry(ledger) AccountItem::AccountItem(SerializedLedgerEntry::ref ledger) : mLedgerEntry(ledger)
{ {

View File

@@ -1,5 +1,3 @@
#include "AccountSetTransactor.h"
#include "Config.h"
TER AccountSetTransactor::doApply() TER AccountSetTransactor::doApply()
{ {

View File

@@ -1,16 +1,4 @@
#include "AccountState.h"
#include <boost/lexical_cast.hpp>
#include <boost/make_shared.hpp>
#include <boost/algorithm/string.hpp>
#include "../json/writer.h"
#include "Ledger.h"
#include "Serializer.h"
#include "Log.h"
AccountState::AccountState(const RippleAddress& naAccountID) : mAccountID(naAccountID), mValid(false) AccountState::AccountState(const RippleAddress& naAccountID) : mAccountID(naAccountID), mValid(false)
{ {
if (!naAccountID.isValid()) return; if (!naAccountID.isValid()) return;

View File

@@ -1,5 +1,3 @@
#include "Contract.h"
#include "Interpreter.h"
using namespace Script; using namespace Script;
/* /*

View File

@@ -1,11 +1,3 @@
#include "FeatureTable.h"
#include <boost/foreach.hpp>
#include "Log.h"
#include "Application.h"
#include "ValidationCollection.h"
#include "HashPrefixes.h"
void FeatureTable::addInitialFeatures() void FeatureTable::addInitialFeatures()
{ {

View File

@@ -1,27 +1,4 @@
#include <iostream>
#include <fstream>
#include <boost/lexical_cast.hpp>
#include <boost/make_shared.hpp>
#include <boost/test/unit_test.hpp>
#include "../json/writer.h"
#include "../database/SqliteDatabase.h"
#include "Application.h"
#include "Ledger.h"
#include "utils.h"
#include "ripple.pb.h"
#include "PackedMessage.h"
#include "Config.h"
#include "BitcoinUtil.h"
#include "Wallet.h"
#include "LedgerTiming.h"
#include "HashPrefixes.h"
#include "Log.h"
DECLARE_INSTANCE(Ledger); DECLARE_INSTANCE(Ledger);
Ledger::Ledger(const RippleAddress& masterID, uint64 startAmount) : mTotCoins(startAmount), mLedgerSeq(1), Ledger::Ledger(const RippleAddress& masterID, uint64 startAmount) : mTotCoins(startAmount), mLedgerSeq(1),

View File

@@ -1,15 +1,4 @@
#include "LedgerAcquire.h"
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include <boost/pointer_cast.hpp>
#include "Application.h"
#include "Log.h"
#include "SHAMapSync.h"
#include "HashPrefixes.h"
DECLARE_INSTANCE(LedgerAcquire); DECLARE_INSTANCE(LedgerAcquire);
#define LA_DEBUG #define LA_DEBUG

View File

@@ -1,18 +1,3 @@
#include "LedgerConsensus.h"
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/unordered_set.hpp>
#include <boost/foreach.hpp>
#include "../json/writer.h"
#include "Application.h"
#include "NetworkOPs.h"
#include "LedgerTiming.h"
#include "SerializedValidation.h"
#include "Log.h"
#include "SHAMapSync.h"
#define LEDGER_TOTAL_PASSES 8 #define LEDGER_TOTAL_PASSES 8
#define LEDGER_RETRY_PASSES 5 #define LEDGER_RETRY_PASSES 5

View File

@@ -1,11 +1,4 @@
#include "LedgerEntrySet.h"
#include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#include <boost/foreach.hpp>
#include "Log.h"
DECLARE_INSTANCE(LedgerEntrySetEntry); DECLARE_INSTANCE(LedgerEntrySetEntry);
DECLARE_INSTANCE(LedgerEntrySet) DECLARE_INSTANCE(LedgerEntrySet)

View File

@@ -1,6 +1,4 @@
#include "LedgerFormats.h"
std::map<int, LedgerEntryFormat*> LedgerEntryFormat::byType; std::map<int, LedgerEntryFormat*> LedgerEntryFormat::byType;
std::map<std::string, LedgerEntryFormat*> LedgerEntryFormat::byName; std::map<std::string, LedgerEntryFormat*> LedgerEntryFormat::byName;

View File

@@ -1,14 +1,4 @@
#include "LedgerHistory.h"
#include <string>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include "Config.h"
#include "Application.h"
#ifndef CACHED_LEDGER_NUM #ifndef CACHED_LEDGER_NUM
#define CACHED_LEDGER_NUM 96 #define CACHED_LEDGER_NUM 96
#endif #endif

View File

@@ -1,13 +1,4 @@
#include "LedgerMaster.h"
#include <boost/foreach.hpp>
#include "Application.h"
#include "RippleAddress.h"
#include "Log.h"
#include "PFRequest.h"
#define MIN_VALIDATION_RATIO 150 // 150/256ths of validations of previous ledger #define MIN_VALIDATION_RATIO 150 // 150/256ths of validations of previous ledger
#define MAX_LEDGER_GAP 100 // Don't catch up more than 100 ledgers (cannot exceed 256) #define MAX_LEDGER_GAP 100 // Don't catch up more than 100 ledgers (cannot exceed 256)

View File

@@ -1,12 +1,4 @@
#include "LedgerProposal.h"
#include <boost/make_shared.hpp>
#include "key.h"
#include "Application.h"
#include "HashPrefixes.h"
DECLARE_INSTANCE(LedgerProposal); DECLARE_INSTANCE(LedgerProposal);
LedgerProposal::LedgerProposal(const uint256& pLgr, uint32 seq, const uint256& tx, uint32 closeTime, LedgerProposal::LedgerProposal(const uint256& pLgr, uint32 seq, const uint256& tx, uint32 closeTime,

View File

@@ -1,12 +1,4 @@
#include "LedgerTiming.h"
#include <cassert>
#include <boost/format.hpp>
#include "Log.h"
// VFALCO: Should rename ContinuousLedgerTiming to LedgerTiming // VFALCO: Should rename ContinuousLedgerTiming to LedgerTiming
struct LedgerTiming; struct LedgerTiming;

View File

@@ -1,4 +1,3 @@
#include "Offer.h"
AccountItem::pointer Offer::makeItem(const uint160& ,SerializedLedgerEntry::ref ledgerEntry) AccountItem::pointer Offer::makeItem(const uint160& ,SerializedLedgerEntry::ref ledgerEntry)
{ {

View File

@@ -1,5 +1,3 @@
#include "OfferCancelTransactor.h"
#include "Log.h"
TER OfferCancelTransactor::doApply() TER OfferCancelTransactor::doApply()
{ {

View File

@@ -1,9 +1,3 @@
#include "Application.h"
#include "OfferCreateTransactor.h"
#include <boost/foreach.hpp>
#include <boost/bind.hpp>
// Make sure an offer is still valid. If not, mark it unfunded. // Make sure an offer is still valid. If not, mark it unfunded.
bool OfferCreateTransactor::bValidOffer( bool OfferCreateTransactor::bValidOffer(

View File

@@ -1,5 +1,3 @@
#include "Operation.h"
#include "Config.h"
/* /*
We also need to charge for each op We also need to charge for each op

View File

@@ -1,5 +1,3 @@
#include "OrderBook.h"
#include "Ledger.h"
OrderBook::OrderBook(SerializedLedgerEntry::ref ledgerEntry) OrderBook::OrderBook(SerializedLedgerEntry::ref ledgerEntry)
{ {

View File

@@ -1,10 +1,3 @@
#include "OrderBookDB.h"
#include <boost/foreach.hpp>
#include <boost/ref.hpp>
#include "Application.h"
#include "Log.h"
OrderBookDB::OrderBookDB() : mSeq(0) OrderBookDB::OrderBookDB() : mSeq(0)
{ {

View File

@@ -1,7 +1,3 @@
#include "PaymentTransactor.h"
#include "Config.h"
#include "RippleCalc.h"
#include "Application.h"
#define RIPPLE_PATHS_MAX 6 #define RIPPLE_PATHS_MAX 6

View File

@@ -1,5 +1,3 @@
#include "RegularKeySetTransactor.h"
#include "Log.h"
uint64 RegularKeySetTransactor::calculateBaseFee() uint64 RegularKeySetTransactor::calculateBaseFee()
{ {

View File

@@ -5,14 +5,6 @@
// all liquidity is used. // all liquidity is used.
// //
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include "RippleCalc.h"
#include "Log.h"
#include "../json/writer.h"
std::size_t hash_value(const aciSource& asValue) std::size_t hash_value(const aciSource& asValue)
{ {

View File

@@ -1,4 +1,3 @@
#include "RippleState.h"
AccountItem::pointer RippleState::makeItem(const uint160& accountID, SerializedLedgerEntry::ref ledgerEntry) AccountItem::pointer RippleState::makeItem(const uint160& accountID, SerializedLedgerEntry::ref ledgerEntry)

View File

@@ -1,9 +1,3 @@
#include "SerializedLedger.h"
#include <boost/format.hpp>
#include "Ledger.h"
#include "Log.h"
DECLARE_INSTANCE(SerializedLedgerEntry) DECLARE_INSTANCE(SerializedLedgerEntry)

View File

@@ -1,18 +1,4 @@
#include "SerializedObject.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/bind.hpp>
#include <boost/test/unit_test.hpp>
#include "../json/writer.h"
#include "Log.h"
#include "LedgerFormats.h"
#include "TransactionFormats.h"
#include "SerializedTransaction.h"
DECLARE_INSTANCE(SerializedObject); DECLARE_INSTANCE(SerializedObject);
DECLARE_INSTANCE(SerializedArray); DECLARE_INSTANCE(SerializedArray);

View File

@@ -1,13 +1,4 @@
#include "SerializedTransaction.h"
#include <boost/foreach.hpp>
#include <boost/test/unit_test.hpp>
#include "Application.h"
#include "Log.h"
#include "HashPrefixes.h"
DECLARE_INSTANCE(SerializedTransaction); DECLARE_INSTANCE(SerializedTransaction);
SerializedTransaction::SerializedTransaction(TransactionType type) : STObject(sfTransaction), mType(type), SerializedTransaction::SerializedTransaction(TransactionType type) : STObject(sfTransaction), mType(type),

View File

@@ -1,18 +1,4 @@
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include "SerializedTypes.h"
#include "SerializedObject.h"
#include "TransactionFormats.h"
#include "LedgerFormats.h"
#include "FieldNames.h"
#include "Log.h"
#include "RippleAddress.h"
#include "utils.h"
#include "RippleAddress.h"
#include "TransactionErr.h"
const STAmount saZero(CURRENCY_ONE, ACCOUNT_ONE, 0); const STAmount saZero(CURRENCY_ONE, ACCOUNT_ONE, 0);
const STAmount saOne(CURRENCY_ONE, ACCOUNT_ONE, 1); const STAmount saOne(CURRENCY_ONE, ACCOUNT_ONE, 1);

View File

@@ -1,9 +1,4 @@
#include "SerializedValidation.h"
#include "Config.h"
#include "Log.h"
DECLARE_INSTANCE(SerializedValidation); DECLARE_INSTANCE(SerializedValidation);
SOTemplate sValidationFormat; SOTemplate sValidationFormat;

View File

@@ -1,17 +1,4 @@
#include "Serializer.h"
#include <cassert>
#include <openssl/ripemd.h>
#include <openssl/sha.h>
#include <boost/test/unit_test.hpp>
#include <boost/foreach.hpp>
#include "key.h"
#include "Log.h"
int Serializer::addZeros(size_t uBytes) int Serializer::addZeros(size_t uBytes)
{ {
int ret = mData.size(); int ret = mData.size();

View File

@@ -1,17 +1,3 @@
#include <cassert>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/make_shared.hpp>
#include <boost/ref.hpp>
#include "Application.h"
#include "Transaction.h"
#include "Wallet.h"
#include "BitcoinUtil.h"
#include "Serializer.h"
#include "SerializedTransaction.h"
#include "Log.h"
DECLARE_INSTANCE(Transaction); DECLARE_INSTANCE(Transaction);

View File

@@ -1,19 +1,3 @@
#include "LedgerConsensus.h"
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/unordered_set.hpp>
#include <boost/foreach.hpp>
#include <boost/pointer_cast.hpp>
#include "../json/writer.h"
#include "Application.h"
#include "NetworkOPs.h"
#include "SerializedValidation.h"
#include "Log.h"
#include "SHAMapSync.h"
#include "HashPrefixes.h"
#define TX_ACQUIRE_TIMEOUT 250 #define TX_ACQUIRE_TIMEOUT 250

View File

@@ -1,7 +1,4 @@
#include "TransactionErr.h"
#include "TransactionEngine.h"
// VFALCO: TODO, move this into TransactionEngine.cpp // VFALCO: TODO, move this into TransactionEngine.cpp
// Double check a transaction's metadata to make sure no system invariants were broken // Double check a transaction's metadata to make sure no system invariants were broken

View File

@@ -2,19 +2,6 @@
// XXX Make sure all fields are recognized in transactions. // XXX Make sure all fields are recognized in transactions.
// //
#include <boost/format.hpp>
#include <boost/foreach.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include "TransactionEngine.h"
#include "Transactor.h"
#include "../json/writer.h"
#include "Config.h"
#include "Log.h"
#include "TransactionFormats.h"
#include "utils.h"
DECLARE_INSTANCE(TransactionEngine); DECLARE_INSTANCE(TransactionEngine);

View File

@@ -1,5 +1,3 @@
#include "TransactionErr.h"
#include "utils.h"
bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman) bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
{ {

View File

@@ -1,4 +1,3 @@
#include "TransactionFormats.h"
std::map<int, TransactionFormat*> TransactionFormat::byType; std::map<int, TransactionFormat*> TransactionFormat::byType;
std::map<std::string, TransactionFormat*> TransactionFormat::byName; std::map<std::string, TransactionFormat*> TransactionFormat::byName;

View File

@@ -1,10 +1,4 @@
#include "TransactionMaster.h"
#include <boost/bind.hpp>
#include "Application.h"
#ifndef CACHED_TRANSACTION_NUM #ifndef CACHED_TRANSACTION_NUM
#define CACHED_TRANSACTION_NUM 65536 #define CACHED_TRANSACTION_NUM 65536
#endif #endif

View File

@@ -1,13 +1,3 @@
#include "TransactionMeta.h"
#include <algorithm>
#include <boost/make_shared.hpp>
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include "Log.h"
#include "SerializedObject.h"
// VFALCO: TODO, rename class to TransactionMeta // VFALCO: TODO, rename class to TransactionMeta

View File

@@ -1,6 +1,3 @@
#include "TransactionQueue.h"
#include <boost/foreach.hpp>
void TXQEntry::addCallbacks(const TXQEntry& otherEntry) void TXQEntry::addCallbacks(const TXQEntry& otherEntry)
{ {

View File

@@ -1,14 +1,3 @@
#include "Transactor.h"
#include "Log.h"
#include "Config.h"
#include "PaymentTransactor.h"
#include "RegularKeySetTransactor.h"
#include "AccountSetTransactor.h"
#include "WalletAddTransactor.h"
#include "OfferCancelTransactor.h"
#include "OfferCreateTransactor.h"
#include "TrustSetTransactor.h"
#include "ChangeTransactor.h"
UPTR_T<Transactor> Transactor::makeTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine) UPTR_T<Transactor> Transactor::makeTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine)
{ {

View File

@@ -1,6 +1,3 @@
#include "Application.h"
#include "TrustSetTransactor.h"
TER TrustSetTransactor::doApply() TER TrustSetTransactor::doApply()
{ {