The Gaudi Framework  v30r3 (a5ef0a68)
PrintAlgsSequences.cpp
Go to the documentation of this file.
6 #include "GaudiKernel/Property.h"
7 
8 namespace
9 {
11  void printAlgsSequences( SmartIF<IAlgManager>& algmgr, const std::string& algname, MsgStream& log, int indent )
12  {
14  log << MSG::ALWAYS;
15  for ( int i = 0; i < indent; ++i ) log << " ";
16  log << algname << endmsg;
17  auto prop = algmgr->algorithm<IProperty>( algname, false );
18  if ( prop ) {
19  // Try to get the property Members
20  Gaudi::Property<std::vector<std::string>> p( "Members", {} );
21  if ( prop->getProperty( &p ).isSuccess() ) {
22  for ( auto& subalgname : p.value() ) {
23  printAlgsSequences( algmgr, subalgname, log, indent + 1 );
24  }
25  }
26  } else {
27  log << MSG::WARNING << "Cannot get properties of " << algname << endmsg;
28  }
29  }
31  void printAlgsSequences( IInterface* app )
32  {
33  auto prop = SmartIF<IProperty>( app );
34  auto algmgr = SmartIF<IAlgManager>( app );
35  auto msgsvc = SmartIF<IMessageSvc>( app );
36  if ( !prop || !algmgr ) return;
37  Gaudi::Property<std::vector<std::string>> topalg( "TopAlg", {} );
38  if ( prop->getProperty( &topalg ).isSuccess() ) {
39  MsgStream log( msgsvc, "ApplicationMgr" );
40  log << MSG::ALWAYS << "****************************** Algorithm Sequence ****************************" << endmsg;
41  for ( auto& algname : topalg.value() ) {
42  printAlgsSequences( algmgr, algname, log, 0 );
43  }
44  log << MSG::ALWAYS << "******************************************************************************" << endmsg;
45  }
46  }
47 }
48 
49 #ifdef GAUDI_HASCLASSVISIBILITY
50 #pragma GCC visibility push( default )
51 #endif
52 extern "C" {
54 void py_helper_printAlgsSequences( IInterface* app ) { printAlgsSequences( app ); }
55 }
56 #ifdef GAUDI_HASCLASSVISIBILITY
57 #pragma GCC visibility pop
58 #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:381
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:277
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:209