The Gaudi Framework  v33r2 (a6f0ec87)
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 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 std::vector< std::string > &interfaces)
 
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, string &ptype2)
 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_importDataObjectHandles = false
 
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
 
std::map< component_t, std::stringm_configurable
 Configurable customization. More...
 

Detailed Description

Definition at line 165 of file genconf.cpp.

Constructor & Destructor Documentation

◆ configGenerator()

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

Definition at line 197 of file genconf.cpp.

198  : m_pkgName( pkgName ), m_outputDirName( outputDirName ) {}
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:171
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:167

Member Function Documentation

◆ genBody()

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

Definition at line 236 of file genconf.cpp.

236  {
237  pyOut << m_pyBuf.str() << flush;
238  dbOut << m_dbBuf.str() << flush;
239  }
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:174
T str(T... args)
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:185
T flush(T... args)

◆ genComponent()

bool configGenerator::genComponent ( const std::string libName,
const std::string componentName,
component_t  componentType,
const vector< PropertyBase * > &  properties,
const std::vector< std::string > &  interfaces 
)
private

Definition at line 682 of file genconf.cpp.

686 {
687  auto cname = pythonizeName( componentName );
688 
690  propDoc.reserve( properties.size() );
691 
692  m_db2Buf << " '" << componentName << "': {\n";
693  m_db2Buf << " '__component_type__': '";
694  switch ( componentType ) {
695  case component_t::Algorithm:
696  m_db2Buf << "Algorithm";
697  break;
698  case component_t::AlgTool:
699  m_db2Buf << "AlgTool";
700  break;
701  case component_t::ApplicationMgr: // FALLTROUGH
702  case component_t::Service:
703  m_db2Buf << "Service";
704  break;
705  case component_t::Auditor:
706  m_db2Buf << "Auditor";
707  break;
708  default:
709  m_db2Buf << "Unknown";
710  }
711  m_db2Buf << "',\n '__interfaces__': (";
712  for ( const auto& intf : std::set<std::string>{begin( interfaces ), end( interfaces )} ) {
713  if ( ignored_interfaces.find( intf ) == end( ignored_interfaces ) ) { m_db2Buf << '\'' << intf << "', "; }
714  }
715  m_db2Buf << "),\n 'properties': {\n";
716 
717  m_pyBuf << "\nclass " << cname << "( " << m_configurable[componentType] << " ) :\n";
718  m_pyBuf << " __slots__ = { \n";
719  for ( const auto& prop : properties ) {
720  const string& pname = prop->name();
721  // Validate property name (it must be a valid Python identifier)
722  if ( !boost::regex_match( pname, pythonIdentifier ) ) {
723  std::cout << "ERROR: invalid property name \"" << pname << "\" in component " << cname
724  << " (invalid Python identifier)" << std::endl;
725  // try to make the buffer at least more or less valid python code.
726  m_pyBuf << " #ERROR-invalid identifier '" << pname << "'\n"
727  << " }\n";
728  return false;
729  }
730 
731  string pvalue, ptype, ptype2;
732  pythonizeValue( prop, pvalue, ptype, ptype2 );
733  m_pyBuf << " '" << pname << "' : " << pvalue << ", # " << ptype << "\n";
734 
735  m_db2Buf << " '" << pname << "': ('" << ptype2 << "', " << pvalue << ", '''" << prop->documentation()
736  << " [" << prop->ownerTypeName() << "]'''";
737  auto sem = prop->semantics();
738  if ( !sem.empty() ) { m_db2Buf << ", '" << sem << '\''; }
739  m_db2Buf << "),\n";
740 
741  if ( prop->documentation() != "none" ) {
742  propDoc.emplace_back( pname, prop->documentation() + " [" + prop->ownerTypeName() + "]" );
743  }
744  }
745  m_pyBuf << " }\n";
746  m_pyBuf << " _propertyDocDct = { \n";
747  for ( const auto& prop : propDoc ) {
748  m_pyBuf << std::setw( 5 ) << "'" << prop.first << "' : "
749  << "\"\"\" " << prop.second << " \"\"\",\n";
750  }
751  m_pyBuf << " }\n";
752 
753  m_pyBuf << " def __init__(self, name = " << m_configurable[component_t::DefaultName] << ", **kwargs):\n"
754  << " super(" << cname << ", self).__init__(name)\n"
755  << " for n,v in kwargs.items():\n"
756  << " setattr(self, n, v)\n"
757  << " def getDlls( self ):\n"
758  << " return '" << libName << "'\n"
759  << " def getType( self ):\n"
760  << " return '" << componentName << "'\n"
761  << " pass # class " << cname << "\n"
762  << flush;
763 
764  // name of the auto-generated module
765  const string pyName = ( fs::path( m_outputDirName ) / fs::path( libName + "Conf.py" ) ).string();
766  const string modName = fs::basename( fs::path( pyName ).leaf() );
767 
768  m_db2Buf << " },\n },\n";
769 
770  // now the db part
771  m_dbBuf << m_pkgName << "." << modName << " " << libName << " " << cname << "\n" << flush;
772 
773  return true;
774 }
T endl(T... args)
void pythonizeValue(const PropertyBase *prop, string &pvalue, string &ptype, string &ptype2)
handle the "marshalling" of Properties
Definition: genconf.cpp:777
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:174
T setw(T... args)
def end
Definition: IOTest.py:123
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:185
T flush(T... args)
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:171
STL class.
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:167
AttribStringParser::Iterator begin(const AttribStringParser &parser)
stringstream m_db2Buf
Definition: genconf.cpp:187
T reserve(T... args)
T emplace_back(T... args)

◆ 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 449 of file genconf.cpp.

451 {
452  //--- Disable checking StatusCode -------------------------------------------
454 
455  const auto endLib = libs.end();
456 
457  static const std::string gaudiSvc = "GaudiCoreSvc";
458  const bool isGaudiSvc = ( std::find( libs.begin(), endLib, gaudiSvc ) != endLib );
459 
460  //--- Instantiate ApplicationMgr --------------------------------------------
461  if ( !isGaudiSvc && createAppMgr() ) {
462  cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
463  return EXIT_FAILURE;
464  }
465 
466  //--- Iterate over component factories --------------------------------------
467  using Gaudi::PluginService::Details::Registry;
468  const Registry& registry = Registry::instance();
469 
470  auto bkgNames = registry.loadedFactoryNames();
471 
472  ISvcLocator* svcLoc = Gaudi::svcLocator();
473  IInterface* dummySvc = new Service( "DummySvc", svcLoc );
474  dummySvc->addRef();
475 
476  bool allGood = true;
477 
478  // iterate over all the requested libraries
479  for ( const auto& iLib : libs ) {
480 
481  LOG_INFO << ":::: processing library: " << iLib << "...";
482 
483  // reset state
484  m_importGaudiHandles = false;
486  m_pyBuf.str( "" );
487  m_dbBuf.str( "" );
488  m_db2Buf.str( "" );
489 
490  //--- Load component library ----------------------------------------------
491  System::ImageHandle handle;
492  unsigned long err = System::loadDynamicLib( iLib, &handle );
493  if ( err != 1 ) {
495  allGood = false;
496  continue;
497  }
498 
499  const auto& factories = registry.factories();
500  for ( const auto& factoryName : registry.loadedFactoryNames() ) {
501  if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
503  LOG_INFO << "\t==> skipping [" << factoryName << "]...";
504  }
505  continue;
506  }
507  auto entry = factories.find( factoryName );
508  if ( entry == end( factories ) ) {
509  LOG_ERROR << "inconsistency in component factories list: I cannot find anymore " << factoryName;
510  continue;
511  }
512  const auto& info = entry->second;
513  if ( !info.is_set() ) continue;
514 
515  // do not generate configurables for the Reflex-compatible aliases
516  if ( !info.getprop( "ReflexName" ).empty() ) continue;
517 
518  // Atlas contributed code (patch #1247)
519  // Skip the generation of configurables if the component does not come
520  // from the same library we are processing (i.e. we found a symbol that
521  // is coming from a library loaded by the linker).
522  if ( libNativeName( iLib ) != info.library ) {
523  LOG_WARNING << "library [" << iLib << "] exposes factory [" << factoryName << "] which is declared in ["
524  << info.library << "] !!";
525  continue;
526  }
527 
528  component_t type = component_t::Unknown;
529  {
530  const auto ft = allowedFactories.find( info.factory.type().name() );
531  if ( ft != allowedFactories.end() ) {
532  type = ft->second;
533  } else if ( factoryName == "ApplicationMgr" ) {
534  type = component_t::ApplicationMgr;
535  } else
536  continue;
537  }
538 
539  // handle possible problems with templated components
540  std::string name = boost::trim_copy( factoryName );
541 
542  const auto className = info.getprop( "ClassName" );
543  LOG_INFO << " - component: " << className << " (" << ( className != name ? ( name + ": " ) : std::string() )
544  << type << ")";
545 
546  string cname = "DefaultName";
547  SmartIF<IProperty> prop;
548  try {
549  switch ( type ) {
550  case component_t::Algorithm:
551  prop = SmartIF<IAlgorithm>( Gaudi::Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
552  break;
553  case component_t::Service:
554  prop = SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
555  break;
556  case component_t::AlgTool:
557  prop =
558  SmartIF<IAlgTool>( AlgTool::Factory::create( factoryName, cname, toString( type ), dummySvc ).release() );
559  // FIXME: AlgTool base class increase artificially by 1 the refcount.
560  prop->release();
561  break;
562  case component_t::Auditor:
563  prop = SmartIF<IAuditor>( Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
564  break;
565  case component_t::ApplicationMgr:
566  prop = SmartIF<ISvcLocator>( svcLoc );
567  break;
568  default:
569  continue; // unknown
570  }
571  } catch ( exception& e ) {
572  LOG_ERROR << "Error instantiating " << name << " from " << iLib;
573  LOG_ERROR << "Got exception: " << e.what();
574  allGood = false;
575  continue;
576  } catch ( ... ) {
577  LOG_ERROR << "Error instantiating " << name << " from " << iLib;
578  allGood = false;
579  continue;
580  }
581  if ( prop ) {
582  if ( !genComponent( iLib, name, type, prop->getProperties(), prop->getInterfaceNames() ) ) { allGood = false; }
583  prop.reset();
584  } else {
585  LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
586  LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
587  allGood = false;
588  }
589  } //> end loop over factories
590 
594  const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( iLib + "Conf.py" ) ).string();
595  const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( iLib + ".confdb" ) ).string();
596 
597  std::fstream py( pyName, std::ios_base::out | std::ios_base::trunc );
598  std::fstream db( dbName, std::ios_base::out | std::ios_base::trunc );
599 
600  genHeader( py, db );
601  if ( !userModule.empty() ) py << "from " << userModule << " import *" << endl;
602  genBody( py, db );
603  genTrailer( py, db );
604 
605  {
606  const std::string db2Name = ( fs::path( m_outputDirName ) / fs::path( iLib + ".confdb2_part" ) ).string();
607  std::fstream db2( db2Name, std::ios_base::out | std::ios_base::trunc );
608  db2 << "{\n" << m_db2Buf.str() << "}\n";
609  }
610 
611  } //> end loop over libraries
612 
613  dummySvc->release();
614  dummySvc = 0;
615 
616  return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
617 }
virtual std::vector< std::string > getInterfaceNames() const =0
Returns a vector of strings containing the names of all the implemented interfaces.
T empty(T... args)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:35
component_t
Definition: genconf.cpp:103
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341
#define LOG_ERROR
Definition: genconf.cpp:74
T endl(T... args)
void * ImageHandle
Definition of an image handle.
Definition: ModuleInfo.h:40
bool genComponent(const std::string &libName, const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties, const std::vector< std::string > &interfaces)
Definition: genconf.cpp:682
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:174
STL class.
bool m_importDataObjectHandles
Definition: genconf.cpp:179
GAUDI_API ISvcLocator * svcLocator()
GAUDIPS_API Logger & logger()
Return the current logger instance.
T what(T... args)
#define LOG_INFO
Definition: genconf.cpp:76
Definition of the basic interface.
Definition: IInterface.h:254
STL class.
void genHeader(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:650
T str(T... args)
def end
Definition: IOTest.py:123
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:185
STL class.
T find(T... args)
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:171
virtual unsigned long release()=0
Release Interface instance.
#define LOG_WARNING
Definition: genconf.cpp:75
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:178
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:55
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
void genTrailer(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:674
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition: System.cpp:272
Base class for all services.
Definition: Service.h:46
int createAppMgr()
Definition: genconf.cpp:839
stringstream m_db2Buf
Definition: genconf.cpp:187
void genBody(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:236
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
Definition: System.cpp:145

◆ genHeader()

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

Definition at line 650 of file genconf.cpp.

652 {
653  // python file part
654  std::string now = Gaudi::Time::current().format( true );
655  py << "#" << now //<< "\n"
656  << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n"
657  << "import sys\n"
658  << "if sys.version_info >= (3,):\n"
659  << " # Python 2 compatibility\n"
660  << " long = int\n";
661 
662  if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
663 
664  if ( m_importDataObjectHandles ) { py << "from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase\n"; }
665 
666  genImport( py, "from {}.Configurable import *" );
667 
668  // db file part
669  db << "## -*- ascii -*- \n"
670  << "# db file automatically generated by genconf on: " << now << "\n"
671  << flush;
672 }
static Time current()
Returns the current time.
Definition: Time.cpp:119
STL class.
bool m_importDataObjectHandles
Definition: genconf.cpp:179
T flush(T... args)
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:262
void genImport(std::ostream &s, std::string_view frmt, std::string indent)
Definition: genconf.cpp:619
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:178

◆ genImport()

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

Definition at line 619 of file genconf.cpp.

619  {
620 
621  std::string::size_type pos = 0, nxtpos = 0;
623 
624  while ( std::string::npos != pos ) {
625  // find end of module name
626  nxtpos = m_configurable[component_t::Module].find_first_of( ',', pos );
627 
628  // Prepare import string
629  mod = m_configurable[component_t::Module].substr( pos, nxtpos - pos );
630  std::ostringstream import;
631  import << fmt::format( frmt, mod );
632 
633  // append a normal import or a try/except enclosed one depending
634  // on availability of a fall-back module (next in the list)
635  if ( std::string::npos == nxtpos ) {
636  // last possible module
637  s << indent << import.str() << "\n" << flush;
638  pos = std::string::npos;
639  } else {
640  // we have a fallback for this
641  s << indent << "try:\n" << indent << py_tab << import.str() << "\n" << indent << "except ImportError:\n" << flush;
642  pos = nxtpos + 1;
643  }
644  // increase indentation level for next iteration
645  indent += py_tab;
646  }
647 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
STL class.
T flush(T... args)
string s
Definition: gaudirun.py:328
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194

◆ genTrailer()

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

Definition at line 674 of file genconf.cpp.

676 {
677  // db file part
678  db << "## " << m_pkgName << "\n" << std::flush;
679 }
T flush(T... args)
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:167

◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 777 of file genconf.cpp.

779 {
780  const std::string cvalue = p->toString();
781  const std::type_index ti = std::type_index( *p->type_info() );
782  ptype2 = System::typeinfoName( *p->type_info() );
783 
784  if ( ti == typeIndex<bool>() ) {
785  pvalue = ( cvalue == "0" || cvalue == "False" || cvalue == "false" ) ? "False" : "True";
786  ptype = "bool";
787  } else if ( ti == typeIndex<char>() || ti == typeIndex<signed char>() || ti == typeIndex<unsigned char>() ||
788  ti == typeIndex<short>() || ti == typeIndex<unsigned short>() || ti == typeIndex<int>() ||
789  ti == typeIndex<unsigned int>() || ti == typeIndex<long>() || ti == typeIndex<unsigned long>() ||
790  ti == typeIndex<long long>() || ti == typeIndex<unsigned long long>() ) {
791  pvalue = cvalue;
792  ptype = "int";
793  } else if ( ti == typeIndex<float>() || ti == typeIndex<double>() ) {
794  // forces python to handle this as a float: put a dot in there...
795  pvalue = boost::to_lower_copy( cvalue );
796  if ( std::string::npos != pvalue.find( "nan" ) ) {
797  pvalue = "float('nan')";
798  std::cout << "WARNING: default value for [" << p->name() << "] is NaN !!" << std::endl;
799  } else if ( std::string::npos == pvalue.find( "." ) && std::string::npos == pvalue.find( "e" ) ) {
800  pvalue = cvalue + ".0";
801  }
802  ptype = "float";
803  } else if ( ti == typeIndex<string>() ) {
804  pvalue = quote( cvalue );
805  ptype = "str";
806  } else if ( ti == typeIndex<GaudiHandleBase>() ) {
807  const GaudiHandleProperty& hdl = dynamic_cast<const GaudiHandleProperty&>( *p );
808  const GaudiHandleBase& base = hdl.value();
809 
810  pvalue = base.pythonRepr();
811  ptype = "GaudiHandle";
812  ptype2 = base.pythonPropertyClassName();
813  m_importGaudiHandles = true;
814  } else if ( ti == typeIndex<GaudiHandleArrayBase>() ) {
815  const GaudiHandleArrayProperty& hdl = dynamic_cast<const GaudiHandleArrayProperty&>( *p );
816  const GaudiHandleArrayBase& base = hdl.value();
817 
818  pvalue = base.pythonRepr();
819  ptype = "GaudiHandleArray";
820  ptype2 = base.pythonPropertyClassName();
821  m_importGaudiHandles = true;
822  } else if ( ti == typeIndex<DataObjectHandleBase>() ) {
823  const DataObjectHandleProperty& hdl = dynamic_cast<const DataObjectHandleProperty&>( *p );
824  const DataObjectHandleBase& base = hdl.value();
825 
826  pvalue = base.pythonRepr();
827  ptype = "DataObjectHandleBase";
829  } else {
830  std::ostringstream v_str;
831  v_str.setf( std::ios::showpoint ); // to correctly display floats
832  p->toStream( v_str );
833  pvalue = v_str.str();
834  ptype = "list";
835  }
836 }
T setf(T... args)
const GaudiHandleArrayBase & value() const
Definition: Property.h:935
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:308
std::string pythonRepr() const override
std::string pythonPropertyClassName() const override
Name of the componentType with "Handle" appended.
Definition: GaudiHandle.cpp:50
T endl(T... args)
std::string pythonRepr() const override
Python representation of handle, i.e.
Definition: GaudiHandle.cpp:58
DataObjectHandleProperty.h GaudiKernel/DataObjectHandleProperty.h.
STL class.
bool m_importDataObjectHandles
Definition: genconf.cpp:179
T str(T... args)
const DataObjectHandleBase & value() const
T find(T... args)
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:342
DataObjectHandleBase GaudiKernel/DataObjectHandleBase.h.
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:178
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:99
const GaudiHandleBase & value() const
Definition: Property.h:898
std::string pythonPropertyClassName() const override
Name of the componentType with "HandleArray" appended.
Definition: GaudiHandle.cpp:86
std::string pythonRepr() const override
Python representation of array of handles, i.e.
Definition: GaudiHandle.cpp:88

◆ setConfigurableAlgorithm()

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

customize the configurable base class for Algorithm component

Definition at line 215 of file genconf.cpp.

215  {
216  m_configurable[component_t::Algorithm] = cfgAlgorithm;
217  }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194

◆ setConfigurableAlgTool()

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

customize the configurable base class for AlgTool component

Definition at line 220 of file genconf.cpp.

220 { m_configurable[component_t::AlgTool] = cfgAlgTool; }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194

◆ setConfigurableAuditor()

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

customize the configurable base class for AlgTool component

Definition at line 223 of file genconf.cpp.

223 { m_configurable[component_t::Auditor] = cfgAuditor; }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194

◆ setConfigurableDefaultName()

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

customize the default name for configurable instances

Definition at line 210 of file genconf.cpp.

210  {
211  m_configurable[component_t::DefaultName] = defaultName;
212  }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194

◆ setConfigurableModule()

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

customize the Module name where configurable base classes are defined

Definition at line 207 of file genconf.cpp.

207 { m_configurable[component_t::Module] = moduleName; }
GAUDI_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.
Definition: ModuleInfo.cpp:64
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194

◆ setConfigurableService()

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

customize the configurable base class for Service component

Definition at line 226 of file genconf.cpp.

226  {
227  m_configurable[component_t::Service] = cfgService;
228  m_configurable[component_t::ApplicationMgr] = cfgService;
229  }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:194

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 194 of file genconf.cpp.

◆ m_db2Buf

stringstream configGenerator::m_db2Buf
private

Definition at line 187 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 185 of file genconf.cpp.

◆ m_importDataObjectHandles

bool configGenerator::m_importDataObjectHandles = false
private

Definition at line 179 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 178 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 171 of file genconf.cpp.

◆ m_pkgName

string configGenerator::m_pkgName
private

name of the package we are processing

Definition at line 167 of file genconf.cpp.

◆ m_pyBuf

stringstream configGenerator::m_pyBuf
private

buffer of auto-generated configurables

Definition at line 174 of file genconf.cpp.


The documentation for this class was generated from the following file: