blob: 9446ff32cb25d5d13149078daa77522453e3aa95 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "clock.h"
namespace vespalib {
class InvokeServiceImpl;
/**
* Self contained clock useable for testing that provides a backing for the vespalib::Clock interface.
*/
class TestClock
{
private:
std::unique_ptr<InvokeServiceImpl> _ticker;
Clock _clock;
public:
TestClock();
TestClock(const TestClock &) = delete;
TestClock & operator =(const TestClock &) = delete;
TestClock(TestClock &&) = delete;
TestClock & operator =(TestClock &&) = delete;
~TestClock();
const Clock & clock() { return _clock; }
};
}
|