ATLAS Offline Software
Loading...
Searching...
No Matches
TokenAddress.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7
8
9void TokenAddress::setToken(std::unique_ptr<Token> token) {
10 m_ownedToken = std::move (token);
11 m_token = m_ownedToken.get();
12 m_par.reset();
13}
14
16{
17 if (!m_ownedToken && m_token) {
18 m_ownedToken = std::make_unique<Token> (m_token);
19 m_token = m_ownedToken.get();
20 }
21 return m_ownedToken.get();
22}
23
24const std::string* TokenAddress::par() const
25{
26 if (!m_par.isValid()) {
27 // We haven't created the parameter array yet.
28 // Do it now.
29 Pars pars;
30 pars.par[0] = this->GenericAddress::par()[0];
31 pars.par[1] = this->GenericAddress::par()[1];
32 pars.par[2] = this->GenericAddress::par()[2];
33 if (pars.par[0].empty() && m_token) {
34 pars.par[0] = m_token->toString();
35 }
36 m_par.set (std::move (pars));
37 }
38 return m_par.ptr()->par;
39}
This file contains the class definition for the TokenAddress class.
const Token * m_token
Token * getToken()
void setToken(std::unique_ptr< Token > token)
std::unique_ptr< Token > m_ownedToken
CxxUtils::CachedValue< Pars > m_par
The parameter array. We create it lazily in par().
virtual const std::string * par() const override
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21