ATLAS Offline Software
PyClassIDSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PYANALYSISCORE_PYCLASSIDSVC_H
6 #define PYANALYSISCORE_PYCLASSIDSVC_H
7 
14 #include "GaudiKernel/IClassIDSvc.h"
15 #include "GaudiKernel/Bootstrap.h"
16 #include "GaudiKernel/ISvcLocator.h"
17 #include "GaudiKernel/MsgStream.h"
19 
21 {
23  static std::string getTypeNameOfID (const unsigned int id)
24  {
25  std::string name;
26  SmartIF<IClassIDSvc> clidSvc{ Gaudi::svcLocator()->service("ClassIDSvc") };
27  CHECK_WITH_CONTEXT( clidSvc.isValid(), "PyClassIDSvc", name );
28 
29  CHECK_WITH_CONTEXT( clidSvc->getTypeNameOfID (id, name), "PyClassIDSvc", name );
30 
31  return name;
32  }
33 };
34 
35 #endif
36 
37 
CHECK_WITH_CONTEXT
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:396
PyClassIDSvc::getTypeNameOfID
static std::string getTypeNameOfID(const unsigned int id)
get type name associated with clID (if any)
Definition: PyClassIDSvc.h:23
PyClassIDSvc
A wrapper for ClassIDSvc.
Definition: PyClassIDSvc.h:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
errorcheck.h
Helpers for checking error return status codes and reporting errors.