ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::DataConsistencyGroup Class Reference

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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ MatchingMode

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.

Constructor & Destructor Documentation

◆ DataConsistencyGroup() [1/4]

ChimeraTK::DataConsistencyGroup::DataConsistencyGroup ( )
default

Construct empty group.

Elements can later be added using the add() function.

◆ DataConsistencyGroup() [2/4]

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.

+ Here is the call graph for this function:

◆ DataConsistencyGroup() [3/4]

ChimeraTK::DataConsistencyGroup::DataConsistencyGroup ( std::initializer_list< boost::shared_ptr< TransferElement >>  list)

Definition at line 20 of file DataConsistencyGroup.cc.

+ Here is the call graph for this function:

◆ DataConsistencyGroup() [4/4]

template<typename ITERATOR >
ChimeraTK::DataConsistencyGroup::DataConsistencyGroup ( ITERATOR  first,
ITERATOR  last 
)

Definition at line 77 of file DataConsistencyGroup.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ add() [1/2]

void ChimeraTK::DataConsistencyGroup::add ( boost::shared_ptr< TransferElement element)

Definition at line 40 of file DataConsistencyGroup.cc.

+ Here is the call graph for this function:

◆ add() [2/2]

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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getElements()

const std::map<TransferElementID, TransferElementAbstractor>& ChimeraTK::DataConsistencyGroup::getElements ( ) const
inline

For inspection of contents.

Definition at line 53 of file DataConsistencyGroup.h.

◆ getMatchingMode()

MatchingMode ChimeraTK::DataConsistencyGroup::getMatchingMode ( ) const
inline

Return the current matching mode.

Definition at line 50 of file DataConsistencyGroup.h.

◆ isConsistent()

bool ChimeraTK::DataConsistencyGroup::isConsistent ( ) const
inline

returns true if consistent state is reached

Definition at line 56 of file DataConsistencyGroup.h.

◆ setMatchingMode()

void ChimeraTK::DataConsistencyGroup::setMatchingMode ( MatchingMode  newMode)
inline

Change the matching mode.

The default mode is MatchingMode::exact.

Definition at line 47 of file DataConsistencyGroup.h.

◆ update()

bool ChimeraTK::DataConsistencyGroup::update ( const TransferElementID transferelementid)
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.


The documentation for this class was generated from the following files: