Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v31r0 (aeb156f0)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
GetAlg.h
Go to the documentation of this file.
1
#ifndef GAUDIALG_GETALG_H
2
#define GAUDIALG_GETALG_H 1
3
// ============================================================================
4
// Include files
5
// ============================================================================
6
#include <type_traits>
7
// ============================================================================
8
// GaudiKernel
9
// ============================================================================
10
#include "
GaudiKernel/IAlgorithm.h
"
11
// ============================================================================
12
// forward declarations
13
// ============================================================================
14
class
IAlgContextSvc
;
15
// ============================================================================
16
namespace
Gaudi
{
17
namespace
Utils {
18
// ========================================================================
24
class
GAUDI_API
AlgSelector
{
25
public
:
27
virtual
bool
operator()
(
const
IAlgorithm
* )
const
= 0;
28
// virtual destructor
29
virtual
~
AlgSelector
() =
default
;
30
};
31
// ========================================================================
38
template
<
class
TYPE>
39
class
GAUDI_API
AlgTypeSelector
:
public
AlgSelector
{
40
public
:
42
bool
operator()
(
const
IAlgorithm
* a )
const override
{
43
using
TYPE_ = std::decay_t<TYPE>;
44
using
CTYPE
= std::add_const_t<TYPE_>;
45
using
cptr = std::add_pointer_t<CTYPE>;
46
return
dynamic_cast<
cptr
>
( a );
47
}
48
};
49
// ========================================================================
56
class
GAUDI_API
AlgNameSelector
:
public
AlgSelector
{
57
public
:
58
AlgNameSelector
() =
delete
;
60
AlgNameSelector
(
std::string
name
) : m_name(
std
::move( name ) ) {}
62
bool
operator()
(
const
IAlgorithm
* a )
const override
{
return
a && a->name() == m_name; }
63
64
private
:
65
// algorithm name
66
std::string
m_name
;
67
};
68
// ========================================================================
69
}
// namespace Utils
70
}
// end of namespace Gaudi
71
// ============================================================================
72
namespace
Gaudi
{
73
namespace
Utils {
74
// ========================================================================
97
GAUDI_API
IAlgorithm
*
getAlgorithm
(
const
IAlgContextSvc
* svc,
const
AlgSelector
&
sel
);
98
// ========================================================================
121
GAUDI_API
IAlgorithm
*
getAlgorithm
(
const
std::vector<IAlgorithm*>
& lst,
const
AlgSelector
& sel );
122
// ========================================================================
123
}
// namespace Utils
124
}
// end of namespace Gaudi
125
// ============================================================================
126
// The END
127
// ============================================================================
128
#endif // GAUDIALG_GETALG_H
gaudiComponentHelp.name
name
Definition:
gaudiComponentHelp.py:41
Gaudi::Utils::AlgNameSelector
The trivial selector of algorithm by type.
Definition:
GetAlg.h:56
IAlgorithm.h
IOTest.sel
sel
Definition:
IOTest.py:93
std
STL namespace.
Gaudi::Utils::AlgTypeSelector::operator()
bool operator()(const IAlgorithm *a) const override
the only one essential method:
Definition:
GetAlg.h:42
std::type_info
std::string
STL class.
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:24
Gaudi::Utils::AlgNameSelector::operator()
bool operator()(const IAlgorithm *a) const override
the only one essential method:
Definition:
GetAlg.h:62
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition:
IAlgorithm.h:28
Gaudi::Utils::AlgTypeSelector
The trivial selector of algorithm by type.
Definition:
GetAlg.h:39
Gaudi::Utils::AlgNameSelector::AlgNameSelector
AlgNameSelector(std::string name)
constructor form the name
Definition:
GetAlg.h:60
std::vector< IAlgorithm * >
Gaudi::Functional::operator()
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
IAlgContextSvc
An abstract interface for Algorithm Context Service.
Definition:
IAlgContextSvc.h:23
Gaudi::Utils::AlgSelector
Simple interface class for selection of algorithms.
Definition:
GetAlg.h:24
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:71
Gaudi
Helper functions to set/get the application return code.
Definition:
__init__.py:1
Gaudi::Utils::AlgNameSelector::m_name
std::string m_name
algorithm name
Definition:
GetAlg.h:66
GaudiAlg
GaudiAlg
GetAlg.h
Generated on Mon Feb 11 2019 17:48:10 for The Gaudi Framework by
1.8.11