The Gaudi Framework  master (29688f1e)
Loading...
Searching...
No Matches
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:
void setConfigurableTypes (const std::set< conf_t > &types)
 customize configurable types to generate
void setConfigurableModule (const std::string &moduleName)
 customize the Module name where configurable base classes are defined
void setConfigurableDefaultName (const std::string &defaultName)
 customize the default name for configurable instances
void setConfigurableAlgorithm (const std::string &cfgAlgorithm)
 customize the configurable base class for Algorithm component
void setConfigurableAlgTool (const std::string &cfgAlgTool)
 customize the configurable base class for AlgTool component
void setConfigurableAuditor (const std::string &cfgAuditor)
 customize the configurable base class for AlgTool component
void setConfigurableService (const std::string &cfgService)
 customize the configurable base class for Service component

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

Private Attributes

string m_pkgName
 name of the package we are processing
string m_outputDirName
 absolute path to the directory where genconf will store auto-generated files (Configurables and ConfigurableDb)
stringstream m_pyBuf
 buffer of auto-generated configurables
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>)
bool m_importDataHandles = false
std::set< conf_t > m_confTypes
 Types of configurables to generate.
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,...
stringstream m_db2Buf
 buffer of generated GaudiConfig2 configurables
std::map< component_t, std::string > m_configurable
 Configurable customization.

Detailed Description

Definition at line 159 of file genconf.cpp.

Constructor & Destructor Documentation

◆ configGenerator()

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

Definition at line 195 of file genconf.cpp.

196 : 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:165
string m_pkgName
name of the package we are processing
Definition genconf.cpp:161

Member Function Documentation

◆ genBody()

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

Definition at line 243 of file genconf.cpp.

243 {
244 pyOut << m_pyBuf.str() << flush;
245 dbOut << m_dbBuf.str() << flush;
246 }
stringstream m_pyBuf
buffer of auto-generated configurables
Definition genconf.cpp:168
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition genconf.cpp:182

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

688{
689 auto cname = pythonizeName( componentName );
690 const auto decl_loc = info.getprop( "declaration_location" );
691
692 std::vector<std::pair<std::string, std::string>> propDoc;
693 propDoc.reserve( properties.size() );
694
695 m_pyBuf << "\nclass " << cname << "( " << m_configurable[componentType] << " ) :\n";
696 m_pyBuf << " __slots__ = { \n";
697 for ( const auto& prop : properties ) {
698 const string& pname = prop->name();
699 // Validate property name (it must be a valid Python identifier)
700 if ( !boost::regex_match( pname, pythonIdentifier ) ) {
701 LOG_ERROR << "invalid property name \"" << pname << "\" in component " << cname << " (invalid Python identifier)"
702 << std::endl;
703 // try to make the buffer at least more or less valid python code.
704 m_pyBuf << " #ERROR-invalid identifier '" << pname << "'\n"
705 << " }\n";
706 return false;
707 }
708
709 string pvalue, ptype;
710 pythonizeValue( prop, pvalue, ptype );
711 m_pyBuf << " '" << pname << "' : " << pvalue << ",\n";
712
713 if ( prop->documentation() != "none" ) {
714 propDoc.emplace_back( pname, prop->documentation() + " [" + prop->ownerTypeName() + "]" );
715 }
716 }
717 m_pyBuf << " }\n";
718 m_pyBuf << " _propertyDocDct = { \n";
719 for ( const auto& prop : propDoc ) {
720 m_pyBuf << std::setw( 5 ) << "'" << prop.first << "' : "
721 << "\"\"\" " << prop.second << " \"\"\",\n";
722 }
723 m_pyBuf << " }\n";
724
725 if ( !decl_loc.empty() ) { m_pyBuf << " __declaration_location__ = '" << decl_loc << "'\n"; }
726 m_pyBuf << " def __init__(self, name = " << m_configurable[component_t::DefaultName] << ", **kwargs):\n"
727 << " super(" << cname << ", self).__init__(name)\n"
728 << " for n,v in kwargs.items():\n"
729 << " setattr(self, n, v)\n"
730 << " def getDlls( self ):\n"
731 << " return '" << libName << "'\n"
732 << " def getType( self ):\n"
733 << " return '" << componentName << "'\n"
734 << " pass # class " << cname << "\n"
735 << flush;
736
737 // name of the auto-generated module
738 const string pyName = ( fs::path( m_outputDirName ) / fs::path( libName + "Conf.py" ) ).string();
739 const string modName = fs::path( pyName ).filename().stem().string();
740
741 // now the db part
742 m_dbBuf << m_pkgName << "." << modName << " " << libName << " " << cname << "\n" << flush;
743
744 return true;
745}
void pythonizeValue(const PropertyBase *prop, string &pvalue, string &ptype)
handle the "marshalling" of Properties
Definition genconf.cpp:810
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition genconf.cpp:192
#define LOG_ERROR
Definition genconf.cpp:65

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

752{
753 m_db2Buf << " '" << componentName << "': {\n";
754 m_db2Buf << " '__component_type__': '";
755 switch ( componentType ) {
756 case component_t::Algorithm:
757 m_db2Buf << "Algorithm";
758 break;
759 case component_t::AlgTool:
760 m_db2Buf << "AlgTool";
761 break;
762 case component_t::ApplicationMgr: // FALLTROUGH
763 case component_t::Service:
764 m_db2Buf << "Service";
765 break;
766 case component_t::Auditor:
767 m_db2Buf << "Auditor";
768 break;
769 default:
770 m_db2Buf << "Unknown";
771 }
772
773 const auto decl_loc = info.getprop( "declaration_location" );
774 if ( !decl_loc.empty() ) { m_db2Buf << "',\n '__declaration_location__': '" << decl_loc; }
775
776 m_db2Buf << "',\n '__interfaces__': (";
777 for ( const auto& intf : std::set<std::string>{ begin( interfaces ), end( interfaces ) } ) {
778 if ( ignored_interfaces.find( intf ) == end( ignored_interfaces ) ) { m_db2Buf << '\'' << intf << "', "; }
779 }
780 m_db2Buf << "),\n 'properties': {\n";
781
782 bool success = true;
783 for ( const auto& prop : properties ) {
784 const string& pname = prop->name();
785 // Validate property name (it must be a valid Python identifier)
786 if ( !boost::regex_match( pname, pythonIdentifier ) ) {
787 LOG_ERROR << "invalid property name \"" << pname << "\" in component " << componentName
788 << " (invalid Python identifier)" << std::endl;
789 m_db2Buf << " #ERROR-invalid identifier '" << pname << "'\n";
790 success = false;
791 break;
792 }
793
794 string pvalue, ptype;
795 pythonizeValue( prop, pvalue, ptype );
796
797 m_db2Buf << " '" << pname << "': ('" << ptype << "', " << pvalue << ", '''" << prop->documentation()
798 << " [" << prop->ownerTypeName() << "]'''";
799 auto sem = prop->semantics();
800 if ( !sem.empty() ) { m_db2Buf << ", '" << sem << '\''; }
801 m_db2Buf << "),\n";
802 }
803
804 m_db2Buf << " },\n },\n";
805
806 return success;
807}
stringstream m_db2Buf
buffer of generated GaudiConfig2 configurables
Definition genconf.cpp:185
AttribStringParser::Iterator begin(const AttribStringParser &parser)

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

449{
450 const auto endLib = libs.end();
451
452 static const std::string gaudiSvc = "GaudiCoreSvc";
453 const bool isGaudiSvc =
454 std::find_if( libs.begin(), endLib, []( const auto& s ) {
455 return s.find( gaudiSvc ) != std::string::npos; // libs can be <name> or path/to/lib<name>.so
456 } ) != endLib;
457
458 //--- Instantiate ApplicationMgr --------------------------------------------
459 if ( !isGaudiSvc && createAppMgr() ) {
460 cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
461 return EXIT_FAILURE;
462 }
463
464 //--- Iterate over component factories --------------------------------------
465 using Gaudi::PluginService::Details::Registry;
466 const Registry& registry = Registry::instance();
467
468 auto bkgNames = registry.loadedFactoryNames();
469
470 ISvcLocator* svcLoc = Gaudi::svcLocator();
471 IInterface* dummySvc = new Service( "DummySvc", svcLoc );
472 dummySvc->addRef();
473
474 bool allGood = true;
475
476 // iterate over all the requested libraries
477 for ( const auto& iLib : libs ) {
478 std::string lib = fs::path( iLib ).stem().string();
479 if ( lib.compare( 0, 3, "lib" ) == 0 ) {
480 lib = lib.substr( 3 ); // For *NIX remove "lib"
481 }
482 LOG_INFO << ":::: processing library: " << iLib << "...";
483
484 // reset state
485 m_importGaudiHandles = false;
486 m_importDataHandles = false;
487 m_pyBuf.str( "" );
488 m_dbBuf.str( "" );
489 m_db2Buf.str( "" );
490
491 //--- Load component library ----------------------------------------------
492 if ( !registry.loadPluginLibrary( iLib ) ) {
494 allGood = false;
495 continue;
496 }
497
498 const auto& factories = registry.factories();
499 for ( const auto& factoryName : registry.loadedFactoryNames() ) {
500 if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
501 if ( Gaudi::PluginService::Details::logger().level() <= 1 ) {
502 LOG_INFO << "\t==> skipping [" << factoryName << "]...";
503 }
504 continue;
505 }
506 auto entry = factories.find( factoryName );
507 if ( entry == end( factories ) ) {
508 LOG_ERROR << "inconsistency in component factories list: I cannot find anymore " << factoryName;
509 continue;
510 }
511 const auto& info = entry->second;
512 if ( !info.is_set() ) continue;
513
514 // do not generate configurables for the Reflex-compatible aliases
515 if ( !info.getprop( "ReflexName" ).empty() ) continue;
516
517 // Atlas contributed code (patch #1247)
518 // Skip the generation of configurables if the component does not come
519 // from the same library we are processing (i.e. we found a symbol that
520 // is coming from a library loaded by the linker).
521 if ( libNativeName( lib ) != info.library ) {
522 LOG_WARNING << "library [" << lib << "] exposes factory [" << factoryName << "] which is declared in ["
523 << info.library << "] !!";
524 continue;
525 }
526
527 component_t type = component_t::Unknown;
528 {
529 const auto ft = allowedFactories.find( info.factory.type().name() );
530 if ( ft != allowedFactories.end() ) {
531 type = ft->second;
532 } else if ( factoryName == "ApplicationMgr" ) {
533 type = component_t::ApplicationMgr;
534 } else
535 continue;
536 }
537
538 // handle possible problems with templated components
539 std::string name = boost::trim_copy( factoryName );
540
541 const auto className = info.getprop( "ClassName" );
542 LOG_INFO << " - component: " << className << " (" << ( className != name ? ( name + ": " ) : std::string() )
543 << type << ")";
544
545 string cname = "DefaultName";
546 SmartIF<IProperty> prop;
547 try {
548 switch ( type ) {
549 case component_t::Algorithm:
550 prop = SmartIF<IAlgorithm>( Gaudi::Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
551 break;
552 case component_t::Service:
553 prop = SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
554 break;
555 case component_t::AlgTool:
556 prop =
557 SmartIF<IAlgTool>( AlgTool::Factory::create( factoryName, cname, toString( type ), dummySvc ).release() );
558 // FIXME: AlgTool base class increase artificially by 1 the refcount.
559 prop->release();
560 break;
561 case component_t::Auditor:
562 prop = SmartIF<Gaudi::IAuditor>( Gaudi::Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
563 break;
564 case component_t::ApplicationMgr:
565 prop = SmartIF<ISvcLocator>( svcLoc );
566 break;
567 default:
568 continue; // unknown
569 }
570 } catch ( exception& e ) {
571 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
572 LOG_ERROR << "Got exception: " << e.what();
573 allGood = false;
574 continue;
575 } catch ( ... ) {
576 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
577 allGood = false;
578 continue;
579 }
580 if ( prop ) {
581 if ( m_confTypes.contains( conf_t::CONF ) && !genComponent( lib, name, type, prop->getProperties(), info ) ) {
582 allGood = false;
583 }
584 if ( m_confTypes.contains( conf_t::CONF2 ) &&
585 !genComponent2( name, type, prop->getProperties(), prop->getInterfaceNames(), info ) ) {
586 allGood = false;
587 }
588 prop.reset();
589 } else {
590 LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
591 LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
592 allGood = false;
593 }
594 } //> end loop over factories
595
599 if ( m_confTypes.contains( conf_t::CONF ) ) {
600 const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( lib + "Conf.py" ) ).string();
601 const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb" ) ).string();
602
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 );
605
606 genHeader( py, db );
607 if ( !userModule.empty() ) py << "from " << userModule << " import *" << endl;
608 genBody( py, db );
609 genTrailer( py, db );
610 }
611 if ( m_confTypes.contains( conf_t::CONF2 ) ) {
612 const std::string db2Name = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb2_part" ) ).string();
613 std::fstream db2( db2Name, std::ios_base::out | std::ios_base::trunc );
614 db2 << "{\n" << m_db2Buf.str() << "}\n";
615 }
616
617 } //> end loop over libraries
618
619 dummySvc->release();
620 dummySvc = 0;
621
622 return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
623}
virtual unsigned long addRef() const =0
Increment the reference count of Interface instance.
virtual unsigned long release() const =0
Release Interface instance.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition SmartIF.h:88
void genHeader(std::ostream &pyOut, std::ostream &dbOut)
Definition genconf.cpp:656
std::set< conf_t > m_confTypes
Types of configurables to generate.
Definition genconf.cpp:176
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition genconf.cpp:172
void genTrailer(std::ostream &pyOut, std::ostream &dbOut)
Definition genconf.cpp:676
bool m_importDataHandles
Definition genconf.cpp:173
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:748
void genBody(std::ostream &pyOut, std::ostream &dbOut)
Definition genconf.cpp:243
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:684
int createAppMgr()
Definition genconf.cpp:863
#define LOG_WARNING
Definition genconf.cpp:66
#define LOG_INFO
Definition genconf.cpp:67
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition ToStream.h:329
GAUDI_API ISvcLocator * svcLocator()
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition System.cpp:228
str release
Definition conf.py:27

◆ genHeader()

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

Definition at line 656 of file genconf.cpp.

658{
659 // python file part
660 std::string now = Gaudi::Time::current().format( true );
661 py << "#" << now //<< "\n"
662 << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n";
663
664 if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
665
666 if ( m_importDataHandles ) { py << "from GaudiKernel.DataHandle import DataHandle\n"; }
667
668 genImport( py, "from {}.Configurable import *" );
669
670 // db file part
671 db << "## -*- ascii -*- \n"
672 << "# db file automatically generated by genconf on: " << now << "\n"
673 << flush;
674}
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition Time.cpp:155
static Time current()
Returns the current time.
Definition Time.cpp:41
void genImport(std::ostream &s, std::string_view frmt, std::string indent)
Definition genconf.cpp:625

◆ genImport()

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

Definition at line 625 of file genconf.cpp.

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

◆ genTrailer()

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

Definition at line 676 of file genconf.cpp.

678{
679 // db file part
680 db << "## " << m_pkgName << "\n" << std::flush;
681}

◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 810 of file genconf.cpp.

812{
813 const std::string cvalue = p->toString();
814 const std::type_index ti = std::type_index( *p->type_info() );
815 ptype = System::typeinfoName( *p->type_info() );
816
817 if ( ti == typeIndex<bool>() ) {
818 pvalue = ( cvalue == "0" || cvalue == "False" || cvalue == "false" ) ? "False" : "True";
819 } else if ( ti == typeIndex<char>() || ti == typeIndex<signed char>() || ti == typeIndex<unsigned char>() ||
820 ti == typeIndex<short>() || ti == typeIndex<unsigned short>() || ti == typeIndex<int>() ||
821 ti == typeIndex<unsigned int>() || ti == typeIndex<long>() || ti == typeIndex<unsigned long>() ||
822 ti == typeIndex<long long>() || ti == typeIndex<unsigned long long>() ) {
823 pvalue = cvalue;
824 } else if ( ti == typeIndex<float>() || ti == typeIndex<double>() || ti == typeIndex<long double>() ) {
825 // forces python to handle this as a float: put a dot in there...
826 pvalue = boost::to_lower_copy( cvalue );
827 if ( std::string::npos != pvalue.find( "nan" ) ) {
828 pvalue = "float('nan')";
829 } else if ( std::string::npos == pvalue.find( "." ) && std::string::npos == pvalue.find( "e" ) ) {
830 pvalue = cvalue + ".0";
831 }
832 } else if ( ti == typeIndex<string>() ) {
833 pvalue = quote( cvalue );
834 } else if ( ti == typeIndex<GaudiHandleBase>() ) {
835 const GaudiHandleProperty& hdl = dynamic_cast<const GaudiHandleProperty&>( *p );
836 const GaudiHandleBase& base = hdl.value();
837
838 pvalue = base.pythonRepr();
839 ptype = base.pythonPropertyClassName();
841 } else if ( ti == typeIndex<GaudiHandleArrayBase>() ) {
842 const GaudiHandleArrayProperty& hdl = dynamic_cast<const GaudiHandleArrayProperty&>( *p );
843 const GaudiHandleArrayBase& base = hdl.value();
844
845 pvalue = base.pythonRepr();
846 ptype = base.pythonPropertyClassName();
848 } else if ( auto hdl = dynamic_cast<const DataHandleProperty*>( p ); hdl ) {
849 // dynamic_cast to support also classes derived from DataHandleProperty
850 const Gaudi::DataHandle& base = hdl->value();
851
852 pvalue = base.pythonRepr();
853 m_importDataHandles = true;
854 } else {
855 std::ostringstream v_str;
856 v_str.setf( std::ios::showpoint ); // to correctly display floats
857 p->toStream( v_str );
858 pvalue = v_str.str();
859 }
860}
const GaudiHandleArrayBase & value() const
Definition Property.h:679
const GaudiHandleBase & value() const
Definition Property.h:642
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition System.cpp:254

◆ setConfigurableAlgorithm()

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

customize the configurable base class for Algorithm component

Definition at line 216 of file genconf.cpp.

216 {
217 m_configurable[component_t::Algorithm] = cfgAlgorithm;
218 }

◆ setConfigurableAlgTool()

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

customize the configurable base class for AlgTool component

Definition at line 221 of file genconf.cpp.

221{ 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 224 of file genconf.cpp.

224{ 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 211 of file genconf.cpp.

211 {
212 m_configurable[component_t::DefaultName] = defaultName;
213 }

◆ setConfigurableModule()

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

customize the Module name where configurable base classes are defined

Definition at line 208 of file genconf.cpp.

208{ m_configurable[component_t::Module] = moduleName; }
GAUDI_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.

◆ setConfigurableService()

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

customize the configurable base class for Service component

Definition at line 227 of file genconf.cpp.

227 {
228 m_configurable[component_t::Service] = cfgService;
229 m_configurable[component_t::ApplicationMgr] = cfgService;
230 }

◆ setConfigurableTypes()

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

customize configurable types to generate

Definition at line 205 of file genconf.cpp.

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

◆ m_confTypes

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

Types of configurables to generate.

Definition at line 176 of file genconf.cpp.

◆ m_db2Buf

stringstream configGenerator::m_db2Buf
private

buffer of generated GaudiConfig2 configurables

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

◆ m_importDataHandles

bool configGenerator::m_importDataHandles = false
private

Definition at line 173 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 172 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 165 of file genconf.cpp.

◆ m_pkgName

string configGenerator::m_pkgName
private

name of the package we are processing

Definition at line 161 of file genconf.cpp.

◆ m_pyBuf

stringstream configGenerator::m_pyBuf
private

buffer of auto-generated configurables

Definition at line 168 of file genconf.cpp.


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