From f89531eb10e4c65031cd429a78a9c2c8fa6687ef Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Tue, 10 Sep 2024 01:33:52 +0200 Subject: [PATCH 1/5] PersistentDataModel: Lazy token copying. TokenAddress needs a writable copy of the token in order to do input. Rather than making the copy when the TokenAddress is created, defer it until we're actually doing the read. This can speed up some analysis use cases where only a small fraction of the data is read. --- .../PersistentDataModel/TokenAddress.h | 31 ++++++++++++++----- .../PersistentDataModel/src/DataHeader.cxx | 5 ++- .../PersistentDataModel/src/TokenAddress.cxx | 14 +++++++-- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/Database/PersistentDataModel/PersistentDataModel/TokenAddress.h b/Database/PersistentDataModel/PersistentDataModel/TokenAddress.h index 2c8edefd6f27..e1146091f11b 100644 --- a/Database/PersistentDataModel/PersistentDataModel/TokenAddress.h +++ b/Database/PersistentDataModel/PersistentDataModel/TokenAddress.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef PERSISTENTDATAMODEL_TOKENADDRESS_H @@ -36,23 +36,40 @@ public: const std::string& p1 = "", const std::string& p2 = "", unsigned long ip = 0, - Token* pt = 0) : GenericAddress(svc, clid, p1, p2, ip), m_token(pt) { + const Token* pt = 0) : GenericAddress(svc, clid, p1, p2, ip), m_token(pt) { } - TokenAddress(const GenericAddress& genAddr, Token* pt = 0) : GenericAddress(genAddr), m_token(pt) { + TokenAddress(long svc, + const CLID& clid, + const std::string& p1, + const std::string& p2, + unsigned long ip, + std::unique_ptr<Token> pt) : + GenericAddress(svc, clid, p1, p2, ip), + m_ownedToken (std::move (pt)), + m_token(m_ownedToken.get()) { + } + TokenAddress(const GenericAddress& genAddr, const Token* pt = 0) : GenericAddress(genAddr), m_token(pt) { + } + TokenAddress(const GenericAddress& genAddr, + std::unique_ptr<Token> pt) : + GenericAddress(genAddr), + m_ownedToken (std::move(pt)), + m_token(m_ownedToken.get()) { } virtual ~TokenAddress() = default; - Token* getToken() { return m_token.get(); } - const Token* getToken() const { return m_token.get(); } - void setToken(Token* token); + Token* getToken(); + const Token* getToken() const { return m_token; } + void setToken(std::unique_ptr<Token> token); virtual const std::string* par() const override; private: struct Pars { std::string par[3]; }; - std::unique_ptr<Token> m_token; + std::unique_ptr<Token> m_ownedToken; + const Token* m_token = nullptr; /// The parameter array. We create it lazily in par(). CxxUtils::CachedValue<Pars> m_par; }; diff --git a/Database/PersistentDataModel/src/DataHeader.cxx b/Database/PersistentDataModel/src/DataHeader.cxx index 3a79ebdf0931..6364c3cda3be 100755 --- a/Database/PersistentDataModel/src/DataHeader.cxx +++ b/Database/PersistentDataModel/src/DataHeader.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @file DataHeader.cxx @@ -148,8 +148,7 @@ SG::TransientAddress* DataHeaderElement::getAddress(unsigned long contextId) con SG::TransientAddress* DataHeaderElement::getAddress(const std::string& key, unsigned long contextId) const { CLID primaryClID = getPrimaryClassID(); - Token* token = new Token(&m_token); - TokenAddress* tokAdd = new TokenAddress(this->getStorageType(), primaryClID, "", m_key, contextId , token); + TokenAddress* tokAdd = new TokenAddress(this->getStorageType(), primaryClID, "", m_key, contextId , &m_token); SG::TransientAddress* sgAddress = new SG::TransientAddress(primaryClID, key, tokAdd); for (std::set<CLID>::const_iterator iter = m_clids.begin(), last = m_clids.end(); iter != last; ++iter) { diff --git a/Database/PersistentDataModel/src/TokenAddress.cxx b/Database/PersistentDataModel/src/TokenAddress.cxx index 7dfac75c64e9..7f1d520ad6f4 100644 --- a/Database/PersistentDataModel/src/TokenAddress.cxx +++ b/Database/PersistentDataModel/src/TokenAddress.cxx @@ -6,11 +6,21 @@ #include "PersistentDataModel/TokenAddress.h" -void TokenAddress::setToken(Token* token) { - m_token = std::unique_ptr<Token> (token); +void TokenAddress::setToken(std::unique_ptr<Token> token) { + m_ownedToken = std::move (token); + m_token = m_ownedToken.get(); m_par.reset(); } +Token* TokenAddress::getToken() +{ + if (!m_ownedToken && m_token) { + m_ownedToken = std::make_unique<Token> (m_token); + m_token = m_ownedToken.get(); + } + return m_ownedToken.get(); +} + const std::string* TokenAddress::par() const { if (!m_par.isValid()) { -- GitLab From 53513f45cf7789a8dfc8512aba6ae2d2fa9d6357 Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Tue, 10 Sep 2024 01:35:19 +0200 Subject: [PATCH 2/5] PersistentDataModelAthenaPool: Lazy token copying. TokenAddress needs a writable copy of the token in order to do input. Rather than making the copy when the TokenAddress is created, defer it until we're actually doing the read. This can speed up some analysis use cases where only a small fraction of the data is read. --- Database/PersistentDataModelAthenaPool/src/DataHeaderCnv.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Database/PersistentDataModelAthenaPool/src/DataHeaderCnv.cxx b/Database/PersistentDataModelAthenaPool/src/DataHeaderCnv.cxx index 96d101240580..cf3f0accd47f 100755 --- a/Database/PersistentDataModelAthenaPool/src/DataHeaderCnv.cxx +++ b/Database/PersistentDataModelAthenaPool/src/DataHeaderCnv.cxx @@ -316,7 +316,7 @@ StatusCode DataHeaderCnv::DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pO return(StatusCode::FAILURE); } // Queue the DH for write - Token* dh_token = m_athenaPoolCnvSvc->registerForWrite(&dh_placement, persObj, m_classDesc); + std::unique_ptr<Token> dh_token (m_athenaPoolCnvSvc->registerForWrite(&dh_placement, persObj, m_classDesc)); if (dh_token == nullptr) { ATH_MSG_FATAL("Failed to write DataHeader"); return(StatusCode::FAILURE); @@ -383,9 +383,8 @@ StatusCode DataHeaderCnv::DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pO } TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddr); if (tokAddr != nullptr) { - tokAddr->setToken(dh_token); dh_token = nullptr; + tokAddr->setToken(std::move(dh_token)); } else { - delete dh_token; dh_token = nullptr; return(StatusCode::FAILURE); } return(StatusCode::SUCCESS); -- GitLab From 6dd1964b8f41e8bb7aaba66603ab2e50d0e3c9ad Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Tue, 10 Sep 2024 01:36:17 +0200 Subject: [PATCH 3/5] TPTools: Lazy token copying. TokenAddress needs a writable copy of the token in order to do input. Rather than making the copy when the TokenAddress is created, defer it until we're actually doing the read. This can speed up some analysis use cases where only a small fraction of the data is read. --- Database/TPTools/CMakeLists.txt | 4 ++-- Database/TPTools/TPTools/AthenaConverterTLPExtension.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Database/TPTools/CMakeLists.txt b/Database/TPTools/CMakeLists.txt index a4ae1a1b943d..1575d6152a95 100644 --- a/Database/TPTools/CMakeLists.txt +++ b/Database/TPTools/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TPTools ) @@ -8,7 +8,7 @@ atlas_add_library( TPTools src/*.cxx PUBLIC_HEADERS TPTools LINK_LIBRARIES AthenaKernel AthenaPoolUtilities CxxUtils GaudiKernel - PRIVATE_LINK_LIBRARIES PersistentDataModel ) + PersistentDataModel ) atlas_add_dictionary( TPToolsDict TPTools/TPToolsDict.h diff --git a/Database/TPTools/TPTools/AthenaConverterTLPExtension.h b/Database/TPTools/TPTools/AthenaConverterTLPExtension.h index 732c0dc34604..2a95794f0100 100644 --- a/Database/TPTools/TPTools/AthenaConverterTLPExtension.h +++ b/Database/TPTools/TPTools/AthenaConverterTLPExtension.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef ATHENACONVERTER_TP_EXT_H @@ -10,9 +10,9 @@ * @author Marcin.Nowak@cern.ch **/ +#include "PersistentDataModel/Token.h" class TopLevelTPCnvBase; class IConverter; -class Token; #include <vector> #include <string> #include <map> @@ -55,9 +55,9 @@ public: Called from the EXTENDED (principal) Athena converter Implemented only in EXTENDING Athena converters @param key [in] StoreGet object key (in APR used to determine storage container placement) - Retursn Token for the written object + Returns Token for the written object */ - virtual const Token* writeObject( const std::string& /*key*/, const std::string& /*output*/ ) { return 0; } + virtual std::unique_ptr<const Token> writeObject( const std::string& /*key*/, const std::string& /*output*/ ) { return 0; } /** Read the extending object @param token [IN] Token of the object to read -- GitLab From a11db7ac45a173d82cd7009b0e49257b463f58ad Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Tue, 10 Sep 2024 01:37:10 +0200 Subject: [PATCH 4/5] EventSelectorAthenaPool: Lazy token copying. TokenAddress needs a writable copy of the token in order to do input. Rather than making the copy when the TokenAddress is created, defer it until we're actually doing the read. This can speed up some analysis use cases where only a small fraction of the data is read. --- .../EventSelectorAthenaPool/src/CondProxyProvider.cxx | 4 ++-- .../src/EventSelectorAthenaPool.cxx | 4 ++-- .../EventSelectorAthenaPool/src/StreamSelectorTool.cxx | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/CondProxyProvider.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/CondProxyProvider.cxx index 4fba13a393e2..cce30151c09b 100755 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/CondProxyProvider.cxx +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/CondProxyProvider.cxx @@ -115,9 +115,9 @@ StatusCode CondProxyProvider::preLoadAddresses(StoreID::type storeID, } } SG::VersionedKey myVersKey(name(), verNumber); - Token* token = new Token; + auto token = std::make_unique<Token>(); token->fromString(headerIterator->eventRef().toString()); - TokenAddress* tokenAddr = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", myVersKey, m_contextId, token); + TokenAddress* tokenAddr = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", myVersKey, m_contextId, std::move(token)); if (!detectorStoreSvc->recordAddress(tokenAddr).isSuccess()) { ATH_MSG_ERROR("Cannot record DataHeader."); return(StatusCode::FAILURE); diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx index a1fcaea9d9cb..84ca9df388b7 100644 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx @@ -765,9 +765,9 @@ StatusCode EventSelectorAthenaPool::createAddress(const IEvtSelector::Context& / ATH_MSG_WARNING("Cannot find AthenaAttribute, key = " << m_attrListKey.value()); tokenStr = m_poolCollectionConverter->retrieveToken(m_headerIterator, ""); } - Token* token = new Token; + auto token = std::make_unique<Token>(); token->fromString(tokenStr); - iop = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", "EventSelector", IPoolSvc::kInputStream, token); + iop = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", "EventSelector", IPoolSvc::kInputStream, std::move(token)); return(StatusCode::SUCCESS); } //________________________________________________________________________________ diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/StreamSelectorTool.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/StreamSelectorTool.cxx index d358efebe582..af10d62bf404 100644 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/StreamSelectorTool.cxx +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/StreamSelectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @file StreamSelectorTool.cxx @@ -47,12 +47,12 @@ StatusCode StreamSelectorTool::postNext() const { if (attrList->specification().exists("eventRef")) { // Recording Extension DataHeader const std::string tokenStr = (*attrList)["eventRef"].data<std::string>(); - Token* token = new Token; + auto token = std::make_unique<Token>(); token->fromString(tokenStr); token->setCont("POOLContainer_" + m_streamName.value() + "(DataHeader)"); - IOpaqueAddress* iop = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", m_streamName.value(), IPoolSvc::kInputStream, token); + IOpaqueAddress* iop = new TokenAddress(POOL_StorageType, ClassID_traits<DataHeader>::ID(), "", m_streamName.value(), IPoolSvc::kInputStream, std::move(token)); if (!evtStore()->recordAddress(iop).isSuccess()) { - ATH_MSG_ERROR("Failed to record AthenaAttribute, name = " << token->contID() << ", eventRef = " << tokenStr); + ATH_MSG_ERROR("Failed to record AthenaAttribute, container = " << m_streamName.value() << ", eventRef = " << tokenStr); return(StatusCode::FAILURE); } } -- GitLab From f6ac4c1e0573eed576eadb79c31456beb677e11e Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Tue, 10 Sep 2024 01:38:05 +0200 Subject: [PATCH 5/5] AthenaPoolCnvSvc: Lazy token copying. TokenAddress needs a writable copy of the token in order to do input. Rather than making the copy when the TokenAddress is created, defer it until we're actually doing the read. This can speed up some analysis use cases where only a small fraction of the data is read. --- .../AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc | 7 +++---- .../T_AthenaPoolCoolMultChanCnv.h | 5 +++-- .../T_AthenaPoolCoolMultChanCnv.icc | 10 ++++------ .../AthenaPoolCnvSvc/T_AthenaPoolCustCnv.h | 4 ++-- .../AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc | 11 +++++----- .../T_AthenaPoolCustomCnv.icc | 7 +++---- .../T_AthenaPoolExtendingCnv.h | 20 +++++++++---------- .../T_AthenaPoolExtendingCnv.icc | 6 +++--- .../AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx | 12 +++++------ .../src/AthenaPoolConverter.cxx | 5 ++--- .../test/T_AthenaPoolAuxContainerCnv_test.cxx | 10 +++++++--- .../test/T_AthenaPoolTPCnvCnv_test.cxx | 12 ++++++++--- .../test/T_AthenaPoolViewVectorCnv_test.cxx | 16 ++++++++++----- .../test/T_AthenaPoolxAODCnv_test.cxx | 10 +++++++--- 14 files changed, 75 insertions(+), 60 deletions(-) diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc index d1c6f94e839d..22e3c46de53d 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @file T_AthenaPoolCnvBase.icc @@ -66,7 +66,7 @@ StatusCode T_AthenaPoolCnvBase<T>::DataObjectToPool(IOpaqueAddress* pAddr, DataO return(StatusCode::FAILURE); } Placement placement = setPlacement(pObj->name(), *pAddr->par()); - Token* token = m_athenaPoolCnvSvc->registerForWrite(&placement, obj, m_classDesc); + std::unique_ptr<Token> token (m_athenaPoolCnvSvc->registerForWrite(&placement, obj, m_classDesc)); // Null/empty token means ERROR if (token == nullptr || token->classID() == Guid::null()) { ATH_MSG_ERROR("failed to get Token for class (type/key) " << className << "/" << pObj->name()); @@ -75,9 +75,8 @@ StatusCode T_AthenaPoolCnvBase<T>::DataObjectToPool(IOpaqueAddress* pAddr, DataO // Update IOpaqueAddress for this object. TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddr); if (tokAddr != nullptr) { - tokAddr->setToken(token); token = nullptr; + tokAddr->setToken(std::move(token)); } else { - delete token; token = nullptr; return(StatusCode::FAILURE); } return(StatusCode::SUCCESS); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.h b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.h index e020f19f8b41..93c716f37fe3 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.h +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLCOOLMULTCHANCNV_H @@ -15,6 +15,7 @@ **/ #include "AthenaPoolCnvSvc/T_AthenaPoolCustCnv.h" +#include "PersistentDataModel/Token.h" #include <string> @@ -62,7 +63,7 @@ protected: StatusCode objectToAttrListColl ATLAS_NOT_THREAD_SAFE (COLL_T* obj, IOpaqueAddress*& pAddr, CondAttrListCollection*& attrListColl, - Token*& token); + std::unique_ptr<Token>& token); /// Read in objects from POOL for the tokens stored /// CondAttrListCollection and save the objects in the output diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc index 0e9f3ab2f345..85616f267940 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ /** @file T_AthenaPoolCoolMultChanCnv.icc @@ -118,7 +118,7 @@ StatusCode T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::objectToAttrListColl ATLAS_NOT_THREAD_SAFE (COLL_T* obj, IOpaqueAddress*& pAddr, CondAttrListCollection*& attrListColl, - Token*& implToken) + std::unique_ptr<Token>& implToken) { ATH_MSG_DEBUG("Creating a CondAttrListCollection from a collection"); @@ -144,13 +144,13 @@ T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::objectToAttrListColl ATLAS_ // Loop over objects in COLL_T* typename COLL_T::chan_const_iterator itChan = obj->chan_begin(); typename COLL_T::iov_const_iterator itIOV = obj->iov_begin(); - Token* token = 0; std::string token_str; std::lock_guard<AthenaPoolConverter::CallMutex> lock(this->m_conv_mut); for (unsigned int chan = 0; chan < obj->size(); ++chan, ++itChan) { ELEM_T* elem = (*obj)[chan]; // Allow for T/P separation, convert to persistent object ELEM_P* elem_p = this->createPersistent(elem); + std::unique_ptr<Token> token; StatusCode sc = this->objectToPool(elem_p, token, "", *pAddr->par()); if (sc != StatusCode::SUCCESS || !token) { ATH_MSG_ERROR("Unable to write out object"); @@ -171,7 +171,6 @@ T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::objectToAttrListColl ATLAS_ // Save as well in implementation impl->add(token_str); - delete token; token = 0; } // Print out tokens @@ -213,7 +212,7 @@ StatusCode T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::createRep(DataOb return(StatusCode::FAILURE); } CondAttrListCollection* coll = 0; - Token* token = 0; + std::unique_ptr<Token> token; // Ok, because it's just creating a new list. StatusCode sc ATLAS_THREAD_SAFE = objectToAttrListColl(obj, pAddr, coll, token); if (sc != StatusCode::SUCCESS || !token) { @@ -226,7 +225,6 @@ StatusCode T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::createRep(DataOb addr->setAttrListColl(coll); delete pAddr; pAddr = addr; pAddr->addRef(); - delete token; token = 0; ATH_MSG_DEBUG("End createRep"); return(StatusCode::SUCCESS); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.h b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.h index 066b64583d59..8346c815db58 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.h +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLCUSTCNV_H @@ -69,7 +69,7 @@ protected: /// @param token [OUT] POOL token of the persistent representation. /// @param key [IN] StoreGate key (string) - placement hint to generate POOL container name template <class P> - StatusCode objectToPool(P* pObj, Token*& token, const std::string& key, const std::string& output); + StatusCode objectToPool(P* pObj, std::unique_ptr<Token>& token, const std::string& key, const std::string& output); /// Read an object from POOL. /// @param token [IN] POOL token of the persistent representation. diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc index 7d92155e911c..b17cc87e6553 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @file T_AthenaPoolCustCnv.icc @@ -53,7 +53,7 @@ Placement T_AthenaPoolCustCnv<TRANS, PERS>::setPlacementForP(P& /*p*/, const std //__________________________________________________________________________ template <class TRANS, class PERS> template <class P> -StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::objectToPool(P* pObj, Token*& token, const std::string& key, const std::string& output) { +StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::objectToPool(P* pObj, std::unique_ptr<Token>& token, const std::string& key, const std::string& output) { const static std::string className = ClassName<P>::name(); // Check dictionary // Allow for multiple class names @@ -71,7 +71,7 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::objectToPool(P* pObj, Token*& token } } Placement placement = setPlacementForP(*pObj, key, output); - token = this->m_athenaPoolCnvSvc->registerForWrite(&placement, pObj, this->m_classDesc); + token.reset (this->m_athenaPoolCnvSvc->registerForWrite(&placement, pObj, this->m_classDesc)); return(StatusCode::SUCCESS); } //__________________________________________________________________________ @@ -120,7 +120,7 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::DataObjectToPool(IOpaqueAddress* pA ATH_MSG_ERROR("Failed to convert to persistent DataType for class (type/key) " << className << "/" << pObj->name()); return(StatusCode::FAILURE); } - Token* token = nullptr; + std::unique_ptr<Token> token; StatusCode status = objectToPool<PERS>(persObj, token, pObj->name(), *pAddr->par()); // Null/empty token means ERROR if (token == nullptr || token->classID() == Guid::null()) { @@ -130,9 +130,8 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::DataObjectToPool(IOpaqueAddress* pA // Update IOpaqueAddress for this object. TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddr); if (tokAddr != nullptr) { - tokAddr->setToken(token); token = nullptr; + tokAddr->setToken(std::move(token)); } else { - delete token; token = nullptr; return(StatusCode::FAILURE); } return(status); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc index d7e26f7d70f0..9862c84449dc 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @file T_AthenaPoolCustomCnv.icc @@ -53,7 +53,7 @@ StatusCode T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::DataObjectToPool(IOpaqueAd typeid(TRANS), pObj->name()); } - Token* token = nullptr; + std::unique_ptr<Token> token; StatusCode status = this->objectToPool(persObj, token, pObj->name(), *pAddr->par()); // Null/empty token means ERROR if (token == nullptr || token->classID() == Guid::null()) { @@ -72,9 +72,8 @@ StatusCode T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::DataObjectToPool(IOpaqueAd // Update IOpaqueAddress for this object. TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddr); if (tokAddr != nullptr) { - tokAddr->setToken(token); token = nullptr; + tokAddr->setToken(std::move(token)); } else { - delete token; token = nullptr; return(StatusCode::FAILURE); } return(status); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.h b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.h index 076fd2c40df7..28a3598b0f10 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.h +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLEXTENDCNV_H @@ -38,7 +38,7 @@ protected: // ########################################################## /// Return the top level TP converter (which is always used for writing) - virtual TopLevelTPCnvBase* getTopLevelTPCnv() = 0; + virtual TopLevelTPCnvBase* getTopLevelTPCnv() override = 0; /// Read the persistent object from POOL /// @param token [IN] token of the object to read @@ -46,11 +46,11 @@ protected: protected: // redirect to the old API readObjectFromPool() - virtual void readObject( const std::string& token ) { this->readObjectFromPool(token); } + virtual void readObject( const std::string& token ) override { this->readObjectFromPool(token); } /// Write the persistent object to POOL /// @param key [IN] StoreGate key (string) - placement hint to generate POOL container name - virtual const Token* writeObject(const std::string& key, const std::string& output); + virtual std::unique_ptr<const Token> writeObject(const std::string& key, const std::string& output) override; /// return the original AthenaPool converter this one was cloned from /// if not cloned this returns self @@ -58,14 +58,14 @@ protected: virtual BaseType* baseAthenaPoolCnv() { return m_originalExtendingCnv; } /// remember the original converter this one was cloned from - virtual void wasClonedFrom( AthenaConverterTLPExtension *orig_converter ); + virtual void wasClonedFrom( AthenaConverterTLPExtension *orig_converter ) override; /// tells if this converter needs to be cloned /// (true after the converter has been registered once already) - virtual bool needsCloning() const { return m_originalExtendingCnv != 0; } + virtual bool needsCloning() const override { return m_originalExtendingCnv != 0; } /// @copydoc T_AthenaPoolCustomCnv::setToken() - virtual void setToken(const std::string& token); + virtual void setToken(const std::string& token)override; /// @copydoc T_AthenaPoolCustomCnv::poolReadObject() /// deprecated - use poolReadObject(TLPCnv) @@ -83,13 +83,13 @@ protected: /// Get the name of this converter (anything that identifies it). Used for logging /// @return Name of this converter - virtual const std::string name() const; + virtual const std::string name() const override; // hidden away, as they don't make sense for this converter /// no-op - virtual PERS *createPersistent( TRANS *) { return 0; } - virtual TRANS *createTransient() { return 0; } + virtual PERS *createPersistent( TRANS *) override { return 0; } + virtual TRANS *createTransient() override { return 0; } /// pointer to the original Gaudi converter - only this one is registered in the framework and has to be used for all I/O operations BaseType* m_originalExtendingCnv; diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.icc index e2f0a20f252f..c66c465e65ea 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolExtendingCnv.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ @@ -88,10 +88,10 @@ poolReadObject( TopLevelTPCnvBase& tlp_converter ) template <class TRANS, class PERS> -const Token * +std::unique_ptr<const Token> T_AthenaPoolExtendingCnv< TRANS, PERS >::writeObject(const std::string& key, const std::string& output) { - Token* pTok = 0; + std::unique_ptr<Token> pTok; PERS *persObj = reinterpret_cast<PERS*>( getTopLevelTPCnv()->getTLPersObjectAsVoid() ); if( persObj ) { //MN - do not pass SG key - this will put the object in a separate container diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index c532f9707cc7..da93e77c61c4 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -957,9 +957,9 @@ StatusCode AthenaPoolCnvSvc::createAddress(long svcType, return(StatusCode::FAILURE); } } - Token* token = nullptr; + std::unique_ptr<Token> token; if (par[0].compare(0, 3, "SHM") == 0) { - token = new Token(); + token = std::make_unique<Token>(); token->setOid(Token::OID_t(ip[0], ip[1])); token->setAuxString("[PNAME=" + par[2] + "]"); RootType classDesc = RootType::ByNameNoQuiet(par[2]); @@ -984,19 +984,19 @@ StatusCode AthenaPoolCnvSvc::createAddress(long svcType, ATH_MSG_WARNING("Failed to get Address Token: " << addressToken.toString()); return(StatusCode::FAILURE); } - token = new Token(); + token = std::make_unique<Token>(); token->fromString(static_cast<const char*>(buffer)); buffer = nullptr; if (token->classID() == Guid::null()) { - delete token; token = nullptr; + token.reset(); } m_inputStreamingTool->getObject(&buffer, nbytes).ignore(); } else { - token = m_poolSvc->getToken(par[0], par[1], ip[0]); + token.reset (m_poolSvc->getToken(par[0], par[1], ip[0])); } if (token == nullptr) { return(StatusCode::RECOVERABLE); } - refpAddress = new TokenAddress(POOL_StorageType, clid, "", par[1], IPoolSvc::kInputStream, token); + refpAddress = new TokenAddress(POOL_StorageType, clid, "", par[1], IPoolSvc::kInputStream, std::move(token)); return(StatusCode::SUCCESS); } //______________________________________________________________________________ diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx index fb5a5d8d9dd8..098578638163 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx @@ -64,16 +64,15 @@ StatusCode AthenaPoolConverter::createObj(IOpaqueAddress* pAddr, DataObject*& pO bool ownTokAddr = false; if (tokAddr == nullptr || tokAddr->getToken() == nullptr) { ownTokAddr = true; - Token* token = new Token; + auto token = std::make_unique<Token>(); token->fromString(*(pAddr->par())); GenericAddress* genAddr = dynamic_cast<GenericAddress*>(pAddr); if (not genAddr){ ATH_MSG_ERROR("Dynamic cast failed in AthenaPoolConverter::createObj"); //clean up - delete token; return StatusCode::FAILURE; } - tokAddr = new TokenAddress(*genAddr, token); + tokAddr = new TokenAddress(*genAddr, std::move(token)); } if( tokAddr->ipar()[0] > 0 and tokAddr->getToken()->auxString().empty() ) { char text[32]; diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx index 7d1c5c0e4152..b7221d91f525 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolAuxContainerCnv_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @@ -234,9 +234,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc) } testsvc.m_pers2 = &pers2; - Token* token = new Token; + auto token = std::make_unique<Token>(); token->setClassID (Guid (YAuxCont_v2_guid)); - TokenAddress taddr (0, 0, "", "", 0, token); + TokenAddress taddr (0, 0, "", "", 0, std::move(token)); { DataObject* pObj = nullptr; @@ -264,7 +264,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc) } testsvc.m_pers1 = &pers1; + token = std::make_unique<Token>(); token->setClassID (Guid (YAuxCont_v1_guid)); + taddr.setToken (std::move (token)); { DataObject* pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isSuccess()); @@ -281,7 +283,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc) delete pObj; } + token = std::make_unique<Token>(); token->setClassID (Guid ("8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA")); + taddr.setToken (std::move (token)); DataObject* pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isFailure()); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx index b34b662bdb51..64b2c55c260d 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** * @file AthenaPoolCnvSvc/test/T_AthenaPoolTPCnvCnv_test.cxx @@ -147,9 +147,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc) pers2.m_v.push_back (X_p2 (i*50)); testsvc.m_pers2 = &pers2; - Token* token = new Token; + auto token = std::make_unique<Token>(); token->setClassID (Guid (XCont_p2_guid)); - TokenAddress taddr (0, 0, "", "", 0, token); + TokenAddress taddr (0, 0, "", "", 0, std::move(token)); { DataObject* pObj = nullptr; @@ -167,7 +167,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc) pers1.m_v.push_back (X_p1 (i*80)); testsvc.m_pers1 = &pers1; + token = std::make_unique<Token>(); token->setClassID (Guid (XCont_p1_guid)); + taddr.setToken (std::move (token)); { DataObject* pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isSuccess()); @@ -184,7 +186,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc) pers0.push_back (new X (i*11)); testsvc.m_pers0 = &pers0; + token = std::make_unique<Token>(); token->setClassID (Guid (XCont_guid)); + taddr.setToken (std::move (token)); { DataObject* pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isSuccess()); @@ -195,7 +199,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc) delete pObj; } + token = std::make_unique<Token>(); token->setClassID (Guid ("8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA")); + taddr.setToken (std::move (token)); DataObject* pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isFailure()); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx index f17cc26a676a..ff07fb1e736a 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** * @file AthenaPoolCnvSvc/test/T_AthenaPoolViewVectorCnv_test.cxx @@ -139,9 +139,9 @@ void test1 (ISvcLocator* svcloc, assert (pers->size() == 0); testsvc.m_pers = pers; - Token* token = new Token; + auto token = std::make_unique<Token>(); token->setClassID (Guid (YCont_v2_guid)); - TokenAddress taddr (0, 0, "", "", 0, token); + TokenAddress taddr (0, 0, "", "", 0, std::move(token)); DataObject* pObj; assert (cnv.createObj (&taddr, pObj).isSuccess()); @@ -164,7 +164,9 @@ void test1 (ISvcLocator* svcloc, pers1.setClearOnPersistent(); pers1.toPersistent(); testsvc.m_pers = &pers1; + token = std::make_unique<Token>(); token->setClassID (Guid (YCont_v1_guid)); + taddr.setToken (std::move (token)); assert (cnv.createObj (&taddr, pObj).isSuccess()); auto* trans2 = SG::Storable_cast<ViewVector<DataVector<Y_v2> > > (pObj); assert (trans2->size() == 10); @@ -176,7 +178,9 @@ void test1 (ISvcLocator* svcloc, ViewVectorBaseTest::checkPersEmpty (*trans2); delete trans2; + token = std::make_unique<Token>(); token->setClassID (Guid ("79E2478D-C17F-45E9-848D-278240C2FED3")); + taddr.setToken (std::move (token)); assert (cnv.createObj (&taddr, pObj).isFailure()); } @@ -198,9 +202,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc, DataVector<Y_v2>& vec) testsvc.m_pers = nullptr; testsvc.m_pers_old = &pers2; - Token* token = new Token; + auto token = std::make_unique<Token>(); token->setClassID (Guid (YCont_v2_guid2)); - TokenAddress taddr (0, 0, "", "", 0, token); + TokenAddress taddr (0, 0, "", "", 0, std::move(token)); DataObject* pObj; assert (cnv.createObj (&taddr, pObj).isSuccess()); @@ -219,7 +223,9 @@ void test2 (ISvcLocator* svcloc, TestCnvSvc& testsvc, DataVector<Y_v2>& vec) for (size_t i = 0; i < sz; i++) pers1.emplace_back ("vec", i); testsvc.m_pers_old = &pers1; + token = std::make_unique<Token>(); token->setClassID (Guid (YCont_v1_guid2)); + taddr.setToken (std::move (token)); assert (cnv.createObj (&taddr, pObj).isSuccess()); auto* trans1 = SG::Storable_cast<ViewVector<DataVector<Y_v2> > > (pObj); assert (trans1->size() == 10); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx index c0757b9db73c..2e552a5f5719 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AthenaPoolxAODCnv_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @@ -109,9 +109,9 @@ void test1 (ISvcLocator* svcloc, TestCnvSvc& testsvc) assert ((*pers1)[i] == trans1[i]); testsvc.m_pers2 = pers1; - Token* token = new Token; + auto token = std::make_unique<Token>(); token->setClassID (Guid (YCont_v2_guid)); - TokenAddress taddr (0, 0, "xyz", "key", 0, token); + TokenAddress taddr (0, 0, "xyz", "key", 0, std::move(token)); DataObject* pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isSuccess()); @@ -128,7 +128,9 @@ void test1 (ISvcLocator* svcloc, TestCnvSvc& testsvc) for (size_t i=0; i < N; i++) pers_old.push_back (new Y_v1(i)); testsvc.m_pers1 = &pers_old; + token = std::make_unique<Token>(); token->setClassID (Guid (YCont_v1_guid)); + taddr.setToken (std::move (token)); pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isSuccess()); auto* trans3 = SG::Storable_cast<DataVector<Y_v2> > (pObj); @@ -138,7 +140,9 @@ void test1 (ISvcLocator* svcloc, TestCnvSvc& testsvc) assert (trans3->getConstStoreLink().dataID() == "keyAux."); delete pObj; + token = std::make_unique<Token>(); token->setClassID (Guid ("8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA")); + taddr.setToken (std::move (token)); pObj = nullptr; assert (cnv.createObj (&taddr, pObj).isFailure()); } -- GitLab