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

Manager class for data providers. More...

#include <DataProviderManager.h>

Public Member Functions

bool AddProvider (std::unique_ptr< DataProvider > provider)
 Add a data provider to the manager. More...
 
ProviderPtr GetProvider (const std::string &name)
 Get a given provider. More...
 
std::vector< ProviderPtrGetProviders () const
 Get a list of providers. More...
 
bool ConnectSource ()
 Dispatches the call to ConnectSource to all the data providers. More...
 
bool DisconnectSource ()
 Dispatches the call to DisconnectSource to all the data providers. More...
 
bool SetEvent (unsigned int event, std::vector< std::pair< ProviderPtr, std::vector< std::string >>> &notValidGlobalObjects)
 Set the current event for all the registered providers. More...
 
bool IsEventAvailable (unsigned int event)
 Checks if the registered data provider can provide the given event. More...
 
bool SetPass (unsigned int pass, unsigned int iter)
 Set the current pass and iteration for all the registered providers. More...
 
bool SetDisabledProviders (const std::vector< std::string > &providerNames)
 Set the disabled providers. More...
 

Private Types

typedef std::list< std::unique_ptr< DataProvider > > ProvidersBook
 

Private Attributes

ProvidersBook _providers
 

Detailed Description

Manager class for data providers.

This class is a management interface for data providers. It owns the registered providers and can be used to fetch a provider and to set the current event and pass number to all the registered providers.

Member Typedef Documentation

◆ ProvidersBook

typedef std::list<std::unique_ptr<DataProvider> > EA::DataProviderManager::ProvidersBook
private

Member Function Documentation

◆ AddProvider()

bool EA::DataProviderManager::AddProvider ( std::unique_ptr< DataProvider provider)

Add a data provider to the manager.

The given provider is added to the list of providers managed by the DataProviderManager no provider with the same name has already been added.

Parameters
providerThe provider to be added.
Returns
true if the given provider has been added, false otherwise.

◆ ConnectSource()

bool EA::DataProviderManager::ConnectSource ( )

Dispatches the call to ConnectSource to all the data providers.

Returns
bool if all the data providers have been successfully connected.

◆ DisconnectSource()

bool EA::DataProviderManager::DisconnectSource ( )

Dispatches the call to DisconnectSource to all the data providers.

Returns
bool if all the data providers have been successfully disconnected.

◆ GetProvider()

ProviderPtr EA::DataProviderManager::GetProvider ( const std::string &  name)

Get a given provider.

Parameters
nameThe name of the requested provider.
Returns
pointer to the requested provider (if it has been registered with AddProvider).

◆ GetProviders()

std::vector< ProviderPtr > EA::DataProviderManager::GetProviders ( ) const

Get a list of providers.

Returns
The providers.

◆ IsEventAvailable()

bool EA::DataProviderManager::IsEventAvailable ( unsigned int  event)

Checks if the registered data provider can provide the given event.

Parameters
eventThe number of the event.
Returns
true if the given event can be provided, false otherwise.

◆ SetDisabledProviders()

bool EA::DataProviderManager::SetDisabledProviders ( const std::vector< std::string > &  providerNames)

Set the disabled providers.

All the providers not included in the list of providers to be disabled will be enabled.

Parameters
providerNamesThe list of providers to be disabled (others will be enabled).
Returns
true If all the listed providers have been successfully disabled and others enabled.

◆ SetEvent()

bool EA::DataProviderManager::SetEvent ( unsigned int  event,
std::vector< std::pair< ProviderPtr, std::vector< std::string >>> &  notValidGlobalObjects 
)

Set the current event for all the registered providers.

Parameters
eventThe event number to be set
notValidGlobalObjectsA list of pair, each pair contains a data provider ptr and a list of global objects which are not valid, the latter will be removed from data stores.
Returns
true if the event number has been set for all the providers.

◆ SetPass()

bool EA::DataProviderManager::SetPass ( unsigned int  pass,
unsigned int  iter 
)

Set the current pass and iteration for all the registered providers.

Parameters
passThe pass number to be set
iterThe iteration number for current pass to be set
Returns
true if the pass number has been set for all the providers.

Member Data Documentation

◆ _providers

ProvidersBook EA::DataProviderManager::_providers
private

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