All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GetAlg.cpp
Go to the documentation of this file.
1 // $Id: GetAlg.cpp,v 1.1 2007/09/25 16:12:41 marcocle Exp $
2 // ============================================================================
3 // Include files
4 // ============================================================================
5 // GaudiKernel
6 // ============================================================================
9 // ============================================================================
10 // GaudiAlg
11 // ============================================================================
12 #include "GaudiAlg/GetAlg.h"
13 // ============================================================================
20 // ============================================================================
21 // virtual destructor
22 // ============================================================================
24 // ============================================================================
25 // simple function to get the algorithm from Context Service
26 // ============================================================================
27 IAlgorithm*
29 ( const IAlgContextSvc* svc ,
30  const AlgSelector& sel )
31 {
32  if ( 0 == svc ) { return 0 ; } // RETURN
33  return getAlgorithm ( svc->algorithms() , sel ) ;
34 }
35 // ============================================================================
36 // simple function to get the algorithm from Context Service
37 // ============================================================================
38 IAlgorithm*
40 ( const std::vector<IAlgorithm*>& lst ,
41  const AlgSelector& sel )
42 {
43  for ( std::vector<IAlgorithm*>::const_reverse_iterator it = lst.rbegin() ;
44  lst.rend() != it ; ++it )
45  {
46  // use the selector:
47  if ( sel ( *it ) ) { return *it ; } // return
48  }
49  return 0 ;
50 }
51 // ============================================================================
52 
53 
54 // ============================================================================
55 // The END
56 // ============================================================================
virtual const Algorithms & algorithms() const =0
get the stack of executed algorithms
GAUDI_API IAlgorithm * getAlgorithm(const IAlgContextSvc *svc, const AlgSelector &sel)
simple function to get the algorithm from Context Service
Definition: GetAlg.cpp:29
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:20
An abstract interface for Algorithm Context Service.
Simple interface class for selection of algorithms.
Definition: GetAlg.h:26