MarlinMT  0.1.0
SimpleScheduler.h
Go to the documentation of this file.
1 #ifndef MARLINMT_SIMPLESCHEDULER_h
2 #define MARLINMT_SIMPLESCHEDULER_h 1
3 
4 // -- marlinmt headers
5 #include <marlinmt/IScheduler.h>
6 #include <marlinmt/Logging.h>
7 
8 namespace marlinmt {
9 
10  class SuperSequence ;
11  class Sequence ;
12 
16  class SimpleScheduler : public IScheduler {
17  public:
18  using ProcessorSequence = std::shared_ptr<SuperSequence> ;
19 
20  public:
21  SimpleScheduler() ;
22 
23  // from IScheduler interface
24  void initialize() override ;
25  void end() override ;
26  void processRunHeader( std::shared_ptr<RunHeader> rhdr ) override ;
27  void pushEvent( std::shared_ptr<EventStore> event ) override ;
28  void popFinishedEvents( std::vector<std::shared_ptr<EventStore>> &events ) override ;
29  std::size_t freeSlots() const override ;
30 
31  private:
35  std::shared_ptr<EventStore> _currentEvent {nullptr} ;
36  };
37 
38 } // end namespace marlinmt
39 
40 #endif
void end() override
Terminate the scheduler activites Cleanup memory, etc ...
IScheduler interface Interface for implementing a scheduling algorithm for event processing.
Definition: IScheduler.h:23
std::shared_ptr< SuperSequence > ProcessorSequence
ProcessorSequence _superSequence
< The processor super sequence
std::size_t freeSlots() const override
Get the number of free event slots.
void popFinishedEvents(std::vector< std::shared_ptr< EventStore >> &events) override
Retrieve finished events from the scheduler.
std::shared_ptr< EventStore > _currentEvent
SimpleScheduler class.
void processRunHeader(std::shared_ptr< RunHeader > rhdr) override
Process a run header.
void pushEvent(std::shared_ptr< EventStore > event) override
Push a new event to the scheduler for processing.
void initialize() override
Initialize the scheduler.