Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (98f5f38d)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
configGenerator Class Reference
Collaboration diagram for configGenerator:

Public Member Functions

 configGenerator (const string &pkgName, const string &outputDirName)
 
int genConfig (const Strings_t &modules, const string &userModule)
 main entry point of this class: More...
 
void setConfigurableTypes (const std::set< conf_t > &types)
 customize configurable types to generate More...
 
void setConfigurableModule (const std::string &moduleName)
 customize the Module name where configurable base classes are defined More...
 
void setConfigurableDefaultName (const std::string &defaultName)
 customize the default name for configurable instances More...
 
void setConfigurableAlgorithm (const std::string &cfgAlgorithm)
 customize the configurable base class for Algorithm component More...
 
void setConfigurableAlgTool (const std::string &cfgAlgTool)
 customize the configurable base class for AlgTool component More...
 
void setConfigurableAuditor (const std::string &cfgAuditor)
 customize the configurable base class for AlgTool component More...
 
void setConfigurableService (const std::string &cfgService)
 customize the configurable base class for Service component More...
 

Private Member Functions

bool genComponent (const std::string &libName, const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties, const Gaudi::PluginService::Details::Registry::FactoryInfo &info)
 
bool genComponent2 (const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties, const std::vector< std::string > &interfaces, const Gaudi::PluginService::Details::Registry::FactoryInfo &info)
 
void genImport (std::ostream &s, std::string_view frmt, std::string indent)
 
void genHeader (std::ostream &pyOut, std::ostream &dbOut)
 
void genBody (std::ostream &pyOut, std::ostream &dbOut)
 
void genTrailer (std::ostream &pyOut, std::ostream &dbOut)
 
void pythonizeValue (const PropertyBase *prop, string &pvalue, string &ptype)
 handle the "marshalling" of Properties More...
 

Private Attributes

string m_pkgName
 name of the package we are processing More...
 
string m_outputDirName
 absolute path to the directory where genconf will store auto-generated files (Configurables and ConfigurableDb) More...
 
stringstream m_pyBuf
 buffer of auto-generated configurables More...
 
bool m_importGaudiHandles = false
 switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the components has a XyzHandle<T>) More...
 
bool m_importDataHandles = false
 
std::set< conf_t > m_confTypes
 Types of configurables to generate. More...
 
stringstream m_dbBuf
 buffer of generated configurables informations for the "Db" file The "Db" file is holding informations about the generated configurables This file is later one used by the PropertyProxy.py to locate Configurables and know their default values, host module,... More...
 
stringstream m_db2Buf
 buffer of generated GaudiConfig2 configurables More...
 
std::map< component_t, std::string > m_configurable
 Configurable customization. More...
 

Detailed Description

Definition at line 171 of file genconf.cpp.

Constructor & Destructor Documentation

◆ configGenerator()

configGenerator::configGenerator ( const string &  pkgName,
const string &  outputDirName 
)
inline

Definition at line 207 of file genconf.cpp.

208  : m_pkgName( pkgName ), m_outputDirName( outputDirName ) {}

Member Function Documentation

◆ genBody()

void configGenerator::genBody ( std::ostream &  pyOut,
std::ostream &  dbOut 
)
inlineprivate

Definition at line 255 of file genconf.cpp.

255  {
256  pyOut << m_pyBuf.str() << flush;
257  dbOut << m_dbBuf.str() << flush;
258  }

◆ genComponent()

bool configGenerator::genComponent ( const std::string &  libName,
const std::string &  componentName,
component_t  componentType,
const vector< PropertyBase * > &  properties,
const Gaudi::PluginService::Details::Registry::FactoryInfo &  info 
)
private

Definition at line 705 of file genconf.cpp.

709 {
710  auto cname = pythonizeName( componentName );
711  const auto decl_loc = info.getprop( "declaration_location" );
712 
713  std::vector<std::pair<std::string, std::string>> propDoc;
714  propDoc.reserve( properties.size() );
715 
716  m_pyBuf << "\nclass " << cname << "( " << m_configurable[componentType] << " ) :\n";
717  m_pyBuf << " __slots__ = { \n";
718  for ( const auto& prop : properties ) {
719  const string& pname = prop->name();
720  // Validate property name (it must be a valid Python identifier)
721  if ( !boost::regex_match( pname, pythonIdentifier ) ) {
722  LOG_ERROR << "invalid property name \"" << pname << "\" in component " << cname << " (invalid Python identifier)"
723  << std::endl;
724  // try to make the buffer at least more or less valid python code.
725  m_pyBuf << " #ERROR-invalid identifier '" << pname << "'\n"
726  << " }\n";
727  return false;
728  }
729 
730  string pvalue, ptype;
731  pythonizeValue( prop, pvalue, ptype );
732  m_pyBuf << " '" << pname << "' : " << pvalue << ",\n";
733 
734  if ( prop->documentation() != "none" ) {
735  propDoc.emplace_back( pname, prop->documentation() + " [" + prop->ownerTypeName() + "]" );
736  }
737  }
738  m_pyBuf << " }\n";
739  m_pyBuf << " _propertyDocDct = { \n";
740  for ( const auto& prop : propDoc ) {
741  m_pyBuf << std::setw( 5 ) << "'" << prop.first << "' : "
742  << "\"\"\" " << prop.second << " \"\"\",\n";
743  }
744  m_pyBuf << " }\n";
745 
746  if ( !decl_loc.empty() ) { m_pyBuf << " __declaration_location__ = '" << decl_loc << "'\n"; }
747  m_pyBuf << " def __init__(self, name = " << m_configurable[component_t::DefaultName] << ", **kwargs):\n"
748  << " super(" << cname << ", self).__init__(name)\n"
749  << " for n,v in kwargs.items():\n"
750  << " setattr(self, n, v)\n"
751  << " def getDlls( self ):\n"
752  << " return '" << libName << "'\n"
753  << " def getType( self ):\n"
754  << " return '" << componentName << "'\n"
755  << " pass # class " << cname << "\n"
756  << flush;
757 
758  // name of the auto-generated module
759  const string pyName = ( fs::path( m_outputDirName ) / fs::path( libName + "Conf.py" ) ).string();
760  const string modName = fs::path( pyName ).filename().stem().string();
761 
762  // now the db part
763  m_dbBuf << m_pkgName << "." << modName << " " << libName << " " << cname << "\n" << flush;
764 
765  return true;
766 }

◆ genComponent2()

bool configGenerator::genComponent2 ( const std::string &  componentName,
component_t  componentType,
const vector< PropertyBase * > &  properties,
const std::vector< std::string > &  interfaces,
const Gaudi::PluginService::Details::Registry::FactoryInfo &  info 
)
private

Definition at line 769 of file genconf.cpp.

773 {
774  m_db2Buf << " '" << componentName << "': {\n";
775  m_db2Buf << " '__component_type__': '";
776  switch ( componentType ) {
777  case component_t::Algorithm:
778  m_db2Buf << "Algorithm";
779  break;
780  case component_t::AlgTool:
781  m_db2Buf << "AlgTool";
782  break;
783  case component_t::ApplicationMgr: // FALLTROUGH
784  case component_t::Service:
785  m_db2Buf << "Service";
786  break;
787  case component_t::Auditor:
788  m_db2Buf << "Auditor";
789  break;
790  default:
791  m_db2Buf << "Unknown";
792  }
793 
794  const auto decl_loc = info.getprop( "declaration_location" );
795  if ( !decl_loc.empty() ) { m_db2Buf << "',\n '__declaration_location__': '" << decl_loc; }
796 
797  m_db2Buf << "',\n '__interfaces__': (";
798  for ( const auto& intf : std::set<std::string>{ begin( interfaces ), end( interfaces ) } ) {
799  if ( ignored_interfaces.find( intf ) == end( ignored_interfaces ) ) { m_db2Buf << '\'' << intf << "', "; }
800  }
801  m_db2Buf << "),\n 'properties': {\n";
802 
803  bool success = true;
804  for ( const auto& prop : properties ) {
805  const string& pname = prop->name();
806  // Validate property name (it must be a valid Python identifier)
807  if ( !boost::regex_match( pname, pythonIdentifier ) ) {
808  LOG_ERROR << "invalid property name \"" << pname << "\" in component " << componentName
809  << " (invalid Python identifier)" << std::endl;
810  m_db2Buf << " #ERROR-invalid identifier '" << pname << "'\n";
811  success = false;
812  break;
813  }
814 
815  string pvalue, ptype;
816  pythonizeValue( prop, pvalue, ptype );
817 
818  m_db2Buf << " '" << pname << "': ('" << ptype << "', " << pvalue << ", '''" << prop->documentation()
819  << " [" << prop->ownerTypeName() << "]'''";
820  auto sem = prop->semantics();
821  if ( !sem.empty() ) { m_db2Buf << ", '" << sem << '\''; }
822  m_db2Buf << "),\n";
823  }
824 
825  m_db2Buf << " },\n },\n";
826 
827  return success;
828 }

◆ genConfig()

int configGenerator::genConfig ( const Strings_t modules,
const string &  userModule 
)

main entry point of this class:

  • iterate over all the modules (ie: library names)
  • for each module extract component informations
  • eventually generate the header/body/trailer python file and "Db" file

write-out files for this library

Definition at line 466 of file genconf.cpp.

468 {
469  const auto endLib = libs.end();
470 
471  static const std::string gaudiSvc = "GaudiCoreSvc";
472  const bool isGaudiSvc =
473  std::find_if( libs.begin(), endLib, []( const auto& s ) {
474  return s.find( gaudiSvc ) != std::string::npos; // libs can be <name> or path/to/lib<name>.so
475  } ) != endLib;
476 
477  //--- Instantiate ApplicationMgr --------------------------------------------
478  if ( !isGaudiSvc && createAppMgr() ) {
479  cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
480  return EXIT_FAILURE;
481  }
482 
483  //--- Iterate over component factories --------------------------------------
484  using Gaudi::PluginService::Details::Registry;
485  const Registry& registry = Registry::instance();
486 
487  auto bkgNames = registry.loadedFactoryNames();
488 
489  ISvcLocator* svcLoc = Gaudi::svcLocator();
490  IInterface* dummySvc = new Service( "DummySvc", svcLoc );
491  dummySvc->addRef();
492 
493  bool allGood = true;
494 
495  // iterate over all the requested libraries
496  for ( const auto& iLib : libs ) {
497  std::string lib = fs::path( iLib ).stem().string();
498  if ( lib.compare( 0, 3, "lib" ) == 0 ) {
499  lib = lib.substr( 3 ); // For *NIX remove "lib"
500  }
501  LOG_INFO << ":::: processing library: " << iLib << "...";
502 
503  // reset state
504  m_importGaudiHandles = false;
505  m_importDataHandles = false;
506  m_pyBuf.str( "" );
507  m_dbBuf.str( "" );
508  m_db2Buf.str( "" );
509 
510  //--- Load component library ----------------------------------------------
511  System::ImageHandle handle;
512  unsigned long err = System::loadDynamicLib( iLib, &handle );
513  if ( err != 1 ) {
515  allGood = false;
516  continue;
517  }
518 
519  const auto& factories = registry.factories();
520  for ( const auto& factoryName : registry.loadedFactoryNames() ) {
521  if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
523  LOG_INFO << "\t==> skipping [" << factoryName << "]...";
524  }
525  continue;
526  }
527  auto entry = factories.find( factoryName );
528  if ( entry == end( factories ) ) {
529  LOG_ERROR << "inconsistency in component factories list: I cannot find anymore " << factoryName;
530  continue;
531  }
532  const auto& info = entry->second;
533  if ( !info.is_set() ) continue;
534 
535  // do not generate configurables for the Reflex-compatible aliases
536  if ( !info.getprop( "ReflexName" ).empty() ) continue;
537 
538  // Atlas contributed code (patch #1247)
539  // Skip the generation of configurables if the component does not come
540  // from the same library we are processing (i.e. we found a symbol that
541  // is coming from a library loaded by the linker).
542  if ( libNativeName( lib ) != info.library ) {
543  LOG_WARNING << "library [" << lib << "] exposes factory [" << factoryName << "] which is declared in ["
544  << info.library << "] !!";
545  continue;
546  }
547 
548  component_t type = component_t::Unknown;
549  {
550  const auto ft = allowedFactories.find( info.factory.type().name() );
551  if ( ft != allowedFactories.end() ) {
552  type = ft->second;
553  } else if ( factoryName == "ApplicationMgr" ) {
554  type = component_t::ApplicationMgr;
555  } else
556  continue;
557  }
558 
559  // handle possible problems with templated components
560  std::string name = boost::trim_copy( factoryName );
561 
562  const auto className = info.getprop( "ClassName" );
563  LOG_INFO << " - component: " << className << " (" << ( className != name ? ( name + ": " ) : std::string() )
564  << type << ")";
565 
566  string cname = "DefaultName";
567  SmartIF<IProperty> prop;
568  try {
569  switch ( type ) {
570  case component_t::Algorithm:
571  prop = SmartIF<IAlgorithm>( Gaudi::Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
572  break;
573  case component_t::Service:
574  prop = SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
575  break;
576  case component_t::AlgTool:
577  prop =
578  SmartIF<IAlgTool>( AlgTool::Factory::create( factoryName, cname, toString( type ), dummySvc ).release() );
579  // FIXME: AlgTool base class increase artificially by 1 the refcount.
580  prop->release();
581  break;
582  case component_t::Auditor:
583  prop = SmartIF<Gaudi::IAuditor>( Gaudi::Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
584  break;
585  case component_t::ApplicationMgr:
586  prop = SmartIF<ISvcLocator>( svcLoc );
587  break;
588  default:
589  continue; // unknown
590  }
591  } catch ( exception& e ) {
592  LOG_ERROR << "Error instantiating " << name << " from " << iLib;
593  LOG_ERROR << "Got exception: " << e.what();
594  allGood = false;
595  continue;
596  } catch ( ... ) {
597  LOG_ERROR << "Error instantiating " << name << " from " << iLib;
598  allGood = false;
599  continue;
600  }
601  if ( prop ) {
602  if ( m_confTypes.contains( conf_t::CONF ) && !genComponent( lib, name, type, prop->getProperties(), info ) ) {
603  allGood = false;
604  }
605  if ( m_confTypes.contains( conf_t::CONF2 ) &&
606  !genComponent2( name, type, prop->getProperties(), prop->getInterfaceNames(), info ) ) {
607  allGood = false;
608  }
609  prop.reset();
610  } else {
611  LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
612  LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
613  allGood = false;
614  }
615  } //> end loop over factories
616 
620  if ( m_confTypes.contains( conf_t::CONF ) ) {
621  const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( lib + "Conf.py" ) ).string();
622  const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb" ) ).string();
623 
624  std::fstream py( pyName, std::ios_base::out | std::ios_base::trunc );
625  std::fstream db( dbName, std::ios_base::out | std::ios_base::trunc );
626 
627  genHeader( py, db );
628  if ( !userModule.empty() ) py << "from " << userModule << " import *" << endl;
629  genBody( py, db );
630  genTrailer( py, db );
631  }
632  if ( m_confTypes.contains( conf_t::CONF2 ) ) {
633  const std::string db2Name = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb2_part" ) ).string();
634  std::fstream db2( db2Name, std::ios_base::out | std::ios_base::trunc );
635  db2 << "{\n" << m_db2Buf.str() << "}\n";
636  }
637 
638  } //> end loop over libraries
639 
640  dummySvc->release();
641  dummySvc = 0;
642 
643  return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
644 }

◆ genHeader()

void configGenerator::genHeader ( std::ostream &  pyOut,
std::ostream &  dbOut 
)
private

Definition at line 677 of file genconf.cpp.

679 {
680  // python file part
681  std::string now = Gaudi::Time::current().format( true );
682  py << "#" << now //<< "\n"
683  << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n";
684 
685  if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
686 
687  if ( m_importDataHandles ) { py << "from GaudiKernel.DataHandle import DataHandle\n"; }
688 
689  genImport( py, "from {}.Configurable import *" );
690 
691  // db file part
692  db << "## -*- ascii -*- \n"
693  << "# db file automatically generated by genconf on: " << now << "\n"
694  << flush;
695 }

◆ genImport()

void configGenerator::genImport ( std::ostream &  s,
std::string_view  frmt,
std::string  indent = "" 
)
private

Definition at line 646 of file genconf.cpp.

646  {
647 
648  std::string::size_type pos = 0, nxtpos = 0;
649  std::string mod;
650 
651  while ( std::string::npos != pos ) {
652  // find end of module name
653  nxtpos = m_configurable[component_t::Module].find_first_of( ',', pos );
654 
655  // Prepare import string
656  mod = m_configurable[component_t::Module].substr( pos, nxtpos - pos );
657  std::ostringstream import;
658  import << fmt::format( fmt::runtime( frmt ), mod );
659 
660  // append a normal import or a try/except enclosed one depending
661  // on availability of a fall-back module (next in the list)
662  if ( std::string::npos == nxtpos ) {
663  // last possible module
664  s << indent << import.str() << "\n" << flush;
665  pos = std::string::npos;
666  } else {
667  // we have a fallback for this
668  s << indent << "try:\n" << indent << py_tab << import.str() << "\n" << indent << "except ImportError:\n" << flush;
669  pos = nxtpos + 1;
670  }
671  // increase indentation level for next iteration
672  indent += py_tab;
673  }
674 }

◆ genTrailer()

void configGenerator::genTrailer ( std::ostream &  pyOut,
std::ostream &  dbOut 
)
private

Definition at line 697 of file genconf.cpp.

699 {
700  // db file part
701  db << "## " << m_pkgName << "\n" << std::flush;
702 }

◆ pythonizeValue()

void configGenerator::pythonizeValue ( const PropertyBase prop,
string &  pvalue,
string &  ptype 
)
private

handle the "marshalling" of Properties

Definition at line 831 of file genconf.cpp.

833 {
834  const std::string cvalue = p->toString();
835  const std::type_index ti = std::type_index( *p->type_info() );
836  ptype = System::typeinfoName( *p->type_info() );
837 
838  if ( ti == typeIndex<bool>() ) {
839  pvalue = ( cvalue == "0" || cvalue == "False" || cvalue == "false" ) ? "False" : "True";
840  } else if ( ti == typeIndex<char>() || ti == typeIndex<signed char>() || ti == typeIndex<unsigned char>() ||
841  ti == typeIndex<short>() || ti == typeIndex<unsigned short>() || ti == typeIndex<int>() ||
842  ti == typeIndex<unsigned int>() || ti == typeIndex<long>() || ti == typeIndex<unsigned long>() ||
843  ti == typeIndex<long long>() || ti == typeIndex<unsigned long long>() ) {
844  pvalue = cvalue;
845  } else if ( ti == typeIndex<float>() || ti == typeIndex<double>() ) {
846  // forces python to handle this as a float: put a dot in there...
847  pvalue = boost::to_lower_copy( cvalue );
848  if ( std::string::npos != pvalue.find( "nan" ) ) {
849  pvalue = "float('nan')";
850  } else if ( std::string::npos == pvalue.find( "." ) && std::string::npos == pvalue.find( "e" ) ) {
851  pvalue = cvalue + ".0";
852  }
853  } else if ( ti == typeIndex<string>() ) {
854  pvalue = quote( cvalue );
855  } else if ( ti == typeIndex<GaudiHandleBase>() ) {
856  const GaudiHandleProperty& hdl = dynamic_cast<const GaudiHandleProperty&>( *p );
857  const GaudiHandleBase& base = hdl.value();
858 
859  pvalue = base.pythonRepr();
860  ptype = base.pythonPropertyClassName();
861  m_importGaudiHandles = true;
862  } else if ( ti == typeIndex<GaudiHandleArrayBase>() ) {
863  const GaudiHandleArrayProperty& hdl = dynamic_cast<const GaudiHandleArrayProperty&>( *p );
864  const GaudiHandleArrayBase& base = hdl.value();
865 
866  pvalue = base.pythonRepr();
867  ptype = base.pythonPropertyClassName();
868  m_importGaudiHandles = true;
869  } else if ( auto hdl = dynamic_cast<const DataHandleProperty*>( p ); hdl ) {
870  // dynamic_cast to support also classes derived from DataHandleProperty
871  const Gaudi::DataHandle& base = hdl->value();
872 
873  pvalue = base.pythonRepr();
874  m_importDataHandles = true;
875  } else {
876  std::ostringstream v_str;
877  v_str.setf( std::ios::showpoint ); // to correctly display floats
878  p->toStream( v_str );
879  pvalue = v_str.str();
880  }
881 }

◆ setConfigurableAlgorithm()

void configGenerator::setConfigurableAlgorithm ( const std::string &  cfgAlgorithm)
inline

customize the configurable base class for Algorithm component

Definition at line 228 of file genconf.cpp.

228  {
229  m_configurable[component_t::Algorithm] = cfgAlgorithm;
230  }

◆ setConfigurableAlgTool()

void configGenerator::setConfigurableAlgTool ( const std::string &  cfgAlgTool)
inline

customize the configurable base class for AlgTool component

Definition at line 233 of file genconf.cpp.

233 { m_configurable[component_t::AlgTool] = cfgAlgTool; }

◆ setConfigurableAuditor()

void configGenerator::setConfigurableAuditor ( const std::string &  cfgAuditor)
inline

customize the configurable base class for AlgTool component

Definition at line 236 of file genconf.cpp.

236 { m_configurable[component_t::Auditor] = cfgAuditor; }

◆ setConfigurableDefaultName()

void configGenerator::setConfigurableDefaultName ( const std::string &  defaultName)
inline

customize the default name for configurable instances

Definition at line 223 of file genconf.cpp.

223  {
224  m_configurable[component_t::DefaultName] = defaultName;
225  }

◆ setConfigurableModule()

void configGenerator::setConfigurableModule ( const std::string &  moduleName)
inline

customize the Module name where configurable base classes are defined

Definition at line 220 of file genconf.cpp.

220 { m_configurable[component_t::Module] = moduleName; }

◆ setConfigurableService()

void configGenerator::setConfigurableService ( const std::string &  cfgService)
inline

customize the configurable base class for Service component

Definition at line 239 of file genconf.cpp.

239  {
240  m_configurable[component_t::Service] = cfgService;
241  m_configurable[component_t::ApplicationMgr] = cfgService;
242  }

◆ setConfigurableTypes()

void configGenerator::setConfigurableTypes ( const std::set< conf_t > &  types)
inline

customize configurable types to generate

Definition at line 217 of file genconf.cpp.

217 { m_confTypes = types; }

Member Data Documentation

◆ m_configurable

std::map<component_t, std::string> configGenerator::m_configurable
private

Configurable customization.

Contains customization for:

  • Name of the module where configurable base classes are defined
  • Name of the configurable base class for the Algorithm component
  • Name of the configurable base class for the AlgTool component
  • Name of the configurable base class for the Service component

Definition at line 204 of file genconf.cpp.

◆ m_confTypes

std::set<conf_t> configGenerator::m_confTypes
private

Types of configurables to generate.

Definition at line 188 of file genconf.cpp.

◆ m_db2Buf

stringstream configGenerator::m_db2Buf
private

buffer of generated GaudiConfig2 configurables

Definition at line 197 of file genconf.cpp.

◆ m_dbBuf

stringstream configGenerator::m_dbBuf
private

buffer of generated configurables informations for the "Db" file The "Db" file is holding informations about the generated configurables This file is later one used by the PropertyProxy.py to locate Configurables and know their default values, host module,...

Definition at line 194 of file genconf.cpp.

◆ m_importDataHandles

bool configGenerator::m_importDataHandles = false
private

Definition at line 185 of file genconf.cpp.

◆ m_importGaudiHandles

bool configGenerator::m_importGaudiHandles = false
private

switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the components has a XyzHandle<T>)

Definition at line 184 of file genconf.cpp.

◆ m_outputDirName

string configGenerator::m_outputDirName
private

absolute path to the directory where genconf will store auto-generated files (Configurables and ConfigurableDb)

Definition at line 177 of file genconf.cpp.

◆ m_pkgName

string configGenerator::m_pkgName
private

name of the package we are processing

Definition at line 173 of file genconf.cpp.

◆ m_pyBuf

stringstream configGenerator::m_pyBuf
private

buffer of auto-generated configurables

Definition at line 180 of file genconf.cpp.


The documentation for this class was generated from the following file:
configGenerator::genTrailer
void genTrailer(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:697
System::loadDynamicLib
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
Definition: System.cpp:150
cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:83
GaudiHandleArrayProperty::value
const GaudiHandleArrayBase & value() const
Definition: Property.h:634
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
configGenerator::genComponent
bool genComponent(const std::string &libName, const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties, const Gaudi::PluginService::Details::Registry::FactoryInfo &info)
Definition: genconf.cpp:705
gaudirun.s
string s
Definition: gaudirun.py:346
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:98
ISvcLocator
Definition: ISvcLocator.h:46
DataHandleProperty
DataHandleProperty.h GaudiKernel/DataHandleProperty.h.
Definition: DataHandleProperty.h:34
configGenerator::m_confTypes
std::set< conf_t > m_confTypes
Types of configurables to generate.
Definition: genconf.cpp:188
Gaudi::DataHandle
Definition: DataHandle.h:38
createAppMgr
int createAppMgr()
Definition: genconf.cpp:884
System::ImageHandle
void * ImageHandle
Definition of an image handle.
Definition: ModuleInfo.h:40
conf.release
string release
Definition: conf.py:27
ProduceConsume.types
types
Definition: ProduceConsume.py:59
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:315
IInterface::addRef
virtual unsigned long addRef() const =0
Increment the reference count of Interface instance.
configGenerator::m_dbBuf
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:194
GaudiHandleBase
Definition: GaudiHandle.h:105
configGenerator::m_importGaudiHandles
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:184
configGenerator::m_pyBuf
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:180
Gaudi.CommonGaudiConfigurables.mod
mod
Definition: CommonGaudiConfigurables.py:39
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:136
Gaudi::Time::format
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:262
configGenerator::genComponent2
bool genComponent2(const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties, const std::vector< std::string > &interfaces, const Gaudi::PluginService::Details::Registry::FactoryInfo &info)
Definition: genconf.cpp:769
configGenerator::m_importDataHandles
bool m_importDataHandles
Definition: genconf.cpp:185
LOG_ERROR
#define LOG_ERROR
Definition: genconf.cpp:75
cpluginsvc.factories
def factories()
Definition: cpluginsvc.py:93
SmartIF< IProperty >
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
GaudiHandleProperty::value
const GaudiHandleBase & value() const
Definition: Property.h:597
configGenerator::m_pkgName
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:173
gaudirun.level
level
Definition: gaudirun.py:364
configGenerator::genImport
void genImport(std::ostream &s, std::string_view frmt, std::string indent)
Definition: genconf.cpp:646
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:204
System::moduleName
GAUDI_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.
Definition: ModuleInfo.cpp:64
GaudiHandleArrayBase
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:337
GaudiHandleProperty
Definition: Property.h:576
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:68
LOG_WARNING
#define LOG_WARNING
Definition: genconf.cpp:76
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:357
gaudirun.type
type
Definition: gaudirun.py:160
Gaudi::PluginService::v1::Details::logger
GAUDIPS_API Logger & logger()
Return the current logger instance.
Definition: PluginServiceV1.cpp:314
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
configGenerator::genHeader
void genHeader(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:677
LOG_INFO
#define LOG_INFO
Definition: genconf.cpp:77
Gaudi::Time::current
static Time current()
Returns the current time.
Definition: Time.cpp:119
IInterface
Definition: IInterface.h:227
configGenerator::m_outputDirName
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:177
compareOutputFiles.pname
pname
Definition: compareOutputFiles.py:482
configGenerator::m_db2Buf
stringstream m_db2Buf
buffer of generated GaudiConfig2 configurables
Definition: genconf.cpp:197
check_ParticleID.base
base
Definition: check_ParticleID.py:24
IOTest.end
end
Definition: IOTest.py:125
System::getLastErrorString
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition: System.cpp:279
configGenerator::pythonizeValue
void pythonizeValue(const PropertyBase *prop, string &pvalue, string &ptype)
handle the "marshalling" of Properties
Definition: genconf.cpp:831
configGenerator::genBody
void genBody(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:255
GaudiHandleArrayProperty
Definition: Property.h:613
IInterface::release
virtual unsigned long release() const =0
Release Interface instance.
Gaudi::Functional::details::out
OptOut && out
Definition: details.h:196