Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PrintAlgsSequences.cpp
Go to the documentation of this file.
6 #include "GaudiKernel/Property.h"
7 
8 namespace {
10  void printAlgsSequences( SmartIF<IAlgManager>& algmgr, const std::string& algname, MsgStream& log, int indent ) {
12  log << MSG::ALWAYS;
13  for ( int i = 0; i < indent; ++i ) log << " ";
14  log << algname << endmsg;
15  auto prop = algmgr->algorithm<IProperty>( algname, false );
16  if ( prop ) {
17  // Try to get the property Members
18  Gaudi::Property<std::vector<std::string>> p( "Members", {} );
19  if ( prop->getProperty( &p ).isSuccess() ) {
20  for ( auto& subalgname : p.value() ) { printAlgsSequences( algmgr, subalgname, log, indent + 1 ); }
21  }
22  } else {
23  log << MSG::WARNING << "Cannot get properties of " << algname << endmsg;
24  }
25  }
27  void printAlgsSequences( IInterface* app ) {
28  auto prop = SmartIF<IProperty>( app );
29  auto algmgr = SmartIF<IAlgManager>( app );
30  auto msgsvc = SmartIF<IMessageSvc>( app );
31  if ( !prop || !algmgr ) return;
32  Gaudi::Property<std::vector<std::string>> topalg( "TopAlg", {} );
33  if ( prop->getProperty( &topalg ).isSuccess() ) {
34  MsgStream log( msgsvc, "ApplicationMgr" );
35  log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
36  for ( auto& algname : topalg.value() ) { printAlgsSequences( algmgr, algname, log, 0 ); }
37  log << MSG::ALWAYS << "******************************************************************************" << endmsg;
38  }
39  }
40 } // namespace
41 
42 #ifdef GAUDI_HASCLASSVISIBILITY
43 # pragma GCC visibility push( default )
44 #endif
45 extern "C" {
47 void py_helper_printAlgsSequences( IInterface* app ) { printAlgsSequences( app ); }
48 }
49 #ifdef GAUDI_HASCLASSVISIBILITY
50 # pragma GCC visibility pop
51 #endif
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Implementation of property with value of concrete type.
Definition: Property.h:352
STL class.
Helper class to parse a string of format "type/name".
void py_helper_printAlgsSequences(IInterface *app)
Helper to call printAlgsSequences from Pyhton ctypes.
Definition of the basic interface.
Definition: IInterface.h:244
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192