ATLAS Offline Software
TokenAddress.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PERSISTENTDATAMODEL_TOKENADDRESS_H
6 #define PERSISTENTDATAMODEL_TOKENADDRESS_H
7 
13 // Framework include files
14 #include "GaudiKernel/GenericAddress.h"
15 
17 
21 class TokenAddress : public GenericAddress {
22 
23 private:
28 
29 public:
31  TokenAddress() : GenericAddress(), m_token(0), m_par() {}
32 
35  const CLID& clid,
36  const std::string& p1 = "",
37  const std::string& p2 = "",
38  unsigned long ip = 0,
39  Token* pt = 0) : GenericAddress(svc, clid, p1, p2, ip), m_token(pt), m_par() {
40  setPar();
41  }
42  TokenAddress(const GenericAddress& genAddr, Token* pt = 0) : GenericAddress(genAddr), m_token(pt), m_par() {
43  setPar();
44  }
45 
46  virtual ~TokenAddress() { delete m_token; m_token = 0; }
47 
48  Token* getToken() { return m_token; }
49  const Token* getToken() const { return m_token; }
50  void setToken(Token* token) {
51  delete m_token;
52  m_token = token;
53  setPar();
54  }
55  const std::string* par() const {
56  return m_par;
57  }
58 
59 private:
60  void setPar() {
61  m_par[0] = this->GenericAddress::par()[0];
62  m_par[1] = this->GenericAddress::par()[1];
63  m_par[2] = this->GenericAddress::par()[2];
64  if (m_par[0].empty() && m_token) {
65  m_par[0] = m_token->toString();
66  }
67  }
69  std::string m_par[3];
70 };
71 
72 #endif
TokenAddress::m_token
Token * m_token
Definition: TokenAddress.h:68
TokenAddress::TokenAddress
TokenAddress(const TokenAddress &rhs)
No copy allowed: put prototype to disable bit-wise copy.
TokenAddress::TokenAddress
TokenAddress(long svc, const CLID &clid, const std::string &p1="", const std::string &p2="", unsigned long ip=0, Token *pt=0)
Standard Constructor.
Definition: TokenAddress.h:34
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
test_pyathena.pt
pt
Definition: test_pyathena.py:11
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
TokenAddress::m_par
std::string m_par[3]
Definition: TokenAddress.h:69
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
TokenAddress
This class provides a Generic Transient Address for POOL tokens.
Definition: TokenAddress.h:21
TokenAddress::setPar
void setPar()
Definition: TokenAddress.h:60
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
TokenAddress::setToken
void setToken(Token *token)
Definition: TokenAddress.h:50
TokenAddress::TokenAddress
TokenAddress(const GenericAddress &genAddr, Token *pt=0)
Definition: TokenAddress.h:42
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
TokenAddress::~TokenAddress
virtual ~TokenAddress()
Definition: TokenAddress.h:46
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
Token::toString
virtual const std::string toString() const
Retrieve the string representation of the token.
Definition: Token.cxx:114
TokenAddress::TokenAddress
TokenAddress()
Dummy constructor.
Definition: TokenAddress.h:31
TokenAddress::getToken
Token * getToken()
Definition: TokenAddress.h:48
TokenAddress::getToken
const Token * getToken() const
Definition: TokenAddress.h:49
TokenAddress::operator=
TokenAddress & operator=(const TokenAddress &rhs)
No assignment allowed: put prototype to disable bit-wise assignment.
Token.h
This file contains the class definition for the Token class (migrated from POOL).
TokenAddress::par
const std::string * par() const
Definition: TokenAddress.h:55