mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
General refactoring, using C++11
* Remove broken RecycledObjectPool * Fix beast::ServiceQueue using List instead of LockFreeStack * Add class semaphore, fixes broken Semaphore * Move crytpo module files to new beast directory * Use c++11 replacements for boost and beast types: - std::atomic instead of beast::Atomic - std::function instead of boost::function, beast::function - std::unique_ptr instead of beast::ScopedPointer - std::shared_ptr instead of boost::shared_ptr * Remove modules: - beast_db - beast_crypto - beast_extras * Remove unnecessary classes: - AbstractFifo - AddConst - AtomicCounter - AtomicFlag - AtomicPointer - AtomicState - CopyConst - Expression - ForwardList - IfCond - Interval - IntrusiveArray - KeyvaDB - PointerToOther - PointerTraits - RemoveConst - RemoveConstVolatile - RemoveReference - RemoveVolatile - SharedObjectArray - SingleThreadedSharedObject - SophiaDB factory - SortedSet - WeakReference - beast::unique_ptr
This commit is contained in:
@@ -147,7 +147,7 @@ public:
|
||||
//
|
||||
// Transaction operations
|
||||
//
|
||||
typedef FUNCTION_TYPE<void (Transaction::pointer, TER)> stCallback; // must complete immediately
|
||||
typedef std::function<void (Transaction::pointer, TER)> stCallback; // must complete immediately
|
||||
void submitTransaction (Job&, SerializedTransaction::pointer, stCallback callback = stCallback ());
|
||||
Transaction::pointer submitTransactionSync (Transaction::ref tpTrans, bool bAdmin, bool bFailHard, bool bSubmit);
|
||||
|
||||
@@ -1778,12 +1778,8 @@ NetworkOPsImp::getAccountTxs (const RippleAddress& account, int32 minLedger, int
|
||||
|
||||
TransactionMetaSet::pointer meta = boost::make_shared<TransactionMetaSet> (txn->getID (), txn->getLedger (), rawMeta.getData ());
|
||||
|
||||
#ifdef C11X
|
||||
// VFALCO NOTE Use emplace instead.
|
||||
ret.push_back (std::pair<Transaction::ref, TransactionMetaSet::ref> (txn, meta));
|
||||
#else
|
||||
ret.push_back (std::pair<Transaction::pointer, TransactionMetaSet::pointer> (txn, meta));
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1937,11 +1933,7 @@ NetworkOPsImp::getTxsAccount (const RippleAddress& account, int32 minLedger, int
|
||||
--numberOfResults;
|
||||
TransactionMetaSet::pointer meta = boost::make_shared<TransactionMetaSet> (txn->getID (), txn->getLedger (), rawMeta.getData ());
|
||||
|
||||
#ifdef C11X
|
||||
ret.push_back (std::pair<Transaction::ref, TransactionMetaSet::ref> (txn, meta));
|
||||
#else
|
||||
ret.push_back (std::pair<Transaction::pointer, TransactionMetaSet::pointer> (txn, meta));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3008,7 +3000,8 @@ void NetworkOPsImp::makeFetchPack (Job&, boost::weak_ptr<Peer> wPeer,
|
||||
if (reply.objects ().size () >= 256)
|
||||
break;
|
||||
|
||||
haveLedger = MOVE_P(wantLedger);
|
||||
// VFALCO NOTE Why use move?
|
||||
haveLedger = std::move (wantLedger);
|
||||
wantLedger = getLedgerByHash (haveLedger->getParentHash ());
|
||||
}
|
||||
while (wantLedger && (UptimeTimer::getInstance ().getElapsedSeconds () <= (uUptime + 1)));
|
||||
@@ -3101,7 +3094,5 @@ NetworkOPs::NetworkOPs (Stoppable& parent)
|
||||
NetworkOPs* NetworkOPs::New (LedgerMaster& ledgerMaster,
|
||||
Stoppable& parent, Journal journal)
|
||||
{
|
||||
ScopedPointer <NetworkOPs> object (new NetworkOPsImp (
|
||||
ledgerMaster, parent, journal));
|
||||
return object.release ();
|
||||
return new NetworkOPsImp (ledgerMaster, parent, journal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user