|
| AlgoSequence (const std::string &name) |
| Constructor. More...
|
|
bool | AddAlgorithm (std::unique_ptr< Algorithm > &&algo) |
| Adds a new algorithm to the sequence. More...
|
|
observer_ptr< Algorithm > | GetAlgorithm (const std::string name) |
| Get an algorithm. More...
|
|
const Algorithms & | GetAlgorithms () const |
| Get the algorithms. More...
|
|
Algorithms & | GetAlgorithms () |
| Get the algorithms. More...
|
|
bool | Initialize () |
| Initializes all algorithms. More...
|
|
bool | Process () |
| Processes all the algorithms. More...
|
|
bool | Finalize () |
| Finalizes all algorithms and branches. More...
|
|
IterateRequest | Iterate () |
| Forward the iteration request to the contained algorithms. More...
|
|
iterator | begin () |
|
iterator | end () |
|
const_iterator | begin () const |
|
const_iterator | end () const |
|
size_t | size () |
|
bool | SetDataStoreManager (observer_ptr< DataStoreManager > dsManager) |
| Set the data store manager for the sequence and all the contained algorithms. More...
|
|
bool | SetEventLoopProxy (observer_ptr< EventLoopProxy > loopProxy) |
| Set the event loop proxy for the sequence and all the contained algorithms. More...
|
|
| Algorithm (const std::string &name) |
|
observer_ptr< EventLoopProxy > | GetEventLoopProxy () |
| Accessor for the event loop proxy. More...
|
|
| Filter () |
| Constructor. More...
|
|
FilterResult | GetFilterResult () |
| Get the result for the filter. More...
|
|
FilterLogic | GetFilterLogic () |
| Get the current filter logic. More...
|
|
void | SetFilterStatus (FilterStatus status) |
| Toggles on and off filtering. More...
|
|
FilterStatus | GetFilterStatus () |
| The filter status. More...
|
|
void | SetFilterLogic (FilterLogic filterLogic) |
| Sets the filter return value logic. More...
|
|
| Info (const std::string &name) |
| Constructor. More...
|
|
virtual | ~Info () |
| Destructor. More...
|
|
virtual const std::string | GetType () const |
|
virtual const std::string | GetName () const |
| The type (i.e. class) of the object. More...
|
|
virtual const std::string | GetVersion () const |
| The name of the object. More...
|
|
| Configurable () |
| Constructor. More...
|
|
template<typename T > |
bool | SetParameter (const std::string &name, const T &value) |
| Set the value of a parameter. More...
|
|
bool | SetParameter (const std::string &name, const char *value) |
| Set the value of a string parameter using a string literal. More...
|
|
std::vector< std::string > | GetParameters () |
| Get the names of the parameters. More...
|
|
| DataStoreUser () |
|
virtual | ~DataStoreUser () |
| Destructor. More...
|
|
observer_ptr< DataStoreManager > | GetDataStoreManager () |
| Getter for the Data store manager. More...
|
|
| ObjectProducer () |
| Constructor. More...
|
|
virtual | ~ObjectProducer () |
| Destructor. More...
|
|
template<typename C > |
void | DeclareProducedObject (std::string name, ObjectCategory category, C aliases, std::string store) |
| Declare a produced objects. More...
|
|
const ProducedObjects & | GetProducedObjects () const |
| Getter method for produced objects. More...
|
|
bool | SetDisabled (bool disabled=true) |
| Disables/enables the producer. More...
|
|
virtual std::vector< std::string > | FreeObjects (const std::vector< std::string > &objs, Memory::Status memStatus) |
| Free the memory for given objects. More...
|
|
template<> |
void | DeclareProducedObject (std::string name, ObjectCategory category, const char *alias, std::string store) |
|
| ObjectConsumer () |
| Constructor. More...
|
|
void | DeclareConsumedObject (std::string name, ObjectCategory category, std::string store, bool optional=false) |
| Declare a consumed objects. More...
|
|
void | DeclareAlternative (const std::string &name, ObjectCategory category, std::string store, const std::string &alternativeName, ObjectCategory alternativeCategory, std::string alternativeStore) |
| Declares two already declared objects as alternatives. More...
|
|
const ConsumedObjects & | GetConsumedObjects () const |
| Getter method for consumed objects. More...
|
|
|
virtual bool | ProcessAlgo (size_t iAlgo) |
| Process the given algorithm. More...
|
|
| AlgoSequence (const std::shared_ptr< Filter::Representation > &filterRepr, const std::shared_ptr< Info::Representation > &infoRepr, const std::shared_ptr< Configurable::Representation > &confRepr, const std::shared_ptr< DataStoreUser::Representation > &dsuRepr, const std::shared_ptr< ObjectProducer::Representation > &opRepr, const std::shared_ptr< ObjectConsumer::Representation > &ocRepr, const std::shared_ptr< Algorithm::Representation > &algoRepr) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
| Algorithm (const std::shared_ptr< Filter::Representation > &filterRepr, const std::shared_ptr< Info::Representation > &infoRepr, const std::shared_ptr< Configurable::Representation > &confRepr, const std::shared_ptr< DataStoreUser::Representation > &dsuRepr, const std::shared_ptr< ObjectProducer::Representation > &opRepr, const std::shared_ptr< ObjectConsumer::Representation > &ocRepr, const std::shared_ptr< Algorithm::Representation > &algoRepr) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
void | SetFilterResult (FilterResult result) |
| Sets the result. More...
|
|
| Filter (const std::shared_ptr< Representation > &impl) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
| Info (const std::shared_ptr< Representation > &impl) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
template<typename T > |
bool | DefineParameter (const std::string &name, T &variable) |
| Set a parameter. More...
|
|
| Configurable (const std::shared_ptr< Representation > &impl) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
| DataStoreUser (const std::shared_ptr< Representation > &impl) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
| ObjectProducer (const std::shared_ptr< Representation > &impl) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
| ObjectConsumer (const std::shared_ptr< Representation > &impl) |
|
std::shared_ptr< Representation > & | GetRepresentation () |
|
Algorithm made by multiple basic algorithms.
An AlgoSequence is an algorithm made of a sequence of algorithms. The class has methods to add algorithms to the sequence and to apply them sequentially to each event.
AlgoSequence::Process is implemented following the template method pattern. Customization can be added by overriding the ProcessAlgo protected virtual method, to customize the processing of an algorithm.
Support for augmenting behavior with the decorator pattern is provided by the AlgoSequenceDecorator class that serves as the base class for decorators.
Technical note: see
https://www.codeproject.com/Articles/42163/Please-Don-t-Fail-Me-Decorator-Cries-Out-to-Templ
for details about how to tie together the template method pattern and the decorator pattern.
Forward the iteration request to the contained algorithms.
This implementation asks for another iteration to all the contained algorithms. If at least one algorithm requires for another iteration by returning #IterateRequest::YES, and all the others return the same value or #IterateRequest::WHATEVER, then this method returns #IterateRequest::YES. If at least one algorithm forbids another iteration by returning #IterateRequest::NO, and all the others return the same value or #IterateRequest::WHATEVER, then this method returns #IterateRequest::NO. In case two algorithms have conflicting iteration requests (e.g. one returns #IterateRequest::YES and another #IterateRequest::NO) then the IterateRequest::ERROR value is returned.
- Returns
Reimplemented from EA::Algorithm.
bool EA::AlgoSequence::Process |
( |
| ) |
|
|
virtual |
Processes all the algorithms.
The processing logic is the following. For each event, the algorithms are applied in the same order as they have been added to the sequence. When the filtering result of an algorithm (ie., the return of its GetFilterResult() method) is false, the processing stops. Note that this depends on the filter logic of the algorithm and on its filter status. If at least one algorithm returns a false filter result, then the filter flag of the sequence will be set to false (the actual value returned by AlgoSequence::GetFilterResult() is however dependent on filter logic set for the sequence object and its filter status, as it happens for VAlgorithm objects).
- Returns
- true if all processed algorithms return without errors, false otherwise.
Reimplemented from EA::Algorithm.