mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Pass and use time_point in DecayingSample ctor (RIPD-359)
Switches a number of places in Resource::Logic to use abstract_clock::now() which returns a time_point. Unfortunately Resource::Logic tracks time locally also, but with ints, not time_point. So Resource::Logic uses a delicate mix of abstract_clock::now() and abstract_clock::elapsed() with this commit. That inconsistency could be addressed in a second commit.
This commit is contained in:
committed by
Vinnie Falco
parent
d7e08f96a5
commit
9fb09d3109
@@ -30,6 +30,26 @@ struct Key
|
||||
beast::IP::Endpoint address;
|
||||
std::string name;
|
||||
|
||||
// No default constructor
|
||||
Key () = delete;
|
||||
|
||||
// Convenience constructors
|
||||
Key (Kind k, beast::IP::Endpoint const& addr)
|
||||
: kind(k)
|
||||
, address(addr)
|
||||
, name()
|
||||
{
|
||||
assert(kind != kindAdmin);
|
||||
}
|
||||
|
||||
Key (Kind k, const std::string& n)
|
||||
: kind(k)
|
||||
, address()
|
||||
, name(n)
|
||||
{
|
||||
assert(kind == kindAdmin);
|
||||
}
|
||||
|
||||
struct hasher
|
||||
{
|
||||
std::size_t operator() (Key const& v) const
|
||||
|
||||
Reference in New Issue
Block a user