This class is a more specialized version of TopLevelTPCnvBase - it is a template parametrized by the actual type of the persistent object the converter will work with.
More...
#include <TopLevelTPCnvBaseP.h>
Inherits TopLevelTPCnvBase.
Inherited by TopLevelTPConverter< SegmentCollectionCnv_p1, Trk::SegmentCollection_tlp4 >, TopLevelTPConverter< TrackCollectionCnv_p4, Trk::TrackCollection_tlp6 >, TopLevelTPConverter< TrackCollectionCnv_p4, Trk::TrackCollection_tlp7 >, Analysis::JetTagInfoCnv_tlp1, Analysis::JetTagInfoCnv_tlp2, Analysis::JetTagInfoCnv_tlp3, InDetTrackCnv_tlp1, InDetTrackCnv_tlp2, MuonMeasurementsCnv_tlp1, MuonMeasurementsCnv_tlp2, and TopLevelTPConverter< MAIN_CNV, TL_PERS >.
template<class TL_PERS>
class TopLevelTPCnvBaseP< TL_PERS >
This class is a more specialized version of TopLevelTPCnvBase - it is a template parametrized by the actual type of the persistent object the converter will work with.
It provided implementations for several methods that were pure virtual before (because of the lack of specific type there)
Definition at line 25 of file TopLevelTPCnvBaseP.h.
◆ convIdMap_t
◆ TopLevelTPCnvBaseP() [1/2]
Definition at line 41 of file TopLevelTPCnvBaseP.h.
TL_PERS * m_tlPersObject
The persistent object this conveter is working on.
◆ ~TopLevelTPCnvBaseP()
Definition at line 43 of file TopLevelTPCnvBaseP.h.
virtual void deleteTLPersObject() override
Delete the persistent object owned by the converter.
◆ TopLevelTPCnvBaseP() [2/2]
◆ addExtTPConverterForReading()
| void TopLevelTPCnvBase::addExtTPConverterForReading |
( |
ITPConverter * | cnv | ) |
|
|
virtualinherited |
add extending TP converter to this top level converter - to the list consulted when reading only.
- Parameters
-
| cnv | [IN] the TP converter to be added |
Definition at line 47 of file TopLevelTPCnvBase.cxx.
48{
49
50
51
52 m_convIdMap[ converter->typeID().value() ] = converter;
53
54
55 converter->setRuntimeTopConverter( this );
56}
convIdMap_t m_convIdMap
Map of elemental TP converters indexed by their ID - used for reading.
◆ addTPConverter()
| void TopLevelTPCnvBase::addTPConverter |
( |
ITPConverter * | cnv | ) |
|
|
virtualinherited |
Add a TP converter to this top level converter.
- Parameters
-
| cnv | [IN] the TP converter to be added |
Definition at line 11 of file TopLevelTPCnvBase.cxx.
12{
15}
virtual void addTPConverterForReading(ITPConverter *cnv)
Add a TP converter to this top level converter but only for reading.
virtual void addTPConverterForWriting(ITPConverter *cnv)
add TP converter to the list of converters consulted when writing - internal method.
◆ addTPConverterForReading()
| void TopLevelTPCnvBase::addTPConverterForReading |
( |
ITPConverter * | cnv | ) |
|
|
virtualinherited |
Add a TP converter to this top level converter but only for reading.
Old converters that read schema evolved objects should be added only for reading.
- Parameters
-
| cnv | [IN] the TP converter to be added |
Definition at line 19 of file TopLevelTPCnvBase.cxx.
20{
21
22
23
26
27
28 converter->setTopConverter( this, full_typeID );
29}
virtual unsigned short getConverterID()=0
unsigned m_typeIDCount
Counter used to create typed IDs used in the transient Ref.
◆ addTPConverterForWriting()
| void TopLevelTPCnvBase::addTPConverterForWriting |
( |
ITPConverter * | cnv | ) |
|
|
privatevirtualinherited |
add TP converter to the list of converters consulted when writing - internal method.
- Parameters
-
| cnv | [IN] the TP converter to be added |
Definition at line 33 of file TopLevelTPCnvBase.cxx.
34{
35
36
37 const std::type_info &
info( converter->transientTInfo() );
39
40 const std::string
error(
"Duplicate TP converter for class ");
41 throw std::runtime_error( error +
info.name() );
42 }
44}
TPConverterTypeMap< ITPConverter > m_converters
Map of elemental TP converters indexed by transient typeid - used for writing.
◆ addTPConvertersForReadingTo()
copy all extending converters from this top level converter to "dest" top level converter - for reading
- Parameters
-
| dest | [IN] destination converter which will receive all elemental TP converters that this one has |
Definition at line 78 of file TopLevelTPCnvBase.cxx.
79{
80
81 if( cnv->hasConvertersFrom( this ) ) {
82 return;
83 }
84
85 for( convIdMap_t::const_iterator itr =
m_convIdMap.begin();
87 cnv->addExtTPConverterForReading( itr->second );
88 }
89
90 cnv->rememberConverter( this );
91}
◆ addTPConvertersTo()
copy all extending converters from this top level converter to "dest" top level converter
copy all TP converters to another topLevel conveter
- Parameters
-
| dest | [IN] destination converter which will receive all elemental TP converters that this one has |
Definition at line 60 of file TopLevelTPCnvBase.cxx.
61{
62
63 for( convIdMap_t::const_iterator itr =
m_convIdMap.begin();
65
66 if(
m_converters.findConverter( itr->second->transientTInfo() ) == itr->second ) {
67
68 cnv->addTPConverterForWriting( itr->second );
69 }
70
71 cnv->addExtTPConverterForReading( itr->second );
72 }
73
74 cnv->rememberConverter( this );
75}
◆ clearTLPersObject()
◆ converterForRef()
Find and return a TP converter for persistent type referenced by ref.
- Parameters
-
| ref | [IN] TP reference of a persistent object |
- Returns
- ITPConverter* pointer to the TP converter for ref
Definition at line 89 of file TopLevelTPCnvBase.h.
89 {
93 }
const boost::regex ref(r_ef)
◆ converterForType()
| ITPConverter * TopLevelTPCnvBase::converterForType |
( |
const std::type_info & | info | ) |
const |
|
inlineinherited |
Find and return a TP converter for a given C++ type info.
- Parameters
-
| info | [IN] C++ type info reference to the transient type |
- Returns
- ITPConverter* pointer to the TP converter for type info
Definition at line 80 of file TopLevelTPCnvBase.h.
◆ createTLPersObject()
Create persistent object - the converter keeps it.
Implements TopLevelTPCnvBase.
Definition at line 57 of file TopLevelTPCnvBaseP.h.
57 {
60 }
This class is a more specialized version of TopLevelTPCnvBase - it is a template parametrized by the ...
virtual void setPStorage(TL_PERS *persObj)=0
A stub for a method that should be provided by the converter creator.
◆ deleteTLPersObject()
Delete the persistent object owned by the converter.
Implements TopLevelTPCnvBase.
Definition at line 64 of file TopLevelTPCnvBaseP.h.
64 {
68 }
69 }
virtual void clearTLPersObject() override
Discard the persistent object.
◆ getConverterID()
| virtual unsigned short TopLevelTPCnvBase::getConverterID |
( |
| ) |
|
|
pure virtualinherited |
- Returns
- ID of the converter
Implemented in Analysis::JetTagInfoCnv_tlp1, Analysis::JetTagInfoCnv_tlp2, Analysis::JetTagInfoCnv_tlp3, InDetTrackCnv_tlp1, InDetTrackCnv_tlp2, JetTagInfoCnv_tlp1, JetTagInfoCnv_tlp2, JetTagInfoCnv_tlp3, MuonCaloEnergyContainerCnv_tlp1, MuonMeasurementsCnv_tlp1, MuonMeasurementsCnv_tlp2, MVFVxContainerCnv_tlp1, TopLevelTPConverter< MAIN_CNV, TL_PERS >, TopLevelTPConverter< SegmentCollectionCnv_p1, Trk::SegmentCollection_tlp4 >, TopLevelTPConverter< TrackCollectionCnv_p4, Trk::TrackCollection_tlp6 >, TopLevelTPConverter< TrackCollectionCnv_p4, Trk::TrackCollection_tlp7 >, V0ContainerCnv_tlp1, and V0ContainerCnv_tlp2.
◆ getTLPersObject() [1/2]
- Returns
- pointer to the persistent object owned by this converter
Definition at line 72 of file TopLevelTPCnvBaseP.h.
◆ getTLPersObject() [2/2]
- Returns
- pointer to the persistent object owned by this converter
Definition at line 77 of file TopLevelTPCnvBaseP.h.
◆ getTLPersObjectAsVoid() [1/2]
◆ getTLPersObjectAsVoid() [2/2]
◆ getTokenListVar()
Return the list of tokens to the objects extending the object owned by this converter.
This method is needed only in a conveter which has extensions. It needs to be implemented in the top-level converter by the user
- Returns
- pointer to the token list from the persistent object
Implements TopLevelTPCnvBase.
Reimplemented in CscPrepDataContainerCnv_tlp1, CscStripPrepDataContainerCnv_tlp1, JetCollectionCnv_tlp2, JetCollectionCnv_tlp5, JetCollectionCnv_tlp6, JetKeyDescriptorCollectionCnv_tlp1, LayerMaterialMapCnv_tlp1, MdtPrepDataContainerCnv_tlp1, PixelClusterContainerCnv_tlp1, RpcPrepDataContainerCnv_tlp1, SCT_ClusterContainerCnv_tlp1, SegmentCollectionCnv_tlp1, SegmentCollectionCnv_tlp2, SegmentCollectionCnv_tlp3, TgcCoinDataContainerCnv_tlp1, TgcCoinDataContainerCnv_tlp2, TgcCoinDataContainerCnv_tlp3, TgcPrepDataContainerCnv_tlp1, TrackCollectionCnv_tlp1, TrackCollectionCnv_tlp2, TrackCollectionCnv_tlp3, TrackCollectionCnv_tlp4, TrackCollectionCnv_tlp5, TrackParticleContainerCnv_tlp1, TrackParticleContainerCnv_tlp2, TrackParticleContainerCnv_tlp3, TRT_DriftCircleContainerCnv_tlp1, VxContainerCnv_tlp1, and VxContainerCnv_tlp2.
Definition at line 112 of file TopLevelTPCnvBaseP.h.
◆ getTokenListVarFrom()
Return the list of tokens to the objects extending the object NOT owned by this converter.
- Parameters
-
| persObj | [IN] persistent object from which contains list of tokens. Passes as void* - if the type is wrong, it may crash |
- Returns
- pointer to the token list from persObj
Implements TopLevelTPCnvBase.
Definition at line 115 of file TopLevelTPCnvBaseP.h.
115 {
116
117
123 }
virtual TPCnvTokenList_p1 * getTokenListVar() override
Return the list of tokens to the objects extending the object owned by this converter.
◆ hasConvertersFrom()
Check if TP converters from a given top-level converter were already registered in this converter.
- Parameters
-
| cnv | [IN] top-level converter to check |
- Returns
- true if TP converters from cnv were already registered
Definition at line 166 of file TopLevelTPCnvBase.h.
167 {
169 }
std::set< TopLevelTPCnvBase * > m_registeredTLConverters
Set top-level converters from which elemental TP converters were registered.
◆ hasTLPersObject()
◆ operator=()
◆ releaseTLPersObject()
◆ rememberConverter()
Remember that elemental TP converters from the given top-level converter are already registered.
- Parameters
-
| cnv | [IN] top-level TP converter - source of the elemental TP converters |
Definition at line 156 of file TopLevelTPCnvBase.h.
◆ setPStorage()
A stub for a method that should be provided by the converter creator.
In that methods all elemental TP converters that belong to this top-level converter need to be assigned to storage vectors in the persistent object.
- Parameters
-
| persObj | [IN] persistent object |
Implemented in TopLevelTPConverter< MAIN_CNV, TL_PERS >.
◆ setTLPersObject()
Take ownership of the persistent object.
Also initialize all elemental TP converters to use that object.
- Parameters
-
| persObj | [IN] the persistent object passed as void* |
Implements TopLevelTPCnvBase.
Definition at line 104 of file TopLevelTPCnvBaseP.h.
◆ m_converters
Map of elemental TP converters indexed by transient typeid - used for writing.
Definition at line 180 of file TopLevelTPCnvBase.h.
◆ m_convIdMap
Map of elemental TP converters indexed by their ID - used for reading.
Definition at line 177 of file TopLevelTPCnvBase.h.
◆ m_registeredTLConverters
Set top-level converters from which elemental TP converters were registered.
Definition at line 184 of file TopLevelTPCnvBase.h.
◆ m_tlPersObject
◆ m_typeIDCount
| unsigned TopLevelTPCnvBase::m_typeIDCount |
|
protectedinherited |
Counter used to create typed IDs used in the transient Ref.
Definition at line 187 of file TopLevelTPCnvBase.h.
The documentation for this class was generated from the following file: