EventAnalysis  1.0.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 Connect();
60 
65  bool Disconnect();
66 
74  bool
75  SetCurrentEvent(unsigned int event,
76  std::vector<std::pair<observer_ptr<DataProvider>, std::vector<std::string>>> &notValidGlobalObjects);
77 
83  bool SetCurrentEvent(unsigned int event) {
84  std::vector<std::pair<observer_ptr<DataProvider>, std::vector<std::string>>> dummy;
85  return SetCurrentEvent(event, dummy);
86  }
87 
94  bool SetCurrentPass(unsigned int pass, unsigned int iter);
95 
96 private:
97  typedef std::list<std::unique_ptr<DataProvider>> ProvidersBook;
98  ProvidersBook _providers;
99 };
100 
101 } // namespace EA
102 
103 #endif /* DATAPROVIDERMANAGER_H_ */
bool SetCurrentEvent(unsigned int event, std::vector< std::pair< observer_ptr< DataProvider >, std::vector< std::string >>> &notValidGlobalObjects)
Set the current event for all the registered providers.
Definition: DataProviderManager.cpp:67
bool SetCurrentEvent(unsigned int event)
Set the current event for all the registered providers.
Definition: DataProviderManager.h:83
ProvidersBook _providers
Definition: DataProviderManager.h:98
bool Connect()
Dispatches the call to Connect to all the data providers.
Definition: DataProviderManager.cpp:41
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
IncludeFileExc.h IncludeFileExc class declaration.
Definition: Algorithm.h:21
std::list< std::unique_ptr< DataProvider > > ProvidersBook
Definition: DataProviderManager.h:97
ProviderPtr GetProvider(const std::string &name)
Get a given provider.
Definition: DataProviderManager.cpp:23
bool Disconnect()
Dispatches the call to Disconnect to all the data providers.
Definition: DataProviderManager.cpp:54
bool AddProvider(std::unique_ptr< DataProvider > provider)
Add a data provider to the manager.
Definition: DataProviderManager.cpp:15
bool SetCurrentPass(unsigned int pass, unsigned int iter)
Set the current pass and iteration for all the registered providers.
Definition: DataProviderManager.cpp:83
Manager class for data providers.
Definition: DataProviderManager.h:29