13#include "GaudiKernel/Converter.h"
36 ISvcLocator* pSvcLocator ) :
37 base_class ( name, pSvcLocator ),
56 ITPCnvBase* cnv = ITPCnvBase::Factory::create (cls).release();
59 <<
"] via Reflex::PluginService");
62 std::scoped_lock lock (
m_mutex);
76 ITPCnvBase* cnv = ITPCnvBase::Factory::create (prefix(
type) +
"_TRANS_" + transClassName).release();
78 return t2p_cnv (transClassName);
81 << transClassName <<
"]");
84 std::scoped_lock lock (
m_mutex);
97 std::string trans_type;
98 if (!
m_clidSvc->getTypeNameOfID(transClid, trans_type).isSuccess()) {
99 ATH_MSG_INFO(
"could not get a type-name for clid [" << transClid <<
"]");
103 ITPCnvBase* cnv = ITPCnvBase::Factory::create (prefix(
type) +
"_TRANS_" + trans_type).release();
104 if (cnv ==
nullptr) {
106 if (!
m_clidSvc->getTypeInfoNameOfID(transClid, trans_type).isSuccess()) {
108 << transClid <<
"]");
111 cnv = ITPCnvBase::Factory::create (prefix(
type) +
"_TRANS_" + trans_type).release();
115 if (cnv ==
nullptr) {
117 << transClid <<
"] (" << trans_type <<
")");
120 std::scoped_lock lock (
m_mutex);
121 m_cnvs.emplace_back (cnv);
133 ITPCnvBase* cnv = ITPCnvBase::Factory::create (prefix(
type) +
"_PERS_" + persClassName).release();
135 return p2t_cnv (persClassName);
136 if (cnv ==
nullptr) {
138 << persClassName <<
"]");
141 std::scoped_lock lock (
m_mutex);
142 m_cnvs.emplace_back (cnv);
151std::unique_ptr<ITPCnvBase>
154 return ITPCnvBase::Factory::create (
"_TRANS_" + transClassName);
162std::unique_ptr<ITPCnvBase>
165 std::string trans_type;
166 if (!
m_clidSvc->getTypeNameOfID(transClid, trans_type).isSuccess()) {
170 std::unique_ptr<ITPCnvBase> cnv = ITPCnvBase::Factory::create (
"_TRANS_" + trans_type);
171 if (cnv ==
nullptr) {
173 if (!
m_clidSvc->getTypeInfoNameOfID(transClid, trans_type).isSuccess()) {
176 cnv = ITPCnvBase::Factory::create (
"_TRANS_" + trans_type);
#define ATH_MSG_WARNING(x)
uint32_t CLID
The Class ID type.
AthTPCnvSvc()
Default constructor:
virtual ~AthTPCnvSvc() override
Destructor:
virtual ITPCnvBase * load_tpcnv(const std::string &cls) override
load the T/P converter class named cls return NULL on failure.
ServiceHandle< IClassIDSvc > m_clidSvc
handle to a IClassIDSvc to handle loading of types by CLID
virtual ITPCnvBase * p2t_cnv(const std::string &persClassName, Athena::TPCnvType::Value type=Athena::TPCnvType::Athena) override
return the T/P converter for a persistent class (NULL if failure) ITPCnvSvc owns the ITPCnvBase point...
virtual ITPCnvBase * t2p_cnv(const std::string &transClassName, Athena::TPCnvType::Value type=Athena::TPCnvType::Athena) override
return the T/P converter for a transient class (NULL if failure) ITPCnvSvc owns the ITPCnvBase pointe...
TpCnvs_t m_cnvs
a registry of ITPCnvBase* instances
virtual std::unique_ptr< ITPCnvBase > t2p_cnv_unique(const std::string &transClassName) const override
return the T/P converter for a transient class (NULL if failure) Ownership is returned to the caller.