The Gaudi Framework
v26r0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GetAlg.h
Go to the documentation of this file.
1
// $Id: GetAlg.h,v 1.2 2007/11/20 13:01:06 marcocle Exp $
2
// ============================================================================
3
#ifndef GAUDIALG_GETALG_H
4
#define GAUDIALG_GETALG_H 1
5
// ============================================================================
6
// Include files
7
// ============================================================================
8
// GaudiKernnel
9
// ============================================================================
10
#include "
GaudiKernel/IAlgorithm.h
"
11
// ============================================================================
12
// forward declarations
13
// ============================================================================
14
class
IAlgContextSvc
;
15
// ============================================================================
16
namespace
Gaudi
17
{
18
namespace
Utils
19
{
20
// ========================================================================
26
class
GAUDI_API
AlgSelector
27
{
28
public
:
30
virtual
bool
operator() (
const
IAlgorithm
* )
const
= 0 ;
31
// virtual destructor
32
virtual
~
AlgSelector
() ;
33
};
34
// ========================================================================
41
template
<
class
TYPE>
42
class
GAUDI_API
AlgTypeSelector
:
public
AlgSelector
43
{
44
public
:
46
virtual
bool
operator() (
const
IAlgorithm
* a )
const
47
{
return
dynamic_cast<
const
TYPE*
>
( a ) != 0; }
48
} ;
49
// ========================================================================
50
template
<
class
TYPE>
51
class
AlgTypeSelector
<TYPE*> :
public
AlgTypeSelector<TYPE>
{} ;
52
// ========================================================================
53
template
<
class
TYPE>
54
class
AlgTypeSelector
<const TYPE*> :
public
AlgTypeSelector<TYPE>
{} ;
55
// ========================================================================
56
template
<
class
TYPE>
57
class
AlgTypeSelector
<TYPE&> :
public
AlgTypeSelector<TYPE>
{} ;
58
// ========================================================================
59
template
<
class
TYPE>
60
class
AlgTypeSelector
<const TYPE&> :
public
AlgTypeSelector<TYPE>
{} ;
61
// ========================================================================
62
template
<
class
TYPE>
63
class
AlgTypeSelector
<const TYPE> :
public
AlgTypeSelector
<TYPE> {} ;
64
// ========================================================================
71
class
GAUDI_API
AlgNameSelector
:
public
AlgSelector
72
{
73
public
:
75
AlgNameSelector
(
const
std::string& name ) : m_name ( name ) {}
77
virtual
bool
operator() (
const
IAlgorithm
* a )
const
78
{
return
0 != a ? a->
name
() == m_name : false ; }
79
private
:
80
// the default constructor is disabled
81
AlgNameSelector
() ;
82
private
:
83
// algorithm name
84
std::string
m_name
;
85
} ;
86
// ========================================================================
87
}
// end of namespace Gaudi::Utils
88
}
// end of namespace Gaudi
89
// ============================================================================
90
namespace
Gaudi
91
{
92
namespace
Utils
93
{
94
// ========================================================================
117
GAUDI_API
IAlgorithm
*
getAlgorithm
118
(
const
IAlgContextSvc
* svc ,
119
const
AlgSelector&
sel
) ;
120
// ========================================================================
143
GAUDI_API
IAlgorithm
*
getAlgorithm
144
(
const
std::vector<IAlgorithm*>& lst ,
145
const
AlgSelector& sel ) ;
146
// ========================================================================
147
}
// end of namespace Gaudi::Utils
148
}
// end of namespace Gaudi
149
// ============================================================================
150
// The END
151
// ============================================================================
152
#endif // GAUDIALG_GETALG_H
153
// ============================================================================
Gaudi::Utils::AlgNameSelector::AlgNameSelector
AlgNameSelector(const std::string &name)
constructor form the name
Definition:
GetAlg.h:75
Gaudi::Utils::AlgNameSelector
The trivial selector of algorithm by type.
Definition:
GetAlg.h:71
IAlgorithm.h
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
Gaudi::Utils::getAlgorithm
GAUDI_API IAlgorithm * getAlgorithm(const IAlgContextSvc *svc, const AlgSelector &sel)
simple function to get the algorithm from Context Service
Definition:
GetAlg.cpp:29
read_lhcb_event_file.sel
tuple sel
Definition:
read_lhcb_event_file.py:10
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition:
IAlgorithm.h:20
Gaudi::Utils::AlgTypeSelector
The trivial selector of algorithm by type.
Definition:
GetAlg.h:42
IAlgContextSvc
An abstract interface for Algorithm Context Service.
Definition:
IAlgContextSvc.h:28
Gaudi::Utils::AlgSelector
Simple interface class for selection of algorithms.
Definition:
GetAlg.h:26
Gaudi
This is a number of static methods for bootstrapping the Gaudi framework.
Definition:
Bootstrap.h:14
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:108
Gaudi::Utils::AlgNameSelector::m_name
std::string m_name
algorithm name
Definition:
GetAlg.h:84
GaudiAlg
GaudiAlg
GetAlg.h
Generated on Tue Jan 20 2015 20:27:14 for The Gaudi Framework by
1.8.7