24 #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLCREATEFUNCS_H
25 #define ATHENAPOOLCNVSVC_T_ATHENAPOOLCREATEFUNCS_H
29 #include "GaudiKernel/MsgStream.h"
31 #include <type_traits>
50 template <
class TPCNV,
51 typename std::enable_if_t<std::is_base_of_v<ITPConverter, TPCNV> >* =
nullptr>
52 std::unique_ptr<typename TPCNV::Pers_t>
54 const typename TPCNV::Trans_t* transObj,
55 const std::string&
key,
58 return std::unique_ptr<typename TPCNV::Pers_t>
59 (cnv.createPersistentWithKey (transObj,
key,
log));
73 template <
class TPCNV,
74 typename std::enable_if_t<!std::is_base_of_v<ITPConverter, TPCNV> >* =
nullptr>
75 std::unique_ptr<typename TPCNV::Pers_t>
77 const typename TPCNV::Trans_t* transObj,
81 auto pers = std::make_unique<typename TPCNV::Pers_t>();
82 cnv.transToPers(transObj, pers.get(),
log);
97 template <
class TPCNV,
98 typename std::enable_if_t<std::is_base_of_v<ITPConverter, TPCNV> >* =
nullptr>
99 std::unique_ptr<typename TPCNV::Trans_t>
101 const typename TPCNV::Pers_t* persObj,
102 const std::string&
key,
105 return std::unique_ptr<typename TPCNV::Trans_t>
106 (cnv.createTransientWithKey (persObj,
key,
log));
120 template <
class TPCNV,
121 typename std::enable_if_t<!std::is_base_of_v<ITPConverter, TPCNV> >* =
nullptr>
122 std::unique_ptr<typename TPCNV::Trans_t>
124 const typename TPCNV::Pers_t* persObj,
128 typedef typename TPCNV::Trans_t Trans_t;
132 log <<
"IdentifiableContainerBase is not compatible with createTransient" <<
endmsg;
133 return std::unique_ptr<Trans_t>();
136 auto trans = std::make_unique<Trans_t>();
137 cnv.persToTrans(persObj, trans.get(),
log);
145 #endif // not ATHENAPOOLCNVSVC_T_ATHENAPOOLCREATEFUNCS_H