ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
29void 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< std::pair< uint8_t, std::pair< uint32_t, uint8_t > > > TRT_BSIdErrContainer
#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 TRT_BSIdErrContainer * createTransient(const TRT_BSIdErrContainer_p1 *persObj, MsgStream &log)
virtual void persToTrans(const TRT_BSIdErrContainer_p1 *persCont, TRT_BSIdErrContainer *transCont, MsgStream &log)
virtual void transToPers(const TRT_BSIdErrContainer *transCont, TRT_BSIdErrContainer_p1 *persCont, MsgStream &log)
std::vector< std::pair< uint8_t, std::pair< uint32_t, uint8_t > > * > m_bsErrs