ChimeraTK-DeviceAccess
03.18.00
|
Group several registers (= TransferElement) which ensures data consistency across multiple variables through an algorithm which matches the VersionNumber. More...
#include <DataConsistencyGroup.h>
Public Types | |
enum | MatchingMode { MatchingMode::none, MatchingMode::exact } |
Enum describing the matching mode of a DataConsistencyGroup. More... | |
Public Member Functions | |
DataConsistencyGroup () | |
Construct empty group. More... | |
DataConsistencyGroup (std::initializer_list< TransferElementAbstractor > list) | |
Construct this group with elements from the list using the add() function. More... | |
DataConsistencyGroup (std::initializer_list< boost::shared_ptr< TransferElement >> list) | |
template<typename ITERATOR > | |
DataConsistencyGroup (ITERATOR first, ITERATOR last) | |
void | add (const TransferElementAbstractor &element) |
Add register to group. More... | |
void | add (boost::shared_ptr< TransferElement > element) |
bool | update (const TransferElementID &transferelementid) |
This function updates consistentElements, a set of TransferElementID. More... | |
void | setMatchingMode (MatchingMode newMode) |
Change the matching mode. More... | |
MatchingMode | getMatchingMode () const |
Return the current matching mode. More... | |
const std::map< TransferElementID, TransferElementAbstractor > & | getElements () const |
For inspection of contents. More... | |
bool | isConsistent () const |
returns true if consistent state is reached More... | |
Group several registers (= TransferElement) which ensures data consistency across multiple variables through an algorithm which matches the VersionNumber.
This group does not read on its own. It should work together with a ReadAnyGroup. You should wait for changed variable and transfer it to this group by calling ChimeraTK::DataConsistencyGroup::update. If a consistent state is reached, this function returns true.
Definition at line 19 of file DataConsistencyGroup.h.
|
strong |
Enum describing the matching mode of a DataConsistencyGroup.
Enumerator | |
---|---|
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. |
Definition at line 41 of file DataConsistencyGroup.h.
|
default |
Construct empty group.
Elements can later be added using the add() function.
ChimeraTK::DataConsistencyGroup::DataConsistencyGroup | ( | std::initializer_list< TransferElementAbstractor > | list | ) |
Construct this group with elements from the list using the add() function.
Definition at line 14 of file DataConsistencyGroup.cc.
ChimeraTK::DataConsistencyGroup::DataConsistencyGroup | ( | std::initializer_list< boost::shared_ptr< TransferElement >> | list | ) |
ChimeraTK::DataConsistencyGroup::DataConsistencyGroup | ( | ITERATOR | first, |
ITERATOR | last | ||
) |
void ChimeraTK::DataConsistencyGroup::add | ( | boost::shared_ptr< TransferElement > | element | ) |
void ChimeraTK::DataConsistencyGroup::add | ( | const TransferElementAbstractor & | element | ) |
Add register to group.
The same TransferElement can be part of multiple DataConsistencyGroups. The register must be must be readable, and it must have AccessMode::wait_for_new_data.
Definition at line 26 of file DataConsistencyGroup.cc.
|
inline |
For inspection of contents.
Definition at line 53 of file DataConsistencyGroup.h.
|
inline |
Return the current matching mode.
Definition at line 50 of file DataConsistencyGroup.h.
|
inline |
returns true if consistent state is reached
Definition at line 56 of file DataConsistencyGroup.h.
|
inline |
Change the matching mode.
The default mode is MatchingMode::exact.
Definition at line 47 of file DataConsistencyGroup.h.
|
inline |
This function updates consistentElements, a set of TransferElementID.
It returns true, if a consistent state is reached. It returns false if an TransferElementID was updated, that was not added to this Group.
Definition at line 83 of file DataConsistencyGroup.h.