ChimeraTK-DeviceAccess  03.18.00
DataConsistencyGroup.cc
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 
4 #include "DataConsistencyGroup.h"
5 
6 namespace ChimeraTK {
7 
8  /********************************************************************************************************************/
9 
11 
12  /********************************************************************************************************************/
13 
14  DataConsistencyGroup::DataConsistencyGroup(std::initializer_list<TransferElementAbstractor> list) {
15  for(const auto& element : list) add(element);
16  }
17 
18  /********************************************************************************************************************/
19 
20  DataConsistencyGroup::DataConsistencyGroup(std::initializer_list<boost::shared_ptr<TransferElement>> list) {
21  for(const auto& element : list) add(element);
22  }
23 
24  /********************************************************************************************************************/
25 
27  if(!element.isReadable()) {
29  "Cannot add non-readable accessor for register " + element.getName() + " to DataConsistencyGroup.");
30  }
33  "Cannot add poll type accessor for register " + element.getName() + " to DataConsistencyGroup.");
34  }
35  push_elements[element.getId()] = element;
36  }
37 
38  /********************************************************************************************************************/
39 
40  void DataConsistencyGroup::add(boost::shared_ptr<TransferElement> element) {
41  add(TransferElementAbstractor(std::move(element)));
42  }
43 
44  /********************************************************************************************************************/
45 
46 } // namespace ChimeraTK
ChimeraTK::TransferElementAbstractor::getId
TransferElementID getId() const
Obtain unique ID for the actual implementation of this TransferElement.
Definition: TransferElementAbstractor.h:192
DataConsistencyGroup.h
ChimeraTK::TransferElementAbstractor::getAccessModeFlags
AccessModeFlags getAccessModeFlags() const
Return the AccessModeFlags for this TransferElement.
Definition: TransferElementAbstractor.h:51
ChimeraTK::DataConsistencyGroup::DataConsistencyGroup
DataConsistencyGroup()
Construct empty group.
ChimeraTK::AccessModeFlags::has
bool has(AccessMode flag) const
Check if a certain flag is in the set.
Definition: AccessMode.cc:20
ChimeraTK::TransferElementAbstractor
Base class for register accessors abstractors independent of the UserType.
Definition: TransferElementAbstractor.h:28
ChimeraTK::TransferElementAbstractor::isReadable
bool isReadable() const
Check if transfer element is readable.
Definition: TransferElementAbstractor.h:107
ChimeraTK::DataConsistencyGroup::add
void add(const TransferElementAbstractor &element)
Add register to group.
Definition: DataConsistencyGroup.cc:26
ChimeraTK::AccessMode::wait_for_new_data
@ wait_for_new_data
Make any read blocking until new data has arrived since the last read.
ChimeraTK::TransferElementAbstractor::getName
const std::string & getName() const
Returns the name that identifies the process variable.
Definition: TransferElementAbstractor.h:37
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::logic_error
Exception thrown when a logic error has occured.
Definition: Exception.h:51