13 void DataConsistencyGroup::initMatcher() {
15 _impl = std::make_unique<DataConsistencyGroupDetail::HistorizedMatcher>();
18 _impl = std::make_unique<DataConsistencyGroupDetail::SimpleMatcher>();
41 for(
const auto& element : list) {
42#pragma GCC diagnostic push
43#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
45#pragma GCC diagnostic pop
54 for(
const auto& element : list) {
55#pragma GCC diagnostic push
56#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
58#pragma GCC diagnostic pop
65 std::initializer_list<std::reference_wrapper<TransferElementAbstractor>> list,
MatchingMode mode,
70 for(
const auto& element : list) {
71 add(element, histLen);
81 "Add function with const-abstractor is deprecated and unsuitable for MatchingMode::historized");
83 _impl->getElements()[element.
getId()] = element;
89#pragma GCC diagnostic push
90#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
92#pragma GCC diagnostic pop
100 "Cannot add non-readable accessor for register " + element.
getName() +
" to DataConsistencyGroup.");
104 "Cannot add poll type accessor for register " + element.
getName() +
" to DataConsistencyGroup.");
111 checkAccess(element);
116 _impl->getElements()[element.
getId()] = element;
124 if(_impl->getElements().find(transferElementID) == _impl->getElements().end()) {
149 throw ChimeraTK::logic_error(
"setMatchingMode cannot be used to switch to or from MatchingMode::historized");
157 return _impl->getElements();
bool has(AccessMode flag) const
Check if a certain flag is in the set.
Data consistency matching via history of available data.
Base class for matcher implementations; will not be instantiated directly.
Simple matcher implementation for DataConsistencyGroup in MatchingMode::exact.
Group several registers (= TransferElement) which ensures data consistency across multiple variables ...
const DataConsistencyGroupDetail::MatcherBase & getMatcher()
For diagnostics.
void setMatchingMode(MatchingMode newMode)
Change the matching mode.
void add(const TransferElementAbstractor &element)
Add register to group.
DataConsistencyGroup & operator=(DataConsistencyGroup &&other) noexcept
MatchingMode
Enum describing the matching mode of a DataConsistencyGroup.
@ none
No matching, effectively disable the DataConsitencyGroup. update() will always return true.
@ exact
Require an exact match of the VersionNumber of all current values of the group's members.
const std::map< TransferElementID, TransferElementAbstractor > & getElements() const
For inspection of contents.
DataConsistencyGroup(MatchingMode mode=MatchingMode::exact)
Construct empty group.
bool isConsistent() const
returns true if consistent state is reached
bool update(const TransferElementID &transferElementID)
This function must be called after an update was received from the ReadAnyGroup.
Base class for register accessors abstractors independent of the UserType.
bool isReadable() const
Check if transfer element is readable.
AccessModeFlags getAccessModeFlags() const
Return the AccessModeFlags for this TransferElement.
TransferElementID getId() const
Obtain unique ID for the actual implementation of this TransferElement.
const std::string & getName() const
Returns the name that identifies the process variable.
Simple class holding a unique ID for a TransferElement.
Exception thrown when a logic error has occured.
@ wait_for_new_data
Make any read blocking until new data has arrived since the last read.