All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SequentialSchedulerSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_SEQUENTIALSCHEDULERSVC_H
2 #define GAUDIHIVE_SEQUENTIALSCHEDULERSVC_H
3 
4 // Framework include files
5 #include "GaudiKernel/IScheduler.h"
6 #include "GaudiKernel/IRunable.h"
7 #include "GaudiKernel/Service.h"
8 #include "GaudiKernel/IAlgResourcePool.h"
9 
10 // C++ include files
11 #include <vector>
12 #include <string>
13 #include <unordered_map>
14 #include <functional>
15 #include <thread>
16 
17 // External libs
18 #include "tbb/concurrent_queue.h"
19 
20 
21 //---------------------------------------------------------------------------
22 
36 class SequentialSchedulerSvc: public extends1<Service, IScheduler> {
37 public:
39  SequentialSchedulerSvc( const std::string& name, ISvcLocator* svc );
40 
43 
45  virtual StatusCode initialize();
46 
48  virtual StatusCode finalize();
49 
51  virtual StatusCode pushNewEvent(EventContext* eventContext);
52 
53  // Make multiple events available to the scheduler
54  virtual StatusCode pushNewEvents(std::vector<EventContext*>& eventContexts);
55 
57  virtual StatusCode popFinishedEvent(EventContext*& eventContext);
58 
60  virtual StatusCode tryPopFinishedEvent(EventContext*& eventContext);
61 
63  virtual unsigned int freeSlots();
64 
65 
66 private:
67 
70 
72  std::list<IAlgorithm*> m_algList;
73 
76 
79 
80 };
81 
82 #endif // GAUDIHIVE_SEQUENTIALSCHEDULERSVC_H
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
std::list< IAlgorithm * > m_algList
Cache the list of algs to be executed.
virtual StatusCode tryPopFinishedEvent(EventContext *&eventContext)
Try to fetch an event from the scheduler.
virtual StatusCode pushNewEvents(std::vector< EventContext * > &eventContexts)
virtual StatusCode finalize()
Finalise.
virtual unsigned int freeSlots()
Get free slots number.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:22
SequentialSchedulerSvc(const std::string &name, ISvcLocator *svc)
Constructor.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode pushNewEvent(EventContext *eventContext)
Make an event available to the scheduler.
int m_freeSlots
The number of free slots (0 or 1)
virtual StatusCode initialize()
Initialise.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
virtual StatusCode popFinishedEvent(EventContext *&eventContext)
Blocks until an event is availble.
bool m_useTopAlgList
Decide if the top alglist or its flat version has to be used.
This SchedulerSvc implements the IScheduler interface.
EventContext * m_eventContext
The context of the event being processed.