Skip to content
Snippets Groups Projects
Commit f50b3058 authored by Peter Van Gemmeren's avatar Peter Van Gemmeren Committed by Johannes Elmsheuser
Browse files

Remove obsolete pers map

Remove obsolete pers map
parent d619fe29
No related branches found
No related tags found
No related merge requests found
......@@ -98,9 +98,6 @@ protected:
public:
/// @return class ID.
static const CLID& classID();
private:
std::map<DataObject*, PERS*> m_persMap;
};
#include "AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc"
......
......@@ -26,7 +26,7 @@
template <class TRANS, class PERS>
T_AthenaPoolCustCnv<TRANS, PERS>::T_AthenaPoolCustCnv(ISvcLocator* pSvcLocator,
const char* name /*= nullptr*/)
: T_AthenaPoolCnvBase<TRANS>(pSvcLocator, name), m_persMap() {
: T_AthenaPoolCnvBase<TRANS>(pSvcLocator, name) {
}
//______________________________________________________________________________
template <class TRANS, class PERS>
......@@ -101,33 +101,24 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::poolToObject(const Token*& token, P
template <class TRANS, class PERS>
StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::DataObjectToPers(DataObject* pObj, IOpaqueAddress*& /*pAddr*/) {
const std::string className = ClassName<TRANS>::name();
ATH_MSG_DEBUG("Called DataObjectToPers for " << pObj << ": " << className << ", with key " << pObj->name() << ", map size = " << m_persMap.size());
PERS* persObj = nullptr;
m_persMap.insert(std::pair<DataObject*, PERS*>(pObj, persObj));
ATH_MSG_DEBUG("Called DataObjectToPers for " << pObj << ": " << className << ", with key " << pObj->name());
return(StatusCode::SUCCESS);
}
//__________________________________________________________________________
template <class TRANS, class PERS>
StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::DataObjectToPool(IOpaqueAddress* pAddr, DataObject* pObj) {
const std::string className = ClassName<TRANS>::name();
ATH_MSG_DEBUG("Called DataObjectToPool for " << pObj << ": " << className << ", with key " << pObj->name() << ", map size = " << m_persMap.size());
ATH_MSG_DEBUG("Called DataObjectToPool for " << pObj << ": " << className << ", with key " << pObj->name());
PERS* persObj = nullptr;
typename std::map<DataObject*, PERS*>::iterator it = m_persMap.find(pObj);
if (it != m_persMap.end()) {
persObj = it->second;
m_persMap.erase(it);
TRANS* obj = nullptr;
bool success = SG::fromStorable(pObj, obj);
if (!success || obj == nullptr) {
ATH_MSG_ERROR("failed to cast to T for class (type/key) " << className << "/" << pObj->name());
return(StatusCode::FAILURE);
}
if (persObj == nullptr) {
TRANS* obj = nullptr;
bool success = SG::fromStorable(pObj, obj);
if (!success || obj == nullptr) {
ATH_MSG_ERROR("failed to cast to T for class (type/key) " << className << "/" << pObj->name());
return(StatusCode::FAILURE);
}
if (!transToPers(obj, persObj).isSuccess()) {
ATH_MSG_ERROR("Failed to convert to persistent DataType for class (type/key) " << className << "/" << pObj->name());
return(StatusCode::FAILURE);
}
if (!transToPers(obj, persObj).isSuccess()) {
ATH_MSG_ERROR("Failed to convert to persistent DataType for class (type/key) " << className << "/" << pObj->name());
return(StatusCode::FAILURE);
}
Token* token = nullptr;
StatusCode status = objectToPool<PERS>(persObj, token, pObj->name(), *pAddr->par());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment