-
Notifications
You must be signed in to change notification settings - Fork 0
/
Coordinator.h
74 lines (59 loc) · 1.7 KB
/
Coordinator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef Subsystem_Package_Coordinator_h
#define Subsystem_Package_Coordinator_h
// -*- C++ -*-
//
// Package: Package
// Class : Coordinator
//
/**\class Coordinator Coordinator.h "Coordinator.h"
Description: [one line class summary]
Usage:
<usage>
*/
//
// Original Author: Chris Jones
// Created: Thu, 14 Mar 2013 19:15:21 GMT
// $Id$
//
// system include files
#include <memory>
#include <vector>
// user include files
#include "SerialTaskQueue.h"
#include "WaitingTaskList.h"
// forward declarations
class Stream;
class RunCache;
class Source;
class GlobalWatcher;
class Run;
namespace tbb {
class task;
}
class Coordinator {
public:
Coordinator(tbb::task* iWaitingTask, Source*, GlobalWatcher*, RunCache&);
tbb::task* assignWorkTo(Stream*);
void beginRunHasFinished(Run*);
void doneWithRun(Run*);
private:
tbb::task* doAssignWorkTo_(Stream* iStream);
void doneProcessing();
tbb::task* prepareToRemoveFromRun(Stream* iStream);
tbb::task* newRun(unsigned int iNewRunsNumber);
tbb::task* startNewRun(unsigned int iNewRunsNumber, Run* iRun);
tbb::task* assignToRunThenDoEvent(Stream* iStream);
tbb::task* assignToARun(Stream* iStream);
edm::SerialTaskQueue m_queue;
tbb::task* m_waitingTask;
Source* m_source;
GlobalWatcher* m_watcher;
RunCache& m_runHandler;
Run* m_activeRun;
std::vector<std::shared_ptr<edm::WaitingTaskList>> m_waitingForBeginRunToFinish;
std::vector<std::atomic<tbb::task*>> m_endRunTasks;
std::vector<edm::SerialTaskQueue> m_runSumQueues;
unsigned int m_presentRunTransitionID;
unsigned int m_presentRunNumber;
};
#endif