ATLAS Offline Software
Loading...
Searching...
No Matches
InDetBSErrContainerCnv_p2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8{
9 (persCont->m_bsErrs).reserve(transCont->size());
10 for (const std::pair<IdentifierHash, int>* bsErr: *transCont) {
11 if (bsErr==nullptr) {
12 log << MSG::WARNING << "const std::pair<IdentifierHash, int>* is nullptr and skipped." << endmsg;
13 continue;
14 }
15 (persCont->m_bsErrs).push_back(*bsErr);
16 }
17
18 }
19
20void InDetBSErrContainerCnv_p2::persToTrans(const InDetBSErrContainer_p2* persCont, InDetBSErrContainer* transCont, MsgStream& /*log*/)
21{
22 transCont->reserve((persCont->m_bsErrs).size());
23 for (const std::pair<IdentifierHash, int>& bsErr: persCont->m_bsErrs) {
24 transCont->push_back(std::make_unique<std::pair<IdentifierHash, int>>(bsErr));
25 }
26
27 }
28
29//================================================================
31 std::unique_ptr<InDetBSErrContainer> trans{std::make_unique<InDetBSErrContainer>()};
32 persToTrans(persObj, trans.get(), log);
33 return trans.release();
34}
#define endmsg
DataVector< std::pair< IdentifierHash, int > > InDetBSErrContainer
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.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual void transToPers(const InDetBSErrContainer *transCont, InDetBSErrContainer_p2 *persCont, MsgStream &log)
virtual void persToTrans(const InDetBSErrContainer_p2 *persCont, InDetBSErrContainer *transCont, MsgStream &log)
virtual InDetBSErrContainer * createTransient(const InDetBSErrContainer_p2 *persObj, MsgStream &log)
std::vector< std::pair< IdentifierHash, int > > m_bsErrs