88// In applying this license CERN does not waive the privileges and immunities
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
11- #ifndef FRAMEWORK_CALLBACKSERVICE_H
12- #define FRAMEWORK_CALLBACKSERVICE_H
11+ #ifndef O2_FRAMEWORK_CALLBACKSERVICE_H_
12+ #define O2_FRAMEWORK_CALLBACKSERVICE_H_
1313
1414#include " CallbackRegistry.h"
1515#include " Framework/ServiceHandle.h"
16+ #include " ServiceRegistry.h"
1617#include < tuple>
1718
1819#include < fairmq/FwdDecls.h>
1920
20- namespace o2
21- {
22- namespace framework
21+ namespace o2 ::framework
2322{
2423
2524class EndOfStreamContext ;
@@ -34,11 +33,12 @@ class CallbackService
3433 constexpr static ServiceKind service_kind = ServiceKind::Global;
3534 // / the defined processing steps at which a callback can be invoked
3635 enum class Id {
37- Start, /* *< Invoked before the inner loop is started */
38- Stop, /* *< Invoked when the device is about to be stoped */
39- Reset, /* *< Invoked on device rest */
40- Idle, /* *< Invoked when there was no computation scheduled */
41- ClockTick, /* *< Invoked every iteration of the inner loop */
36+ Start, /* *< Invoked before the inner loop is started */
37+ Stop, /* *< Invoked when the device is about to be stoped */
38+ Reset, /* *< Invoked on device rest */
39+ Idle, /* *< Invoked when there was no computation scheduled */
40+ ClockTick, /* *< Invoked every iteration of the inner loop */
41+ DataConsumed, /* *< Invoked whenever data has been consumed */
4242 // / Invoked when we are notified that no further data will arrive.
4343 // / Notice that one could have more "EndOfData" notifications. Because
4444 // / we could be signaled by control that the data flow restarted.
@@ -66,6 +66,7 @@ class CallbackService
6666 using ResetCallback = std::function<void ()>;
6767 using IdleCallback = std::function<void ()>;
6868 using ClockTickCallback = std::function<void ()>;
69+ using DataConsumedCallback = std::function<void (ServiceRegistry&)>;
6970 using EndOfStreamCallback = std::function<void (EndOfStreamContext&)>;
7071 using RegionInfoCallback = std::function<void (FairMQRegionInfo const &)>;
7172
@@ -75,6 +76,7 @@ class CallbackService
7576 RegistryPair<Id, Id::Reset, ResetCallback>, //
7677 RegistryPair<Id, Id::Idle, IdleCallback>, //
7778 RegistryPair<Id, Id::ClockTick, ClockTickCallback>, //
79+ RegistryPair<Id, Id::DataConsumed, DataConsumedCallback>, //
7880 RegistryPair<Id, Id::EndOfStream, EndOfStreamCallback>, //
7981 RegistryPair<Id, Id::RegionInfoCallback, RegionInfoCallback> //
8082 >; //
@@ -97,6 +99,5 @@ class CallbackService
9799 Callbacks mCallbacks ;
98100};
99101
100- } // namespace framework
101- } // namespace o2
102- #endif // FRAMEWORK_CALLBACKSERVICE_H
102+ } // namespace o2::framework
103+ #endif // O2_FRAMEWORK_CALLBACKSERVICE_H_
0 commit comments