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

Manager class for data stores. More...

#include <DataStoreManager.h>

Public Types

using GlobalStores = std::list< GlobalDataStore >
 Type of container for global stores. More...
 
using PassStores = std::list< PassDataStore >
 Type of container for pass stores. More...
 
using EventStores = std::list< EventDataStore >
 Type of container for event stores. More...
 

Public Member Functions

bool CreateGlobalDataStore (const std::string &name)
 Creates a global data store. More...
 
bool CreatePassDataStore (const std::string &name)
 Creates a pass data store. More...
 
bool CreateEventDataStore (const std::string &name)
 Creates an event data store. More...
 
GlobalStorePtr GetGlobalDataStore (const std::string &name)
 Retrieves a global data store. More...
 
PassStorePtr GetPassDataStore (const std::string &name)
 Retrieves a pass data store. More...
 
EventStorePtr GetEventDataStore (const std::string &name)
 Retrieves an event data store. More...
 
GlobalStoresGetGlobalDataStores ()
 Retrieves all the global stores. More...
 
PassStoresGetPassDataStores ()
 Retrieves all the pass stores. More...
 
EventStoresGetEventDataStores ()
 Retrieves all the event stores. More...
 
bool CleanPassDataStores ()
 Clean all the pass data stores. More...
 
bool CleanEventDataStores ()
 Clean all the event data stores. More...
 
bool CleanGlobalAliases ()
 Removes the aliases on all the global stores. More...
 
void TrackRemovedObjects (bool track=true)
 Enables the tracking of removed objects. More...
 
bool FreeRemoved (Memory::Status memStatus)
 Release the memory allocated for removed objects in all the event data stores. More...
 
bool SetAlgoProducedObjects (const AlgoSequence &seq)
 Sets the objects produced by the algorithms for all the data stores. More...
 

Private Attributes

GlobalStores _globalStores
 
PassStores _passStores
 
EventStores _eventStores
 

Detailed Description

Manager class for data stores.

This class is both a factory and a locator for data stores.

Member Typedef Documentation

◆ EventStores

Type of container for event stores.

◆ GlobalStores

Type of container for global stores.

◆ PassStores

Type of container for pass stores.

Member Function Documentation

◆ CleanEventDataStores()

bool EA::DataStoreManager::CleanEventDataStores ( )

Clean all the event data stores.

Returns
true if cleaning is successful.

◆ CleanGlobalAliases()

bool EA::DataStoreManager::CleanGlobalAliases ( )

Removes the aliases on all the global stores.

Returns
true if cleaning is successful.

◆ CleanPassDataStores()

bool EA::DataStoreManager::CleanPassDataStores ( )

Clean all the pass data stores.

Returns
true if cleaning is successful.

◆ CreateEventDataStore()

bool EA::DataStoreManager::CreateEventDataStore ( const std::string &  name)

Creates an event data store.

If an event data store with the same name already exists then nothing happens. The data store is cleaned at the end of each event processing.

Parameters
nameThe name of the desired data store.
Returns
true if the data store already exists or is correctly created, false if the creation fails.

◆ CreateGlobalDataStore()

bool EA::DataStoreManager::CreateGlobalDataStore ( const std::string &  name)

Creates a global data store.

If a global data store with the same name already exists then nothing happens. The data store is never cleaned during the whole program execution.

Parameters
nameThe name of the desired data store.
Returns
true if the data store already exists or is correctly created, false if the creation fails.

◆ CreatePassDataStore()

bool EA::DataStoreManager::CreatePassDataStore ( const std::string &  name)

Creates a pass data store.

If a pass data store with the same name already exists then nothing happens. The data store is cleaned at the end of each processing pass.

Parameters
nameThe name of the desired data store.
Returns
true if the data store already exists or is correctly created, false if the creation fails.

◆ FreeRemoved()

bool EA::DataStoreManager::FreeRemoved ( Memory::Status  memStatus)

Release the memory allocated for removed objects in all the event data stores.

This method asks all the event data stores to free the memory allocated for removed objects. The memStatus code is passed to the producers, which are free to decide whether to actually free the memory or not and to which degree, based on the memory status code. However, with a value of Memory::Status::EXHAUSTED all the producers are required to free all the removed objects they handle.

Parameters
memStatusThe memory status code.
Returns
true if no error occurs

◆ GetEventDataStore()

EventStorePtr EA::DataStoreManager::GetEventDataStore ( const std::string &  name)

Retrieves an event data store.

If the data store does not exists then a #Retrieval::NotFound exception is thrown. The data store is cleaned at the end of each event processing.

Parameters
nameThe name of the desired data store.
Returns
a pointer to the required pass data store.
Exceptions
Retrieval::NotFoundif the requested data store does not exist.

◆ GetEventDataStores()

EventStores& EA::DataStoreManager::GetEventDataStores ( )
inline

Retrieves all the event stores.

Returns
The collection of event stores.

◆ GetGlobalDataStore()

GlobalStorePtr EA::DataStoreManager::GetGlobalDataStore ( const std::string &  name)

Retrieves a global data store.

If the data store does not exists then a #Retrieval::NotFound exception is thrown. The data store is never cleaned during the whole program execution.

Parameters
nameThe name of the desired data store.
Returns
a pointer to the required global data store.
Exceptions
Retrieval::NotFoundif the requested data store does not exist.

◆ GetGlobalDataStores()

GlobalStores& EA::DataStoreManager::GetGlobalDataStores ( )
inline

Retrieves all the global stores.

Returns
The collection of global stores.

◆ GetPassDataStore()

PassStorePtr EA::DataStoreManager::GetPassDataStore ( const std::string &  name)

Retrieves a pass data store.

If the data store does not exists then a #Retrieval::NotFound exception is thrown. The data store is cleaned at the end of each processing pass.

Parameters
nameThe name of the desired data store.
Returns
a pointer to the required pass data store.
Exceptions
Retrieval::NotFoundif the requested data store does not exist.

◆ GetPassDataStores()

PassStores& EA::DataStoreManager::GetPassDataStores ( )
inline

Retrieves all the pass stores.

Returns
The collection of pass stores.

◆ SetAlgoProducedObjects()

bool EA::DataStoreManager::SetAlgoProducedObjects ( const AlgoSequence seq)

Sets the objects produced by the algorithms for all the data stores.

Parameters
seqThe sequence of algorithms.
Returns
true if the produced objects have been correctly set for all the data stores.
See also
DataStore::SetAlgoProducedObjects

◆ TrackRemovedObjects()

void EA::DataStoreManager::TrackRemovedObjects ( bool  track = true)

Enables the tracking of removed objects.

This method asks all the event data stores to track the removed objects by calling the #DataStore::TrackRemovedObjects method.

Parameters
trackIf true then the tracking of the removed objects will be enabled, otherwise it will be disabled.

Member Data Documentation

◆ _eventStores

EventStores EA::DataStoreManager::_eventStores
private

◆ _globalStores

GlobalStores EA::DataStoreManager::_globalStores
private

◆ _passStores

PassStores EA::DataStoreManager::_passStores
private

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