ATLAS Offline Software
Loading...
Searching...
No Matches
MuonFeatureCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "MuonFeatureCnv.h"
8
9MuonFeatureCnv::MuonFeatureCnv(ISvcLocator *svcloc): MuonFeatureCnvBase(svcloc) {}
11
12//createPersistent
14 MsgStream mlog(msgSvc(), "MuonFeatureConverter" );
15
16 mlog << MSG::DEBUG << "MuonFeatureCnv::createPersistent" << endmsg;
17
18 MuonFeatureCnv_p2 converter;
19 MuonFeature_PERS *persObj = converter.createPersistent( transObj, mlog );
20
21 return persObj;
22}
23
24//createTransient
26 MsgStream mlog(msgSvc(), "MuonFeatureConverter" );
27
28 mlog << MSG::DEBUG << "MuonFeatureCnv::createTransient " << endmsg;
29
30 static const pool::Guid p2_guid("3785A9E4-7845-4B54-B49F-DCC2A24409C0");
31 static const pool::Guid p1_guid("3DFFECBF-3251-4BE7-9D12-B3A9FCAC486E");
32 static const pool::Guid p0_guid("295FBAFB-ED82-43EA-8B63-6E3D3F4D2A9F");
33
34 if( compareClassGuid(p1_guid) ) {
35
36 std::unique_ptr< MuonFeature_p1 > col_vect( poolReadObject< MuonFeature_p1 >() );
37 MuonFeatureCnv_p1 converter;
38 return converter.createTransient( col_vect.get(), mlog );
39
40 }
41 else if( compareClassGuid(p2_guid) ) {
42
43 std::unique_ptr< MuonFeature_p2 > col_vect( poolReadObject< MuonFeature_p2 >() );
44 MuonFeatureCnv_p2 converter;
45 return converter.createTransient( col_vect.get(), mlog );
46
47 }
48 else if( compareClassGuid(p0_guid) ) {
49 // old version from before TP separation, just return it
50 return this->poolReadObject<MuonFeature>();
51 }
52 else {
53 throw std::runtime_error("Unsupported persistent version");
54 }
55
56}
#define endmsg
T_AthenaPoolCustomCnv< MuonFeature, MuonFeature_PERS > MuonFeatureCnvBase
MuonFeature_p2 MuonFeature_PERS
virtual MuonFeature * createTransient()
MuonFeatureCnv(ISvcLocator *svcloc)
virtual MuonFeature_PERS * createPersistent(MuonFeature *transObj)
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
virtual bool compareClassGuid(const Guid &clid) const