The Gaudi Framework
master (53935a5b)
Toggle main menu visibility
Loading...
Searching...
No Matches
DODBasicMapper.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
12
// Framework includes
13
#include <
Gaudi/Parsers/CommonParsers.h
>
14
#include <
GaudiKernel/AlgTool.h
>
15
#include <
GaudiKernel/HashMap.h
>
16
#include <
GaudiKernel/IDODAlgMapper.h
>
17
#include <
GaudiKernel/IDODNodeMapper.h
>
18
26
class
DODBasicMapper
:
public
extends
<AlgTool, IDODAlgMapper, IDODNodeMapper> {
27
public
:
29
using
extends::extends;
30
32
Gaudi::Utils::TypeNameString
algorithmForPath
(
const
std::string& path )
override
;
33
35
std::string
nodeTypeForPath
(
const
std::string& path )
override
;
36
37
private
:
38
template
<
class
T>
39
using
MapProp
=
Gaudi::Property<GaudiUtils::HashMap<std::string, T>
>;
40
41
MapProp<std::string>
m_nodeMap
{
42
this
,
"Nodes"
, {},
"map of the type of nodes to be associated to paths (path -> data_type)."
};
43
MapProp<Gaudi::Utils::TypeNameString>
m_algMap
{
44
this
,
"Algorithms"
, {},
"map of algorithms to be used to produce entries (path -> alg_name)."
};
45
};
46
47
// Local implementation of parsers from HashMap
48
namespace
Gaudi
{
49
namespace
Parsers
{
52
template
<
typename
K,
typename
V>
53
StatusCode
parse
(
GaudiUtils::HashMap<K, V>
& result, std::string_view input ) {
54
std::map<std::string, std::string> tmp;
55
StatusCode
sc =
parse
( tmp, input );
56
if
( sc.
isSuccess
() ) {
57
result.clear();
58
result.insert( tmp.begin(), tmp.end() );
59
}
60
return
sc;
61
}
62
}
// namespace Parsers
63
}
// namespace Gaudi
64
65
DECLARE_COMPONENT
(
DODBasicMapper
)
66
67
Gaudi
::Utils::TypeNameString
DODBasicMapper
::
algorithmForPath
( const
std
::
string
& path ) {
68
auto
alg =
m_algMap
.find( path );
69
return
( alg !=
m_algMap
.end() ) ? alg->second :
""
;
70
}
71
72
std::string
DODBasicMapper::nodeTypeForPath
(
const
std::string& path ) {
73
auto
node =
m_nodeMap
.find( path );
74
return
( node !=
m_nodeMap
.end() ) ? node->second :
""
;
75
}
AlgTool.h
CommonParsers.h
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
HashMap.h
IDODAlgMapper.h
IDODNodeMapper.h
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition
PluginServiceV1.h:45
DODBasicMapper
Default implementation of a DataOnDemand mapper.
Definition
DODBasicMapper.cpp:26
DODBasicMapper::m_nodeMap
MapProp< std::string > m_nodeMap
Definition
DODBasicMapper.cpp:41
DODBasicMapper::nodeTypeForPath
std::string nodeTypeForPath(const std::string &path) override
Definition
DODBasicMapper.cpp:72
DODBasicMapper::MapProp
Gaudi::Property< GaudiUtils::HashMap< std::string, T > > MapProp
Definition
DODBasicMapper.cpp:39
DODBasicMapper::algorithmForPath
Gaudi::Utils::TypeNameString algorithmForPath(const std::string &path) override
Definition
DODBasicMapper.cpp:67
DODBasicMapper::m_algMap
MapProp< Gaudi::Utils::TypeNameString > m_algMap
Definition
DODBasicMapper.cpp:43
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition
TypeNameString.h:19
GaudiUtils::HashMap
Common class providing an architecture-independent hash map.
Definition
HashMap.h:80
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::isSuccess
bool isSuccess() const
Definition
StatusCode.h:302
extends
Base class used to extend a class implementing other interfaces.
Definition
extends.h:19
Gaudi::Parsers
Definition
DODBasicMapper.cpp:49
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition
DODBasicMapper.cpp:53
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
std
STL namespace.
GaudiCoreSvc
src
IncidentSvc
DODBasicMapper.cpp
Generated on
for The Gaudi Framework by
1.17.0