|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef T_ATHENAPOOLTPINTVECTORCNV_H
6 #define T_ATHENAPOOLTPINTVECTORCNV_H
20 template<
class TRANS_BASE,
class TRANS >
61 reinterpret_cast<TRANS*
> (trans),
70 transToPers (
reinterpret_cast<const TRANS*
> (trans),
71 reinterpret_cast<Pers_t*
> (pers),
85 TPObjRef toPersistent_impl(
const TRANS *trans, MsgStream &
log );
89 virtual const std::type_info&
transientTInfo()
const {
return typeid(TRANS); }
102 assert (index < m_pStorage->
size());
112 return toPersistent_impl(
dynamic_cast<const TRANS*
>(trans),
log);
120 throw std::runtime_error(
121 std::string(
"virt_createTransFromPStore() mothod not supported in TP converter for an abstract class: ")
122 +
typeid(*this).name() );
168 template<
class TRANS_BASE,
class TRANS >
188 std::unique_ptr<TRANS> trans(
new TRANS());
190 return(trans.release());
213 template<
class TRANS >
227 return toPersistent_impl( trans,
log );
232 assert (index < this->m_pStorage->size());
234 persToTrans( &pers, trans,
log );
241 template<
class TRANS_BASE,
class TRANS >
276 template<
class TRANS,
class CONV>
278 :
public TPCnvBase<TRANS, TPIntegerVector_p2 > {
290 size_t pers_size = persVect->
next(
piter);
292 transVect->reserve( pers_size );
294 while( pers_size-- ) {
306 persVect->
reserve( 1 + transVect->size()*2 );
307 persVect->
push_back( transVect->size() );
309 for(
typename TRANS::const_iterator
310 it = transVect->begin(),
311 iEnd = transVect->end();
334 template<
class TRANS,
class CONV>
342 persVect->
reserve( 1 + transVect->size()*2 );
343 persVect->
push_back( transVect->size() );
345 for(
typename TRANS::const_iterator
346 it = transVect->begin(),
347 iEnd = transVect->end();
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 createTLPersObject()=0
Create persistent object - the converter keeps it.
virtual const std::type_info & transientTInfo() const
return C++ type id of the transient class this converter is for
virtual TRANS * virt_createTransFromPStore(unsigned, MsgStream &)
This method implements a pure virtual base class method, but should never be called,...
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...
virtual void transToPers(const TRANS *transVect, TPIntegerVector_p2 *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of Pers_t::value_type objects,...
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
TPObjRef next_TPObjRef(const_iterator &iter) const
void reserve(size_t new_size)
virtual TRANS * virt_createTransFromPStore(unsigned index, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (createTransient)
This file contains definition of TPIntegerVectorStorage_p2, which is a storage class used in top-leve...
TPIntegerVector_p2 Pers_t
TPIntegerVector_p2 Pers_t
virtual TopLevelTPCnvBase * topConverter()
return the top-level converter for this elemental TP converter
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log)=0
Convert transient representation to persistent one.
Storage implementation for TP converters producing TP representation as series of ints.
TPObjRef::typeID_t m_pStorageTID
TP Ref typeID for the persistent objects this converter is creating.
virtual void transToPersUntyped(const void *trans, void *pers, MsgStream &log)
Convert transient object representation to persistent.
virtual void persToTransUntyped(const void *pers, void *trans, MsgStream &log)
Convert persistent object representation to transient.
virtual void persToTrans(const TPIntegerVector_p2 *persVect, TRANS *transVect, MsgStream &log)
Converts vector of Pers_t::value_type objects to vector of TRANS::value_type objects,...
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
virtual void reservePStorage(size_t size)
Reserve 'size' elements for persistent storage - not much sense in this clas.
TPIntegerVector_p2 Pers_t
const value_type * const_iterator
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...
TPIntegerVectorStorage_p2 * m_pStorage
the address of the storage vector for persistent representations
void push_back(const value_type &val)
virtual void transToPers(const TRANS *transVect, TPIntegerVector_p2 *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log)=0
Convert persistent representation to transient one.
CONV * m_elementCnv
pointer to the TP converter used for vector elements
virtual ~TPAbstractPolyCnvBase()
virtual TRANS * createTransient(const Pers_t *persObj, MsgStream &log)
Create transient representation of a persistent object.
CONV * m_elementCnv
pointer to the TP converter used for vector elements
void push_TPObjRef(const TPObjRef &val)
void setPStorage(TPIntegerVectorStorage_p2 *storage)
Tell this converter which storage vector it should use to store or retrieve persistent representation...
virtual void persToTrans(const Pers_t *persObj, TRANS *transObj, MsgStream &log)=0
Convert persistent representation to transient one.
const value_type & next(const_iterator &iter) const
virtual void transToPers(const TRANS *transObj, Pers_t *persObj, MsgStream &log)=0
Convert transient representation to persistent 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.
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.
def piter(iterable, eoi=None)
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...