ATLAS Offline Software
Loading...
Searching...
No Matches
MaterialStepCollectionCnv_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
6// MaterialStepCollectionCnv_p1.h, (c) ATLAS Detector software
8
9#ifndef MATERIAKSTEPCOLLECTION_CNV_P1_TRK_H
10#define MATERIAKSTEPCOLLECTION_CNV_P1_TRK_H
11
13
18
19
20class MsgStream;
21
22class MaterialStepCollectionCnv_p1 : public T_AthenaPoolTPCnvBase< Trk::MaterialStepCollection, Trk::MaterialStepCollection_p1 >
23{
24 public:
25
29
31 virtual void persToTrans(const Trk::MaterialStepCollection_p1* persVect, Trk::MaterialStepCollection* transVect, MsgStream &log) {
32 transVect->clear();
33 transVect->reserve( persVect->size() );
34 // convert vector entries one by one
35 Trk::MaterialStepCollection_p1::const_iterator it = persVect->begin();
36 Trk::MaterialStepCollection_p1::const_iterator iEnd = persVect->end();
37 for ( ; it != iEnd; ++it ) {
38 const Trk::MaterialStep_p1* ms = &(*it);
39 transVect->push_back( m_materialStepCnv.createTransient(ms, log ) );
40 }
41 }
42
44 virtual void transToPers(const Trk::MaterialStepCollection* transVect, Trk::MaterialStepCollection_p1* persVect, MsgStream &log) {
45 persVect->clear();
46 persVect->resize( transVect->size() );
47 // convert vector entries one by one
48 unsigned int i=0;
51 for( ; it != iEnd; ++it ) {
52 m_materialStepCnv.transToPers(*it, &(*persVect)[i++], log ) ;
53 }
54 }
55
56 private :
58};
59
60#endif // MATERIAKSTEPCOLLECTION_CNV_P1_TRK_H
TPConverterBase< TRANS, PERS > T_AthenaPoolTPCnvBase
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void clear()
Erase all the elements in the collection.
virtual void transToPers(const Trk::MaterialStepCollection *transVect, Trk::MaterialStepCollection_p1 *persVect, MsgStream &log)
transient to persistent
virtual void persToTrans(const Trk::MaterialStepCollection_p1 *persVect, Trk::MaterialStepCollection *transVect, MsgStream &log)
persistent to transient
MaterialStepCollectionCnv_p1()
Standard constructor.
the persistent object is simply a std::vector<float> where
DataVector< Trk::MaterialStep > MaterialStepCollection
#define private