libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
clockdomain.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <promeki/namespace.h>
14#include <promeki/string.h>
16#include <promeki/list.h>
17#include <promeki/enums.h>
18
19PROMEKI_NAMESPACE_BEGIN
20
21class Metadata;
22
78class ClockDomain {
79 public:
81 using ID = StringRegistry<"ClockDomain">::Item;
82
84 using IDList = ::promeki::List<ID>;
85
93 struct Data;
94
96 static const ID Synthetic;
97
99 static const ID SystemMonotonic;
100
114 static ID registerDomain(const String &name, const String &description,
115 const ClockEpoch &epoch = ClockEpoch::Correlated);
116
125 static void setDomainMetadata(const ID &id, const Metadata &metadata);
126
131 static IDList registeredIDs();
132
138 static ClockDomain lookup(const String &name);
139
141 ClockDomain() = default;
142
147 ClockDomain(const ID &id);
148
153 bool isValid() const;
154
159 ID id() const;
160
165 const String &name() const;
166
171 const String &description() const;
172
178 const ClockEpoch &epoch() const;
179
187 const Metadata &metadata() const;
188
195 bool isCrossStreamComparable() const;
196
203 bool isCrossMachineComparable() const;
204
213 String toString() const;
214
223 const Data *data() const { return d; }
224
226 bool operator==(const ClockDomain &other) const { return d == other.d; }
227
229 bool operator!=(const ClockDomain &other) const { return d != other.d; }
230
231 private:
232 const Data *d = nullptr;
233 static const Data *lookupData(const ID &id);
234};
235
236PROMEKI_NAMESPACE_END
237
238PROMEKI_FORMAT_VIA_TOSTRING(promeki::ClockDomain);
239
240#endif // PROMEKI_ENABLE_CORE