ATLAS Offline Software
Public Member Functions | Friends | List of all members
DataHeaderElementCnv_p3 Class Reference

This class provides the converter to customize the saving of DataHeaderElement_p3. More...

#include <DataHeaderCnv_p3.h>

Collaboration diagram for DataHeaderElementCnv_p3:

Public Member Functions

 DataHeaderElementCnv_p3 ()
 
virtual ~DataHeaderElementCnv_p3 ()
 
void persToTrans (const DataHeaderElement_p3 *pers, DataHeaderElement *trans, const std::vector< std::string > &map)
 
void transToPers (const DataHeaderElement *trans, DataHeaderElement_p3 *pers, std::vector< std::string > &map)
 

Friends

class DataHeaderCnv_p3
 

Detailed Description

This class provides the converter to customize the saving of DataHeaderElement_p3.

Definition at line 21 of file DataHeaderCnv_p3.h.

Constructor & Destructor Documentation

◆ DataHeaderElementCnv_p3()

DataHeaderElementCnv_p3::DataHeaderElementCnv_p3 ( )

Definition at line 17 of file DataHeaderCnv_p3.cxx.

17 {}

◆ ~DataHeaderElementCnv_p3()

DataHeaderElementCnv_p3::~DataHeaderElementCnv_p3 ( )
virtual

Definition at line 18 of file DataHeaderCnv_p3.cxx.

18 {}

Member Function Documentation

◆ persToTrans()

void DataHeaderElementCnv_p3::persToTrans ( const DataHeaderElement_p3 pers,
DataHeaderElement trans,
const std::vector< std::string > &  map 
)

Definition at line 21 of file DataHeaderCnv_p3.cxx.

23  {
24  trans->m_pClid = *pers->m_clids.begin();
25  trans->m_clids.clear();
26  std::set<CLID>::iterator lastClid = trans->m_clids.begin();
27  for (std::vector<unsigned int>::const_iterator iter = pers->m_clids.begin() + 1,
28  last = pers->m_clids.end(); iter != last; ++iter) {
29  lastClid = trans->m_clids.insert(lastClid, *iter);
30  }
31  trans->m_key = *pers->m_alias.begin();
32  trans->m_alias.clear();
33  std::set<std::string>::iterator lastAlias = trans->m_alias.begin();
34  for (std::vector<std::string>::const_iterator iter = pers->m_alias.begin() + 1,
35  last = pers->m_alias.end(); iter != last; ++iter) {
36  lastAlias = trans->m_alias.insert(lastAlias, *iter);
37  }
38  trans->m_hashes.clear();
39  trans->m_hashes.reserve(pers->m_hashes.size());
40  for (std::vector<uint64_t>::const_iterator iter = pers->m_hashes.begin(),
41  last = pers->m_hashes.end(); iter != last; ++iter) {
42  trans->m_hashes.push_back((unsigned int)(*iter));
43  }
44 // Translate PoolToken
45  std::string tokenStr;
46  if (map.empty()) {
47  tokenStr = pers->m_token;
48  } else {
49  unsigned int tokenSize = 129 + pers->m_token.size();
50  if (pers->m_prefixIdx > 0) {
51  tokenSize += map[pers->m_prefixIdx].size();
52  }
53  if (pers->m_keyPos > 0) {
54  tokenSize += trans->m_key.size();
55  }
56  tokenStr.reserve(tokenSize);
57 // Append DbGuid
58  tokenStr = "[DB=";
59  tokenStr.append(map[pers->m_dbGuidIdx]);
60 // Still optimize
61  tokenStr.append("][CNT=");
62  if (pers->m_prefixIdx > 0) {
63  tokenStr.append(map[pers->m_prefixIdx]);
64  }
65 // insert key
66  if (pers->m_keyPos > 0) {
67  tokenStr.append(pers->m_token.substr(0, pers->m_keyPos - 1));
68  tokenStr.append(trans->m_key);
69  tokenStr.append(pers->m_token.substr(pers->m_keyPos - 1));
70  } else {
71  tokenStr.append(pers->m_token);
72  }
73 // Append ClassId
74  tokenStr.append("][CLID=");
75  tokenStr.append(map[pers->m_classIdIdx]);
76  const unsigned int length = 40;
77  char text[length];
78  snprintf(text, length, "][TECH=%08X][OID=%08X-%08X]", pers->m_technology, pers->m_oid1, pers->m_oid2);
79  tokenStr.append(text);
80  }
81  Token* token = new Token;
82  token->fromString(tokenStr);
83  delete trans->m_token; trans->m_token = token;
84 }

◆ transToPers()

void DataHeaderElementCnv_p3::transToPers ( const DataHeaderElement trans,
DataHeaderElement_p3 pers,
std::vector< std::string > &  map 
)

Definition at line 86 of file DataHeaderCnv_p3.cxx.

88  {
89 // Moved to next _p version
90 }

Friends And Related Function Documentation

◆ DataHeaderCnv_p3

friend class DataHeaderCnv_p3
friend

Definition at line 29 of file DataHeaderCnv_p3.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
DataHeaderElement::m_key
std::string m_key
string with StoreGate key.
Definition: DataHeader.h:111
DataHeaderElement::m_clids
std::set< CLID > m_clids
set of unsigned long to store ClassID's for symlinked container.
Definition: DataHeader.h:109
DataHeaderElement_p3::m_classIdIdx
unsigned short m_classIdIdx
Definition: DataHeader_p3.h:45
DataHeaderElement_p3::m_dbGuidIdx
unsigned short m_dbGuidIdx
Definition: DataHeader_p3.h:45
DataHeaderElement::m_pClid
CLID m_pClid
primary ClassID.
Definition: DataHeader.h:107
DataHeaderElement_p3::m_hashes
std::vector< uint64_t > m_hashes
Definition: DataHeader_p3.h:47
DataHeaderElement_p3::m_oid2
unsigned int m_oid2
Definition: DataHeader_p3.h:44
DataHeaderElement_p3::m_prefixIdx
unsigned short m_prefixIdx
Definition: DataHeader_p3.h:45
DataHeaderElement_p3::m_token
std::string m_token
Definition: DataHeader_p3.h:42
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
DataHeaderElement_p3::m_oid1
unsigned int m_oid1
Definition: DataHeader_p3.h:44
Token::fromString
Token & fromString(const std::string &from)
Build from the string representation of a token.
Definition: Token.cxx:133
DataHeaderElement::m_alias
std::set< std::string > m_alias
set of StoreGate alias string.
Definition: DataHeader.h:113
DataHeaderElement::m_hashes
std::vector< sgkey_t > m_hashes
hash table for ElementLink host container keys.
Definition: DataHeader.h:118
DataHeaderElement_p3::m_technology
unsigned int m_technology
Definition: DataHeader_p3.h:44
DataHeaderElement_p3::m_clids
std::vector< unsigned int > m_clids
Definition: DataHeader_p3.h:41
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
DataHeaderElement::m_token
const Token * m_token
pointer to transient address
Definition: DataHeader.h:115
DataHeaderElement_p3::m_keyPos
unsigned short m_keyPos
Definition: DataHeader_p3.h:46
DataHeaderElement_p3::m_alias
std::vector< std::string > m_alias
Definition: DataHeader_p3.h:43
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26