ATLAS Offline Software
PyAthenaUtils.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // PyAthenaUtils.h
8 // Header file for various PyAthena helpers and utils
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef ATHENAPYTHON_PYATHENAUTILS_H
12 #define ATHENAPYTHON_PYATHENAUTILS_H
13 
14 // STL includes
15 
16 // FrameWork includes
17 #include "GaudiKernel/StatusCode.h"
19 
20 // Forward declaration
21 class InterfaceID;
22 class StatusCode;
23 // Python
24 struct _object;
25 typedef _object PyObject;
26 
27 namespace PyAthena {
28 
32  std::string repr (PyObject* o);
33 
37  std::string str (PyObject* o);
38 
41  const char* method,
42  PyObject* arg = nullptr );
43 
45  StatusCode queryInterface ATLAS_NOT_THREAD_SAFE ( PyObject* self,
46  const InterfaceID& riid,
47  void** ppvInterface );
48 
50  void pyAudit ATLAS_NOT_THREAD_SAFE ( PyObject* self,
51  const char* method,
52  const char* evt, const char* component );
53 
55  void pyAudit ATLAS_NOT_THREAD_SAFE ( PyObject* self,
56  const char* method,
57  const char* evt, const char* component,
58  const StatusCode& sc );
59 
62  [[noreturn]]
63  void throw_py_exception (bool display = true);
64 
65 }
66 
67 #endif // ATHENAPYTHON_PYATHENAUTILS_H
RunTileTBRec.method
method
Definition: RunTileTBRec.py:73
PyAthena::throw_py_exception
void throw_py_exception(bool display=true)
helper function to capture the boilerplate code for user friendly stack trace display
Definition: PyAthenaUtils.cxx:135
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
PyAthena::str
std::string str(PyObject *o)
returns the string representation of a python object equivalent of calling str(o) in python
Definition: PyAthenaUtils.cxx:121
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PyAthena::repr
std::string repr(PyObject *o)
returns the string representation of a python object equivalent of calling repr(o) in python
Definition: PyAthenaUtils.cxx:106
pyroot.display
display
Definition: pyroot.py:44
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
PyAthena
Definition: IPyComponent.h:28
PyObject
_object PyObject
Definition: PyAthenaUtils.h:24
checker_macros.h
Define macros for attributes used to control the static checker.
PyObject
_object PyObject
Definition: IPyComponent.h:26
PyAthena::ATLAS_NOT_THREAD_SAFE
StatusCode callPyMethod ATLAS_NOT_THREAD_SAFE(PyObject *self, const char *method, PyObject *arg=nullptr)
call the python method