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

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

#include <DataHeaderCnv_p4.h>

Collaboration diagram for DataHeaderElementCnv_p4:

Public Member Functions

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

Friends

class DataHeaderCnv_p4
 

Detailed Description

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

Definition at line 21 of file DataHeaderCnv_p4.h.

Constructor & Destructor Documentation

◆ DataHeaderElementCnv_p4()

DataHeaderElementCnv_p4::DataHeaderElementCnv_p4 ( )

Definition at line 17 of file DataHeaderCnv_p4.cxx.

17 {}

◆ ~DataHeaderElementCnv_p4()

DataHeaderElementCnv_p4::~DataHeaderElementCnv_p4 ( )
virtual

Definition at line 18 of file DataHeaderCnv_p4.cxx.

18 {}

Member Function Documentation

◆ persToTrans()

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

Definition at line 21 of file DataHeaderCnv_p4.cxx.

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

◆ transToPers()

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

Definition at line 90 of file DataHeaderCnv_p4.cxx.

92  {
93 // Moved to next _p version
94 }

Friends And Related Function Documentation

◆ DataHeaderCnv_p4

friend class DataHeaderCnv_p4
friend

Definition at line 29 of file DataHeaderCnv_p4.h.


The documentation for this class was generated from the following files:
DataHeaderElement_p4::m_classIdIdx
unsigned short m_classIdIdx
Definition: DataHeader_p4.h:45
DataHeaderElement::m_key
std::string m_key
string with StoreGate key.
Definition: DataHeader.h:111
DataHeaderElement_p4::m_token
std::string m_token
Definition: DataHeader_p4.h:42
DataHeaderElement_p4::m_prefixIdx
unsigned short m_prefixIdx
Definition: DataHeader_p4.h:45
DataHeaderElement::m_clids
std::set< CLID > m_clids
set of unsigned long to store ClassID's for symlinked container.
Definition: DataHeader.h:109
DataHeaderElement::m_pClid
CLID m_pClid
primary ClassID.
Definition: DataHeader.h:107
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
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_p4::m_technology
unsigned int m_technology
Definition: DataHeader_p4.h:44
DataHeaderElement_p4::m_keyPos
unsigned short m_keyPos
Definition: DataHeader_p4.h:46
DataHeaderElement::m_hashes
std::vector< sgkey_t > m_hashes
hash table for ElementLink host container keys.
Definition: DataHeader.h:118
DataHeaderElement_p4::m_hashes
std::vector< uint64_t > m_hashes
Definition: DataHeader_p4.h:47
DataHeaderElement_p4::m_alias
std::vector< std::string > m_alias
Definition: DataHeader_p4.h:43
DataHeaderElement_p4::m_dbGuidIdx
unsigned short m_dbGuidIdx
Definition: DataHeader_p4.h:45
DataHeaderElement_p4::m_clids
std::vector< unsigned int > m_clids
Definition: DataHeader_p4.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_p4::m_oid1
unsigned int m_oid1
Definition: DataHeader_p4.h:44
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
DataHeaderElement_p4::m_oid2
unsigned int m_oid2
Definition: DataHeader_p4.h:44