ATLAS Offline Software
AsgService.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 
9 
10 // Local include(s):
11 #include "AsgServices/AsgService.h"
12 
13 // System include(s):
14 #include <iostream>
15 
16 namespace asg
17 {
19  AsgService( const std::string& name,
20  ISvcLocator* pSvcLocator )
22 #ifndef XAOD_STANDALONE
23  name, pSvcLocator
24 #else // not XAOD_STANDALONE
25  name
26 #endif // not XAOD_STANDALONE
27  )
28  {
29  (void) pSvcLocator;
30  }
31 
33  initialize ()
34  {
35  return StatusCode::SUCCESS;
36  }
37 
38 
39 
41  finalize ()
42  {
43  return StatusCode::SUCCESS;
44  }
45 
46 
47 
48  void AsgService::print() const
49  {
50  ATH_MSG_INFO( "AsgService " << name() << " @ " << this );
51  return;
52  }
53 
54 
55 
56 #ifndef XAOD_STANDALONE
58  queryInterface (const InterfaceID& riid, void **ppvi)
59  {
60  for (const auto& interface : m_interfaces)
61  {
62  if (riid == interface.first())
63  {
64  *ppvi = interface.second (this);
65  addRef();
66  return StatusCode::SUCCESS;
67  }
68  }
69  return AsgServiceBase::queryInterface (riid, ppvi);
70  }
71 #endif
72 
73 } // namespace asg
asg::AsgService::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvi)
query interface for gaudi
Definition: AsgService.cxx:58
AsgService.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
asg::AsgService::finalize
virtual StatusCode finalize()
Definition: AsgService.cxx:41
asg
Definition: DataHandleTestTool.h:28
asg::AsgService::m_interfaces
std::vector< std::pair< const InterfaceID &(*)(), void *(*)(AsgService *)> > m_interfaces
list of interfaces we have
Definition: AsgService.h:68
asg::AsgService::print
virtual void print() const
Print the state of the service.
Definition: AsgService.cxx:48
asg::AsgService::initialize
virtual StatusCode initialize()
set up/tear down functions
Definition: AsgService.cxx:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
asg::AsgService::AsgService
AsgService(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AsgService.cxx:19