ATLAS Offline Software
Loading...
Searching...
No Matches
RingerRingsContainerCnv_p1.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5/**********************************************************************************
6 * @Project: Trigger
7 * @Package: TrigCaloEventTPCnv
8 * @class : RingerRingsContainerCnv_p1
9 *
10 * @brief transient persistent converter for RingerRingsContainer
11 *
12 * @author Danilo Enoque Ferreira de Lima <dferreir@mail.cern.ch> - UFRJ
13 *
14 * $Id: RingerRingsContainerCnv_p1.h,v 1.2 2009-04-01 22:01:37 salvator Exp $
15 **********************************************************************************/
16#ifndef TRIGCALOEVENTTPCNV_RINGERRINGSCONTAINER_CNV_P1_H
17#define TRIGCALOEVENTTPCNV_RINGERRINGSCONTAINER_CNV_P1_H
18
20
24
25class RingerRingsContainerCnv_p1 : public T_AthenaPoolTPPtrVectorCnv<RingerRingsContainer, RingerRingsContainer_p1, RingerRingsCnv_p1> {
26
27 public:
29
30 // This part is implemented in T_AthenaPoolTPConverter.h.
31 // It is here temporarily to override and allow some extra debugging
32 virtual void persToTrans(const RingerRingsContainer_p1 *persVect,
33 RingerRingsContainer *transVect,
34 MsgStream &log) override {
35 log << MSG::DEBUG << "RingerRingsContainerCnv::persToTrans" << endmsg;
36 if (!persVect) {
37 log << MSG::WARNING << "RingerRingsContainerCnv::persToTrans cannot convert NULL persVect" << endmsg;
38 return;
39 }
40 if (!transVect) {
41 log << MSG::WARNING << "RingerRingsContainerCnv::persToTrans cannot convert to NULL transVect" << endmsg;
42 return;
43 }
44
45 transVect->clear();
46 transVect->reserve(persVect->size());
47
48 // convert vector entries one by one
49 for (RingerRingsContainer_p1::const_iterator it = persVect->begin();
50 it != persVect->end(); ++it) {
52 transVect->push_back(p);
53 if (!p)
54 log << MSG::WARNING << "RingerRingsContainerCnv::persToTrans failed for an element " << endmsg;
55 }
56 }
57
58
59 virtual void transToPers(const RingerRingsContainer *transVect,
61 MsgStream &log) override {
62 if (!persVect) {
63 log << MSG::WARNING << "RingerRingsContainerCnv::transToPers cannot convert NULL persVect" << endmsg;
64 return;
65 }
66 if (!transVect) {
67 log << MSG::WARNING << "RingerRingsContainerCnv::transToPers cannot convert to NULL transVect" << endmsg;
68 return;
69 }
70
71 persVect->clear();
72 persVect->reserve(transVect->size());
73 // convert vector entries one by one
74 for (RingerRingsContainer::const_iterator it = transVect->begin();
75 it != transVect->end(); ++it ) {
76 TPObjRef a = toPersistent(&m_elementCnv, *it, log);
77 persVect->push_back(a);
78 if (a.isNull()) {
79 log << MSG::WARNING << "RingerRingsContainerCnv::transToPers failed for an element " << *it << " "
80 << m_elementCnv << endmsg;
81 }
82 }
83 }
84};
85
86#endif
87
#define endmsg
static Double_t a
TPPtrVectorCnv< TRANS, PERS, CONV > T_AthenaPoolTPPtrVectorCnv
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.
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
virtual void transToPers(const RingerRingsContainer *transVect, RingerRingsContainer_p1 *persVect, MsgStream &log) override
virtual void persToTrans(const RingerRingsContainer_p1 *persVect, RingerRingsContainer *transVect, MsgStream &log) override
This class carries the generated Rings.
Definition RingerRings.h:18
This class is an object reference used in Athena persistent data model.
Definition TPObjRef.h:20
CONV * m_elementCnv
pointer to the TP converter used for vector elements