Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IScheduler.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 #pragma once
12 
14 #include <GaudiKernel/IInterface.h>
15 #include <chrono>
16 #include <functional>
17 #include <memory>
18 #include <vector>
19 
28 class GAUDI_API IScheduler : virtual public IInterface {
29 public:
32 
34  virtual StatusCode pushNewEvent( EventContext* eventContext ) = 0;
35 
38  virtual StatusCode pushNewEvents( std::vector<EventContext*>& eventContexts ) = 0;
39 
41  virtual StatusCode popFinishedEvent( EventContext*& eventContext ) = 0;
42 
44  virtual StatusCode tryPopFinishedEvent( EventContext*& eventContext ) = 0;
45 
47  virtual unsigned int freeSlots() = 0;
48 
49  virtual void dumpState() {}
50 
52  virtual StatusCode scheduleEventView( const EventContext* sourceContext, const std::string& nodeName,
53  std::unique_ptr<EventContext> viewContext ) = 0;
54 
59  std::chrono::system_clock::time_point time;
60  std::vector<std::vector<int>> states;
61  };
62  virtual void recordOccupancy( int samplePeriod, std::function<void( OccupancySnapshot )> callback ) = 0;
63 };
IScheduler::pushNewEvent
virtual StatusCode pushNewEvent(EventContext *eventContext)=0
Make an event available to the scheduler.
IScheduler::OccupancySnapshot::time
std::chrono::system_clock::time_point time
Definition: IScheduler.h:59
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:58
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:64
IInterface.h
IScheduler::recordOccupancy
virtual void recordOccupancy(int samplePeriod, std::function< void(OccupancySnapshot)> callback)=0
IScheduler::dumpState
virtual void dumpState()
Definition: IScheduler.h:49
IScheduler
Definition: IScheduler.h:28
IScheduler::DeclareInterfaceID
DeclareInterfaceID(IScheduler, 1, 0)
InterfaceID.
EventContext.h
IInterface
Definition: IInterface.h:225
EventContext
Definition: EventContext.h:34
IScheduler::OccupancySnapshot::states
std::vector< std::vector< int > > states
Definition: IScheduler.h:60
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.
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:49
gaudirun.callback
callback
Definition: gaudirun.py:202