ATLAS Offline Software
AthenaBarCodeCnv_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 #ifndef ATHENABARCODECNV_P1_H
6 #define ATHENABARCODECNV_P1_H
8 
11 
12 
15 
16 class MsgStream;
17 
19  public T_AthenaPoolTPCnvConstBase<AthenaBarCodeImpl, AthenaBarCode_p1>
20 {
21 public:
24 
25 
27  {
28  }
29 
30  virtual void persToTrans(const AthenaBarCode_p1* persObj,
31  AthenaBarCodeImpl* transObj, MsgStream &) const override;
32  virtual void transToPers(const AthenaBarCodeImpl* transObj,
33  AthenaBarCode_p1* persObj, MsgStream &) const override;
34 };
35 
37  AthenaBarCode_p1* pers, MsgStream &) const {
38  pers->m_athenabarcode = trans->getAthenaBarCode();
39  // ATH_MSG_DEBUG("AthenaBarCodeCnv_p1::transToPers::pers->m_barcode="<<std::hex
40  // <<pers->m_athenabarcode);
41 }
42 
44  AthenaBarCodeImpl* trans, MsgStream &) const {
45 
46  static std::atomic<unsigned short> msgCount{0};
47  const int ABCMAXMSGCOUNT=10;
48 
51  //Maybe reading from an old version where Athenabarcode didn't exist
52  if (msgCount<ABCMAXMSGCOUNT) {
53  // log << MSG::DEBUG << "AthenaBarCodeCnv_p1::persToTrans(): AthenaBarCode undefined in the persistent state. Maybe reading from an older version where AthenaBarCode didn't exist. A new AthenaBarCode has been assigned to this object: " <<std::hex<<trans->getAthenaBarCode()<<endmsg;
54  ++msgCount;
55  } else if (msgCount==ABCMAXMSGCOUNT) {
56  // log << MSG::DEBUG << "AthenaBarCodeCnv_p1::persToTrans(): AthenaBarCode undefined in the persistent state. Maybe reading from an older version where AthenaBarCode didn't exist. A new AthenaBarCode has been assigned to this object: " <<std::hex<<trans->getAthenaBarCode()<<"suppressing further messages on this issue, please set message level to VERBOSE to see other messages."<<endmsg;
57  ++msgCount;
58  } else {
59  // log << MSG::VERBOSE << "AthenaBarCodeCnv_p1::persToTrans(): AthenaBarCode undefined in the persistent state. Maybe reading from an older version where AthenaBarCode didn't exist. A new AthenaBarCode has been assigned to this object: " <<std::hex<<trans->getAthenaBarCode()<<endmsg;
60  }
61  } else {
62  trans->setAthenaBarCode(pers->m_athenabarcode);
63  if (!(trans->hasUUIDHash())) {
64  // log << MSG::WARNING
65  // << "AthenaBarCodeCnv_p1::persToTrans(): BarCode for Object "
66  // <<trans->getAthenaBarCode()
67  // <<" has no jobID hash, something wrong!"<<endmsg;
68  }
69  }
70 
71  // log<<MSG::VERBOSE<<"AthenaBarCodeCnv_p1::persToTrans::trans->getAthenaBarCode()="
72  //<<std::hex<<trans->getAthenaBarCode()<<endmsg;
73 }
74 
75 #endif
76 
AthenaBarCodeImpl.h
AthenaBarCodeCnv_p1::AthenaBarCodeCnv_p1
AthenaBarCodeCnv_p1()
Definition: AthenaBarCodeCnv_p1.h:26
IAthenaBarCode::UNDEFINEDBARCODE
static const AthenaBarCode_t UNDEFINEDBARCODE
Definition: AthenaKernel/AthenaKernel/IAthenaBarCode.h:52
AthMsgStreamMacros.h
AthenaBarCodeImpl
Definition: AthenaBarCodeImpl.h:37
AthenaBarCodeCnv_p1
Definition: AthenaBarCodeCnv_p1.h:20
TPConverterConstBase::transToPers
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log) const =0
Convert transient representation to persistent one.
IAthenaBarCode.h
AthenaBarCodeImpl::setAthenaBarCode
void setAthenaBarCode(AthenaBarCode_t id)
Definition: AthenaBarCodeImpl.cxx:211
AthenaBarCodeCnv_p1::transToPers
virtual void transToPers(const AthenaBarCodeImpl *transObj, AthenaBarCode_p1 *persObj, MsgStream &) const override
Definition: AthenaBarCodeCnv_p1.h:36
AthenaBarCodeImpl::hasUUIDHash
AthenaBarCode_t hasUUIDHash() const
Definition: AthenaBarCodeImpl.cxx:239
AthenaBarCodeCnv_p1::persToTrans
virtual void persToTrans(const AthenaBarCode_p1 *persObj, AthenaBarCodeImpl *transObj, MsgStream &) const override
Definition: AthenaBarCodeCnv_p1.h:43
T_AthenaPoolTPConverter.h
TPConverterConstBase::persToTrans
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log) const =0
Convert persistent representation to transient one.
AthenaBarCodeImpl::getAthenaBarCode
AthenaBarCode_t getAthenaBarCode() const
Definition: AthenaBarCodeImpl.cxx:203
AthenaBarCode_p1::m_athenabarcode
AthenaBarCode_t m_athenabarcode
Definition: AthenaBarCode_p1.h:14
AthenaBarCode_p1.h
AthenaBarCode_p1
Definition: AthenaBarCode_p1.h:10
TPConverterConstBase
Definition: TPConverter.h:776