ATLAS Offline Software
Loading...
Searching...
No Matches
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
16class MsgStream;
17
19 public T_AthenaPoolTPCnvConstBase<AthenaBarCodeImpl, AthenaBarCode_p1>
20{
21public:
24
25
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 {
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
TPConverterConstBase< TRANS, PERS > T_AthenaPoolTPCnvConstBase
virtual void persToTrans(const AthenaBarCode_p1 *persObj, AthenaBarCodeImpl *transObj, MsgStream &) const override
virtual void transToPers(const AthenaBarCodeImpl *transObj, AthenaBarCode_p1 *persObj, MsgStream &) const override
AthenaBarCode_t hasUUIDHash() const
void setAthenaBarCode(AthenaBarCode_t id)
AthenaBarCode_t getAthenaBarCode() const
AthenaBarCode_t m_athenabarcode
static const AthenaBarCode_t UNDEFINEDBARCODE
virtual void transToPers(const TRANS *transObj, PERS *persObj, MsgStream &log) const =0
Convert transient representation to persistent one.
virtual void persToTrans(const PERS *persObj, TRANS *transObj, MsgStream &log) const =0
Convert persistent representation to transient one.