ATLAS Offline Software
Loading...
Searching...
No Matches
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"
22
23// AthenaPython includes
25
26// Forward declaration
27class ISvcLocator;
28template <class TYPE> class SvcFactory;
29struct _object;
30typedef _object PyObject;
31class IPyComponent;
32
33namespace PyAthena {
34
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
66private:
67
68 PyComponentMgr() = delete;
69
70
71 private:
72
83
84 typedef std::unordered_map<std::string, PyObject*> PyComponents_t;
91};
92
93} //> namespace PyAthena
94
95#endif //> ATHENAPYTHON_PYATHENA_PYCOMPONENTMGR_H
_object PyObject
Define macros for attributes used to control the static checker.
PyComponents_t m_components
A fast look-up hash-map for python components { 'name' : PyObject* } PyObject* is NULL if not yet ins...
virtual StatusCode finalize() override
virtual StatusCode initialize() override
Gaudi Service Implementation.
virtual PyObject * pyObject(IPyComponent *component) override
Retrieve a python object from the python world.
std::unordered_map< std::string, PyObject * > PyComponents_t
PyComponentMgr(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
PyObject * m_dict
The dictionary of python components' description It should be of the form: { 'name' : { 'package' : "...
StatusCode callPyMethod ATLAS_NOT_THREAD_SAFE(PyObject *self, const char *method, PyObject *arg=nullptr)
call the python method