ATLAS Offline Software
SegmentCollectionCnv_p1.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SEGMENT_COLLECTION_CNV_P1_H
6 #define SEGMENT_COLLECTION_CNV_P1_H
7 
8 //-----------------------------------------------------------------------------
9 //
10 // file: SegmentCollectionCnv_p1.h
11 //
12 //-----------------------------------------------------------------------------
13 
15 
19 #include "TrkSegment/Segment.h"
20 
21 class MsgStream;
22 
24  : public T_AthenaPoolTPCnvBase< Trk::SegmentCollection, Trk::SegmentCollection_p1 >
25 {
26 public:
28 
29 // remark: the usual templated needed to be overwritten in this case because
30 // 1) SegmentCollection is DV< Segments >
31 // 2) but Segment and TrkSegment have their T/P entry point at MeasurementBase which
32 // is their highers abstract base class
33  virtual void transToPers(const Trk::SegmentCollection* transVect, Trk::SegmentCollection_p1* persVect, MsgStream &log) {
34  persVect->clear();
35  persVect->reserve( transVect->size() );
36  // convert vector entries one by one
38  it != transVect->end(); ++it ) {
39  persVect->push_back( toPersistent( (ITPConverterFor<Trk::MeasurementBase>**)0, *it, log ) );
40  }
41  }
42 
43 
44  virtual void persToTrans(const Trk::SegmentCollection_p1* persVect, Trk::SegmentCollection* transVect, MsgStream &log)
45  {
46  transVect->clear();
47  transVect->reserve( persVect->size() );
48  // convert vector entries one by one
49  for( Trk::SegmentCollection_p1::const_iterator it = persVect->begin();
50  it != persVect->end(); ++it )
51  {
53  }
54  }
55 
56 };
57 
58 
59 #endif
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
SegmentCollectionCnv_p1::persToTrans
virtual void persToTrans(const Trk::SegmentCollection_p1 *persVect, Trk::SegmentCollection *transVect, MsgStream &log)
Definition: SegmentCollectionCnv_p1.h:44
ITPConverterFor< Trk::MeasurementBase >
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MeasurementBase.h
SegmentCollection_p1.h
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TPConverterBase
Definition: TPConverter.h:738
T_AthenaPoolTPConverter.h
Trk::Segment
Definition: Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h:56
DataVector< Trk::Segment >
DataVector::clear
void clear()
Erase all the elements in the collection.
SegmentCollectionCnv_p1
Definition: SegmentCollectionCnv_p1.h:25
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
SegmentCollectionCnv_p1::SegmentCollectionCnv_p1
SegmentCollectionCnv_p1()
Definition: SegmentCollectionCnv_p1.h:27
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SegmentCollectionCnv_p1::transToPers
virtual void transToPers(const Trk::SegmentCollection *transVect, Trk::SegmentCollection_p1 *persVect, MsgStream &log)
Definition: SegmentCollectionCnv_p1.h:33
Trk::SegmentCollection_p1
Definition: SegmentCollection_p1.h:21
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
SegmentCollection.h
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Segment.h
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