EventAnalysis  1.3.0
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
EA::Algorithm Class Reference

Algorithm interface. More...

#include <Algorithm.h>

Inheritance diagram for EA::Algorithm:
EA::Filter EA::Info EA::Configurable EA::DataStoreUser EA::ObjectProducer EA::ObjectConsumer EA::AlgoSequence EA::PersistenceAlgo EA::AlgoSequenceDecorator EA::GarbageCollectorDecorator

Classes

class  Representation
 

Public Types

enum  IterateRequest { IterateRequest::YES, IterateRequest::NO, IterateRequest::WHATEVER, IterateRequest::ERROR }
 
- Public Types inherited from EA::ObjectProducer
using ProducedObjects = std::vector< ProducedObject >
 Type for container of produced objects. More...
 
- Public Types inherited from EA::ObjectConsumer
using ConsumedObjects = std::vector< ConsumedObject >
 Type for container of produced objects. More...
 

Public Member Functions

 Algorithm (const std::string &name)
 
virtual bool SetEventLoopProxy (observer_ptr< EventLoopProxy > loopProxy)
 Injector for dependency on EventLoopProxy. More...
 
virtual bool Initialize ()
 Initialization method. More...
 
virtual bool Process ()
 Processing method. More...
 
virtual bool Finalize ()
 Finalization method. More...
 
virtual IterateRequest Iterate ()
 Request for another iteration of the event loop. More...
 
observer_ptr< EventLoopProxyGetEventLoopProxy ()
 Accessor for the event loop proxy. More...
 
- Public Member Functions inherited from EA::Filter
 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...
 
- Public Member Functions inherited from EA::Info
 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...
 
- Public Member Functions inherited from EA::Configurable
 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...
 
- Public Member Functions inherited from EA::DataStoreUser
 DataStoreUser ()
 
virtual ~DataStoreUser ()
 Destructor. More...
 
virtual bool SetDataStoreManager (observer_ptr< DataStoreManager > dsManager)
 Injector for dependency on DataStoreManager. More...
 
observer_ptr< DataStoreManagerGetDataStoreManager ()
 Getter for the Data store manager. More...
 
- Public Member Functions inherited from EA::ObjectProducer
 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 ProducedObjectsGetProducedObjects () 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)
 
- Public Member Functions inherited from EA::ObjectConsumer
 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 ConsumedObjectsGetConsumedObjects () const
 Getter method for consumed objects. More...
 

Protected Member Functions

 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 ()
 
- Protected Member Functions inherited from EA::Filter
void SetFilterResult (FilterResult result)
 Sets the result. More...
 
 Filter (const std::shared_ptr< Representation > &impl)
 
std::shared_ptr< Representation > & GetRepresentation ()
 
- Protected Member Functions inherited from EA::Info
 Info (const std::shared_ptr< Representation > &impl)
 
std::shared_ptr< Representation > & GetRepresentation ()
 
- Protected Member Functions inherited from EA::Configurable
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 ()
 
- Protected Member Functions inherited from EA::DataStoreUser
 DataStoreUser (const std::shared_ptr< Representation > &impl)
 
std::shared_ptr< Representation > & GetRepresentation ()
 
- Protected Member Functions inherited from EA::ObjectProducer
 ObjectProducer (const std::shared_ptr< Representation > &impl)
 
std::shared_ptr< Representation > & GetRepresentation ()
 
- Protected Member Functions inherited from EA::ObjectConsumer
 ObjectConsumer (const std::shared_ptr< Representation > &impl)
 
std::shared_ptr< Representation > & GetRepresentation ()
 

Private Attributes

std::shared_ptr< Representation_repr
 

Detailed Description

Algorithm interface.

An Algorithm is a class that process event data. It has method for initialization, processing and finalization.

Member Enumeration Documentation

◆ IterateRequest

Enumerator
YES 
NO 
WHATEVER 
ERROR 

Constructor & Destructor Documentation

◆ Algorithm() [1/2]

EA::Algorithm::Algorithm ( const std::string &  name)

Constructor.

◆ Algorithm() [2/2]

EA::Algorithm::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 
)
inlineprotected

Member Function Documentation

◆ Finalize()

bool EA::Algorithm::Finalize ( )
virtual

Finalization method.

Operations to be performed after the actual processing finishes.

Returns
true if finalization has succeeded.

Reimplemented in EA::AlgoSequence, EA::PersistenceAlgo, and EA::AlgoSequenceDecorator.

◆ GetEventLoopProxy()

observer_ptr<EventLoopProxy> EA::Algorithm::GetEventLoopProxy ( )
inline

Accessor for the event loop proxy.

Returns
Pointer to the event loop proxy.

◆ GetRepresentation()

std::shared_ptr<Representation>& EA::Algorithm::GetRepresentation ( )
inlineprotected

◆ Initialize()

bool EA::Algorithm::Initialize ( )
virtual

Initialization method.

Operations to be performed before the actual processing starts. After calling this method the objects produced and consumed by the algorithm are assumed to be declared.

Returns
true if initialization has succeeded.

Reimplemented in EA::AlgoSequence, EA::PersistenceAlgo, EA::AlgoSequenceDecorator, and EA::GarbageCollectorDecorator.

◆ Iterate()

Algorithm::IterateRequest EA::Algorithm::Iterate ( )
virtual

Request for another iteration of the event loop.

Algorithms requiring another iteration of the event loop (e.g. algorithms based on a convergent procedure, needing to loop over all the events for an a priori undefined number of times) should return #IterateRequest::YES. To inhibit another iteration of the loop, #IterateRequest::NO. In case the algorithm has no preference over the two cases, #IterateRequest::WHATEVER.

Note that #IterateRequest::WHATEVER leaves the decision about an eventual subsequent iteration to other algorithms inside the same loop, while #IterateRequest::YES and #IterateRequest::NO force one of the two behaviors. An eventual request conflict between two algorithms in the same loop is handled by the #EventLoop itself (see the class' documentation for details about how the conflict is handled).

The default implementation of this method returns #IterateRequest::WHATEVER, so it should be reimplemented only if a specific behavior is needed.

Returns
an IterateRequest code for triggering or inhibiting another loop iteration.

Reimplemented in EA::AlgoSequence.

◆ Process()

bool EA::Algorithm::Process ( )
virtual

Processing method.

Event data processing.

Returns
true if event data processing has succeeded.

Reimplemented in EA::AlgoSequence, and EA::PersistenceAlgo.

◆ SetEventLoopProxy()

bool EA::Algorithm::SetEventLoopProxy ( observer_ptr< EventLoopProxy loopProxy)
virtual

Injector for dependency on EventLoopProxy.

Parameters
loopProxyThe proxy for the event loop managing this algorithm.
Returns
true if the event loop proxy has been correctly set.

Reimplemented in EA::AlgoSequence.

Member Data Documentation

◆ _repr

std::shared_ptr<Representation> EA::Algorithm::_repr
private

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