The Gaudi Framework  master (37c0b60a)
IScheduler.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_ISCHEDULER_H
12 #define GAUDIKERNEL_ISCHEDULER_H
13 
14 // Framework include files
16 #include <GaudiKernel/IInterface.h>
17 
18 // C++ include files
19 #include <chrono>
20 #include <functional>
21 #include <memory>
22 #include <vector>
23 
32 class GAUDI_API IScheduler : virtual public IInterface {
33 public:
36 
38  virtual StatusCode pushNewEvent( EventContext* eventContext ) = 0;
39 
42  virtual StatusCode pushNewEvents( std::vector<EventContext*>& eventContexts ) = 0;
43 
45  virtual StatusCode popFinishedEvent( EventContext*& eventContext ) = 0;
46 
48  virtual StatusCode tryPopFinishedEvent( EventContext*& eventContext ) = 0;
49 
51  virtual unsigned int freeSlots() = 0;
52 
53  virtual void dumpState() {}
54 
56  virtual StatusCode scheduleEventView( const EventContext* sourceContext, const std::string& nodeName,
57  std::unique_ptr<EventContext> viewContext ) = 0;
58 
63  std::chrono::system_clock::time_point time;
65  };
66  virtual void recordOccupancy( int samplePeriod, std::function<void( OccupancySnapshot )> callback ) = 0;
67 };
68 #endif
std::string
STL class.
IScheduler::pushNewEvent
virtual StatusCode pushNewEvent(EventContext *eventContext)=0
Make an event available to the scheduler.
std::vector
STL class.
std::function
IScheduler::OccupancySnapshot::time
std::chrono::system_clock::time_point time
Definition: IScheduler.h:63
IScheduler::tryPopFinishedEvent
virtual StatusCode tryPopFinishedEvent(EventContext *&eventContext)=0
Try to retrieve a finished event from the scheduler.
IScheduler::OccupancySnapshot
Sample occupancy at fixed interval (ms) Negative value to deactivate, 0 to snapshot every change Each...
Definition: IScheduler.h:62
IScheduler::freeSlots
virtual unsigned int freeSlots()=0
Get the free event processing slots.
IScheduler::popFinishedEvent
virtual StatusCode popFinishedEvent(EventContext *&eventContext)=0
Retrieve a finished event from the scheduler.
StatusCode
Definition: StatusCode.h:65
IInterface.h
IScheduler::recordOccupancy
virtual void recordOccupancy(int samplePeriod, std::function< void(OccupancySnapshot)> callback)=0
IScheduler::dumpState
virtual void dumpState()
Definition: IScheduler.h:53
IScheduler
Definition: IScheduler.h:32
IScheduler::DeclareInterfaceID
DeclareInterfaceID(IScheduler, 1, 0)
InterfaceID.
EventContext.h
IInterface
Definition: IInterface.h:239
EventContext
Definition: EventContext.h:34
IScheduler::OccupancySnapshot::states
std::vector< std::vector< int > > states
Definition: IScheduler.h:64
IScheduler::scheduleEventView
virtual StatusCode scheduleEventView(const EventContext *sourceContext, const std::string &nodeName, std::unique_ptr< EventContext > viewContext)=0
Method to inform the scheduler about event views.
std::unique_ptr< EventContext >
IScheduler::pushNewEvents
virtual StatusCode pushNewEvents(std::vector< EventContext * > &eventContexts)=0
Make a list of events available to the scheduler This method makes a bunch creation of new events ato...
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
gaudirun.callback
callback
Definition: gaudirun.py:202