All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DataFlowManager.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_DATAFLOWMANAGER_H
2 #define GAUDIHIVE_DATAFLOWMANAGER_H
3 
4 // FW includes
6 #include "GaudiKernel/SmartIF.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 
29 
30 public:
31 
33  typedef boost::dynamic_bitset<> dependency_bitset;
34 
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:
60 
62  dependency_bitset m_dataObjectsCatalog;
69 
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
boost::dynamic_bitset dependency_bitset
Type holding the dependencies for one single algorithm.
The DataFlowManager takes care of keeping track of the dependencies of the algorithms in terms of dat...
void updateDataObjectsCatalog(const DataObjIDColl &newProducts)
Update the catalog of available products in the slot.
DataObjIDColl dataDependencies(unsigned int iAlgo) const
Get the dependencies of a single algo;.
static std::vector< DataObjID > m_productName_vec
Track the products, assigning an index to them. Static since the same for all events.
DataObjIDColl content() const
Get the content of the catalog.
static std::unordered_map< productName_t, long int, DataObjID_Hasher > m_productName_index_map
DataObjIDColl m_fc
static std::vector< dependency_bitset > m_algosRequirements
Requirements of algos. Static since the same for all events.
DataObjID & index2productName(const unsigned int i)
Simple helper method to convert an index to a product name.
T count(T...args)
long int productName2index(const productName_t &productName)
Simple helper method to convert the product name into an index.
STL class.
std::vector< DataObjIDColl > algosDependenciesCollection
void reset()
Reset to default values.
dependency_bitset m_dataObjectsCatalog
Catalog of the products in the whiteboard.
DataObjID productName_t
Track the products, assigning an index to them. Static since the same for all events.
DataFlowManager(const std::list< IAlgorithm * > &)
Constructor.
bool canAlgorithmRun(unsigned int iAlgo)
Needed data products are available.