|
| PersistenceAlgo (const std::string &name) |
|
bool | SetPersistenceServiceManager (PersistenceServiceManager &persManager) |
| Method to set the persistence manager. More...
|
|
bool | Initialize () |
| Connects and initializes the persistence service. More...
|
|
bool | Process () |
| Triggers the persistence for the current event. More...
|
|
bool | Finalize () |
| Finalizes the persistence. More...
|
|
| Algorithm (const std::string &name) |
|
virtual bool | SetEventLoopProxy (observer_ptr< EventLoopProxy > loopProxy) |
| Injector for dependency on EventLoopProxy. More...
|
|
virtual IterateRequest | Iterate () |
| Request for another iteration of the event loop. More...
|
|
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...
|
|
virtual bool | SetDataStoreManager (observer_ptr< DataStoreManager > dsManager) |
| Injector for dependency on DataStoreManager. 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...
|
|
|
enum | IterateRequest { IterateRequest::YES,
IterateRequest::NO,
IterateRequest::WHATEVER,
IterateRequest::ERROR
} |
|
using | ProducedObjects = std::vector< ProducedObject > |
| Type for container of produced objects. More...
|
|
using | ConsumedObjects = std::vector< ConsumedObject > |
| Type for container of produced objects. More...
|
|
| 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 () |
|
An algorithm that saves data objects.
This algorithm allows to execute the tasks of a #PersistenceService during the execution of the algorithm sequence, rather than at the end as it is usually done by persistence services. It allows for saving event objects as they are at the moment when the algorithm is executed. The main usage of this class is for saving only those events surviving some given selection criteria: it is sufficient to insert in the sequence the cut algorithms followed by the persistence algorithm; for example:
EventLoop
Sequence seq
Algo CutAlgo1 cut1
Algo CutAlgo2 cut2
EndSequence
Only the data objects of the events surviving cut1 and cut2 will be saved in the output tree.
The PersistenceAlgo is configured by creating and configuring a #PersistenceService, and then assigning it to the algorithm. The same persistence service can be assigned to different instances of PersistenceAlgo, for easily performing the same type of persistence operation at different points in the algorithm sequence. Each PersistenceAlgo must be configured with a different output name, to avoid clashes. For example, suppose to have a persistence service that writes output data on a file:
Persistence MyPersistence myPersistence outputFile
Book globObj global globStore
Book evObj event evStore
EventLoop
Sequence seq1
Algo CutAlgo1 cut1
Algo CutAlgo2 cut2
Set persistence myPersistence
Set output file1
Algo CutAlgo3 cut3
Set persistence myPersistence
Set output file2
EndSequence
The output file file1
will contain the object evObj
for each event surviving the cuts cut1 and cut2, while in file2
there will be the same objects for events also surviving cut3. In both files the global object globObj
will be present. Please note that global objects are always written at the end of the event loop, so globObj
will be the same in file1
and file2
. This also means that if there is another loop then the eventual modifications it makes to the global objects will not be reflected in the persistent objects; in other words, the global objects are saved as they are at the end of the event loop to which the PersistenceAlgo belongs.