ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaPython
src
PyComponentMgr.h
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// PyComponentMgr.h
8
// Header file for class PyAthena::PyComponentMgr
9
// Author: S.Binet<binet@cern.ch>
11
#ifndef ATHENAPYTHON_PYCOMPONENTMGR_H
12
#define ATHENAPYTHON_PYCOMPONENTMGR_H
13
14
// STL includes
15
#include <string>
16
#include <unordered_map>
17
18
// FrameWork includes
19
#include "GaudiKernel/ServiceHandle.h"
20
#include "
AthenaBaseComps/AthService.h
"
21
#include "
CxxUtils/checker_macros.h
"
22
23
// AthenaPython includes
24
#include "
AthenaPython/IPyComponentMgr.h
"
25
26
// Forward declaration
27
class
ISvcLocator;
28
template
<
class
TYPE>
class
SvcFactory
;
29
struct
_object;
30
typedef
_object
PyObject
;
31
class
IPyComponent
;
32
33
namespace
PyAthena
{
34
35
class
ATLAS_NOT_THREAD_SAFE
PyComponentMgr
36
:
public
extends<AthService, IPyComponentMgr>
37
{
38
friend
class
SvcFactory
<
PyAthena
::
PyComponentMgr
>;
39
41
// Public methods:
43
public
:
44
45
// Copy constructor:
46
48
PyComponentMgr
( const std::string& name, ISvcLocator* pSvcLocator );
49
51
virtual
~
PyComponentMgr
();
52
54
55
virtual
StatusCode
initialize
() override;
56
virtual
StatusCode
finalize
() override;
58
63
virtual
PyObject
*
pyObject
( IPyComponent* component ) override;
64
65
66
private
:
67
68
PyComponentMgr
() = delete;
69
70
71
private
:
72
82
PyObject
*
m_dict
;
83
84
typedef std::unordered_map<std::string, PyObject*>
PyComponents_t
;
90
PyComponents_t
m_components
;
91
};
92
93
}
//> namespace PyAthena
94
95
#endif
//> ATHENAPYTHON_PYATHENA_PYCOMPONENTMGR_H
AthService.h
IPyComponentMgr.h
PyObject
_object PyObject
Definition
IPyComponent.h:27
checker_macros.h
Define macros for attributes used to control the static checker.
IPyComponent
Definition
IPyComponent.h:31
PyAthena::PyComponentMgr::m_components
PyComponents_t m_components
A fast look-up hash-map for python components { 'name' : PyObject* } PyObject* is NULL if not yet ins...
Definition
PyComponentMgr.h:90
PyAthena::PyComponentMgr::finalize
virtual StatusCode finalize() override
Definition
PyComponentMgr.cxx:198
PyAthena::PyComponentMgr::initialize
virtual StatusCode initialize() override
Gaudi Service Implementation.
Definition
PyComponentMgr.cxx:116
PyAthena::PyComponentMgr::pyObject
virtual PyObject * pyObject(IPyComponent *component) override
Retrieve a python object from the python world.
Definition
PyComponentMgr.cxx:206
PyAthena::PyComponentMgr::PyComponents_t
std::unordered_map< std::string, PyObject * > PyComponents_t
Definition
PyComponentMgr.h:84
PyAthena::PyComponentMgr::PyComponentMgr
PyComponentMgr(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition
PyComponentMgr.cxx:72
PyAthena::PyComponentMgr::m_dict
PyObject * m_dict
The dictionary of python components' description It should be of the form: { 'name' : { 'package' : "...
Definition
PyComponentMgr.h:82
SvcFactory
Definition
AthCnvSvc.h:28
PyAthena
Definition
IPyComponent.h:28
PyAthena::ATLAS_NOT_THREAD_SAFE
StatusCode callPyMethod ATLAS_NOT_THREAD_SAFE(PyObject *self, const char *method, PyObject *arg=nullptr)
call the python method
Generated on
for ATLAS Offline Software by
1.17.0