#include <PyAthenaTool.h>
Definition at line 30 of file PyAthenaTool.h.
◆ Tool() [1/2]
Tool::Tool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~Tool()
◆ Tool() [2/2]
◆ finalize()
StatusCode Tool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode Tool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ self()
virtual PyObject* PyAthena::Tool::self |
( |
| ) |
|
|
inlineoverridevirtual |
return associated python object.
BORROWED reference.
Definition at line 64 of file PyAthenaTool.h.
◆ setPyAttr()
bool Tool::setPyAttr |
( |
PyObject * |
pyobj | ) |
|
|
overrideprotectedvirtual |
attach the C++ component to its python cousin
Definition at line 108 of file PyAthenaTool.cxx.
112 PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
117 pyobj = TPython::CPPInstance_FromVoidPtr ((
void*)
this,
"PyAthena::Tool");
119 (
"could not dyncast component [" <<
name() <<
"] to a python "
120 <<
"object of type [" << this->
typeName() <<
"] (probably a missing "
121 <<
"dictionary)" <<
endmsg
122 <<
"fallback to [PyAthena::Tool]...");
127 <<
name() <<
"] to a pyobject of type ["
128 << this->
typeName() <<
"] (missing reflex dict ?)");
130 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", pyobj) ) {
133 (
"Could not attach C++ handle [" <<
name() <<
"] to its python "
135 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", Py_None) ) {
138 (
"could not attach a dummy C++ handle [" <<
name() <<
"] to its "
139 <<
"python cousin !");
◆ sysInitialize()
StatusCode Tool::sysInitialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 76 of file PyAthenaTool.cxx.
79 (
"PyAthena::PyComponentMgr/PyComponentMgr",
81 if ( !pyMgr.retrieve().isSuccess() ) {
82 ATH_MSG_ERROR(
"Could not retrieve service [" << pyMgr.typeAndName() <<
"] !!");
83 return StatusCode::FAILURE;
87 m_self = pyMgr->pyObject(
this );
91 return StatusCode::FAILURE;
◆ typeName()
const char * Tool::typeName |
( |
| ) |
const |
|
overridevirtual |
return the std::type_info
name of the underlying py-component This is used by concrete implementations to connect a python component to its C++ counter-part
Definition at line 100 of file PyAthenaTool.cxx.
103 return tname.c_str();
◆ m_self
Pointer to self (from the python world)
Definition at line 80 of file PyAthenaTool.h.
The documentation for this class was generated from the following files: