All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
EventSchedulingState.cpp
Go to the documentation of this file.
2 
3 EventSchedulingState::EventSchedulingState(const unsigned int& n_algos, const unsigned int& n_products)
4  : m_numberOfAlgos(n_algos), m_eventState(n_products)
5 {
6  m_algosInFlight = 0;
7  m_algosFinished = 0;
8  m_algosStarted.resize(n_algos);
9  std::fill(m_algosStarted.begin(),m_algosStarted.end(),false);
10 }
11 
15 }
16 
17 bool EventSchedulingState::hasStarted(unsigned int& index) const {
18  return m_algosStarted[index];
19 }
20 
21 void EventSchedulingState::algoStarts(unsigned int& index) {
23  m_algosStarted[index] = true;
24 }
25 
26 void EventSchedulingState::update_state(unsigned int& product_index){
27  m_eventState[product_index] = true;
28 }
void update_state(unsigned int &product_index)
void algoStarts(unsigned int &index)
std::atomic_uint m_algosInFlight
Number of algos in flight.
bool hasStarted(unsigned int &index) const
tbb::concurrent_vector< bool > m_algosStarted
Register of algorithms started.
std::atomic_uint m_algosFinished
Number of finished algos.
state_type m_eventState
Event state recording which products are there.
T fill(T...args)
EventSchedulingState(const unsigned int &n_algos, const unsigned int &n_products)