2016-09-29 11:37:16 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-09-29 11:37:16 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-09-29 11:37:16 +00:00
|
|
|
*/
|
2017-04-06 14:38:10 +00:00
|
|
|
#include "base/runtime_composer.h"
|
2016-09-29 11:37:16 +00:00
|
|
|
|
|
|
|
struct RuntimeComposerMetadatasMap {
|
2018-08-08 20:11:28 +00:00
|
|
|
std::map<uint64, std::unique_ptr<RuntimeComposerMetadata>> data;
|
|
|
|
QMutex mutex;
|
2016-09-29 11:37:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const RuntimeComposerMetadata *GetRuntimeComposerMetadata(uint64 mask) {
|
|
|
|
static RuntimeComposerMetadatasMap RuntimeComposerMetadatas;
|
|
|
|
|
2018-08-08 20:11:28 +00:00
|
|
|
QMutexLocker lock(&RuntimeComposerMetadatas.mutex);
|
|
|
|
auto i = RuntimeComposerMetadatas.data.find(mask);
|
|
|
|
if (i == end(RuntimeComposerMetadatas.data)) {
|
|
|
|
i = RuntimeComposerMetadatas.data.emplace(
|
|
|
|
mask,
|
|
|
|
std::make_unique<RuntimeComposerMetadata>(mask)).first;
|
2016-09-29 11:37:16 +00:00
|
|
|
}
|
2018-08-08 20:11:28 +00:00
|
|
|
return i->second.get();
|
2016-09-29 11:37:16 +00:00
|
|
|
}
|
|
|
|
|
2018-01-14 16:02:25 +00:00
|
|
|
const RuntimeComposerMetadata *RuntimeComposerBase::ZeroRuntimeComposerMetadata = GetRuntimeComposerMetadata(0);
|
2016-09-29 11:37:16 +00:00
|
|
|
|
|
|
|
RuntimeComponentWrapStruct RuntimeComponentWraps[64];
|
|
|
|
|
|
|
|
QAtomicInt RuntimeComponentIndexLast;
|