From c1d2012fd0e827b5652ee0d0e3b35044f68daad4 Mon Sep 17 00:00:00 2001 From: Atlas-Software Librarian <Atlas-Software.Librarian@cern.ch> Date: Fri, 8 Apr 2016 16:42:10 +0200 Subject: [PATCH] 'CMakeLists.txt' (StoreGateBindings-00-06-17) 2015-08-11 sss <snyder@bnl.gov> 2015-07-20 scott snyder <snyder@bnl.gov> 2015-07-16 scott snyder <snyder@bnl.gov> * Tagging StoreGateBindings-00-06-15. * src/SgPyDataModel.h: Add override keywords. Add tinfo(). * src/PyThinning.cxx: deep_proxy -> proxy. --- Control/StoreGateBindings/CMakeLists.txt | 37 +++++++++++++++++++ Control/StoreGateBindings/src/PyThinning.cxx | 8 ++-- Control/StoreGateBindings/src/SgPyDataModel.h | 24 ++++++++---- 3 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 Control/StoreGateBindings/CMakeLists.txt diff --git a/Control/StoreGateBindings/CMakeLists.txt b/Control/StoreGateBindings/CMakeLists.txt new file mode 100644 index 00000000000..0cef278f03c --- /dev/null +++ b/Control/StoreGateBindings/CMakeLists.txt @@ -0,0 +1,37 @@ +################################################################################ +# Package: StoreGateBindings +################################################################################ + +# Declare the package name: +atlas_subdir( StoreGateBindings ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PRIVATE + Control/AthenaKernel + Control/CxxUtils + Control/DataModelRoot + Control/SGTools + Control/StoreGate + GaudiKernel ) + +# External dependencies: +find_package( PythonLibs ) +find_package( ROOT COMPONENTS PyROOT Core Tree MathCore Hist RIO pthread ) + +# Component(s) in the package: +atlas_add_library( StoreGateBindings + src/*.cxx + PUBLIC_HEADERS StoreGateBindings + PRIVATE_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES StoreGateLib SGtests + PRIVATE_LINK_LIBRARIES ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel CxxUtils DataModelRoot SGTools GaudiKernel ) + +atlas_add_dictionary( StoreGateBindingsDict + src/StoreGateBindingsDict.h + StoreGateBindings/selection.xml + INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${PYTHON_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel CxxUtils DataModelRoot SGTools StoreGateLib SGtests GaudiKernel StoreGateBindings ) + +# Install files from the package: +atlas_install_python_modules( python/*.py ) + diff --git a/Control/StoreGateBindings/src/PyThinning.cxx b/Control/StoreGateBindings/src/PyThinning.cxx index fa4ea54c42a..099515b30de 100755 --- a/Control/StoreGateBindings/src/PyThinning.cxx +++ b/Control/StoreGateBindings/src/PyThinning.cxx @@ -221,10 +221,10 @@ AthenaInternal::thinContainer( IThinningSvc* self, // Filter_t& filter = // *(Filter_t*)ObjectProxy_ASVOIDPTR(filter); - SG::DataProxy* proxy = self->deep_proxy( ObjectProxy_ASVOIDPTR(container) ); + SG::DataProxy* proxy = self->proxy( ObjectProxy_ASVOIDPTR(container) ); if ( !proxy ) { PyErr_SetString( PyExc_RuntimeError, - "could not manage to find a deep_proxy" ); + "could not manage to find a proxy" ); return 0; } @@ -290,10 +290,10 @@ AthenaInternal::thinIdxContainer( IThinningSvc* self, return 0; } - SG::DataProxy* proxy = self->deep_proxy( ObjectProxy_ASVOIDPTR(container) ); + SG::DataProxy* proxy = self->proxy( ObjectProxy_ASVOIDPTR(container) ); if ( 0 == proxy ) { PyErr_SetString( PyExc_RuntimeError, - "could not manage to find a deep_proxy" ); + "could not manage to find a proxy" ); return 0; } return self->index( proxy, idx ); diff --git a/Control/StoreGateBindings/src/SgPyDataModel.h b/Control/StoreGateBindings/src/SgPyDataModel.h index 156bbf78141..027c0ea42c7 100644 --- a/Control/StoreGateBindings/src/SgPyDataModel.h +++ b/Control/StoreGateBindings/src/SgPyDataModel.h @@ -95,11 +95,11 @@ namespace SG { /** * @brief Destructor. */ - ~PyDataBucket() { Py_DECREF( m_pyObj ); } + virtual ~PyDataBucket() override { Py_DECREF( m_pyObj ); } /** * @brief Return the held object. */ - virtual void* object() + virtual void* object() override { return m_clid != PyCLID ? ObjectProxy_ASVOIDPTR(m_pyObj) @@ -116,7 +116,7 @@ namespace SG { * @param isConst True if the object being converted is regarded as const. */ virtual void* cast (CLID clid, IRegisterTransient* itr = 0, - bool isConst = true) const; + bool isConst = true) const override; /** @@ -129,23 +129,31 @@ namespace SG { */ virtual void* cast (const std::type_info& tinfo, IRegisterTransient* itr = 0, - bool isConst = true) const; + bool isConst = true) const override; /** * @brief Retrieve reference to class definition structure */ - virtual const CLID& clID() const { return m_clid; } + virtual const CLID& clID() const override { return m_clid; } + + /** + * @brief Return the @c type_info for the stored object. + */ + virtual const std::type_info& tinfo() const override + { + return m_bib->typeinfo(); + } /** * @brief Return a new @c DataBucket whose payload has been cloned from the * original one. */ - virtual SG::PyDataBucket* clone() const; + virtual SG::PyDataBucket* clone() const override; /** * @brief Give up ownership of the @c DataBucket contents. */ - virtual void relinquish() + virtual void relinquish() override { Py_DECREF( m_pyObj ); } @@ -153,7 +161,7 @@ namespace SG { /** * If the held object derives from @c ILockable, call @lock() on it. */ - virtual void lock(); + virtual void lock() override; private: /// Pointer to the held pyroot object (or 'regular' PyObject) -- GitLab