ATLAS Offline Software
Loading...
Searching...
No Matches
DataLinkCnv_p2.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5/** @file DataLinkCnv_p2.icc
6 * @brief This file contains the implementation for the DataLinkCnv_p2 template methods.
7 * @author Marcin.Nowak@cern.ch
8 **/
9
10#include <stdexcept>
11
12
13template <typename DLINK_TYPE>
14inline
15void DataLinkCnv_p2<DLINK_TYPE>::transToPers (const DLink_t& trans,
16 PersDLink_t& pers,
17 MsgStream& /*log*/) const
18{
19 pers.m_SGKeyHash = trans.key();
20}
21
22template <typename DLINK_TYPE>
23inline
24void
25DataLinkCnv_p2<DLINK_TYPE>
26::transToPers(const DLink_t* trans, PersDLink_t* pers, MsgStream& log) const
27{
28 this->transToPers(*trans, *pers, log);
29}
30
31
32
33template <typename DLINK_TYPE >
34inline
35void DataLinkCnv_p2< DLINK_TYPE >::persToTrans (const PersDLink_t& pers,
36 DLink_t& trans,
37 MsgStream& /*log*/) const
38{
39 if( pers.m_SGKeyHash ) {
40 trans.toIdentifiedObject( pers.m_SGKeyHash );
41 if( !trans.toTransient() ) {
42 throw std::runtime_error("DataLinkCnv_p2::persToTrans: failed to convert DataLink.");
43 }
44 } else
45 trans.clear();
46}
47
48template <typename DLINK_TYPE >
49inline
50void
51DataLinkCnv_p2< DLINK_TYPE >
52::persToTrans(const PersDLink_t* pers, DLink_t* trans, MsgStream& log) const
53{
54 this->persToTrans(*pers, *trans, log);
55}