The Gaudi Framework  master (50869dff)
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 160 of file genconf.cpp.

Constructor & Destructor Documentation

◆ configGenerator()

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

Definition at line 196 of file genconf.cpp.

197 : 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:166
string m_pkgName
name of the package we are processing
Definition genconf.cpp:162

Member Function Documentation

◆ genBody()

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

Definition at line 244 of file genconf.cpp.

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

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

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

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

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

450{
451 const auto endLib = libs.end();
452
453 static const std::string gaudiSvc = "GaudiCoreSvc";
454 const bool isGaudiSvc =
455 std::find_if( libs.begin(), endLib, []( const auto& s ) {
456 return s.find( gaudiSvc ) != std::string::npos; // libs can be <name> or path/to/lib<name>.so
457 } ) != endLib;
458
459 //--- Instantiate ApplicationMgr --------------------------------------------
460 if ( !isGaudiSvc && createAppMgr() ) {
461 cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
462 return EXIT_FAILURE;
463 }
464
465 //--- Iterate over component factories --------------------------------------
466 using Gaudi::PluginService::Details::Registry;
467 const Registry& registry = Registry::instance();
468
469 auto bkgNames = registry.loadedFactoryNames();
470
471 ISvcLocator* svcLoc = Gaudi::svcLocator();
472 IInterface* dummySvc = new Service( "DummySvc", svcLoc );
473 dummySvc->addRef();
474
475 bool allGood = true;
476
477 // iterate over all the requested libraries
478 for ( const auto& iLib : libs ) {
479 std::string lib = fs::path( iLib ).stem().string();
480 if ( lib.compare( 0, 3, "lib" ) == 0 ) {
481 lib = lib.substr( 3 ); // For *NIX remove "lib"
482 }
483 LOG_INFO << ":::: processing library: " << iLib << "...";
484
485 // reset state
486 m_importGaudiHandles = false;
487 m_importDataHandles = false;
488 m_pyBuf.str( "" );
489 m_dbBuf.str( "" );
490 m_db2Buf.str( "" );
491
492 //--- Load component library ----------------------------------------------
493 if ( !registry.loadPluginLibrary( iLib ) ) {
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() ) {
502 if ( Gaudi::PluginService::Details::logger().level() <= 1 ) {
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( lib ) != info.library ) {
523 LOG_WARNING << "library [" << lib << "] 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<Gaudi::IAuditor>( Gaudi::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 ( m_confTypes.contains( conf_t::CONF ) && !genComponent( lib, name, type, prop->getProperties(), info ) ) {
583 allGood = false;
584 }
585 if ( m_confTypes.contains( conf_t::CONF2 ) &&
586 !genComponent2( name, type, prop->getProperties(), prop->getInterfaceNames(), info ) ) {
587 allGood = false;
588 }
589 prop.reset();
590 } else {
591 LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
592 LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
593 allGood = false;
594 }
595 } //> end loop over factories
596
600 if ( m_confTypes.contains( conf_t::CONF ) ) {
601 const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( lib + "Conf.py" ) ).string();
602 const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb" ) ).string();
603
604 std::fstream py( pyName, std::ios_base::out | std::ios_base::trunc );
605 std::fstream db( dbName, std::ios_base::out | std::ios_base::trunc );
606
607 genHeader( py, db );
608 if ( !userModule.empty() ) py << "from " << userModule << " import *" << endl;
609 genBody( py, db );
610 genTrailer( py, db );
611 }
612 if ( m_confTypes.contains( conf_t::CONF2 ) ) {
613 const std::string db2Name = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb2_part" ) ).string();
614 std::fstream db2( db2Name, std::ios_base::out | std::ios_base::trunc );
615 db2 << "{\n" << m_db2Buf.str() << "}\n";
616 }
617
618 } //> end loop over libraries
619
620 dummySvc->release();
621 dummySvc = 0;
622
623 return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
624}
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:660
std::set< conf_t > m_confTypes
Types of configurables to generate.
Definition genconf.cpp:177
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition genconf.cpp:173
void genTrailer(std::ostream &pyOut, std::ostream &dbOut)
Definition genconf.cpp:680
bool m_importDataHandles
Definition genconf.cpp:174
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:752
void genBody(std::ostream &pyOut, std::ostream &dbOut)
Definition genconf.cpp:244
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:688
int createAppMgr()
Definition genconf.cpp:869
#define LOG_WARNING
Definition genconf.cpp:67
#define LOG_INFO
Definition genconf.cpp:68
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 660 of file genconf.cpp.

662{
663 // python file part
664 std::string now = Gaudi::Time::current().format( true );
665 py << "#" << now //<< "\n"
666 << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n";
667
668 if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
669
670 if ( m_importDataHandles ) { py << "from GaudiKernel.DataHandle import DataHandle\n"; }
671
672 genImport( py, "from {}.Configurable import *" );
673
674 // db file part
675 db << "## -*- ascii -*- \n"
676 << "# db file automatically generated by genconf on: " << now << "\n"
677 << flush;
678}
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:626

◆ genImport()

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

Definition at line 626 of file genconf.cpp.

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

◆ genTrailer()

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

Definition at line 680 of file genconf.cpp.

682{
683 // db file part
684 db << "## " << m_pkgName << "\n" << std::flush;
685}

◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 814 of file genconf.cpp.

816{
817 const std::string cvalue = p->toString();
818 const std::type_index ti = std::type_index( *p->type_info() );
819 ptype = System::typeinfoName( *p->type_info() );
820
821 if ( ti == typeIndex<bool>() ) {
822 pvalue = ( cvalue == "0" || cvalue == "False" || cvalue == "false" ) ? "False" : "True";
823 } else if ( ti == typeIndex<char>() || ti == typeIndex<signed char>() || ti == typeIndex<unsigned char>() ||
824 ti == typeIndex<short>() || ti == typeIndex<unsigned short>() || ti == typeIndex<int>() ||
825 ti == typeIndex<unsigned int>() || ti == typeIndex<long>() || ti == typeIndex<unsigned long>() ||
826 ti == typeIndex<long long>() || ti == typeIndex<unsigned long long>() ) {
827 pvalue = cvalue;
828 } else if ( ti == typeIndex<float>() || ti == typeIndex<double>() || ti == typeIndex<long double>() ) {
829 // forces python to handle this as a float: put a dot in there...
830 pvalue = boost::to_lower_copy( cvalue );
831 if ( std::string::npos != pvalue.find( "nan" ) ) {
832 pvalue = "float('nan')";
833 } else if ( std::string::npos == pvalue.find( "." ) && std::string::npos == pvalue.find( "e" ) ) {
834 pvalue = cvalue + ".0";
835 }
836 } else if ( ti == typeIndex<string>() ) {
837 pvalue = quote( cvalue );
838 } else if ( ti == typeIndex<nlohmann::json>() ) {
839 pvalue = quote( cvalue );
840 } else if ( ti == typeIndex<GaudiHandleBase>() ) {
841 const GaudiHandleProperty& hdl = dynamic_cast<const GaudiHandleProperty&>( *p );
842 const GaudiHandleBase& base = hdl.value();
843
844 pvalue = base.pythonRepr();
845 ptype = base.pythonPropertyClassName();
847 } else if ( ti == typeIndex<GaudiHandleArrayBase>() ) {
848 const GaudiHandleArrayProperty& hdl = dynamic_cast<const GaudiHandleArrayProperty&>( *p );
849 const GaudiHandleArrayBase& base = hdl.value();
850
851 pvalue = base.pythonRepr();
852 ptype = base.pythonPropertyClassName();
854 } else if ( auto hdl = dynamic_cast<const DataHandleProperty*>( p ); hdl ) {
855 // dynamic_cast to support also classes derived from DataHandleProperty
856 const Gaudi::DataHandle& base = hdl->value();
857
858 pvalue = base.pythonRepr();
859 m_importDataHandles = true;
860 } else {
861 std::ostringstream v_str;
862 v_str.setf( std::ios::showpoint ); // to correctly display floats
863 p->toStream( v_str );
864 pvalue = v_str.str();
865 }
866}
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 217 of file genconf.cpp.

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

◆ setConfigurableAlgTool()

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

customize the configurable base class for AlgTool component

Definition at line 222 of file genconf.cpp.

222{ 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 225 of file genconf.cpp.

225{ 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 212 of file genconf.cpp.

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

◆ setConfigurableModule()

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

customize the Module name where configurable base classes are defined

Definition at line 209 of file genconf.cpp.

209{ 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 228 of file genconf.cpp.

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

◆ setConfigurableTypes()

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

customize configurable types to generate

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

◆ m_confTypes

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

Types of configurables to generate.

Definition at line 177 of file genconf.cpp.

◆ m_db2Buf

stringstream configGenerator::m_db2Buf
private

buffer of generated GaudiConfig2 configurables

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

◆ m_importDataHandles

bool configGenerator::m_importDataHandles = false
private

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

◆ m_pkgName

string configGenerator::m_pkgName
private

name of the package we are processing

Definition at line 162 of file genconf.cpp.

◆ m_pyBuf

stringstream configGenerator::m_pyBuf
private

buffer of auto-generated configurables

Definition at line 169 of file genconf.cpp.


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