ChimeraTK-DeviceAccess 03.20.00
Loading...
Searching...
No Matches
DataConsistencyRealm.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
5#include "../VersionNumber.h"
7
8#include <boost/circular_buffer.hpp>
9
10#include <mutex>
11
12namespace ChimeraTK::async {
13
14 class DataConsistencyRealmStore;
15
16 /********************************************************************************************************************/
17
19 public:
22
24
27
28 private:
29 constexpr static DataConsistencyKey::BaseType maxSizeEventIdMap = 2000;
30
31 // mutex for both _versionHistory and _latestKey
32 std::mutex _mapMutex;
33 boost::circular_buffer<VersionNumber> _versionHistory{maxSizeEventIdMap};
34 DataConsistencyKey _latestKey{0};
35 };
36
37 /********************************************************************************************************************/
38
39} // namespace ChimeraTK::async
Class for generating and holding version numbers without exposing a numeric representation.
uint64_t BaseType
Numeric data type for the key. Must be a valid UserType for the register accessors.
DataConsistencyRealm(const DataConsistencyRealm &)=delete
ChimeraTK::VersionNumber getVersion(const DataConsistencyKey &eventId)
DataConsistencyRealm & operator=(const DataConsistencyRealm &)=delete