ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7#include "GaudiKernel/IClassIDSvc.h"
8#include "GaudiKernel/MsgStream.h"
9#include "GaudiKernel/StatusCode.h"
10#include "IOVDbParser.h"
12
13namespace IOVDbNamespace {
14
15bool 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()) {
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
#define endmsg
std::string key() const
CLID classId(MsgStream &msg) const
bool named() const
bool getKey(const std::string &key, const std::string &devvalue, std::string &value) const
original 'getKey' method, now implemented using 'at'
std::string addressHeader() const
bool resolveFolderAddress(MsgStream &log, const IOVDbParser &parsedDescription, const std::string &folderName, bool jokey, const std::string &currentKey, IClassIDSvc *clidSvc, FolderAddressSpec &result)
bool replaceServiceType71(std::string &addrHeader)