ATLAS Offline Software
Loading...
Searching...
No Matches
InDetBSErrContainerCnv_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
6
8(const InDetBSErrContainer* transCont, InDetBSErrContainer_p1* persCont, MsgStream& /*log*/)
9{
11 InDetBSErrContainer::const_iterator itEnd = transCont->end();
12 (persCont->m_bsErrs).reserve(transCont->size());
13
14 for (; it != itEnd; ++it) {
15 // FIXME: Should change type of m_bsErrs, but don't want to cause possible
16 // back-compatibility problems.
17 std::pair<IdentifierHash, int>* ptr ATLAS_THREAD_SAFE = const_cast<std::pair<IdentifierHash, int>*> (*it);
18 (persCont->m_bsErrs).push_back(ptr);
19 }
20 }
21
22void InDetBSErrContainerCnv_p1::persToTrans(const InDetBSErrContainer_p1* persCont, InDetBSErrContainer* transCont, MsgStream& /*log*/)
23{
24 std::vector<std::pair<IdentifierHash, int>* >::const_iterator it = (persCont->m_bsErrs).begin();
25 std::vector<std::pair<IdentifierHash, int>* >::const_iterator itEnd = (persCont->m_bsErrs).end();
26 transCont->reserve((persCont->m_bsErrs).size());
27
28 for (; it != itEnd; ++it) {
29 transCont->push_back(*it);
30 }
31
32}
33
34//================================================================
36 std::unique_ptr<InDetBSErrContainer> trans(std::make_unique<InDetBSErrContainer>());
37 persToTrans(persObj, trans.get(), log);
38 return(trans.release());
39}
DataVector< std::pair< IdentifierHash, int > > InDetBSErrContainer
#define ATLAS_THREAD_SAFE
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.
virtual void transToPers(const InDetBSErrContainer *transCont, InDetBSErrContainer_p1 *persCont, MsgStream &log)
virtual void persToTrans(const InDetBSErrContainer_p1 *persCont, InDetBSErrContainer *transCont, MsgStream &log)
virtual InDetBSErrContainer * createTransient(const InDetBSErrContainer_p1 *persObj, MsgStream &log)
std::vector< std::pair< IdentifierHash, int32_t > * > m_bsErrs