Commit a3c65c91 authored by Tadej Novak's avatar Tadej Novak
Browse files

Merge branch 'hgtd_rdo_athpool_cnv_21p9' into '21.9'

Adding ath pool converter to complete rdo converters

See merge request !46085
parents b191d921 cb3ac9f6
......@@ -18,9 +18,9 @@ atlas_depends_on_subdirs( PUBLIC
# Component(s) in the package:
atlas_add_poolcnv_library( HGTD_EventAthenaPoolPoolCnv
src/*.cxx
FILES HGTD_PrepRawData/HGTD_ClusterContainer.h
TYPES_WITH_NAMESPACE HGTD::HGTD_ClusterContainer
LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib AtlasSealCLHEP GaudiKernel HGTD_PrepRawData HGTD_EventTPCnv )
FILES HGTD_PrepRawData/HGTD_ClusterContainer.h HGTD_RawData/HGTD_RDOContainer.h
TYPES_WITH_NAMESPACE HGTD::HGTD_ClusterContainer HGTD::HGTD_RDOContainer
LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib AtlasSealCLHEP GaudiKernel HGTD_PrepRawData HGTD_EventTPCnv HGTD_RawData)
# Install files from the package:
atlas_install_headers( HGTD_EventAthenaPool )
/**
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
*
* @file HGTD_EventAthenaPool/src/HGTD_RDOContainerCnv.cxx
* @author Alexander Leopold <alexander.leopold@cern.ch>
* @date August, 2021
* @brief
*/
#include "HGTD_RDOContainerCnv.h"
#include "GaudiKernel/MsgStream.h"
#include <memory>
// #include <iostream>
HGTD_RDOContainerCnv::HGTD_RDOContainerCnv(ISvcLocator* svcloc)
: HGTD_RDOContainerCnvBase_t(svcloc) {}
HGTD_RDOContainerCnv::~HGTD_RDOContainerCnv() {}
HGTD::HGTD_RDOContainer* HGTD_RDOContainerCnv::createTransient() {
static pool::Guid p1_guid(
"C25315CC-F0A2-43D6-8F42-012BE34B0107"); // with HGTD_RDO_p1
ATH_MSG_DEBUG("createTransient(): main converter");
HGTD::HGTD_RDOContainer* trans_cont(0);
if (compareClassGuid(p1_guid)) {
ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
std::auto_ptr<HGTD_RDOContainer_PERS_t> pers_cont(
poolReadObject<HGTD_RDOContainer_PERS_t>());
trans_cont = m_converter.createTransient(pers_cont.get(), msg());
} else {
throw std::runtime_error(
"Unsupported persistent version of HGTD_RDOContainer");
}
return trans_cont;
}
HGTD_RDOContainer_PERS_t*
HGTD_RDOContainerCnv::createPersistent(HGTD::HGTD_RDOContainer* trans_cont) {
HGTD_RDOContainer_PERS_t* pers_cont =
m_converter.createPersistent(trans_cont, msg());
return pers_cont;
}
/**
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
*
* @file HGTD_EventAthenaPool/HGTD_RDOContainerCnv.h
* @author Alexander Leopold <alexander.leopold@cern.ch>
* @date August, 2021
* @brief
*
*/
#ifndef HGTD_EVENTATHENAPOOL_HGTD_RDOCONTAINERCNV_H
#define HGTD_EVENTATHENAPOOL_HGTD_RDOCONTAINERCNV_H
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
#include "GaudiKernel/MsgStream.h"
#include "HGTD_RawData/HGTD_RDOContainer.h"
#include "HGTD_EventTPCnv/HGTD_RDOContainerCnv_p1.h"
// the latest persistent representation type of the container holding
// HGTD_RawData
typedef HGTD::HGTD_RDOContainer_p1 HGTD_RDOContainer_PERS_t;
typedef HGTD::HGTD_RDOContainerCnv_p1 HGTD_RDOContainerCNV_t;
typedef T_AthenaPoolCustomCnv<HGTD::HGTD_RDOContainer, HGTD_RDOContainer_PERS_t>
HGTD_RDOContainerCnvBase_t;
class HGTD_RDOContainerCnv : public HGTD_RDOContainerCnvBase_t {
friend class CnvFactory<HGTD_RDOContainerCnv>;
protected:
HGTD_RDOContainerCnv(ISvcLocator* svcloc);
virtual ~HGTD_RDOContainerCnv() override;
virtual HGTD_RDOContainer_PERS_t*
createPersistent(HGTD::HGTD_RDOContainer* trans) override;
virtual HGTD::HGTD_RDOContainer* createTransient() override;
private:
HGTD_RDOContainerCNV_t m_converter;
};
#endif // HGTD_CLUSTERCONTAINERCNV_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment