The Gaudi Framework
master (ff829712)
Loading...
Searching...
No Matches
AsynchronousAlgorithm.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 2023-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
13
#include <
Gaudi/Algorithm.h
>
14
#include <
GaudiKernel/IHiveWhiteBoard.h
>
15
#include <boost/fiber/all.hpp>
16
#include <chrono>
17
18
namespace
Gaudi
{
28
29
class
GAUDI_API
AsynchronousAlgorithm
:
public
Gaudi::Algorithm
{
30
public
:
31
using
Gaudi::Algorithm::Algorithm
;
32
StatusCode
sysInitialize
()
override
;
33
StatusCode
sysExecute
(
const
EventContext
& ctx )
override
;
34
36
virtual
StatusCode
restoreAfterSuspend
()
const
;
37
39
StatusCode
yield
()
const
;
40
42
template
<
typename
Clock,
typename
Duration>
43
StatusCode
sleep_until
( std::chrono::time_point<Clock, Duration>
const
& sleep_time )
const
{
44
boost::this_fiber::sleep_until( sleep_time );
45
return
restoreAfterSuspend
();
46
}
47
49
template
<
typename
Rep,
typename
Period>
50
StatusCode
sleep_for
( std::chrono::duration<Rep, Period>
const
& dur )
const
{
51
boost::this_fiber::sleep_for( dur );
52
return
restoreAfterSuspend
();
53
}
54
55
private
:
57
boost::fibers::fiber_specific_ptr<std::size_t>
s_currentSlot
{};
58
};
59
}
// namespace Gaudi
Algorithm.h
IHiveWhiteBoard.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:34
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition
Algorithm.h:87
Gaudi::Algorithm::Algorithm
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition
Algorithm.h:98
Gaudi::AsynchronousAlgorithm
Base class for asynchronous algorithms.
Definition
AsynchronousAlgorithm.h:29
Gaudi::AsynchronousAlgorithm::sleep_until
StatusCode sleep_until(std::chrono::time_point< Clock, Duration > const &sleep_time) const
Forwards to boost::this_fiber::sleep_until.
Definition
AsynchronousAlgorithm.h:43
Gaudi::AsynchronousAlgorithm::sysExecute
StatusCode sysExecute(const EventContext &ctx) override
Definition
AsynchronousAlgorithm.cpp:19
Gaudi::AsynchronousAlgorithm::restoreAfterSuspend
virtual StatusCode restoreAfterSuspend() const
Restore after suspend.
Definition
AsynchronousAlgorithm.cpp:34
Gaudi::AsynchronousAlgorithm::yield
StatusCode yield() const
Forwards to boost::this_fiber::yield.
Definition
AsynchronousAlgorithm.cpp:42
Gaudi::AsynchronousAlgorithm::sysInitialize
StatusCode sysInitialize() override
Definition
AsynchronousAlgorithm.cpp:13
Gaudi::AsynchronousAlgorithm::sleep_for
StatusCode sleep_for(std::chrono::duration< Rep, Period > const &dur) const
Forwards to boost::this_fiber::sleep_for.
Definition
AsynchronousAlgorithm.h:50
Gaudi::AsynchronousAlgorithm::s_currentSlot
boost::fibers::fiber_specific_ptr< std::size_t > s_currentSlot
Contains current slot.
Definition
AsynchronousAlgorithm.h:57
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
GaudiKernel
include
Gaudi
AsynchronousAlgorithm.h
Generated on Fri Sep 26 2025 11:24:27 for The Gaudi Framework by
1.13.1