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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef MS_SHARED_INTERFACE_HPP
#define MS_SHARED_INTERFACE_HPP
#include "Channel/ChannelMessageRegistratorInterface.hpp"
// TODO: We should have a ChannelNotifierInterface class instead.
#include "Channel/ChannelNotifier.hpp"
#include "handles/BackoffTimerHandleInterface.hpp"
#include "handles/TimerHandleInterface.hpp"
class SharedInterface
{
public:
virtual ~SharedInterface() = default;
public:
/**
* @todo We should have a ChannelMessageRegistratorInterface class instead.
*/
virtual Channel::ChannelMessageRegistratorInterface* GetChannelMessageRegistrator() = 0;
/**
* @todo We should have a ChannelNotifierInterface class instead.
*/
virtual Channel::ChannelNotifier* GetChannelNotifier() = 0;
/**
* Creates a TimerHandle timer.
*
* @remarks
* - The caller is responsible for freeing it.
*/
virtual TimerHandleInterface* CreateTimer(TimerHandleInterface::Listener* listener) = 0;
/**
* Creates a BackoffTimerHandle timer.
*
* @remarks
* - The caller is responsible for freeing it.
*/
virtual BackoffTimerHandleInterface* CreateBackoffTimer(
const BackoffTimerHandleInterface::BackoffTimerHandleOptions& options) = 0;
/**
* Get current time in milliseconds.
*/
virtual uint64_t GetTimeMs() = 0;
/**
* Get current time in microseconds.
*/
virtual uint64_t GetTimeUs() = 0;
/**
* Get current time in nanoseconds.
*/
virtual uint64_t GetTimeNs() = 0;
/**
* @remarks
* - Used within libwebrtc dependency which uses int64_t values for time
* representation.
*
* @todo Remove once not needed.
*/
virtual int64_t GetTimeMsInt64() = 0;
/**
* @remarks
* - Used within libwebrtc dependency which uses int64_t values for time
* representation.
*
* @todo Remove once not needed.
*/
virtual int64_t GetTimeUsInt64() = 0;
};
#endif