Template abstract_clock on Clock:

The abstract_clock is now templated on a type meeting the requirements of
the Clock concept. It inherits the nested types of the Clock on which it
is based. This resolves a problem with the original design which broke the
type-safety of time_point from different abstract clocks.
This commit is contained in:
Vinnie Falco
2014-11-20 05:51:47 -08:00
committed by Nik Bougalis
parent 7d72dfe0be
commit 55637f7508
42 changed files with 483 additions and 602 deletions

View File

@@ -36,8 +36,8 @@ namespace Validators {
// Forward declare unit test so it can be a friend to LRUCache.
class Logic_test;
namespace detail
{
namespace detail {
// The LRUCache class (ab)uses an aged_unordered_set so it can hold on
// to a limited number of values. When the container gets too full the
// LRUCache expires the oldest values.
@@ -58,10 +58,9 @@ template <class Key,
class LRUCache
{
private:
typedef std::chrono::seconds Duration;
typedef beast::manual_clock <Duration> Clock;
typedef beast::manual_clock <std::chrono::steady_clock> Clock;
typedef beast::aged_unordered_set <
Key, Duration, Hash, KeyEqual, Allocator> ContainerType;
Key, std::chrono::steady_clock, Hash, KeyEqual, Allocator> ContainerType;
public:
LRUCache () = delete;

View File

@@ -43,7 +43,7 @@ private:
// Holds the Entry of all recent ledgers for this validator.
#if 1
typedef beast::aged_unordered_map <RippleLedgerHash, Entry,
std::chrono::seconds, beast::hardened_hash<>,
std::chrono::steady_clock, beast::hardened_hash<>,
RippleLedgerHash::key_equal> Table;
#else
typedef beast::aged_map <RippleLedgerHash, Entry,