The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
Algorithm.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 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
#include <
Gaudi/Algorithm.h
>
13
#include <
GaudiKernel/ThreadLocalContext.h
>
14
15
namespace
Gaudi
{
16
namespace
details
{
17
#pragma GCC diagnostic push
18
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
19
class
LegacyAlgorithmAdapter
:
public
Gaudi::Algorithm
{
20
public
:
21
LegacyAlgorithmAdapter
( std::string
name
,
ISvcLocator
* svcloc, std::string
version
=
PACKAGE_VERSION
)
22
:
Gaudi
::
Algorithm
(
std
::move(
name
), svcloc,
std
::move(
version
) ) {
23
// default cardinality for non-reentrant algorithms
24
setProperty
(
"Cardinality"
, 1 ).
ignore
();
25
}
26
27
virtual
StatusCode
execute
() = 0;
28
29
const
EventContext
&
getContext
()
const
{
return
Gaudi::Hive::currentContext
(); }
30
32
bool
isExecuted
()
const
;
33
35
void
setExecuted
(
bool
state )
const
;
36
38
bool
filterPassed
()
const
;
39
41
void
setFilterPassed
(
bool
state )
const
;
42
43
protected
:
44
bool
isReEntrant
()
const override
{
return
false
; }
45
46
private
:
47
StatusCode
execute
(
const
EventContext
& )
const
override
final
{
48
return
const_cast<
LegacyAlgorithmAdapter
*
>
( this )->
execute
();
49
}
50
};
51
#pragma GCC diagnostic pop
52
}
// namespace details
53
}
// namespace Gaudi
54
55
#pragma GCC diagnostic push
56
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
58
class
Algorithm
:
public
Gaudi::details::LegacyAlgorithmAdapter
{
59
public
:
60
using
Gaudi::details::LegacyAlgorithmAdapter::LegacyAlgorithmAdapter
;
61
// this is to explicitly hide the other signature of `execute`
62
StatusCode
execute
()
override
= 0;
63
};
64
#pragma GCC diagnostic pop
Algorithm.h
PACKAGE_VERSION
#define PACKAGE_VERSION
Definition
Algorithm.h:55
ThreadLocalContext.h
Algorithm
Alias for backward compatibility.
Definition
Algorithm.h:58
Algorithm::execute
StatusCode execute() override=0
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:35
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::Algorithm::version
const std::string & version() const override
Definition
Algorithm.cpp:522
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition
Algorithm.cpp:518
Gaudi::details::LegacyAlgorithmAdapter
Definition
Algorithm.h:19
Gaudi::details::LegacyAlgorithmAdapter::execute
StatusCode execute(const EventContext &) const override final
Definition
Algorithm.h:47
Gaudi::details::LegacyAlgorithmAdapter::isExecuted
bool isExecuted() const
Has this algorithm been executed since the last reset?
Definition
LegacyAlgorithm.cpp:17
Gaudi::details::LegacyAlgorithmAdapter::setExecuted
void setExecuted(bool state) const
Set the executed flag to the specified state.
Definition
LegacyAlgorithm.cpp:21
Gaudi::details::LegacyAlgorithmAdapter::LegacyAlgorithmAdapter
LegacyAlgorithmAdapter(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Definition
Algorithm.h:21
Gaudi::details::LegacyAlgorithmAdapter::isReEntrant
bool isReEntrant() const override
Definition
Algorithm.h:44
Gaudi::details::LegacyAlgorithmAdapter::filterPassed
bool filterPassed() const
Did this algorithm pass or fail its filter criterion for the last event?
Definition
LegacyAlgorithm.cpp:25
Gaudi::details::LegacyAlgorithmAdapter::setFilterPassed
void setFilterPassed(bool state) const
Set the filter passed flag to the specified state.
Definition
LegacyAlgorithm.cpp:29
Gaudi::details::LegacyAlgorithmAdapter::execute
virtual StatusCode execute()=0
Gaudi::details::LegacyAlgorithmAdapter::getContext
const EventContext & getContext() const
Definition
Algorithm.h:29
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::ignore
void ignore() const
Allow discarding a StatusCode without warning.
Definition
StatusCode.h:128
Gaudi::Hive::currentContext
GAUDI_API const EventContext & currentContext()
Definition
ThreadLocalContext.cpp:30
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
details
Definition
AnyDataWrapper.h:19
std
STL namespace.
GaudiKernel
include
GaudiKernel
Algorithm.h
Generated on
for The Gaudi Framework by
1.17.0