Refactoring of container usage:

* New ripple container aliases use hardened_hash
* Use std::tuple instead of boost::tuple
* Use std unordered containers instead of boost
* Fix Destroyer for new containers
* Fix warning for fnv1a on 32-bit arch
* Validator fixes for new containers
This commit is contained in:
Howard Hinnant
2014-04-03 17:08:52 -04:00
committed by Vinnie Falco
parent 6f8145b696
commit 6596c94eb9
72 changed files with 503 additions and 570 deletions

View File

@@ -20,6 +20,8 @@
#ifndef RIPPLE_VALIDATORS_CHOSENLIST_H_INCLUDED
#define RIPPLE_VALIDATORS_CHOSENLIST_H_INCLUDED
#include "../../common/UnorderedMap.h"
namespace ripple {
namespace Validators {
@@ -35,7 +37,8 @@ public:
}
};
typedef boost::unordered_map <RipplePublicKey, Info, RipplePublicKey::hasher> MapType;
typedef ripple::unordered_map <RipplePublicKey, Info,
beast::hardened_hash<RipplePublicKey>> MapType;
ChosenList (std::size_t expectedSize = 0)
{

View File

@@ -21,6 +21,7 @@
#define RIPPLE_VALIDATORS_LOGIC_H_INCLUDED
#include <memory>
#include <unordered_map>
namespace ripple {
namespace Validators {
@@ -67,9 +68,9 @@ public:
// Holds the internal list of trusted validators
//
typedef boost::unordered_map <
typedef ripple::unordered_map <
RipplePublicKey, Validator,
RipplePublicKey::hasher> ValidatorTable;
beast::hardened_hash<RipplePublicKey>> ValidatorTable;
ValidatorTable m_validators;
// Filters duplicate validations

View File

@@ -20,6 +20,8 @@
#ifndef RIPPLE_VALIDATORS_TUNING_H_INCLUDED
#define RIPPLE_VALIDATORS_TUNING_H_INCLUDED
#include "../../common/UnorderedMap.h"
#include <boost/version.hpp>
namespace ripple {
@@ -61,11 +63,11 @@ template <class Key,
class Info, // per-container info
class Hash = typename Key::hasher,
class KeyEqual = std::equal_to <Key>,
class Allocator = std::allocator <Key> >
class Allocator = std::allocator <std::pair <Key const, T> > >
class CycledMap
{
private:
typedef boost::unordered_map <
typedef ripple::unordered_map <
Key, T, Hash, KeyEqual, Allocator> ContainerType;
typedef typename ContainerType::iterator iterator;

View File

@@ -43,7 +43,8 @@ private:
/** Holds the state of all recent ledgers for this validator. */
/** @{ */
typedef CycledMap <RippleLedgerHash, Ledger, Count,
RippleLedgerHash::hasher, RippleLedgerHash::key_equal> LedgerMap;
beast::hardened_hash<RippleLedgerHash>,
RippleLedgerHash::key_equal> LedgerMap;
LedgerMap m_ledgers;
/** @} */