ChimeraTK-DeviceAccess 03.20.00
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DataConsistencyRealmStore.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3#pragma once
4
6
7#include <map>
8#include <mutex>
9#include <string>
10
11namespace ChimeraTK::async {
12
13 /********************************************************************************************************************/
14
16 public:
18 static DataConsistencyRealmStore instance;
19 return instance;
20 }
21
22 std::shared_ptr<DataConsistencyRealm> getRealm(const std::string& realmName);
23
24 private:
25 DataConsistencyRealmStore() = default;
27
28 std::mutex _mapMutex;
29 std::map<std::string, std::weak_ptr<DataConsistencyRealm>> _realmMap;
30 };
31
32 /********************************************************************************************************************/
33
34} // namespace ChimeraTK::async
static DataConsistencyRealmStore & getInstance()
std::shared_ptr< DataConsistencyRealm > getRealm(const std::string &realmName)