ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
DataConsistencyGroupSimpleMatcher.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#include "TransferElementID.h"
7#include "VersionNumber.h"
8
9#include <map>
10#include <unordered_set>
11
13
14 /********************************************************************************************************************/
15
18 public:
19 virtual ~MatcherBase() = default;
20
22 [[nodiscard]] const auto& getElements() const { return _pushElements; }
23 [[nodiscard]] auto& getElements() { return _pushElements; }
24
25 protected:
27 std::map<TransferElementID, TransferElementAbstractor> _pushElements;
28 };
29
39 public:
41 SimpleMatcher() = default;
42
45 bool update(const TransferElementID& transferElementID);
46
48 bool isConsistent() const;
49
50 private:
52 std::unordered_set<TransferElementID> _consistentElements;
54 VersionNumber _versionNumberToBeConsistentTo{nullptr};
55 };
56
57 /********************************************************************************************************************/
58
59} // namespace ChimeraTK::DataConsistencyGroupDetail
Base class for matcher implementations; will not be instantiated directly.
std::map< TransferElementID, TransferElementAbstractor > _pushElements
map of push-type elements in this group, there are only push type elements, like in ReadAnyGroup
const auto & getElements() const
For inspection of contents.
Simple matcher implementation for DataConsistencyGroup in MatchingMode::exact.
bool update(const TransferElementID &transferElementID)
This function updates consistentElements, a set of TransferElementID.
SimpleMatcher()=default
Construct empty group.
bool isConsistent() const
returns true if consistent state is reached
Simple class holding a unique ID for a TransferElement.
Class for generating and holding version numbers without exposing a numeric representation.