EventAnalysis  1.3.0
DataProviderManager.h
Go to the documentation of this file.
1 /*
2  * DataProviderManager.h
3  *
4  * Created on: 31 May 2017
5  * Author: Nicola Mori
6  */
7 
10 #ifndef DATAPROVIDERMANAGER_H_
11 #define DATAPROVIDERMANAGER_H_
12 
13 #include "core/ObserverPtr.h"
14 #include "data/DataProvider.h"
15 
16 #include <list>
17 
18 namespace EA {
19 
21 
30 
31 public:
40  bool AddProvider(std::unique_ptr<DataProvider> provider);
41 
47  ProviderPtr GetProvider(const std::string &name);
48 
53  std::vector<ProviderPtr> GetProviders() const;
54 
59  bool ConnectSource();
60 
65  bool DisconnectSource();
66 
74  bool SetEvent(unsigned int event,
75  std::vector<std::pair<ProviderPtr, std::vector<std::string>>> &notValidGlobalObjects);
76 
82  bool IsEventAvailable(unsigned int event);
83 
90  bool SetPass(unsigned int pass, unsigned int iter);
91 
99  bool SetDisabledProviders(const std::vector<std::string> &providerNames);
100 
101 private:
102  typedef std::list<std::unique_ptr<DataProvider>> ProvidersBook;
103  ProvidersBook _providers;
104 };
105 
106 } // namespace EA
107 
108 #endif /* DATAPROVIDERMANAGER_H_ */
bool DisconnectSource()
Dispatches the call to DisconnectSource to all the data providers.
Definition: DataProviderManager.cpp:54
ProvidersBook _providers
Definition: DataProviderManager.h:103
bool ConnectSource()
Dispatches the call to ConnectSource to all the data providers.
Definition: DataProviderManager.cpp:41
bool SetPass(unsigned int pass, unsigned int iter)
Set the current pass and iteration for all the registered providers.
Definition: DataProviderManager.cpp:92
A smart pointer not owning the wrapped object.
Definition: ObserverPtr.h:28
std::vector< ProviderPtr > GetProviders() const
Get a list of providers.
Definition: DataProviderManager.cpp:32
bool SetDisabledProviders(const std::vector< std::string > &providerNames)
Set the disabled providers.
Definition: DataProviderManager.cpp:100
IncludeFileExc.h IncludeFileExc class declaration.
Definition: Algorithm.h:21
bool SetEvent(unsigned int event, std::vector< std::pair< ProviderPtr, std::vector< std::string >>> &notValidGlobalObjects)
Set the current event for all the registered providers.
Definition: DataProviderManager.cpp:67
std::list< std::unique_ptr< DataProvider > > ProvidersBook
Definition: DataProviderManager.h:102
ProviderPtr GetProvider(const std::string &name)
Get a given provider.
Definition: DataProviderManager.cpp:23
bool AddProvider(std::unique_ptr< DataProvider > provider)
Add a data provider to the manager.
Definition: DataProviderManager.cpp:15
bool IsEventAvailable(unsigned int event)
Checks if the registered data provider can provide the given event.
Definition: DataProviderManager.cpp:83
Manager class for data providers.
Definition: DataProviderManager.h:29