| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

DODBasicMapper.cpp
Go to the documentation of this file.
1 // Include files
2
3 #include "GaudiKernel/HashMap.h"
4 #include "GaudiKernel/Parsers.h"
5 // Local implementation of parsers from HashMap
6 namespace Gaudi {
7 namespace Parsers {
10 template <typename K, typename V>
11 StatusCode parse(GaudiUtils::HashMap<K, V> &result, const std::string &input) {
12 std::map<std::string, std::string> tmp;
13 StatusCode sc = parse(tmp, input);
14 if (sc.isSuccess()) {
15 result.clear();
16 result.insert(tmp.begin(), tmp.end());
17 }
18 return sc;
19 }
20 }
21 }
22
23 // local
24 #include "DODBasicMapper.h"
25
26 // ----------------------------------------------------------------------------
27 // Implementation file for class: DODBasicMapper
28 //
29 // 16/01/2012: Marco Clemencic
30 // ----------------------------------------------------------------------------
31 DECLARE_COMPONENT(DODBasicMapper)
32
33 // ============================================================================
34 // Standard constructor, initializes variables
35 // ============================================================================
36 DODBasicMapper::DODBasicMapper(const std::string& type, const std::string& name, const IInterface* parent)
37 : base_class(type, name, parent)
38 {
39 declareProperty("Nodes", m_nodeMap,
40 "Map of the type of nodes to be associated to paths (path -> data_type).");
41 declareProperty("Algorithms", m_algMap,
42 "Map of algorithms to be used to produce entries (path -> alg_name).");
43 }
44
45
46 Gaudi::Utils::TypeNameString DODBasicMapper::algorithmForPath(const std::string & path)
47 {
48 auto alg = m_algMap.find(path);
49 return (alg != m_algMap.end()) ? alg->second : "";
50 }
51
52
53 std::string DODBasicMapper::nodeTypeForPath(const std::string & path)
54 {
55 auto node = m_nodeMap.find(path);
56 return (node != m_nodeMap.end()) ? node->second : "";
57 }
58
59 // ============================================================================
DODBasicMapper
Default implementation of a DataOnDemand mapper.
Definition: DODBasicMapper.h:19
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
Parsers.h
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
DODBasicMapper::m_nodeMap
GaudiUtils::HashMap< std::string, std::string > m_nodeMap
Definition: DODBasicMapper.h:35
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std
STL namespace.
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:11
std::map::end
T end(T...args)
HashMap.h
merge_files.sc
int sc
Definition: merge_files.py:167
std::map< std::string, std::string >
DODBasicMapper::nodeTypeForPath
std::string nodeTypeForPath(const std::string &path) override
Definition: DODBasicMapper.cpp:53
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
std::string
STL class.
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
gaudirun.type
string type
Definition: gaudirun.py:151
DODBasicMapper::m_algMap
GaudiUtils::HashMap< std::string, Gaudi::Utils::TypeNameString > m_algMap
Definition: DODBasicMapper.h:34
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:149
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DODBasicMapper.h
std::map::begin
T begin(T...args)
GaudiUtils::HashMap
Common class providing an architecture-independent hash map.
Definition: HashMap.h:77
GaudiUtils::Map::insert
std::pair< iterator, bool > insert(ValueType &&val)
Definition: Map.h:168
DODBasicMapper::algorithmForPath
Gaudi::Utils::TypeNameString algorithmForPath(const std::string &path) override
Definition: DODBasicMapper.cpp:46
CommonMessaging
Definition: CommonMessaging.h:58
GaudiUtils::Map::clear
void clear()
Definition: Map.h:178
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1