ATLAS Offline Software
TPConverter.h
Go to the documentation of this file.
1 // dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TPCONVERTER_H
8 #define TPCONVERTER_H 1
9 
19 #include "ITPConverter.h"
20 #include "TopLevelTPCnvBase.h"
21 
22 #include "GaudiKernel/MsgStream.h"
23 
24 #include <vector>
25 #include <stdexcept>
26 #include <cassert>
27 
28 
35 template< class TRANS >
37 {
38 public:
39  typedef TRANS TransBase_t;
42 
45  m_wasUsedForReading( false )
46  {}
47 
48  virtual ~ITPConverterFor() = default;
49 
56  template < class CNV >
57  CNV *
58  converterForType( CNV *cnv, const std::type_info& t_info, MsgStream& log ) const {
60  cnv = dynamic_cast< CNV* >( c );
61  if( !cnv )
62  this->converterNotFound( typeid(CNV), c, t_info.name(), log );
63  return cnv;
64  }
65 
72  template < class CNV >
73  CNV *
74  converterForRef( CNV *cnv, const TPObjRef& ref, MsgStream& log ) const {
76  cnv = dynamic_cast<CNV*>(c);
77  if( !cnv )
78  this->converterNotFound( ref.typeID(), c, typeid(CNV).name(), log );
79  return cnv;
80  }
81 
95  template < class CNV >
96  TPObjRef
97  baseToPersistent( CNV **cnv, const typename CNV::Trans_t* transObj, MsgStream& log) const {
98  if( !*cnv || (*cnv)->wasUsedForReading() ) {
99  // don't trust the converter if it was used for reading, find again
100  *cnv = converterForType( *cnv, typeid(typename CNV::Trans_t), log );
101  if( !*cnv ) return TPObjRef();
102  (*cnv)->clearReadingFlag();
103  }
104 // return (**cnv).toPersistent_impl(transObj, log);
105  return (**cnv).virt_toPersistent(transObj, log);
106  }
107 
118  template < class CNV >
119  TPObjRef toPersistent( CNV **cnv, const typename CNV::TransBase_t* transObj, MsgStream& log) const {
120  if( !transObj ) return TPObjRef();
121  CNV *temp_cnv_p = 0;
122  if( !cnv ) cnv = &temp_cnv_p;
123  if( !*cnv || (*cnv)->wasUsedForReading() ) {
124  // don't trust the converter if it was used for reading, find again
125  *cnv = converterForType( *cnv, typeid(*transObj), log );
126  if( !*cnv ) return TPObjRef();
127  (*cnv)->clearReadingFlag();
128  }
129  return (**cnv).virt_toPersistent(transObj, log);
130  }
131 
144  template < class CNV, class TRANS_T >
145  void fillTransFromPStore( CNV **cnv, const TPObjRef& ref, TRANS_T *trans, MsgStream &log ) const {
146  if( ref.isNull() ) return;
147  CNV *temp_cnv_p = 0;
148  if( !cnv ) cnv = &temp_cnv_p;
149  // see if we already have a converter and if it is the right one
150  if( !*cnv || (*cnv)->typeID().value() != ref.typeID() ) {
151  // we don't - find the right converter for ref.typeID()
152  *cnv = converterForRef( *cnv, ref, log );
153  if( !*cnv ) return;
154  (*cnv)->setReadingFlag();
155  }
156  (**cnv).pstoreToTrans( ref.index(), trans, log );
157  }
158 
170  template < class CNV >
171  typename CNV::Trans_t*
172  createTransFromPStore( CNV **cnv, const TPObjRef& ref, MsgStream& log) const {
173  if( ref.isNull() ) return 0;
174  CNV *temp_cnv_p = 0;
175  if( !cnv ) cnv = &temp_cnv_p;
176  // see if we already have a converter and if it is the right one
177  if( !*cnv || (*cnv)->typeID().value() != ref.typeID() ) {
178  // we don't - find the right converter for ref.typeID()
179  *cnv = converterForRef( *cnv, ref, log );
180  if( !*cnv ) return 0;
181  (*cnv)->setReadingFlag();
182  }
183  return (**cnv).virt_createTransFromPStore( ref.index(), log );
184  }
185 
186  // hook to initialize private converters
188 
189 
192  return m_topConverter;
193  }
194 
196  virtual const TopLevelTPCnvBase* topConverter() const {
197  return m_topConverter;
198  }
199 
201  virtual const std::type_info& transientTInfo() const { return typeid(TRANS); }
202 
205  const std::type_info& transBaseTInfo() const { return typeid(TRANS); }
206 
208  virtual const TPObjRef::typeID_t& typeID() const { return m_pStorageTID; }
209 
211  unsigned typeIDvalue() const { return m_pStorageTIDvalue; }
212 
213 
218  }
219 
222  const TPObjRef::typeID_t &TPtypeID )
223  {
225  m_pStorageTID = TPtypeID;
226  m_pStorageTIDvalue = TPtypeID.value();
228  }
229 
230 
231  /* Internal accessor methods for the Read Flag
232  Need to be public
233  */
237 
238 
239 //protected:
240  // ------ methods operating on the persistent store of the top level object
241 
249  virtual TPObjRef virt_toPersistent( const TransBase_t* trans, MsgStream& log) = 0;
250 
260  const std::string& key,
261  MsgStream& log) = 0;
262 
269  virtual TRANS* virt_createTransFromPStore( unsigned index, MsgStream &log ) = 0;
270 
278  virtual TRANS* virt_createTransFromPStoreWithKey( unsigned index,
279  const std::string& key,
280  MsgStream &log ) = 0;
281 
288  virtual void pstoreToTrans( unsigned index, TransBase_t* transObj, MsgStream& log) = 0;
289 
290 protected:
293 
296 
300 
303 
307 };
308 
309 
310 
311 
312 // --------------------------------------------------------------
313 
329 template< class TRANS_BASE, class TRANS, class PERS >
331  : public ITPConverterFor< TRANS_BASE >
332 {
333 public:
334  typedef TRANS Trans_t;
335  typedef PERS Pers_t;
336  typedef PERS PersBase_t; // Obsolete, for backward compat
337 
339  m_pStorage(0),
340  m_curRecLevel(0),
341  m_recursive(false),
342  m_ignoreRecursion(false)
343  {}
344 
345  virtual ~TPAbstractPolyCnvBase() = default;
346 
347 
348  // conversion methods - to be implemented in the concrete converter
349  // -------------------------------------------
350 
358  virtual void persToTrans(const PERS* persObj, TRANS* transObj, MsgStream &log) = 0;
359 
367  virtual void transToPers(const TRANS* transObj, PERS* persObj, MsgStream &log) = 0;
368 
376  virtual void persToTransWithKey(const PERS* persObj, TRANS* transObj,
377  const std::string& /*key*/,
378  MsgStream &log)
379  {
380  return persToTrans (persObj, transObj, log);
381  }
382 
383 
392  virtual void transToPersWithKey(const TRANS* transObj, PERS* persObj,
393  const std::string& /*key*/,
394  MsgStream &log)
395  {
396  return transToPers (transObj, persObj, log);
397  }
398 
400  virtual void persToTransUntyped(const void* pers,
401  void* trans,
402  MsgStream& log)
403  {
404  persToTrans (reinterpret_cast<const PERS*> (pers),
405  reinterpret_cast<TRANS*> (trans),
406  log);
407  }
408 
410  virtual void transToPersUntyped(const void* trans,
411  void* pers,
412  MsgStream& log)
413  {
414  transToPers (reinterpret_cast<const TRANS*> (trans),
415  reinterpret_cast<PERS*> (pers),
416  log);
417  }
418 
420  virtual void persToTransWithKeyUntyped(const void* pers,
421  void* trans,
422  const std::string& key,
423  MsgStream& log)
424  {
425  persToTransWithKey (reinterpret_cast<const PERS*> (pers),
426  reinterpret_cast<TRANS*> (trans),
427  key,
428  log);
429  }
430 
432  virtual void transToPersWithKeyUntyped(const void* trans,
433  void* pers,
434  const std::string& key,
435  MsgStream& log)
436  {
437  transToPersWithKey (reinterpret_cast<const TRANS*> (trans),
438  reinterpret_cast<PERS*> (pers),
439  key,
440  log);
441  }
442 
443  // Default implementations (usually no need to overwrite)
444  // ------------------------------------------------------
445 
452  virtual PERS* createPersistent(const TRANS* transObj, MsgStream &log);
453 
461  virtual PERS* createPersistentWithKey(const TRANS* transObj,
462  const std::string& key,
463  MsgStream &log);
464 
473  TPObjRef toPersistentWithKey_impl( const TRANS *trans,
474  const std::string& key,
475  MsgStream &log );
476 
477 
479  virtual const std::type_info& transientTInfo() const { return typeid(TRANS); }
480 
482  virtual const std::type_info& persistentTInfo() const { return typeid(PERS); }
483 
484 //protected:
485  // various virtual "redirector" methods
486 
494  virtual void pstoreToTrans( unsigned index, TRANS_BASE *trans, MsgStream &log ) {
495  assert (index < m_pStorage->size());
496  TRANS* trans_der = dynamic_cast<TRANS*>(trans);
497  if (!trans_der) std::abort();
498  this->persToTrans( &(*m_pStorage)[index], trans_der, log );
499  }
500 
505  virtual TPObjRef virt_toPersistent( const TRANS_BASE *trans, MsgStream &log ) {
506  const TRANS* trans_der = dynamic_cast<const TRANS*>(trans);
507  if (!trans_der) std::abort();
508  return toPersistentWithKey_impl( trans_der, "", log);
509  }
510 
515  virtual TPObjRef virt_toPersistentWithKey( const TRANS_BASE *trans,
516  const std::string& key,
517  MsgStream &log )
518  {
519  const TRANS* trans_der = dynamic_cast<const TRANS*>(trans);
520  if (!trans_der) std::abort();
521  return toPersistentWithKey_impl( trans_der, key, log);
522  }
523 
528  virtual TRANS* virt_createTransFromPStore( unsigned, MsgStream& ) {
529  throw std::runtime_error(
530  std::string("virt_createTransFromPStore() mothod not supported in TP converter for an abstract class: ")
531  + typeid(*this).name() );
532  return 0;
533  }
534 
539  virtual TRANS* virt_createTransFromPStoreWithKey( unsigned, const std::string&, MsgStream& ) {
540  throw std::runtime_error(
541  std::string("virt_createTransFromPStore() method not supported in TP converter for an abstract class: ")
542  + typeid(*this).name() );
543  return 0;
544  }
545 
546 public:
551  void setPStorage( std::vector< PERS > *storage ) {
552  m_pStorage = storage;
553  m_curRecLevel = 0;
554  }
555 
559  void setRecursive( bool flag=true ) {
560  m_recursive = flag;
561  }
562 
568  void ignoreRecursion( bool flag=false ) {
570  }
571 
573  virtual void reservePStorage( size_t size ) {
574  m_pStorage->reserve( size );
575  }
576 
577 protected:
579  std::vector< PERS > *m_pStorage;
580 
583 
586 
589 };
590 
591 
592 
597 template< class TRANS_BASE, class TRANS, class PERS >
599  : public TPAbstractPolyCnvBase<TRANS_BASE, TRANS, PERS>
600 {
601 public:
602  // To shorten using declarations in derived classes.
604 
605 
613  virtual void persToTrans (const PERS* persObj,
614  TRANS* transObj,
615  MsgStream &log) const = 0;
616 
617 
625  virtual void transToPers (const TRANS* transObj,
626  PERS* persObj,
627  MsgStream &log) const = 0;
628 
629 
630  // These call through to the const implementations.
631  virtual void persToTrans(const PERS* persObj,
632  TRANS* transObj,
633  MsgStream &log) override final
634  {
635  return const_cast<const TPAbstractPolyCnvConstBase*>(this)->persToTrans (persObj, transObj, log);
636  }
637 
638 
639  virtual void transToPers(const TRANS* transObj,
640  PERS* persObj,
641  MsgStream &log) override final
642  {
643  return const_cast<const TPAbstractPolyCnvConstBase*>(this)->transToPers (transObj, persObj, log);
644  }
645 };
646 
647 
648 
649 // --------------------------------------------------------------
650 
651 
652 // Base converter template for polymorphic types
653 
654 // Converters for objects in the same inheritance tree must share the same
655 // base class type: TRANS_BASE
656 
671 template< class TRANS_BASE, class TRANS, class PERS >
673  : public TPAbstractPolyCnvBase< TRANS_BASE, TRANS, PERS >
674 {
675 public:
677  virtual ~TPPolyCnvBase() = default;
678 
679 
680  // Default implementations (usually no need to overwrite)
681  // ------------------------------------------------------
682 
689  virtual TRANS* createTransient(const PERS* persObj, MsgStream &log);
690 
698  virtual TRANS* createTransientWithKey(const PERS* persObj, const std::string& key, MsgStream &log);
699 
706  virtual TRANS* virt_createTransFromPStore( unsigned index, MsgStream &log ) {
707  assert (index < this->m_pStorage->size());
708  return createTransient( &(*this->m_pStorage)[index], log );
709  }
710 
718  virtual TRANS* virt_createTransFromPStoreWithKey( unsigned index,
719  const std::string& key,
720  MsgStream &log )
721  {
722  assert (index < this->m_pStorage->size());
723  return createTransientWithKey( &(*this->m_pStorage)[index], key, log );
724  }
725 
726 };
727 
728 
729 
735 template< class TRANS, class PERS >
737  : public TPPolyCnvBase< TRANS, TRANS, PERS >
738 {
739 public:
741  virtual ~TPConverterBase() = default;
742 
743 
744  // implement these methods without dynamic cast to TRANS
745 
747  virtual TPObjRef virt_toPersistent( const TRANS *trans, MsgStream &log ) {
748  return this->toPersistentWithKey_impl( trans, "", log);
749  }
750 
752  virtual TPObjRef virt_toPersistentWithKey( const TRANS *trans,
753  const std::string& key,
754  MsgStream &log )
755  {
756  return this->toPersistentWithKey_impl( trans, key, log);
757  }
758 
760  virtual void pstoreToTrans( unsigned index, TRANS *trans, MsgStream &log ) {
761  assert (index < this->m_pStorage->size());
762  this->persToTrans( &(*this->m_pStorage)[index], trans, log );
763  }
764 
765 };
766 
767 
773 template< class TRANS, class PERS >
775  : public TPConverterBase< TRANS, PERS >
776 {
777 public:
778  // To shorten using declarations in derived classes.
780 
781 
789  virtual void persToTrans (const PERS* persObj,
790  TRANS* transObj,
791  MsgStream &log) const = 0;
792 
793 
801  virtual void transToPers (const TRANS* transObj,
802  PERS* persObj,
803  MsgStream &log) const = 0;
804 
805 
806  // These call through to the const implementations.
807  virtual void persToTrans(const PERS* persObj,
808  TRANS* transObj,
809  MsgStream &log) override final
810  {
811  return const_cast<const TPConverterConstBase*>(this)->persToTrans (persObj, transObj, log);
812  }
813 
814 
815  virtual void transToPers(const TRANS* transObj,
816  PERS* persObj,
817  MsgStream &log) override final
818  {
819  return const_cast<const TPConverterConstBase*>(this)->transToPers (transObj, persObj, log);
820  }
821 
822 
823  virtual TRANS* createTransientConst (const PERS* persObj, MsgStream& log) const;
824  virtual PERS* createPersistentConst(const TRANS* transObj, MsgStream &log) const;
825 };
826 
827 
832 template< class TRANS, class PERS >
834  : public TPConverterConstBase< TRANS, PERS >
835 {
836 public:
839 
840  // To shorten using declarations in derived classes.
842 
843 
852  virtual void persToTransWithKey (const PERS* persObj,
853  TRANS* transObj,
854  const std::string& key,
855  MsgStream &log) const = 0;
856 
857 
866  virtual void transToPersWithKey (const TRANS* transObj,
867  PERS* persObj,
868  const std::string& key,
869  MsgStream &log) const = 0;
870 
871 
872  // These call through to the const implementations.
873  virtual void persToTransWithKey (const PERS* persObj,
874  TRANS* transObj,
875  const std::string& key,
876  MsgStream &log) override final
877  {
878  return const_cast<const TPConverterWithKeyBase*>(this)->persToTransWithKey (persObj, transObj, key, log);
879  }
880 
881 
882  virtual void transToPersWithKey (const TRANS* transObj,
883  PERS* persObj,
884  const std::string& key,
885  MsgStream &log) override final
886  {
887  return const_cast<const TPConverterWithKeyBase*>(this)->transToPersWithKey (transObj, persObj, key, log);
888  }
889 
890 
891  // It's an error if the non-key versions get called.
892  virtual void persToTrans(const PERS* /*persObj*/,
893  TRANS* /*transObj*/,
894  MsgStream& /*log*/) const override final
895  {
896  throw std::runtime_error ("persToTrans called where persToTransWithKey required.");
897  }
898 
899 
900  virtual void transToPers(const TRANS* /*transObj*/,
901  PERS* /*persObj*/,
902  MsgStream& /*log*/) const override final
903  {
904  throw std::runtime_error ("transToPers called where transToPersWithKey required.");
905  }
906 };
907 
908 
909 // --------------------------------------------------------------
910 
918 template<class TRANS, class PERS, class CONV>
919 class TPPtrVectorCnv : public TPConverterBase<TRANS, PERS> {
920 public:
922 
929  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log) {
930  transVect->clear();
931  transVect->reserve( persVect->size() );
932  // convert vector entries one by one
933  for( typename PERS::const_iterator
934  it = persVect->begin(),
935  iEnd = persVect->end();
936  it != iEnd; ++it ) {
937  transVect->push_back( this->createTransFromPStore( &m_elementCnv, *it, log ) );
938  }
939  }
940 
941 
948  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) {
949  persVect->clear();
950  persVect->reserve( transVect->size() );
951  // convert vector entries one by one
952  for( typename TRANS::const_iterator
953  it = transVect->begin(),
954  iEnd = transVect->end();
955  it != iEnd;
956  ++it ) {
957  persVect->push_back( this->toPersistent( &m_elementCnv, *it, log ) );
958  }
959  }
960 
961 protected:
963  CONV *m_elementCnv;
964 };
965 
966 
967 
968 // --------------------------------------------------------------
969 
978 template<class TRANS, class PERS, class CONV>
979 class TPPtrVectorCnvConst : public TPConverterConstBase<TRANS, PERS> {
980 public:
983 
984 
986 
993  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log) const override {
994  transVect->clear();
995  transVect->reserve( persVect->size() );
996  // convert vector entries one by one
997  CONV* cnv = nullptr;
998  for( typename PERS::const_iterator
999  it = persVect->begin(),
1000  iEnd = persVect->end();
1001  it != iEnd; ++it ) {
1002  transVect->push_back( this->createTransFromPStore( &cnv,
1003  *it, log ) );
1004  }
1005  }
1006 
1007 
1014  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) const override
1015  {
1016  persVect->clear();
1017  persVect->reserve( transVect->size() );
1018  // convert vector entries one by one
1019  CONV* cnv = nullptr;
1020  for( typename TRANS::const_iterator
1021  it = transVect->begin(),
1022  iEnd = transVect->end();
1023  it != iEnd; ++it ) {
1024  persVect->push_back( this->toPersistent( &cnv, *it, log ) );
1025  }
1026  }
1027 };
1028 
1029 
1030 
1031 // --------------------------------------------------------------
1032 
1041 template<class TRANS, class PERS, class CONV>
1042 class TPThinnedPtrVectorCnv : public TPConverterWithKeyBase<TRANS, PERS> {
1043 public:
1046 
1047 
1049 
1057  virtual void persToTransWithKey (const PERS* persVect,
1058  TRANS* transVect,
1059  const std::string& /*key*/,
1060  MsgStream &log) const override
1061  {
1062  transVect->clear();
1063  transVect->reserve( persVect->size() );
1064  // convert vector entries one by one
1065  CONV* cnv = nullptr;
1066  for( typename PERS::const_iterator
1067  it = persVect->begin(),
1068  iEnd = persVect->end();
1069  it != iEnd; ++it ) {
1070  transVect->push_back( this->createTransFromPStore( &cnv,
1071  *it, log ) );
1072  }
1073  }
1074 
1075 
1083  virtual void transToPersWithKey (const TRANS* transVect,
1084  PERS* persVect,
1085  const std::string& key,
1086  MsgStream &log) const override
1087  {
1089  persVect->clear();
1090  persVect->reserve( transVect->size() );
1091  // convert vector entries one by one
1092  CONV* cnv = nullptr;
1093  size_t ipos = 0;
1094  for( typename TRANS::const_iterator
1095  it = transVect->begin(),
1096  iEnd = transVect->end();
1097  it != iEnd; ++it, ++ipos )
1098  {
1099  if (!dec || !dec->thinned (ipos)) {
1100  persVect->push_back( this->toPersistent( &cnv, *it, log ) );
1101  }
1102  }
1103  }
1104 };
1105 
1106 
1107 
1108 // --------------------------------------------------------------
1117 template<class TRANS, class PERS, class CONV>
1118 class TPPolyVectorCnv : public TPPtrVectorCnv<TRANS, PERS, CONV> {
1119 public:
1122  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) {
1123  persVect->clear();
1124  persVect->reserve( transVect->size() );
1125  // convert vector entries one by one
1126  for( typename TRANS::const_iterator
1127  it = transVect->begin(),
1128  iEnd = transVect->end();
1129  it != iEnd; ++it ) {
1130  persVect->push_back( this->toPersistent( (CONV**)0, *it, log ) );
1131  }
1132  }
1133 };
1134 
1135 
1145 template<class TRANS, class PERS, class CONV>
1146 class TPPolyVectorCnvConst : public TPPtrVectorCnvConst<TRANS, PERS, CONV> {
1147 public:
1150 
1151 
1154  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) const {
1155  persVect->clear();
1156  persVect->reserve( transVect->size() );
1157  // convert vector entries one by one
1158  for( typename TRANS::const_iterator
1159  it = transVect->begin(),
1160  iEnd = transVect->end();
1161  it != iEnd; ++it ) {
1162  persVect->push_back( this->toPersistent( (CONV**)0, *it, log ) );
1163  }
1164  }
1165 };
1166 
1167 
1168 /*
1169  Converter between
1170  transient vector<T> (by value) and persistent vector<TPObjRef>
1171 */
1172 
1173 template<class TRANS, class PERS, class CONV>
1174 class TPValVectorCnv : public TPConverterBase<TRANS, PERS> {
1175 public:
1177 
1179  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log) {
1180  transVect->clear();
1181  transVect->reserve( persVect->size() );
1182  // convert vector entries one by one
1183  typename TRANS::iterator ti = transVect->begin();
1184  typename PERS::const_iterator pi = persVect->begin(), iEnd = persVect->end();
1185  for( ; pi != iEnd; ++pi, ++ti ) {
1186  fillTransFromPStore( &m_elementCnv, *pi, &*ti, log );
1187  }
1188  }
1189 
1191  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) {
1192  persVect->clear();
1193  persVect->reserve( transVect->size() );
1194  // convert vector entries one by one
1195  for( typename TRANS::const_iterator
1196  it = transVect->begin(), iEnd = transVect->end();
1197  it != iEnd; ++it ) {
1198  persVect->push_back( toPersistent( &m_elementCnv, &*it, log ) );
1199  }
1200  }
1201 
1202 protected:
1205 };
1206 
1207 
1208 
1209 // --------------------------------------------------------------
1210 /*
1211  Converter between
1212  transient AthenaHistVector of T* and persistent vector<T>
1213 */
1214 
1215 template<class TRANS, class PERS, class CONV>
1216 class T_AthenaHitsVectorCnv : public TPConverterBase<TRANS, PERS> {
1217 public:
1219 
1221  virtual void persToTrans(const PERS* persCont, TRANS* transCont, MsgStream &log);
1223  virtual void transToPers(const TRANS* transCont, PERS* persCont, MsgStream &log);
1224 };
1225 
1226 
1227 // --------------------------------------------------------------
1228 /*
1229  Converter between
1230  transient AtlasHitsVector of T* and persistent vector<T>
1231 */
1232 
1233 template<class TRANS, class PERS, class CONV>
1234 class T_AtlasHitsVectorCnv : public TPConverterBase<TRANS, PERS> {
1235 public:
1237 
1239  virtual void persToTrans(const PERS* persCont, TRANS* transCont, MsgStream &log);
1241  virtual void transToPers(const TRANS* transCont, PERS* persCont, MsgStream &log);
1242 };
1243 
1244 
1245 // -------------------------------
1246 // OLD STYLE vector TP converters
1247 // TP conversion in-place, not involving top-level objects or TPRefs
1248 // -------------------------------------------------------------------
1249 /*
1250  Converter between
1251  transient vector of T* (like DataVector<T>)
1252  and persistent vector<T>
1253 */
1254 
1255 template<class TRANS, class PERS, class CONV>
1256 class TPCnvVector : public TPConverterBase<TRANS, PERS> {
1257 public:
1259 
1261  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log);
1263  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log);
1264 
1267 };
1268 
1269 
1270 template<class TRANS, class PERS, class CONV>
1271 class TPCnvVectorConst : public TPConverterConstBase<TRANS, PERS> {
1272 public:
1274 
1277 
1279  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log) const override;
1281  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) const override;
1282 };
1283 
1284 
1285 /*
1286  Converter between
1287  transient vector of T and persistent vector<T>
1288 */
1289 
1290 template<class TRANS, class PERS, class CONV>
1291 class TPCnvStdVector : public TPConverterBase<TRANS, PERS> {
1292 public:
1294 
1296  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log) ;
1298  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) ;
1299 };
1300 
1301 
1306 template<class TRANS, class PERS, class CONV>
1307 class TPCnvStdVectorConst : public TPConverterConstBase<TRANS, PERS>
1308 {
1309 public:
1312 
1313 
1315  virtual void persToTrans(const PERS* persVect,
1316  TRANS* transVect,
1317  MsgStream &log) const override;
1318 
1320  virtual void transToPers(const TRANS* transVect,
1321  PERS* persVect,
1322  MsgStream &log) const override;
1323 };
1324 
1325 
1326 //---------------------------------------------------------------------------------
1327 /*
1328  Converter between
1329  transient IdentifiableContainer<T> and persistent std::vector<T>
1330  Used by Muon RDO containers
1331  This version assumes RDO collection returns an identifier as a unsigned int.
1332 */
1333 
1334 template<class TRANS, class PERS, class CONV>
1335 class TPCnvIDCont : public TPConverterBase<TRANS, PERS> {
1336 public:
1338 
1340  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log) ;
1341 
1343  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) ;
1344 
1345  typedef typename TRANS::IDENTIFIABLE COLLECTION_t;
1346 
1349 };
1350 
1351 //---------------------------------------------------------------------------------
1352 /*
1353  Converter between
1354  transient IdentifiableContainer<T> and persistent std::vector<T>
1355  Used by Muon RDO containers
1356  This version assumes RDO collection returns an identifier as an Identifier
1357 */
1358 
1359 template<class TRANS, class PERS, class CONV>
1360 class TPCnvIDContFromIdentifier : public TPConverterBase<TRANS, PERS> {
1361 public:
1363 
1365  virtual void persToTrans(const PERS* persVect, TRANS* transVect, MsgStream &log) ;
1366 
1368  virtual void transToPers(const TRANS* transVect, PERS* persVect, MsgStream &log) ;
1369 
1370  typedef typename TRANS::IDENTIFIABLE COLLECTION_t;
1371 
1374 };
1375 
1376 
1377 
1378 #include "TPConverter.icc"
1379 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TPConverterConstBase::transToPers
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log) override final
Convert transient representation to persistent one.
Definition: TPConverter.h:815
TPConverterWithKeyBase::transToPersWithKey
virtual void transToPersWithKey(const TRANS *transObj, PERS *persObj, const std::string &key, MsgStream &log) const =0
Convert transient representation to persistent one.
TopLevelTPCnvBase::converterForType
ITPConverter * converterForType(const std::type_info &info) const
Find and return a TP converter for a given C++ type info.
Definition: TopLevelTPCnvBase.h:80
TPValVectorCnv::TPValVectorCnv
TPValVectorCnv()
Definition: TPConverter.h:1176
TPAbstractPolyCnvBase::m_pStorage
std::vector< PERS > * m_pStorage
the address of the storage vector for persistent representations
Definition: TPConverter.h:579
ITPConverterFor::clearReadingFlag
void clearReadingFlag()
Definition: TPConverter.h:235
ITPConverterFor
Definition: TPConverter.h:37
TPAbstractPolyCnvBase::virt_toPersistentWithKey
virtual TPObjRef virt_toPersistentWithKey(const TRANS_BASE *trans, const std::string &key, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (toPersistent_impl) in th...
Definition: TPConverter.h:515
ITPConverterFor::setReadingFlag
void setReadingFlag()
Definition: TPConverter.h:234
TPAbstractPolyCnvBase::virt_createTransFromPStore
virtual TRANS * virt_createTransFromPStore(unsigned, MsgStream &)
This method implements a pure virtual base class method, but should never be called,...
Definition: TPConverter.h:528
ITPConverterFor::m_topConverter
TopLevelTPCnvBase * m_topConverter
top level converter that owns this elemental TP converter it also holds the storage object
Definition: TPConverter.h:299
TPAbstractPolyCnvBase::TPAbstractPolyCnvBase
TPAbstractPolyCnvBase()
Definition: TPConverter.h:338
T_AthenaHitsVectorCnv::transToPers
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
transToPers
TPAbstractPolyCnvConstBase::persToTrans
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log) override final
Convert persistent representation to transient one.
Definition: TPConverter.h:631
ITPConverterFor::TransBase_t
TRANS TransBase_t
Definition: TPConverter.h:39
TPPolyCnvBase::virt_createTransFromPStoreWithKey
virtual TRANS * virt_createTransFromPStoreWithKey(unsigned index, const std::string &key, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (createTransient)
Definition: TPConverter.h:718
TPAbstractPolyCnvBase::virt_toPersistent
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...
Definition: TPConverter.h:505
TPAbstractPolyCnvBase::setPStorage
void setPStorage(std::vector< PERS > *storage)
Tell this converter which storage vector it should use to store or retrieve persistent representation...
Definition: TPConverter.h:551
T_AthenaHitsVectorCnv::T_AthenaHitsVectorCnv
T_AthenaHitsVectorCnv()
Definition: TPConverter.h:1218
TPAbstractPolyCnvBase::toPersistentWithKey_impl
TPObjRef toPersistentWithKey_impl(const TRANS *trans, const std::string &key, MsgStream &log)
Convert transient object to persistent representation.
TPCnvIDCont::m_elementCnv
CONV m_elementCnv
the TP converter used for vector elements
Definition: TPConverter.h:1348
TPCnvVectorConst
Definition: TPConverter.h:1271
TPObjRef::typeID_t::value
unsigned value() const
Returns the type ID as an integer.
Definition: TPObjRef.h:46
index
Definition: index.py:1
TPConverterConstBase::transToPers
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log) const =0
Convert transient representation to persistent one.
SG::ThinningDecisionBase
Hold thinning decisions for one container.
Definition: ThinningDecisionBase.h:39
ITPConverterFor::typeID
virtual const TPObjRef::typeID_t & typeID() const
Return TP typeID for persistent objects produced by this converter.
Definition: TPConverter.h:208
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
TPValVectorCnv::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
Definition: TPConverter.h:1179
TPConverterWithKeyBase::persToTrans
virtual void persToTrans(const PERS *, TRANS *, MsgStream &) const override final
Convert persistent representation to transient one.
Definition: TPConverter.h:892
T_AtlasHitsVectorCnv::T_AtlasHitsVectorCnv
T_AtlasHitsVectorCnv()
Definition: TPConverter.h:1236
ITPConverterFor::ITPConverterFor
ITPConverterFor()
Definition: TPConverter.h:43
TPCnvVector::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
TPCnvIDContFromIdentifier::TPCnvIDContFromIdentifier
TPCnvIDContFromIdentifier()
Definition: TPConverter.h:1362
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TPConverter.icc
TPConverterBase
Definition: TPConverter.h:738
SG::ThinningDecisionBase::thinned
bool thinned(size_t ndx) const
Return true if element ndx should be thinned.
TPPolyVectorCnvConst
Definition: TPConverter.h:1146
TopLevelTPCnvBase::converterForRef
ITPConverter * converterForRef(const TPObjRef &ref) const
Find and return a TP converter for persistent type referenced by ref.
Definition: TopLevelTPCnvBase.h:89
TPPolyCnvBase::virt_createTransFromPStore
virtual TRANS * virt_createTransFromPStore(unsigned index, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (createTransient)
Definition: TPConverter.h:706
T_AtlasHitsVectorCnv::transToPers
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
transToPers
TPPolyCnvBase::createTransientWithKey
virtual TRANS * createTransientWithKey(const PERS *persObj, const std::string &key, MsgStream &log)
Create transient representation of a persistent object, with SG key.
ThinningDecisionBase.h
Hold thinning decisions for one container.
TPAbstractPolyCnvBase::transToPersWithKeyUntyped
virtual void transToPersWithKeyUntyped(const void *trans, void *pers, const std::string &key, MsgStream &log)
Convert transient object representation to persistent.
Definition: TPConverter.h:432
ITPCnvBase.h
TPAbstractPolyCnvConstBase::transToPers
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log) const =0
Convert transient representation to persistent one.
TPAbstractPolyCnvBase::PersBase_t
PERS PersBase_t
Definition: TPConverter.h:336
TPCnvIDCont
Definition: TPConverter.h:1335
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TPAbstractPolyCnvBase::m_ignoreRecursion
bool m_ignoreRecursion
if true, do not throw errors in case of recursion.
Definition: TPConverter.h:588
TPAbstractPolyCnvBase::persistentTInfo
virtual const std::type_info & persistentTInfo() const
return C++ type id of the persistent class this converter is for
Definition: TPConverter.h:482
TPAbstractPolyCnvBase::createPersistentWithKey
virtual PERS * createPersistentWithKey(const TRANS *transObj, const std::string &key, MsgStream &log)
Create persistent representation of a transient object, with SG key.
ITPConverterFor::topConverter
virtual TopLevelTPCnvBase * topConverter()
return the top-level converter for this elemental TP converter
Definition: TPConverter.h:191
TPObjRef
Definition: TPObjRef.h:20
TPValVectorCnv
Definition: TPConverter.h:1174
TPAbstractPolyCnvBase::pstoreToTrans
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.
Definition: TPConverter.h:494
pi
#define pi
Definition: TileMuonFitter.cxx:65
ITPConverterFor::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
TPConverterWithKeyBase::persToTransWithKey
virtual void persToTransWithKey(const PERS *persObj, TRANS *transObj, const std::string &key, MsgStream &log) const =0
Convert persistent representation to transient one.
TPCnvStdVectorConst::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log) const override
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
ITPConverterFor::transBaseTInfo
const std::type_info & transBaseTInfo() const
return C++ type id of the common base transient type for all converters for a group of polymorphic ty...
Definition: TPConverter.h:205
TPAbstractPolyCnvBase::transToPers
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log)=0
Convert transient representation to persistent one.
ITPConverterFor::m_wasUsedForReading
bool m_wasUsedForReading
flag set when using this converter for reading triggers search for a new converter before writing,...
Definition: TPConverter.h:306
TPConverterConstBase::persToTrans
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log) override final
Convert persistent representation to transient one.
Definition: TPConverter.h:807
TPCnvStdVector
Definition: TPConverter.h:1291
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TPPolyCnvBase
Definition: TPConverter.h:674
TPConverterWithKeyBase::transToPers
virtual void transToPers(const TRANS *, PERS *, MsgStream &) const override final
Convert transient representation to persistent one.
Definition: TPConverter.h:900
TPCnvVectorConst::TPCnvVectorConst
TPCnvVectorConst()
Definition: TPConverter.h:1273
TPValVectorCnv::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1191
TPAbstractPolyCnvBase
Definition: TPConverter.h:332
ITPConverterFor::converterForType
CNV * converterForType(CNV *cnv, const std::type_info &t_info, MsgStream &log) const
Find converter for a given C++ type ID, that is or ihnerits from CNV type.
Definition: TPConverter.h:58
TPPolyCnvBase::TPPolyCnvBase
TPPolyCnvBase()
Definition: TPConverter.h:676
TPPtrVectorCnvConst
Definition: TPConverter.h:979
TPConverterBase::virt_toPersistentWithKey
virtual TPObjRef virt_toPersistentWithKey(const TRANS *trans, const std::string &key, MsgStream &log)
Internal interface method that is used to invoke the real conversion method (toPersistent_impl) in th...
Definition: TPConverter.h:752
TPCnvVector::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
ITPConverterFor::PolyCnvBase_t
ITPConverterFor< TRANS > PolyCnvBase_t
Definition: TPConverter.h:41
TPValVectorCnv::m_elementCnv
CONV * m_elementCnv
pointer to the TP converter used for vector elements
Definition: TPConverter.h:1204
ITPConverterFor::m_pStorageTID
TPObjRef::typeID_t m_pStorageTID
TP Ref typeID for the persistent objects this converter is creating.
Definition: TPConverter.h:292
ITPConverterFor::setRuntimeTopConverter
virtual void setRuntimeTopConverter(TopLevelTPCnvBase *topConverter)
Set runtime top-level converter - usually it is the owning TL converter, but in case of extended obje...
Definition: TPConverter.h:215
TPAbstractPolyCnvBase::reservePStorage
virtual void reservePStorage(size_t size)
Reserve 'size' elements for persistent storage.
Definition: TPConverter.h:573
master.flag
bool flag
Definition: master.py:29
TPPtrVectorCnvConst::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log) const override
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
Definition: TPConverter.h:993
TPPtrVectorCnv::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:948
TPAbstractPolyCnvBase::Trans_t
TRANS Trans_t
Definition: TPConverter.h:334
getThinningCache.h
Helpers to retrieve the current thinning cache from the event context.
TPAbstractPolyCnvBase::persToTransWithKey
virtual void persToTransWithKey(const PERS *persObj, TRANS *transObj, const std::string &, MsgStream &log)
Convert persistent representation to transient one.
Definition: TPConverter.h:376
TPPtrVectorCnv::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
Definition: TPConverter.h:929
TPPolyVectorCnv::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1122
TPConverterConstBase::createPersistentConst
virtual PERS * createPersistentConst(const TRANS *transObj, MsgStream &log) const
TPConverterBase::pstoreToTrans
virtual void pstoreToTrans(unsigned index, TRANS *trans, MsgStream &log)
Convert persistent representation stored in the storage vector of the top-level object to transient.
Definition: TPConverter.h:760
ITPConverter.h
Defines the base ITPConverter class interface for all TP converters. Also defines TPConverterTypeMap ...
ITPConverterFor::Trans_t
TransBase_t Trans_t
Definition: TPConverter.h:40
T_AtlasHitsVectorCnv
Definition: TPConverter.h:1234
TPCnvIDContFromIdentifier::m_elementCnv
CONV m_elementCnv
the TP converter used for vector elements
Definition: TPConverter.h:1373
ITPConverterFor::m_topConverterRuntime
TopLevelTPCnvBase * m_topConverterRuntime
top level converter "owning" this TP converter at runtime (different from m_topConverter in case the ...
Definition: TPConverter.h:302
TPAbstractPolyCnvBase::Pers_t
PERS Pers_t
Definition: TPConverter.h:335
TPCnvIDContFromIdentifier
Definition: TPConverter.h:1360
TPCnvIDCont::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
TPAbstractPolyCnvBase::transToPersUntyped
virtual void transToPersUntyped(const void *trans, void *pers, MsgStream &log)
Convert transient object representation to persistent.
Definition: TPConverter.h:410
ITPConverterFor::converterForRef
CNV * converterForRef(CNV *cnv, const TPObjRef &ref, MsgStream &log) const
Find converter for a TP type ID (passed in a TP Ref), that is or ihnerits from CNV type.
Definition: TPConverter.h:74
TPPtrVectorCnv::TPPtrVectorCnv
TPPtrVectorCnv()
Definition: TPConverter.h:921
ITPConverterFor::toPersistent
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...
Definition: TPConverter.h:119
ITPConverterFor::baseToPersistent
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Persistify bass class of a given object and store the persistent represenation in the storage vector ...
Definition: TPConverter.h:97
SG::getThinningDecision
const SG::ThinningDecisionBase * getThinningDecision(const EventContext &ctx, const std::string &key)
Retrieve the current thinning decision for key.
Definition: getThinningCache.cxx:83
TPCnvStdVector::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
T_AtlasHitsVectorCnv::persToTrans
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
persToTrans
TPConverterConstBase::persToTrans
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log) const =0
Convert persistent representation to transient one.
ITPConverterFor::topConverter
virtual const TopLevelTPCnvBase * topConverter() const
return the top-level converter for this elemental TP converter
Definition: TPConverter.h:196
TopLevelTPCnvBase
Base class for top-level TP converters.
Definition: TopLevelTPCnvBase.h:32
ITPConverterFor::setTopConverter
virtual void setTopConverter(TopLevelTPCnvBase *topConverter, const TPObjRef::typeID_t &TPtypeID)
Set which top-level converter owns this elemental converter, and what TPtypeID was assigned to the pe...
Definition: TPConverter.h:221
PERS
RpcSectorLogicContainer_p1 PERS
Definition: RpcSectorLogicContainerCnv.h:13
ITPConverterFor::pstoreToTrans
virtual void pstoreToTrans(unsigned index, TransBase_t *transObj, MsgStream &log)=0
Internal interface method that is used to invoke the real conversion method (persToTrans) in the deri...
RpcSectorLogicContainer_p1
Class to represent.
Definition: RpcSectorLogicContainer_p1.h:19
ITPConverterFor::~ITPConverterFor
virtual ~ITPConverterFor()=default
TPCnvIDCont::TPCnvIDCont
TPCnvIDCont()
Definition: TPConverter.h:1337
ITPConverterFor::wasUsedForReading
bool wasUsedForReading()
Definition: TPConverter.h:236
TPAbstractPolyCnvConstBase
Definition: TPConverter.h:600
TPCnvIDCont::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
TPThinnedPtrVectorCnv::TPThinnedPtrVectorCnv
TPThinnedPtrVectorCnv()
Definition: TPConverter.h:1048
TPAbstractPolyCnvBase::transToPersWithKey
virtual void transToPersWithKey(const TRANS *transObj, PERS *persObj, const std::string &, MsgStream &log)
Convert transient representation to persistent one.
Definition: TPConverter.h:392
ITPConverterFor::typeIDvalue
unsigned typeIDvalue() const
inlined non-virtual version to get the typeID value fast
Definition: TPConverter.h:211
TPCnvIDContFromIdentifier::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
ITPConverterFor::initPrivateConverters
virtual void initPrivateConverters(TopLevelTPCnvBase *)
Definition: TPConverter.h:187
TPAbstractPolyCnvBase::m_recursive
bool m_recursive
if true, work in recursion-safe way (slower)
Definition: TPConverter.h:585
TPCnvStdVector::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
TPThinnedPtrVectorCnv::persToTransWithKey
virtual void persToTransWithKey(const PERS *persVect, TRANS *transVect, const std::string &, MsgStream &log) const override
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
Definition: TPConverter.h:1057
ITPConverterFor::virt_createTransFromPStoreWithKey
virtual TRANS * virt_createTransFromPStoreWithKey(unsigned index, const std::string &key, MsgStream &log)=0
Internal interface method that is used to invoke the real conversion method (createTransient) in the ...
TPAbstractPolyCnvBase::virt_createTransFromPStoreWithKey
virtual TRANS * virt_createTransFromPStoreWithKey(unsigned, const std::string &, MsgStream &)
This method implements a pure virtual base class method, but should never be called,...
Definition: TPConverter.h:539
TPPtrVectorCnvConst::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log) const override
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1014
TPThinnedPtrVectorCnv::transToPersWithKey
virtual void transToPersWithKey(const TRANS *transVect, PERS *persVect, const std::string &key, MsgStream &log) const override
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1083
TPAbstractPolyCnvConstBase::transToPers
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log) override final
Convert transient representation to persistent one.
Definition: TPConverter.h:639
TPConverterWithKeyBase::transToPersWithKey
virtual void transToPersWithKey(const TRANS *transObj, PERS *persObj, const std::string &key, MsgStream &log) override final
Convert transient representation to persistent one.
Definition: TPConverter.h:882
ITPConverterFor::m_pStorageTIDvalue
unsigned m_pStorageTIDvalue
m_pStorageTID converted to integer value
Definition: TPConverter.h:295
TPConverterBase::virt_toPersistent
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...
Definition: TPConverter.h:747
TPConverterBase::~TPConverterBase
virtual ~TPConverterBase()=default
ref
const boost::regex ref(r_ef)
TPConverterWithKeyBase
Definition: TPConverter.h:835
TPCnvStdVectorConst
Const version of TPCnvStdVector.
Definition: TPConverter.h:1308
T_AthenaHitsVectorCnv::persToTrans
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
persToTrans
TPAbstractPolyCnvBase::persToTrans
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log)=0
Convert persistent representation to transient one.
TPPtrVectorCnvConst::TPPtrVectorCnvConst
TPPtrVectorCnvConst()
Definition: TPConverter.h:985
TPConverterWithKeyBase::persToTransWithKey
virtual void persToTransWithKey(const PERS *persObj, TRANS *transObj, const std::string &key, MsgStream &log) override final
Convert persistent representation to transient one.
Definition: TPConverter.h:873
TopLevelTPCnvBase.h
Defines the base class for top-level TP converters.
TPCnvStdVector::TPCnvStdVector
TPCnvStdVector()
Definition: TPConverter.h:1293
T_AthenaHitsVectorCnv
Definition: TPConverter.h:1216
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TPCnvVectorConst::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log) const override
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
TPPolyVectorCnv
Definition: TPConverter.h:1118
TPPtrVectorCnv::m_elementCnv
CONV * m_elementCnv
pointer to the TP converter used for vector elements
Definition: TPConverter.h:963
TPCnvIDContFromIdentifier::COLLECTION_t
TRANS::IDENTIFIABLE COLLECTION_t
Definition: TPConverter.h:1370
TPCnvStdVectorConst::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log) const override
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
TPCnvVector
Definition: TPConverter.h:1256
TPPolyVectorCnvConst::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log) const
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1154
TPAbstractPolyCnvBase::setRecursive
void setRecursive(bool flag=true)
Tell the converter if it should work in recursive mode slower but it can safely handle recursion.
Definition: TPConverter.h:559
TPObjRef::typeID_t
Definition: TPObjRef.h:31
TPAbstractPolyCnvBase::persToTransUntyped
virtual void persToTransUntyped(const void *pers, void *trans, MsgStream &log)
Convert persistent object representation to transient.
Definition: TPConverter.h:400
ITPConverter
Definition: TPTools/TPTools/ITPConverter.h:32
TPPolyCnvBase::~TPPolyCnvBase
virtual ~TPPolyCnvBase()=default
ITPConverter::converterNotFound
virtual void converterNotFound(const std::type_info &converterType, ITPConverter *c, const std::string &typeName, MsgStream &log) const
method called when the right TP converter was not found during writing
Definition: ITPConverter.cxx:22
TPObjRef::typeID
unsigned typeID() const
returns the type ID (as integer) of the referenced object
Definition: TPObjRef.h:71
TPPtrVectorCnv
Definition: TPConverter.h:919
TPCnvVector::m_elementCnv
CONV m_elementCnv
the TP converter used for vector elements
Definition: TPConverter.h:1266
TPThinnedPtrVectorCnv
Definition: TPConverter.h:1042
ITPConverterFor::transientTInfo
virtual const std::type_info & transientTInfo() const
return C++ type id of the transient class this converter is for
Definition: TPConverter.h:201
ITPConverterFor::virt_createTransFromPStore
virtual TRANS * virt_createTransFromPStore(unsigned index, MsgStream &log)=0
Internal interface method that is used to invoke the real conversion method (createTransient) in the ...
TPConverterConstBase
Definition: TPConverter.h:776
ITPConverterFor::virt_toPersistent
virtual TPObjRef virt_toPersistent(const TransBase_t *trans, MsgStream &log)=0
Internal interface method that is used to invoke the real conversion method (toPersistent_impl) in th...
TPCnvVectorConst::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log) const override
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
python.compressB64.c
def c
Definition: compressB64.py:93
TPAbstractPolyCnvBase::ignoreRecursion
void ignoreRecursion(bool flag=false)
Tell the converter to ignore recursion (do not throw errors) even when recurion is detected.
Definition: TPConverter.h:568
TPAbstractPolyCnvBase::persToTransWithKeyUntyped
virtual void persToTransWithKeyUntyped(const void *pers, void *trans, const std::string &key, MsgStream &log)
Convert persistent object representation to transient.
Definition: TPConverter.h:420
TPAbstractPolyCnvBase::transientTInfo
virtual const std::type_info & transientTInfo() const
return C++ type id of the transient class this converter is for
Definition: TPConverter.h:479
TPCnvIDContFromIdentifier::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
TPAbstractPolyCnvBase::~TPAbstractPolyCnvBase
virtual ~TPAbstractPolyCnvBase()=default
TPAbstractPolyCnvBase::m_curRecLevel
int m_curRecLevel
count recursive invocations, to detect recursion
Definition: TPConverter.h:582
TPCnvVector::TPCnvVector
TPCnvVector()
Definition: TPConverter.h:1258
TPConverterConstBase::createTransientConst
virtual TRANS * createTransientConst(const PERS *persObj, MsgStream &log) const
ITPConverterFor::virt_toPersistentWithKey
virtual TPObjRef virt_toPersistentWithKey(const TransBase_t *trans, const std::string &key, MsgStream &log)=0
Internal interface method that is used to invoke the real conversion method (toPersistent_impl) in th...
ITPConverterFor::createTransFromPStore
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...
Definition: TPConverter.h:172
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TPAbstractPolyCnvConstBase::persToTrans
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log) const =0
Convert persistent representation to transient one.
TPConverterBase::TPConverterBase
TPConverterBase()
Definition: TPConverter.h:740
TPCnvIDCont::COLLECTION_t
TRANS::IDENTIFIABLE COLLECTION_t
Definition: TPConverter.h:1345