|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLTPVECTORCNV_H
6 #define ATHENAPOOLCNVSVC_T_ATHENAPOOLTPVECTORCNV_H
8 #include "AthenaPoolUtilities/TPIntegerVector.h"
12 template<
class TRANS_BASE,
class TRANS >
48 reinterpret_cast<TRANS*
> (trans),
54 transToPers (
reinterpret_cast<const TRANS*
> (trans),
55 reinterpret_cast<PERS*
> (pers),
77 TPObjRef toPersistent_impl(
const TRANS *trans, MsgStream &
log );
81 virtual const std::type_info&
transientTInfo()
const {
return typeid(TRANS); }
94 assert (index < m_pStorage->
size());
104 return toPersistent_impl(
dynamic_cast<const TRANS*
>(trans),
log);
112 throw std::runtime_error(
113 std::string(
"virt_createTransFromPStore() mothod not supported in TP converter for an abstract class: ")
114 +
typeid(*this).name() );
167 template<
class TRANS_BASE,
class TRANS >
186 std::unique_ptr<TRANS> trans(
new TRANS());
188 return(trans.release());
211 template<
class TRANS >
225 return toPersistent_impl( trans,
log );
230 assert (index < this->m_pStorage->size());
232 persToTrans( &pers, trans,
log );
240 template<
class TRANS_BASE,
class TRANS >
252 throw std::runtime_error(
253 std::string(
"T/P converter: ") +
typeid(*this).name()
254 +
" recursive usage not supported! " );
virtual void pstoreToTrans(unsigned index, TRANS_BASE *trans, MsgStream &log)
Convert persistent representation stored in the storage vector of the top-level object to transient.
This file contains template definitions for Transient/Persistent converters.
std::vector< PERS > * m_pStorage
the address of the storage vector for persistent representations
virtual void persToTransUntyped(const void *pers, void *trans, MsgStream &log)
Convert persistent object representation to transient.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log)=0
Convert transient representation to persistent one.
virtual void transToPersUntyped(const void *trans, void *pers, MsgStream &log)
Convert transient object representation to persistent.
virtual const std::type_info & transientTInfo() const
return C++ type id of the transient class this converter is for
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log)=0
Convert transient representation to persistent one.
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log)=0
Convert persistent representation to transient one.
virtual TPObjRef virt_toPersistent(const TRANS *trans, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (toPersistent_impl) in th...
TPObjRef::typeID_t m_pStorageTID
TP Ref typeID for the persistent objects this converter is creating.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
int m_curRecLevel
count recursive invocations, to detect recursion
virtual TRANS * virt_createTransFromPStore(unsigned index, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (createTransient)
void setPStorage(TPIntegerVectorStorage_p1 *storage)
Tell this converter which storage vector it should use to store or retrieve persistent representation...
virtual ~TPAbstractPolyCnvBase()
virtual TPObjRef virt_toPersistent(const TRANS_BASE *trans, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (toPersistent_impl) in th...
virtual void reservePStorage(size_t size)
Reserve 'size' elements for persistent storage - not much sense in this clas.
virtual TRANS * virt_createTransFromPStore(unsigned, MsgStream &)
This method implements a pure virtual base class method, but should never be called,...
bool m_recursive
if true, work in recursion-safe way (slower)
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log)=0
Convert persistent representation to transient one.
virtual void pstoreToTrans(unsigned index, TRANS *trans, MsgStream &log)
Convert persistent representation stored in the storage vector of the top-level object to transient.
TPIntegerVectorStorage_p1 * m_pStorage
the address of the storage vector for persistent representations
int m_curRecLevel
count recursive invocations, to detect recursion