All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GetAlg.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // ============================================================================
4 #include <algorithm>
5 // ============================================================================
6 // GaudiKernel
7 // ============================================================================
10 // ============================================================================
11 // GaudiAlg
12 // ============================================================================
13 #include "GaudiAlg/GetAlg.h"
14 // ============================================================================
21 // ============================================================================
22 // simple function to get the algorithm from Context Service
23 // ============================================================================
24 IAlgorithm*
26 ( const IAlgContextSvc* svc ,
27  const AlgSelector& sel )
28 {
29  return svc ? getAlgorithm ( svc->algorithms() , sel ) : nullptr;
30 }
31 // ============================================================================
32 // simple function to get the algorithm from Context Service
33 // ============================================================================
34 IAlgorithm*
36 ( const std::vector<IAlgorithm*>& lst ,
37  const AlgSelector& sel )
38 {
39  auto it = std::find_if( lst.rbegin(), lst.rend(), std::cref(sel));
40  return it != lst.rend() ? *it : nullptr ;
41 }
42 // ============================================================================
43 
44 // ============================================================================
45 // The END
46 // ============================================================================
T rend(T...args)
sel
Definition: IOTest.py:84
GAUDI_API IAlgorithm * getAlgorithm(const IAlgContextSvc *svc, const AlgSelector &sel)
simple function to get the algorithm from Context Service
Definition: GetAlg.cpp:26
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:27
virtual const Algorithms & algorithms() const =0
get the stack of executed algorithms
T find_if(T...args)
T cref(T...args)
An abstract interface for Algorithm Context Service.
Simple interface class for selection of algorithms.
Definition: GetAlg.h:26
T rbegin(T...args)