The Gaudi Framework
master (0ea74171)
Toggle main menu visibility
Loading...
Searching...
No Matches
Algorithms.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 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 "
FloatTool.h
"
12
#include <
Gaudi/Functional/Consumer.h
>
13
#include <
Gaudi/Functional/Producer.h
>
14
#include <
GaudiKernel/MsgStream.h
>
15
16
namespace
Gaudi
{
17
namespace
TestSuite
{
18
using
BaseClass_t
= Gaudi::Functional::Traits::BaseClass_t<::Algorithm>;
19
20
struct
THDataProducer
:
Gaudi::Functional::Producer
<int(), BaseClass_t> {
21
22
THDataProducer
(
const
std::string& name,
ISvcLocator
* svcLoc )
23
: Producer( name, svcLoc, {
"OutputLocation"
,
"/Event/MyInt"
} ) {}
24
25
int
operator()
()
const override
{
26
info() <<
"executing IntDataProducer, storing 7 into "
<< outputLocation() <<
endmsg
;
27
return
7;
28
}
29
};
30
31
DECLARE_COMPONENT
( THDataProducer )
32
33
struct
THDataProducer2
:
Gaudi
::
Functional
::Producer<
float
(),
BaseClass_t
> {
34
35
THDataProducer2
(
const
std::string& name,
ISvcLocator
* svcLoc )
36
: Producer( name, svcLoc, {
"OutputLocation"
,
"/Event/MyFloat"
} ) {}
37
38
float
operator()
()
const override
{
39
info() <<
"executing IntDataProducer, storing 7.0 into "
<< outputLocation() <<
endmsg
;
40
return
7.0;
41
}
42
};
43
44
DECLARE_COMPONENT
( THDataProducer2 )
45
46
struct
THDataConsumer
:
Gaudi
::
Functional
::Consumer<
void
( const
int
& ),
BaseClass_t
> {
47
48
THDataConsumer
(
const
std::string& name,
ISvcLocator
* svcLoc )
49
: Consumer( name, svcLoc, {
"InputLocation"
,
"/Event/MyInt"
} ) {}
50
51
void
operator()
(
const
int
& input )
const override
{
52
info() <<
"executing IntDataConsumer, checking "
<< input <<
" from "
<< inputLocation() <<
" and "
53
<<
m_floatTool
->getFloat() <<
" from FloatTool are matching"
<<
endmsg
;
54
}
55
56
ToolHandle<FloatTool>
m_floatTool
{
this
,
"FloatTool"
,
"Gaudi::TestSuite::FloatTool"
};
57
};
58
59
DECLARE_COMPONENT
( THDataConsumer )
60
}
// namespace TestSuite
61
}
// namespace Gaudi
Consumer.h
FloatTool.h
MsgStream.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition
PluginServiceV1.h:45
Producer.h
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
ToolHandle
Handle to be used in lieu of naked pointers to tools.
Definition
ToolHandle.h:132
Gaudi::Functional
Definition
Consumer.h:15
Gaudi::Functional::Producer
details::Producer< Signature, Traits_, details::isLegacy< Traits_ > > Producer
Definition
Producer.h:37
Gaudi::TestSuite
Definition
ConditionAccessorHolder.h:21
Gaudi::TestSuite::BaseClass_t
Gaudi::Functional::Traits::BaseClass_t< Gaudi::Algorithm > BaseClass_t
Definition
MakeAndConsume.cpp:63
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
Gaudi::TestSuite::THDataConsumer::THDataConsumer
THDataConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition
Algorithms.cpp:48
Gaudi::TestSuite::THDataConsumer::m_floatTool
ToolHandle< FloatTool > m_floatTool
Definition
Algorithms.cpp:56
Gaudi::TestSuite::THDataConsumer::operator()
void operator()(const int &input) const override
Definition
Algorithms.cpp:51
Gaudi::TestSuite::THDataProducer2::operator()
float operator()() const override
Definition
Algorithms.cpp:38
Gaudi::TestSuite::THDataProducer2::THDataProducer2
THDataProducer2(const std::string &name, ISvcLocator *svcLoc)
Definition
Algorithms.cpp:35
Gaudi::TestSuite::THDataProducer::operator()
int operator()() const override
Definition
Algorithms.cpp:25
Gaudi::TestSuite::THDataProducer::THDataProducer
THDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition
Algorithms.cpp:22
GaudiTestSuite
src
ToolHandles
Algorithms.cpp
Generated on
for The Gaudi Framework by
1.17.0