The Gaudi Framework  v33r0 (d5ea422b)
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, const boost::format &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_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 174 of file genconf.cpp.

Constructor & Destructor Documentation

◆ configGenerator()

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

Definition at line 206 of file genconf.cpp.

207  : 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:180
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:176

Member Function Documentation

◆ genBody()

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

Definition at line 245 of file genconf.cpp.

245  {
246  pyOut << m_pyBuf.str() << flush;
247  dbOut << m_dbBuf.str() << flush;
248  }
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:183
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:194
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 691 of file genconf.cpp.

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

460 {
461  //--- Disable checking StatusCode -------------------------------------------
463 
464  const auto endLib = libs.end();
465 
466  static const std::string gaudiSvc = "GaudiCoreSvc";
467  const bool isGaudiSvc = ( std::find( libs.begin(), endLib, gaudiSvc ) != endLib );
468 
469  //--- Instantiate ApplicationMgr --------------------------------------------
470  if ( !isGaudiSvc && createAppMgr() ) {
471  cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
472  return EXIT_FAILURE;
473  }
474 
475  //--- Iterate over component factories --------------------------------------
476  using Gaudi::PluginService::Details::Registry;
477  const Registry& registry = Registry::instance();
478 
479  auto bkgNames = registry.loadedFactoryNames();
480 
481  ISvcLocator* svcLoc = Gaudi::svcLocator();
482  IInterface* dummySvc = new Service( "DummySvc", svcLoc );
483  dummySvc->addRef();
484 
485  bool allGood = true;
486 
487  // iterate over all the requested libraries
488  for ( const auto& iLib : libs ) {
489 
490  LOG_INFO << ":::: processing library: " << iLib << "...";
491 
492  // reset state
493  m_importGaudiHandles = false;
495  m_pyBuf.str( "" );
496  m_dbBuf.str( "" );
497  m_db2Buf.str( "" );
498 
499  //--- Load component library ----------------------------------------------
500  System::ImageHandle handle;
501  unsigned long err = System::loadDynamicLib( iLib, &handle );
502  if ( err != 1 ) {
504  allGood = false;
505  continue;
506  }
507 
508  const auto& factories = registry.factories();
509  for ( const auto& factoryName : registry.loadedFactoryNames() ) {
510  if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
512  LOG_INFO << "\t==> skipping [" << factoryName << "]...";
513  }
514  continue;
515  }
516  auto entry = factories.find( factoryName );
517  if ( entry == end( factories ) ) {
518  LOG_ERROR << "inconsistency in component factories list: I cannot find anymore " << factoryName;
519  continue;
520  }
521  const auto& info = entry->second;
522  if ( !info.is_set() ) continue;
523 
524  // do not generate configurables for the Reflex-compatible aliases
525  if ( !info.getprop( "ReflexName" ).empty() ) continue;
526 
527  // Atlas contributed code (patch #1247)
528  // Skip the generation of configurables if the component does not come
529  // from the same library we are processing (i.e. we found a symbol that
530  // is coming from a library loaded by the linker).
531  if ( libNativeName( iLib ) != info.library ) {
532  LOG_WARNING << "library [" << iLib << "] exposes factory [" << factoryName << "] which is declared in ["
533  << info.library << "] !!";
534  continue;
535  }
536 
537  component_t type = component_t::Unknown;
538  {
539  const auto ft = allowedFactories.find( info.factory.type().name() );
540  if ( ft != allowedFactories.end() ) {
541  type = ft->second;
542  } else if ( factoryName == "ApplicationMgr" ) {
543  type = component_t::ApplicationMgr;
544  } else
545  continue;
546  }
547 
548  // handle possible problems with templated components
549  std::string name = boost::trim_copy( factoryName );
550 
551  const auto className = info.getprop( "ClassName" );
552  LOG_INFO << " - component: " << className << " (" << ( className != name ? ( name + ": " ) : std::string() )
553  << type << ")";
554 
555  string cname = "DefaultName";
556  SmartIF<IProperty> prop;
557  try {
558  switch ( type ) {
559  case component_t::Algorithm:
560  prop = SmartIF<IAlgorithm>( Gaudi::Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
561  break;
562  case component_t::Service:
563  prop = SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
564  break;
565  case component_t::AlgTool:
566  prop =
567  SmartIF<IAlgTool>( AlgTool::Factory::create( factoryName, cname, toString( type ), dummySvc ).release() );
568  // FIXME: AlgTool base class increase artificially by 1 the refcount.
569  prop->release();
570  break;
571  case component_t::Auditor:
572  prop = SmartIF<IAuditor>( Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
573  break;
574  case component_t::ApplicationMgr:
575  prop = SmartIF<ISvcLocator>( svcLoc );
576  break;
577  default:
578  continue; // unknown
579  }
580  } catch ( exception& e ) {
581  LOG_ERROR << "Error instantiating " << name << " from " << iLib;
582  LOG_ERROR << "Got exception: " << e.what();
583  allGood = false;
584  continue;
585  } catch ( ... ) {
586  LOG_ERROR << "Error instantiating " << name << " from " << iLib;
587  allGood = false;
588  continue;
589  }
590  if ( prop ) {
591  if ( !genComponent( iLib, name, type, prop->getProperties(), prop->getInterfaceNames() ) ) { allGood = false; }
592  prop.reset();
593  } else {
594  LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
595  LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
596  allGood = false;
597  }
598  } //> end loop over factories
599 
603  const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( iLib + "Conf.py" ) ).string();
604  const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( iLib + ".confdb" ) ).string();
605 
606  std::fstream py( pyName, std::ios_base::out | std::ios_base::trunc );
607  std::fstream db( dbName, std::ios_base::out | std::ios_base::trunc );
608 
609  genHeader( py, db );
610  if ( !userModule.empty() ) py << "from " << userModule << " import *" << endl;
611  genBody( py, db );
612  genTrailer( py, db );
613 
614  {
615  const std::string db2Name = ( fs::path( m_outputDirName ) / fs::path( iLib + ".confdb2_part" ) ).string();
616  std::fstream db2( db2Name, std::ios_base::out | std::ios_base::trunc );
617  db2 << "{\n" << m_db2Buf.str() << "}\n";
618  }
619 
620  } //> end loop over libraries
621 
622  dummySvc->release();
623  dummySvc = 0;
624 
625  return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
626 }
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:112
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:83
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:691
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:183
STL class.
bool m_importDataObjectHandles
Definition: genconf.cpp:188
GAUDI_API ISvcLocator * svcLocator()
GAUDIPS_API Logger & logger()
Return the current logger instance.
T what(T... args)
#define LOG_INFO
Definition: genconf.cpp:85
Definition of the basic interface.
Definition: IInterface.h:254
STL class.
void genHeader(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:659
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:194
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:180
virtual unsigned long release()=0
Release Interface instance.
#define LOG_WARNING
Definition: genconf.cpp:84
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:187
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:683
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:844
stringstream m_db2Buf
Definition: genconf.cpp:196
void genBody(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:245
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 659 of file genconf.cpp.

661 {
662  // python file part
663  std::string now = Gaudi::Time::current().format( true );
664  py << "#" << now //<< "\n"
665  << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n"
666  << "import sys\n"
667  << "if sys.version_info >= (3,):\n"
668  << " # Python 2 compatibility\n"
669  << " long = int\n";
670 
671  if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
672 
673  if ( m_importDataObjectHandles ) { py << "from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase\n"; }
674 
675  genImport( py, boost::format( "from %1%.Configurable import *" ) );
676 
677  // db file part
678  db << "## -*- ascii -*- \n"
679  << "# db file automatically generated by genconf on: " << now << "\n"
680  << flush;
681 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
static Time current()
Returns the current time.
Definition: Time.cpp:119
STL class.
bool m_importDataObjectHandles
Definition: genconf.cpp:188
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, const boost::format &frmt, std::string indent)
Definition: genconf.cpp:628
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:187

◆ genImport()

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

Definition at line 628 of file genconf.cpp.

628  {
629 
630  std::string::size_type pos = 0, nxtpos = 0;
632 
633  while ( std::string::npos != pos ) {
634  // find end of module name
635  nxtpos = m_configurable[component_t::Module].find_first_of( ',', pos );
636 
637  // Prepare import string
638  mod = m_configurable[component_t::Module].substr( pos, nxtpos - pos );
639  std::ostringstream import;
640  import << boost::format( frmt ) % mod;
641 
642  // append a normal import or a try/except enclosed one depending
643  // on availability of a fall-back module (next in the list)
644  if ( std::string::npos == nxtpos ) {
645  // last possible module
646  s << indent << import.str() << "\n" << flush;
647  pos = std::string::npos;
648  } else {
649  // we have a fallback for this
650  s << indent << "try:\n" << indent << py_tab << import.str() << "\n" << indent << "except ImportError:\n" << flush;
651  pos = nxtpos + 1;
652  }
653  // increase indentation level for next iteration
654  indent += py_tab;
655  }
656 }
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:203

◆ genTrailer()

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

Definition at line 683 of file genconf.cpp.

685 {
686  // db file part
687  db << "## " << m_pkgName << "\n" << std::flush;
688 }
T flush(T... args)
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:176

◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 786 of file genconf.cpp.

788 {
789  const std::string cvalue = p->toString();
790  const std::type_index ti = std::type_index( *p->type_info() );
791  if ( ti == typeIndex<bool>() ) {
792  pvalue = ( cvalue == "0" || cvalue == "False" || cvalue == "false" ) ? "False" : "True";
793  ptype = "bool";
794  } else if ( ti == typeIndex<char>() || ti == typeIndex<signed char>() || ti == typeIndex<unsigned char>() ||
795  ti == typeIndex<short>() || ti == typeIndex<unsigned short>() || ti == typeIndex<int>() ||
796  ti == typeIndex<unsigned int>() || ti == typeIndex<long>() || ti == typeIndex<unsigned long>() ||
797  ti == typeIndex<long long>() || ti == typeIndex<unsigned long long>() ) {
798  pvalue = cvalue;
799  ptype = "int";
800  } else if ( ti == typeIndex<float>() || ti == typeIndex<double>() ) {
801  // forces python to handle this as a float: put a dot in there...
802  pvalue = boost::to_lower_copy( cvalue );
803  if ( pvalue == "nan" ) {
804  pvalue = "float('nan')";
805  std::cout << "WARNING: default value for [" << p->name() << "] is NaN !!" << std::endl;
806  } else if ( std::string::npos == pvalue.find( "." ) && std::string::npos == pvalue.find( "e" ) ) {
807  pvalue = cvalue + ".0";
808  }
809  ptype = "float";
810  } else if ( ti == typeIndex<string>() ) {
811  pvalue = quote( cvalue );
812  ptype = "str";
813  } else if ( ti == typeIndex<GaudiHandleBase>() ) {
814  const GaudiHandleProperty& hdl = dynamic_cast<const GaudiHandleProperty&>( *p );
815  const GaudiHandleBase& base = hdl.value();
816 
817  pvalue = base.pythonRepr();
818  ptype = "GaudiHandle";
819  m_importGaudiHandles = true;
820  } else if ( ti == typeIndex<GaudiHandleArrayBase>() ) {
821  const GaudiHandleArrayProperty& hdl = dynamic_cast<const GaudiHandleArrayProperty&>( *p );
822  const GaudiHandleArrayBase& base = hdl.value();
823 
824  pvalue = base.pythonRepr();
825  ptype = "GaudiHandleArray";
826  m_importGaudiHandles = true;
827  } else if ( ti == typeIndex<DataObjectHandleBase>() ) {
828  const DataObjectHandleProperty& hdl = dynamic_cast<const DataObjectHandleProperty&>( *p );
829  const DataObjectHandleBase& base = hdl.value();
830 
831  pvalue = base.pythonRepr();
832  ptype = "DataObjectHandleBase";
834  } else {
835  std::ostringstream v_str;
836  v_str.setf( std::ios::showpoint ); // to correctly display floats
837  p->toStream( v_str );
838  pvalue = v_str.str();
839  ptype = "list";
840  }
841 }
T setf(T... args)
const GaudiHandleArrayBase & value() const
Definition: Property.h:931
std::string pythonRepr() const override
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:188
T str(T... args)
const DataObjectHandleBase & value() const
T find(T... args)
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:340
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:187
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:894
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 224 of file genconf.cpp.

224  {
225  m_configurable[component_t::Algorithm] = cfgAlgorithm;
226  }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:203

◆ setConfigurableAlgTool()

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

customize the configurable base class for AlgTool component

Definition at line 229 of file genconf.cpp.

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

◆ setConfigurableAuditor()

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

customize the configurable base class for AlgTool component

Definition at line 232 of file genconf.cpp.

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

◆ setConfigurableDefaultName()

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

customize the default name for configurable instances

Definition at line 219 of file genconf.cpp.

219  {
220  m_configurable[component_t::DefaultName] = defaultName;
221  }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:203

◆ setConfigurableModule()

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

customize the Module name where configurable base classes are defined

Definition at line 216 of file genconf.cpp.

216 { 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:203

◆ setConfigurableService()

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

customize the configurable base class for Service component

Definition at line 235 of file genconf.cpp.

235  {
236  m_configurable[component_t::Service] = cfgService;
237  m_configurable[component_t::ApplicationMgr] = cfgService;
238  }
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:203

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

◆ m_db2Buf

stringstream configGenerator::m_db2Buf
private

Definition at line 196 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_importDataObjectHandles

bool configGenerator::m_importDataObjectHandles = false
private

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

◆ m_pkgName

string configGenerator::m_pkgName
private

name of the package we are processing

Definition at line 176 of file genconf.cpp.

◆ m_pyBuf

stringstream configGenerator::m_pyBuf
private

buffer of auto-generated configurables

Definition at line 183 of file genconf.cpp.


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