blob: 1c2f4ea16e75a5a31d6ecd210ebb71f44a52d6d4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "named_service.h"
#include <chrono>
namespace slobrok {
//-----------------------------------------------------------------------------
/**
* @class ReservedName
* @brief A reservation for a name
*
* a reservation expires 15 seconds after it is created.
**/
class ReservedName: public NamedService
{
private:
using steady_clock = std::chrono::steady_clock;
steady_clock::time_point _reservedTime;
int64_t milliseconds() const;
public:
const bool isLocal;
ReservedName(const std::string &name, const std::string &spec, bool local);
bool stillReserved() const;
};
//-----------------------------------------------------------------------------
} // namespace slobrok
|