ATLAS Offline Software
TRT_BSIdErrContainerCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
10 #include "AthAllocators/DataPool.h"
11 
12 #include <iostream>
13 
15 (const TRT_BSIdErrContainer* transCont, TRT_BSIdErrContainer_p1* persCont, MsgStream & /* log */)
16 {
18  TRT_BSIdErrContainer::const_iterator itEnd = transCont->end();
19  (persCont->m_bsErrs).reserve(transCont->size());
20 
21  for (; it != itEnd; ++it) {
22  // FIXME: Should change type of m_bsErrs, but don't want to cause possible
23  // back-compatibility problems.
24  std::pair<uint8_t, std::pair<uint32_t, uint8_t> >* ptr ATLAS_THREAD_SAFE = const_cast<std::pair<uint8_t, std::pair<uint32_t, uint8_t> >*> (*it);
25  (persCont->m_bsErrs).push_back(ptr);
26  }
27  }
28 
29 void TRT_BSIdErrContainerCnv_p1::persToTrans(const TRT_BSIdErrContainer_p1* persCont, TRT_BSIdErrContainer* transCont, MsgStream & /* log */)
30 {
31 
32  std::vector<std::pair<uint8_t, std::pair<uint32_t, uint8_t> >* >::const_iterator it = (persCont->m_bsErrs).begin();
33  std::vector<std::pair<uint8_t, std::pair<uint32_t, uint8_t> >* >::const_iterator itEnd = (persCont->m_bsErrs).end();
34  transCont->reserve((persCont->m_bsErrs).size());
35 
36  for (; it != itEnd; ++it) {
37  transCont->push_back(*it);
38  }
39 
40 }
41 
42 //================================================================
44  std::unique_ptr<TRT_BSIdErrContainer> trans(std::make_unique<TRT_BSIdErrContainer>());
45  persToTrans(persObj, trans.get(), log);
46  return(trans.release());
47 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TRT_BSIdErrContainerCnv_p1.h
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TRT_BSIdErrContainerCnv_p1::transToPers
virtual void transToPers(const TRT_BSIdErrContainer *transCont, TRT_BSIdErrContainer_p1 *persCont, MsgStream &log)
Definition: TRT_BSIdErrContainerCnv_p1.cxx:15
TRT_BSIdErrContainer.h
TRT_BSIdErrContainerCnv_p1::createTransient
virtual TRT_BSIdErrContainer * createTransient(const TRT_BSIdErrContainer_p1 *persObj, MsgStream &log)
Definition: TRT_BSIdErrContainerCnv_p1.cxx:43
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TRT_BSIdErrContainer_p1.h
TRT_BSIdErrContainerCnv_p1::persToTrans
virtual void persToTrans(const TRT_BSIdErrContainer_p1 *persCont, TRT_BSIdErrContainer *transCont, MsgStream &log)
Definition: TRT_BSIdErrContainerCnv_p1.cxx:29
TRT_BSIdErrContainer_p1::m_bsErrs
std::vector< std::pair< uint8_t, std::pair< uint32_t, uint8_t > > * > m_bsErrs
Definition: TRT_BSIdErrContainer_p1.h:18
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DataPool.h
IdentifierHash.h
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
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
TRT_BSIdErrContainer_p1
Definition: TRT_BSIdErrContainer_p1.h:12
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.