2 * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
5 * @file AthenaPoolCnvSvc/T_AuxContainerCopyTPCnv.icc
6 * @author scott snyder <snyder@bnl.gov>
8 * @brief Convert aux container version by generic copy.
12 template <class NEWTYPE, class OLDTYPE>
13 void T_AuxContainerCopyTPCnv<NEWTYPE, OLDTYPE>::
14 persToTrans( const OLDTYPE* oldObj,
16 MsgStream& log ) const
19 if( log.level() <= MSG::DEBUG ) {
20 log << MSG::DEBUG << "Converting " << ClassName<OLDTYPE>::name()
21 << " to " << ClassName<NEWTYPE>::name() << "..." << endmsg;
24 // Clear the transient object:
27 // Copy the payload of the v1 object into the latest one by misusing
28 // the thinning code a bit...
29 SG::copyAuxStoreThinned( *oldObj, *newObj, nullptr);
31 // Print what happened:
32 if( log.level() <= MSG::DEBUG ) {
33 log << MSG::DEBUG << "Converting " << ClassName<OLDTYPE>::name()
34 << " to " << ClassName<NEWTYPE>::name() << " [OK]" << endmsg;
40 /// This function should never be called, as we are not supposed to convert
41 /// object before writing.
43 template <class NEWTYPE, class OLDTYPE>
44 void T_AuxContainerCopyTPCnv<NEWTYPE, OLDTYPE>::
45 transToPers( const NEWTYPE*,
47 MsgStream& log ) const
50 << "Somebody called transToPers for "
51 << ClassName<OLDTYPE>::name() << endmsg;
52 throw std::runtime_error( "Somebody called transToPers for " +
53 ClassName<OLDTYPE>::name() );