ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
IOVDbSvc
src
FolderAddressResolver.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
FolderAddressResolver.h
"
6
7
#include "GaudiKernel/IClassIDSvc.h"
8
#include "GaudiKernel/MsgStream.h"
9
#include "GaudiKernel/StatusCode.h"
10
#include "
IOVDbParser.h
"
11
#include "
IOVDbStringFunctions.h
"
12
13
namespace
IOVDbNamespace
{
14
15
bool
resolveFolderAddress
(MsgStream& log,
16
const
IOVDbParser
& parsedDescription,
17
const
std::string& folderName,
18
bool
jokey,
19
const
std::string& currentKey,
20
IClassIDSvc* clidSvc,
21
FolderAddressSpec
& result) {
22
// Check for key, giving a different key to the foldername
23
result.key = currentKey;
24
if
(
auto
newkey = parsedDescription.
key
(); not newkey.empty() and not jokey) {
25
log << MSG::DEBUG <<
"Key for folder "
<< folderName <<
" set to "
<< newkey
26
<<
" from description string"
<<
endmsg
;
27
result.key = std::move(newkey);
28
}
29
30
// Check for <named/>
31
result.named = parsedDescription.
named
();
32
33
// Get addressHeader
34
if
(
auto
newAddrHeader = parsedDescription.
addressHeader
(); not newAddrHeader.empty()) {
35
IOVDbNamespace::replaceServiceType71
(newAddrHeader);
36
result.addrheader = std::move(newAddrHeader);
37
}
38
39
// Get clid, if it exists (set to zero otherwise)
40
result.clid = parsedDescription.
classId
(log);
41
// Decode the typeName
42
if
(!parsedDescription.
getKey
(
"typeName"
,
""
, result.typeName)) {
43
log << MSG::ERROR <<
"Primary type name is empty"
<<
endmsg
;
44
return
false
;
45
}
46
bool
gotCLID = (result.clid != 0);
47
48
log << MSG::DEBUG <<
"Got folder typename "
<< result.typeName <<
endmsg
;
49
50
// Only consult the service when the description supplied no clid. It may
51
// legitimately be null.
52
if
(!gotCLID && clidSvc) {
53
if
(StatusCode::SUCCESS == clidSvc->getIDOfTypeName(result.typeName, result.clid)) {
54
gotCLID =
true
;
55
}
56
}
57
58
if
(!gotCLID) {
59
log << MSG::ERROR <<
"Could not get clid for typeName: "
<< result.typeName <<
endmsg
;
60
return
false
;
61
}
62
63
log << MSG::DEBUG <<
"Got folder typename "
<< result.typeName
64
<<
" with CLID "
<< result.clid <<
endmsg
;
65
return
true
;
66
}
67
68
}
// namespace IOVDbNamespace
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
FolderAddressResolver.h
IOVDbParser.h
IOVDbStringFunctions.h
IOVDbParser
Definition
IOVDbParser.h:19
IOVDbParser::key
std::string key() const
Definition
IOVDbParser.cxx:138
IOVDbParser::classId
CLID classId(MsgStream &msg) const
Definition
IOVDbParser.cxx:190
IOVDbParser::named
bool named() const
Definition
IOVDbParser.cxx:174
IOVDbParser::getKey
bool getKey(const std::string &key, const std::string &devvalue, std::string &value) const
original 'getKey' method, now implemented using 'at'
Definition
IOVDbParser.cxx:108
IOVDbParser::addressHeader
std::string addressHeader() const
Definition
IOVDbParser.cxx:206
IOVDbNamespace
Definition
Base64Codec.cxx:16
IOVDbNamespace::resolveFolderAddress
bool resolveFolderAddress(MsgStream &log, const IOVDbParser &parsedDescription, const std::string &folderName, bool jokey, const std::string ¤tKey, IClassIDSvc *clidSvc, FolderAddressSpec &result)
Definition
FolderAddressResolver.cxx:15
IOVDbNamespace::replaceServiceType71
bool replaceServiceType71(std::string &addrHeader)
Definition
IOVDbStringFunctions.cxx:211
IOVDbNamespace::FolderAddressSpec
Definition
FolderAddressResolver.h:23
Generated on
for ATLAS Offline Software by
1.17.0