| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

DataFlowManager.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_DATAFLOWMANAGER_H
2 #define GAUDIHIVE_DATAFLOWMANAGER_H
3
4 // FW includes
5 #include "GaudiKernel/IAlgorithm.h"
6 #include "GaudiKernel/SmartIF.h"
7 #include "GaudiKernel/DataObjID.h"
8
9 // boost
10 #include "boost/dynamic_bitset.hpp"
11
12 // std includes
13 #include <list>
14 #include <vector>
15 #include <set>
16 #include <unordered_set>
17 #include <unordered_map>
18
28 class DataFlowManager{
29
30 public:
31
33 typedef boost::dynamic_bitset<> dependency_bitset;
34
35 typedef std::vector<DataObjIDColl> algosDependenciesCollection;
37 DataFlowManager(const std::list<IAlgorithm*>& /*algos*/):
38 m_dataObjectsCatalog(0){};
39
41 DataFlowManager(algosDependenciesCollection algoDependencies);
42
44 bool canAlgorithmRun(unsigned int iAlgo);
45
47 void updateDataObjectsCatalog(const DataObjIDColl& newProducts);
48
50 void reset();
51
53 DataObjIDColl content() const;
54
56 DataObjIDColl dataDependencies(unsigned int iAlgo) const;
57
58 private:
59 DataObjIDColl m_fc;
60
62 dependency_bitset m_dataObjectsCatalog;
64 static std::vector< dependency_bitset > m_algosRequirements;
66 static std::vector<DataObjID> m_productName_vec;
68 typedef DataObjID productName_t;
69
70 static std::unordered_map<productName_t,long int,DataObjID_Hasher> m_productName_index_map;
72 inline long int productName2index(const productName_t& productName){return m_productName_index_map.count(productName)>0 ? m_productName_index_map[productName]: -1 ;};
74 inline DataObjID& index2productName(const unsigned int i){return m_productName_vec[i];};
75
76 };
77
78 #endif
DataFlowManager::dependency_bitset
boost::dynamic_bitset dependency_bitset
Type holding the dependencies for one single algorithm.
Definition: DataFlowManager.h:33
DataFlowManager
The DataFlowManager takes care of keeping track of the dependencies of the algorithms in terms of dat...
Definition: DataFlowManager.h:28
DataFlowManager::updateDataObjectsCatalog
void updateDataObjectsCatalog(const DataObjIDColl &newProducts)
Update the catalog of available products in the slot.
Definition: DataFlowManager.cpp:65
DataFlowManager::dataDependencies
DataObjIDColl dataDependencies(unsigned int iAlgo) const
Get the dependencies of a single algo;.
Definition: DataFlowManager.cpp:96
DataObjID
Definition: DataObjID.h:38
IAlgorithm.h
DataFlowManager::m_productName_vec
static std::vector< DataObjID > m_productName_vec
Track the products, assigning an index to them. Static since the same for all events.
Definition: DataFlowManager.h:66
DataFlowManager::content
DataObjIDColl content() const
Get the content of the catalog.
Definition: DataFlowManager.cpp:86
DataFlowManager::m_productName_index_map
static std::unordered_map< productName_t, long int, DataObjID_Hasher > m_productName_index_map
Definition: DataFlowManager.h:70
DataFlowManager::m_fc
DataObjIDColl m_fc
Definition: DataFlowManager.h:59
DataFlowManager::m_algosRequirements
static std::vector< dependency_bitset > m_algosRequirements
Requirements of algos. Static since the same for all events.
Definition: DataFlowManager.h:64
DataFlowManager::index2productName
DataObjID & index2productName(const unsigned int i)
Simple helper method to convert an index to a product name.
Definition: DataFlowManager.h:74
SmartIF.h
std::unordered_set< DataObjID, DataObjID_Hasher >
std::list< IAlgorithm * >
std::unordered_map::count
T count(T...args)
DataObjID.h
DataFlowManager::productName2index
long int productName2index(const productName_t &productName)
Simple helper method to convert the product name into an index.
Definition: DataFlowManager.h:72
std::vector
STL class.
DataFlowManager::algosDependenciesCollection
std::vector< DataObjIDColl > algosDependenciesCollection
Definition: DataFlowManager.h:35
DataFlowManager::reset
void reset()
Reset to default values.
Definition: DataFlowManager.cpp:78
DataFlowManager::m_dataObjectsCatalog
dependency_bitset m_dataObjectsCatalog
Catalog of the products in the whiteboard.
Definition: DataFlowManager.h:62
DataFlowManager::productName_t
DataObjID productName_t
Track the products, assigning an index to them. Static since the same for all events.
Definition: DataFlowManager.h:68
DataFlowManager::DataFlowManager
DataFlowManager(const std::list< IAlgorithm * > &)
Constructor.
Definition: DataFlowManager.h:37
DataFlowManager::canAlgorithmRun
bool canAlgorithmRun(unsigned int iAlgo)
Needed data products are available.
Definition: DataFlowManager.cpp:57
std::unordered_map
STL class.