Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
master (d98a2936)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
q
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
Macros
_
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
AnyViewAlgorithm.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2023 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
#include <
Gaudi/Functional/Consumer.h
>
12
#include <
Gaudi/Functional/Producer.h
>
13
#include <
GaudiKernel/Algorithm.h
>
14
#include <
GaudiKernel/DataObjectHandle.h
>
15
#include <gsl/span>
16
#include <string>
17
#include <string_view>
18
#include <vector>
19
20
using
BaseClass_t
=
Gaudi::Functional::Traits::BaseClass_t<Gaudi::Algorithm>
;
21
22
template
<
typename
Data,
typename
View>
23
using
writeViewFor
=
Gaudi::Functional::Traits::use_<Gaudi::Functional::Traits::writeViewFor<Data, View>
,
BaseClass_t
>;
24
25
struct
ProduceStringView
:
Gaudi::Functional::Producer
<std::string(), writeViewFor<std::string, std::string_view>> {
26
ProduceStringView
(
const
std::string&
name
,
ISvcLocator
* svcLoc )
27
:
Producer
{
name
, svcLoc, {
"Output"
,
"/Event/Test/StringView"
} } {}
28
29
std::string
operator()
()
const override
{
return
"Hello World"
; }
30
};
31
DECLARE_COMPONENT
(
ProduceStringView
)
32
33
struct
ProduceIntView
34
:
Gaudi
::Functional::
Producer
<
std
::
vector
<
int
>(),
writeViewFor
<
std
::
vector
<
int
>, gsl::span<const
int
>>> {
35
ProduceIntView
(
const
std::string&
name
,
ISvcLocator
* svcLoc )
36
:
Producer
{
name
, svcLoc, {
"Output"
,
"/Event/Test/IntView"
} } {}
37
38
std::vector<int>
operator()
()
const override
{
39
std::vector<int> vi{ 1, 2, 3, 5, 8, 13, 21, 34 };
40
info() <<
"made vector with data at : "
<< vi.data() <<
endmsg
;
41
return
vi;
42
}
43
};
44
DECLARE_COMPONENT
(
ProduceIntView
)
45
46
struct
GetStringView
:
Gaudi
::Functional::
Consumer
<
void
(
std
::string_view const& ),
BaseClass_t
> {
47
GetStringView
(
const
std::string&
name
,
ISvcLocator
* svcLoc )
48
:
Consumer
{
name
, svcLoc, {
"Input"
,
"/Event/Test/StringView"
} } {}
49
50
void
operator()
(
const
std::string_view& sv )
const override
{ info() << sv <<
endmsg
; }
51
};
52
DECLARE_COMPONENT
(
GetStringView
)
53
54
struct
GetIntView
:
Gaudi
::Functional::
Consumer
<
void
( gsl::span<const
int
> const& ),
BaseClass_t
> {
55
GetIntView
(
const
std::string&
name
,
ISvcLocator
* svcLoc )
56
:
Consumer
{
name
, svcLoc, {
"Input"
,
"/Event/Test/IntView"
} } {}
57
58
void
operator()
(
const
gsl::span<const int>& view )
const override
{
59
info() <<
"got a span with data at : "
<< view.data() <<
endmsg
;
60
auto
&
out
= info();
61
for
(
int
i : view )
out
<< i <<
" "
;
62
out
<<
endmsg
;
63
}
64
};
65
DECLARE_COMPONENT
(
GetIntView
)
GetStringView::operator()
void operator()(const std::string_view &sv) const override
Definition:
AnyViewAlgorithm.cpp:50
ProduceIntView::ProduceIntView
ProduceIntView(const std::string &name, ISvcLocator *svcLoc)
Definition:
AnyViewAlgorithm.cpp:35
GetIntView::operator()
void operator()(const gsl::span< const int > &view) const override
Definition:
AnyViewAlgorithm.cpp:58
Gaudi::Functional::Consumer
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
Definition:
Consumer.h:69
GaudiPartProp.decorators.std
std
Definition:
decorators.py:32
GetStringView::GetStringView
GetStringView(const std::string &name, ISvcLocator *svcLoc)
Definition:
AnyViewAlgorithm.cpp:47
ISvcLocator
Definition:
ISvcLocator.h:42
GetIntView
Definition:
AnyViewAlgorithm.cpp:54
Algorithm.h
ProduceStringView::ProduceStringView
ProduceStringView(const std::string &name, ISvcLocator *svcLoc)
Definition:
AnyViewAlgorithm.cpp:26
Consumer.h
Gaudi::Functional::Producer
details::Producer< Signature, Traits_, details::isLegacy< Traits_ > > Producer
Definition:
Producer.h:37
Producer.h
Gaudi::Functional::Traits::use_
Definition:
utilities.h:33
Gaudi::Functional::details::Producer
Definition:
Producer.h:22
ProduceIntView::operator()
std::vector< int > operator()() const override
Definition:
AnyViewAlgorithm.cpp:38
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition:
MsgStream.h:198
ProduceStringView
Definition:
AnyViewAlgorithm.cpp:25
ProduceIntView
Definition:
AnyViewAlgorithm.cpp:34
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition:
__init__.py:1
Containers::vector
struct GAUDI_API vector
Parametrisation class for vector-like implementation.
Definition:
KeyedObjectManager.h:31
ConditionsStallTest.name
name
Definition:
ConditionsStallTest.py:77
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition:
PluginServiceV1.h:45
Gaudi::Functional::Traits::BaseClass_t
Definition:
utilities.h:37
ProduceStringView::operator()
std::string operator()() const override
Definition:
AnyViewAlgorithm.cpp:29
GetStringView
Definition:
AnyViewAlgorithm.cpp:46
DataObjectHandle.h
GetIntView::GetIntView
GetIntView(const std::string &name, ISvcLocator *svcLoc)
Definition:
AnyViewAlgorithm.cpp:55
Gaudi::Functional::details::out
OptOut && out
Definition:
details.h:179
GaudiTestSuite
src
AnyData
AnyViewAlgorithm.cpp
Generated on Wed Aug 13 2025 09:05:05 for The Gaudi Framework by
1.8.18