The Gaudi Framework
master (6507eef1)
Toggle main menu visibility
Loading...
Searching...
No Matches
MetaDataSvc.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 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
* MetaDataSvc.cpp
13
*
14
* Created on: Mar 24, 2015
15
* Author: Ana Trisovic
16
*/
17
18
// Framework include files
19
#include <
Gaudi/Interfaces/IOptionsSvc.h
>
20
#include <
GaudiKernel/IAlgManager.h
>
21
#include <
GaudiKernel/IAlgorithm.h
>
22
#include <
GaudiKernel/IProperty.h
>
23
#include <
GaudiKernel/IService.h
>
24
#include <
GaudiKernel/ISvcLocator.h
>
25
#include <
GaudiKernel/IToolSvc.h
>
26
27
#include "
MetaDataSvc.h
"
28
29
using
Gaudi::MetaDataSvc
;
30
31
DECLARE_COMPONENT
(
MetaDataSvc
)
32
33
StatusCode
MetaDataSvc
::
start
() {
34
if
(
msgLevel
(
MSG::DEBUG
) )
debug
() <<
"started"
<<
endmsg
;
35
return
collectData
();
36
}
37
38
std::map<std::string, std::string>
MetaDataSvc::getMetaDataMap
()
const
{
return
m_metadata
; }
39
40
StatusCode
MetaDataSvc::collectData
() {
41
42
// save options for all clients
43
for
(
const
auto
& p :
serviceLocator
()->getOptsSvc().items() ) {
m_metadata
[std::get<0>( p )] = std::get<1>( p ); }
44
45
if
(
msgLevel
(
MSG::DEBUG
) ) {
46
debug
() <<
"Metadata collected:\n"
;
47
for
(
const
auto
& item :
m_metadata
) {
debug
() << item.first <<
':'
<< item.second <<
'\n'
; }
48
debug
() <<
endmsg
;
49
}
50
51
return
StatusCode::SUCCESS
;
52
}
IAlgManager.h
IAlgorithm.h
IOptionsSvc.h
IProperty.h
IService.h
ISvcLocator.h
IToolSvc.h
MetaDataSvc.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition
PluginServiceV1.h:45
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition
CommonMessaging.h:118
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition
CommonMessaging.h:127
Gaudi::MetaDataSvc
Definition
MetaDataSvc.h:24
Gaudi::MetaDataSvc::m_metadata
std::map< std::string, std::string > m_metadata
Definition
MetaDataSvc.h:39
Gaudi::MetaDataSvc::start
StatusCode start() override
Definition
MetaDataSvc.cpp:33
Gaudi::MetaDataSvc::collectData
StatusCode collectData()
Definition
MetaDataSvc.cpp:40
MetaDataSvc::getMetaDataMap
std::map< std::string, std::string > getMetaDataMap() const override
Definition
MetaDataSvc.cpp:38
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition
Service.cpp:336
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
MSG::DEBUG
@ DEBUG
Definition
IMessageSvc.h:22
GaudiSvc
src
MetaDataSvc
MetaDataSvc.cpp
Generated on
for The Gaudi Framework by
1.17.0