Skip to content
Snippets Groups Projects
Commit fa30ca70 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'DataHeder_p6.add.Container' into 'master'

Add Container name to object Refs kept in DataHeader_p6

See merge request atlas/athena!38886
parents 28e12363 8c6a7506
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PERSISTENTDATAMODELTPCNV_DATAHEADER_P6_H
......@@ -34,12 +34,14 @@ public:
bool operator==(const DbRecord& rhs) const { return fid==rhs.fid && tech==rhs.tech; }
};
struct ObjRecord {
Guid guid; std::string key; unsigned clid; long long oid1;
Guid guid;
std::string cont, key;
unsigned clid; long long oid1;
ObjRecord() {}
ObjRecord( const Guid& g, const std::string& k, unsigned id, long long o)
: guid(g), key(k), clid(id), oid1(o) {}
ObjRecord( const Guid& g, const std::string& c, const std::string& k, unsigned id, long long o)
: guid(g), cont(c), key(k), clid(id), oid1(o) {}
bool operator==(const ObjRecord& rhs) const
{ return clid == rhs.clid && key == rhs.key && oid1 == rhs.oid1; }
{ return clid == rhs.clid && cont == rhs.cont && key == rhs.key && oid1 == rhs.oid1; }
};
public: // Constructor and Destructor
......@@ -58,6 +60,7 @@ public: // Constructor and Destructor
const std::set<unsigned int>& symLinks = std::set<unsigned int>(),
const std::vector<unsigned int>& hashes = std::vector<unsigned int>());
std::size_t sizeObj() const;
std::string getObjContainer(unsigned int index) const;
std::string getObjKey(unsigned int index) const;
unsigned int getObjType(unsigned int index) const;
Guid getObjClassId(unsigned int index) const;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/** @file DataHeaderCnv_p6.cxx
......@@ -36,8 +36,9 @@ void DataHeaderCnv_p6::persToElem( const DataHeader_p6* pers, unsigned p_idx,
oid2 = full_el.oid2;
}
// Append DbGuid
token->setDb( form.getDbGuid(db_idx ) );
token->setTechnology( form.getDbTech(db_idx ) );
token->setDb( form.getDbGuid( db_idx ) );
token->setCont( form.getObjContainer( obj_idx ) );
token->setTechnology( form.getDbTech( db_idx ) );
// Append ClassId
token->setClassID( form.getObjClassId(obj_idx) );
token->setOid( Token::OID_t( form.getObjOid1(obj_idx), oid2) );
......@@ -85,7 +86,8 @@ void DataHeaderCnv_p6::elemToPers(const DataHeaderElement* trans,
DataHeaderForm_p6::DbRecord db_rec( token->dbID(), token->technology() );
unsigned db_idx = form.insertDb( db_rec );
// StoreGate Type/Key & persistent Class GUID
DataHeaderForm_p6::ObjRecord transObj( token->classID(), trans->m_key, trans->m_pClid, token->oid().first );
DataHeaderForm_p6::ObjRecord transObj( token->classID(), token->contID(), trans->m_key,
trans->m_pClid, token->oid().first );
unsigned obj_idx = form.insertObj(transObj, trans->m_alias, trans->m_clids, trans->m_hashes);
unsigned long long oid2 = token->oid().second;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "PersistentDataModelTPCnv/DataHeader_p6.h"
......@@ -103,6 +103,10 @@ std::size_t DataHeaderForm_p6::sizeObj() const {
return(m_objRecords.size());
}
std::string DataHeaderForm_p6::getObjContainer(unsigned int index) const {
return m_objRecords[index].cont;
}
std::string DataHeaderForm_p6::getObjKey(unsigned int index) const {
return m_objRecords[index].key;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment