460 const auto endLib = libs.end();
462 static const std::string gaudiSvc =
"GaudiCoreSvc";
463 const bool isGaudiSvc = (
std::find( libs.begin(), endLib, gaudiSvc ) != endLib );
467 cout <<
"ERROR: ApplicationMgr can not be created. Check environment" <<
endl;
472 using Gaudi::PluginService::Details::Registry;
473 const Registry&
registry = Registry::instance();
475 auto bkgNames = registry.loadedFactoryNames();
484 for (
const auto& iLib : libs ) {
486 LOG_INFO <<
":::: processing library: " << iLib <<
"...";
503 const auto&
factories = registry.factories();
504 for (
const auto& factoryName : registry.loadedFactoryNames() ) {
505 if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
507 LOG_INFO <<
"\t==> skipping [" << factoryName <<
"]...";
511 auto entry =
factories.find( factoryName );
513 LOG_ERROR <<
"inconsistency in component factories list: I cannot find anymore " << factoryName;
516 const auto& info = entry->second;
517 if ( !info.is_set() )
continue;
520 if ( !info.getprop(
"ReflexName" ).empty() )
continue;
526 if ( libNativeName( iLib ) != info.library ) {
527 LOG_WARNING <<
"library [" << iLib <<
"] exposes factory [" << factoryName <<
"] which is declared in [" 528 << info.library <<
"] !!";
534 const auto ft = allowedFactories.find( info.factory.type().name() );
535 if ( ft != allowedFactories.end() ) {
537 }
else if ( factoryName ==
"ApplicationMgr" ) {
538 type = component_t::ApplicationMgr;
546 const auto className = info.getprop(
"ClassName" );
547 LOG_INFO <<
" - component: " << className <<
" (" << ( className != name ? ( name +
": " ) :
std::string() )
550 string cname =
"DefaultName";
554 case component_t::Algorithm:
555 prop =
SmartIF<IAlgorithm>( Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
557 case component_t::Service:
558 prop =
SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
560 case component_t::AlgTool:
566 case component_t::Auditor:
567 prop =
SmartIF<IAuditor>( Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
569 case component_t::ApplicationMgr:
576 LOG_ERROR <<
"Error instantiating " << name <<
" from " << iLib;
581 LOG_ERROR <<
"Error instantiating " << name <<
" from " << iLib;
591 LOG_ERROR <<
"could not cast IInterface* object to an IProperty* !";
592 LOG_ERROR <<
"NO Configurable will be generated for [" << name <<
"] !";
603 std::fstream py( pyName, std::ios_base::out | std::ios_base::trunc );
604 std::fstream db( dbName, std::ios_base::out | std::ios_base::trunc );
607 if ( !userModule.
empty() ) py <<
"from " << userModule <<
" import *" << endl;
616 return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
void * ImageHandle
Definition of an image handle.
stringstream m_pyBuf
buffer of auto-generated configurables
bool m_importDataObjectHandles
GAUDI_API ISvcLocator * svcLocator()
GAUDIPS_API Logger & logger()
Return the current logger instance.
Definition of the basic interface.
void genHeader(std::ostream &pyOut, std::ostream &dbOut)
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
virtual unsigned long release()=0
Release Interface instance.
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
static GAUDI_API void disableChecking()
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
void genTrailer(std::ostream &pyOut, std::ostream &dbOut)
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
bool genComponent(const std::string &libName, const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties)
Base class for all services.
void genBody(std::ostream &pyOut, std::ostream &dbOut)
std::string toString(const Type &)
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.