EventAnalysis  1.3.0
Public Member Functions | Private Attributes | List of all members
EA::SequenceDataChecker Class Reference

Class for ensuring data consistency in a given sequence. More...

#include <SequenceDataChecker.h>

Public Member Functions

 SequenceDataChecker (AlgoSequence &sequence)
 Constructor. More...
 
std::vector< DataObjectHandlerGetAvailableAfterEnd ()
 Gets a list of data objects that will be available after the sequence event processing is complete. More...
 
bool Check ()
 Checks for object availability. More...
 
bool SetPersistenceServiceManager (PersistenceServiceManager &psManager)
 Set the persistence manager. More...
 

Private Attributes

observer_ptr< AlgoSequence_algoSequence
 
observer_ptr< PersistenceServiceManager_psManager
 
std::vector< DataObjectHandler_available
 

Detailed Description

Class for ensuring data consistency in a given sequence.

This class checks for all the objects needed by the algorithms in a sequence to be actually available, i.e. provided by a data provider or by other algorithms. Nested sequences are automatically managed. A set of objects that are already available at the begin of the sequence (for whatever reason) can be defined with the #SetAvailableOnBegin method. If the data store manager is set with the #SetDataStoreManager method then all the objects provided by the data providers attached to a store will be automatically added to the objects that are available at the begin of the sequence. The Check method ensures that all the algorithms in the sequence or sub-sequences will have all the needed objects available. If the persistence service manager has been set with SetPersistenceServiceManager then Check will perform the availability check also for objects booked for persistence.

Constructor & Destructor Documentation

◆ SequenceDataChecker()

EA::SequenceDataChecker::SequenceDataChecker ( AlgoSequence sequence)

Constructor.

Builds the data manager for a given sequence of algorithms.

Parameters
sequenceThe algorithm sequence.

Member Function Documentation

◆ Check()

bool EA::SequenceDataChecker::Check ( )

Checks for object availability.

This method checks if all the objects required by algorithms in the sequence (and eventually by the persistence services if the related manager has been set with SetPersistenceServiceManager) are actually available at process time, either provided by some preceding algorithm or by a data provider (if the data store manager has been set with #SetDataStoreManager). If optional objects are missing then a warning message will be printed but no error will be raised. If an object is missing but has available alternative objects then warning message will be printed but no error will be raised.

Returns
true if some needed, non-optional data objects are missing for at least an algorithm or a persistence.

◆ GetAvailableAfterEnd()

std::vector< DataObjectHandler > EA::SequenceDataChecker::GetAvailableAfterEnd ( )

Gets a list of data objects that will be available after the sequence event processing is complete.

The returned list contains all the objects provided by the data providers. If Check has already been called when this method is called then also objects produced by algorithms will be in the returned list.

Returns
A list of objects that will be available at the end of the sequence.

◆ SetPersistenceServiceManager()

bool EA::SequenceDataChecker::SetPersistenceServiceManager ( PersistenceServiceManager psManager)

Set the persistence manager.

If this method is called then a subsequent call to Check will ensure that all the objects booked for persistence are available at the end of the processing pipeline. Template persistences will be ignored since the availability check for their needed objects will be done through the #PersistenceAlgo objects containing them.

Parameters
psManagerThe data store manager
Returns
true if the persistence service manager has been correctly set.

Member Data Documentation

◆ _algoSequence

observer_ptr<AlgoSequence> EA::SequenceDataChecker::_algoSequence
private

◆ _available

std::vector<DataObjectHandler> EA::SequenceDataChecker::_available
private

◆ _psManager

observer_ptr<PersistenceServiceManager> EA::SequenceDataChecker::_psManager
private

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