Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/ServiceHandle.h"
20 TClass*
cls =
nullptr;
23 const char*
s = PyUnicode_AsUTF8AndSize (attr,
nullptr);
26 if (strncmp (
s,
"ROOT.", 5) == 0)
28 if (strncmp (
s,
"cppyy.gbl.", 10) == 0)
30 cls = TClass::GetClass (
s);
72 if ( o ) {
return o; }
78 PyErr_Format( PyExc_TypeError,
"actual type of CLID %lu unknown",
79 (
long unsigned int)clid );
86 TClass*
cls = TClass::GetClass (pytpstr.c_str());
88 PyErr_Format( PyExc_TypeError,
"Can't find TClass for `%s'",
92 TClass* act_class =
cls->GetActualClass (
address);
95 if (
value && TPython::CPPInstance_Check(
value) ) {
115 if ( tcls && (
tinfo == *(tcls->GetTypeInfo())) ) {
123 if ( o ) {
return o; }
128 TClass* clsnew = TClass::GetClass (
tinfo);
131 ( PyExc_RuntimeError,
132 "SG::PyDataBucket::cast() can't find TClass" );
135 TClass* act_class = clsnew->GetActualClass (
address);
139 if (
value && TPython::CPPInstance_Check(
value) ) {
151 if (!PyObject_HasAttrString (
m_pyObj,
"lock"))
155 if (PyCallable_Check (
lock)) {
172 if ( !
svc.retrieve().isSuccess()) {
173 throw std::runtime_error
174 (
"SG::PyProxyMgr: Could not retrieve ClassIDSvc");
181 if ( !
svc.retrieve().isSuccess()) {
182 throw std::runtime_error
183 (
"SG::PyProxyMgr: Could not retrieve AthDictLoaderSvc");
193 if (_PyThreadState_UncheckedGet())
204 delete i->second;
i->second = 0;
JetConstituentVector::iterator iterator
CPyCppyy::PyException PyException
Interface for registering a transient object in t2p map.
virtual const std::type_info & tinfo() const override
Return the type_info for the stored object.
virtual void lock() override
If the held object derives from ILockable, call lock() on it.
const SG::BaseInfoBase * m_bib
pointer to the SG::BaseInfoBase structure holding the converter functions for objects held by StoreGa...
std::string find(const std::string &s)
return a remapped string
CLID m_clid
The class ID of the wrapped object.
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
IDictLoaderSvc * m_dictSvc
PyObject * m_aliases
a dictionary of "typedef'ed typename" -> "typename"
PyObject * m_pyObj
Pointer to the held pyroot object (or 'regular' PyObject)
void * cast(void *p, CLID clid) const
Cast to a base pointer.
#define CPPInstance_ASVOIDPTR(o)
virtual void * cast(CLID clid, IRegisterTransient *itr=0, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
TClass * objectIsA(PyObject *obj)
AthROOTErrorHandlerSvc * svc
uint32_t CLID
The Class ID type.
PyObject * importDictAliases()
import the dictionary of aliases from a well known location
PyObject * m_clids
a dictionary of 'typename' -> CLID (and reverse CLID->'typename')
std::pair< std::string, bool > PyGetString(PyObject *s)
Convert python string -> C++ string for py2 and py3.
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
PyObject * pytp(PyObject *clid)
returns a borrowed reference
The non-template portion of the BaseInfo implementation.
static PyProxyMgr & instance()
Define macros for attributes used to control the static checker.
PyDataBucket(PyObject *obj, CLID clid)
Constructor.