The Gaudi Framework
master (6507eef1)
Toggle main menu visibility
Loading...
Searching...
No Matches
UseSvcWithoutInterface.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 2025 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/Algorithm.h
>
12
#include <
Gaudi/Functional/Consumer.h
>
13
#include <
GaudiKernel/Service.h
>
14
15
namespace
Gaudi::TestSuite
{
16
class
SvcWithoutInterface
:
public
Service
{
17
public
:
18
using
Service::Service
;
19
20
StatusCode
initialize
()
override
{
21
return
Service::initialize
().
andThen
( [
this
] {
info
() <<
"initialized"
<<
endmsg
; } );
22
}
23
24
void
doSomething
()
const
{
info
() <<
"doing something"
<<
endmsg
; }
25
};
26
DECLARE_COMPONENT
( SvcWithoutInterface )
27
28
class
UseSvcWithoutInterface
: public
Gaudi
::
Functional
::Consumer<
void
()> {
29
public
:
30
UseSvcWithoutInterface
(
const
std::string& name,
ISvcLocator
* svcLoc )
31
: Consumer( name, svcLoc ),
m_svc
(
"Gaudi::TestSuite::SvcWithoutInterface/SvcWithoutInterface"
, name ) {}
32
StatusCode
initialize
()
override
{
33
return
Algorithm::initialize
()
34
.
andThen
( [
this
] { info() <<
"initializing..."
<<
endmsg
; } )
35
.andThen( [
this
] {
m_svc
->doSomething(); } )
36
.andThen( [
this
] { info() <<
"initialized"
<<
endmsg
; } );
37
}
38
void
operator()
()
const override
{}
39
40
private
:
41
// Add your member variables here
42
ServiceHandle<SvcWithoutInterface>
m_svc
;
43
};
44
DECLARE_COMPONENT
(
UseSvcWithoutInterface
)
45
}
// namespace Gaudi::TestSuite
Consumer.h
Algorithm.h
class
#define class
Definition
HistogramPersistencySvc.cpp:54
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
Service.h
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition
CommonMessaging.h:115
Gaudi::Algorithm::initialize
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition
Algorithm.h:175
Gaudi::TestSuite::SvcWithoutInterface
Definition
UseSvcWithoutInterface.cpp:16
Gaudi::TestSuite::SvcWithoutInterface::doSomething
void doSomething() const
Definition
UseSvcWithoutInterface.cpp:24
Gaudi::TestSuite::SvcWithoutInterface::initialize
StatusCode initialize() override
Definition
UseSvcWithoutInterface.cpp:20
Gaudi::TestSuite::SvcWithoutInterface::Service
Service(std::string name, ISvcLocator *svcloc)
Standard Constructor.
Definition
Service.cpp:340
Gaudi::TestSuite::UseSvcWithoutInterface
Definition
UseSvcWithoutInterface.cpp:28
Gaudi::TestSuite::UseSvcWithoutInterface::UseSvcWithoutInterface
UseSvcWithoutInterface(const std::string &name, ISvcLocator *svcLoc)
Definition
UseSvcWithoutInterface.cpp:30
Gaudi::TestSuite::UseSvcWithoutInterface::operator()
void operator()() const override
Definition
UseSvcWithoutInterface.cpp:38
Gaudi::TestSuite::UseSvcWithoutInterface::initialize
StatusCode initialize() override
Definition
UseSvcWithoutInterface.cpp:32
Gaudi::TestSuite::UseSvcWithoutInterface::m_svc
ServiceHandle< SvcWithoutInterface > m_svc
Definition
UseSvcWithoutInterface.cpp:42
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
ServiceHandle
Handle to be used in lieu of naked pointers to services.
Definition
ServiceHandle.h:38
Service::initialize
StatusCode initialize() override
Definition
Service.cpp:118
Service::Service
Service(std::string name, ISvcLocator *svcloc)
Standard Constructor.
Definition
Service.cpp:340
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::andThen
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
Definition
StatusCode.h:151
Gaudi::Functional
Definition
Consumer.h:15
Gaudi::TestSuite
Definition
ConditionAccessorHolder.h:21
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
GaudiTestSuite
src
UseSvcWithoutInterface.cpp
Generated on
for The Gaudi Framework by
1.17.0