23 const auto get_name = [](
const auto* i ) {
return i->
name(); };
27 auto operator()( T&& t ) const -> decltype( auto )
29 return std::forward<T>( t );
33 template <
typename Iterator,
typename Sep,
typename Projection = Identity>
37 if ( first != last ) s += proj( *first++ );
38 for ( ; first != last; ++first ) {
44 template <
typename Container,
typename Sep,
typename Projection = Identity>
45 std::string join(
const Container&
c, Sep sep, Projection proj = {} )
66 auto joSvc = service<IJobOptionsSvc>(
"JobOptionsSvc" );
68 for (
const auto c : joSvc->getClients() ) {
70 const auto props = joSvc->getProperties( c );
72 for (
const auto prop : *props ) {
73 m_metadata[c +
"." + prop->name()] = prop->toString();
79 for (
const auto*
name : {
"ApplicationMgr",
"MessageSvc",
"NTupleSvc"} ) {
80 auto svc = service<IProperty>(
name );
81 if ( !svc.isValid() )
continue;
83 for (
const auto* prop : svc->getProperties() ) {
84 m_metadata[
prefix + prop->name()] = prop->toString();
93 m_metadata[
"ToolSvc"] = join( tSvc->
getInstances(
"" ),
", " );
99 m_metadata[
"ISvcLocator.Services"] = join( serviceLocator()->getServices(),
", ", get_name );
105 m_metadata[
"IAlgManager.Algorithms"] = join( algMan->
getAlgorithms(),
", ", get_name );
111 auto joSvc = service<IProperty>(
"JobOptionsSvc" );
113 for (
const auto* prop : joSvc->getProperties() ) {
114 m_metadata[
"JobOptionsSvc." + prop->name()] = prop->toString();
119 debug() <<
"Metadata collected:\n";
120 for (
const auto& item : m_metadata ) {
121 debug() << item.first <<
':' << item.second <<
'\n';
constexpr static const auto FAILURE
const std::string & name() const override
Retrieve name of the service.
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
bool isValid() const
Allow for check if smart pointer is valid.
virtual const std::vector< IAlgorithm * > & getAlgorithms() const =0
Return the list of Algorithms.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.