The Gaudi Framework  master (991ff291)
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 687 of file genconf.cpp.

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

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

452{
453 const auto endLib = libs.end();
454
455 static const std::string gaudiSvc = "GaudiCoreSvc";
456 const bool isGaudiSvc =
457 std::find_if( libs.begin(), endLib, []( const auto& s ) {
458 return s.find( gaudiSvc ) != std::string::npos; // libs can be <name> or path/to/lib<name>.so
459 } ) != endLib;
460
461 //--- Instantiate ApplicationMgr --------------------------------------------
462 if ( !isGaudiSvc && createAppMgr() ) {
463 cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
464 return EXIT_FAILURE;
465 }
466
467 //--- Iterate over component factories --------------------------------------
468 using Gaudi::PluginService::Details::Registry;
469 const Registry& registry = Registry::instance();
470
471 auto bkgNames = registry.loadedFactoryNames();
472
473 ISvcLocator* svcLoc = Gaudi::svcLocator();
474 IInterface* dummySvc = new Service( "DummySvc", svcLoc );
475 dummySvc->addRef();
476
477 bool allGood = true;
478
479 // iterate over all the requested libraries
480 for ( const auto& iLib : libs ) {
481 std::string lib = fs::path( iLib ).stem().string();
482 if ( lib.compare( 0, 3, "lib" ) == 0 ) {
483 lib = lib.substr( 3 ); // For *NIX remove "lib"
484 }
485 LOG_INFO << ":::: processing library: " << iLib << "...";
486
487 // reset state
488 m_importGaudiHandles = false;
489 m_importDataHandles = false;
490 m_pyBuf.str( "" );
491 m_dbBuf.str( "" );
492 m_db2Buf.str( "" );
493
494 //--- Load component library ----------------------------------------------
495 if ( !registry.loadPluginLibrary( iLib ) ) {
497 allGood = false;
498 continue;
499 }
500
501 const auto& factories = registry.factories();
502 for ( const auto& factoryName : registry.loadedFactoryNames() ) {
503 if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
504 if ( Gaudi::PluginService::Details::logger().level() <= 1 ) {
505 LOG_INFO << "\t==> skipping [" << factoryName << "]...";
506 }
507 continue;
508 }
509 auto entry = factories.find( factoryName );
510 if ( entry == end( factories ) ) {
511 LOG_ERROR << "inconsistency in component factories list: I cannot find anymore " << factoryName;
512 continue;
513 }
514 const auto& info = entry->second;
515 if ( !info.is_set() ) continue;
516
517 // do not generate configurables for the Reflex-compatible aliases
518 if ( !info.getprop( "ReflexName" ).empty() ) continue;
519
520 // Atlas contributed code (patch #1247)
521 // Skip the generation of configurables if the component does not come
522 // from the same library we are processing (i.e. we found a symbol that
523 // is coming from a library loaded by the linker).
524 if ( libNativeName( lib ) != info.library ) {
525 LOG_WARNING << "library [" << lib << "] exposes factory [" << factoryName << "] which is declared in ["
526 << info.library << "] !!";
527 continue;
528 }
529
530 component_t type = component_t::Unknown;
531 {
532 const auto ft = allowedFactories.find( info.factory.type().name() );
533 if ( ft != allowedFactories.end() ) {
534 type = ft->second;
535 } else if ( factoryName == "ApplicationMgr" ) {
536 type = component_t::ApplicationMgr;
537 } else
538 continue;
539 }
540
541 // handle possible problems with templated components
542 std::string name = boost::trim_copy( factoryName );
543
544 const auto className = info.getprop( "ClassName" );
545 LOG_INFO << " - component: " << className << " (" << ( className != name ? ( name + ": " ) : std::string() )
546 << type << ")";
547
548 string cname = "DefaultName";
549 SmartIF<IProperty> prop;
550 try {
551 switch ( type ) {
552 case component_t::Algorithm:
553 prop = SmartIF<IAlgorithm>( Gaudi::Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
554 break;
555 case component_t::Service:
556 prop = SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
557 break;
558 case component_t::AlgTool:
559 prop =
560 SmartIF<IAlgTool>( AlgTool::Factory::create( factoryName, cname, toString( type ), dummySvc ).release() );
561 // FIXME: AlgTool base class increase artificially by 1 the refcount.
562 prop->release();
563 break;
564 case component_t::Auditor:
565 prop = SmartIF<Gaudi::IAuditor>( Gaudi::Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
566 break;
567 case component_t::ApplicationMgr:
568 prop = SmartIF<ISvcLocator>( svcLoc );
569 break;
570 default:
571 continue; // unknown
572 }
573 } catch ( exception& e ) {
574 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
575 LOG_ERROR << "Got exception: " << e.what();
576 allGood = false;
577 continue;
578 } catch ( ... ) {
579 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
580 allGood = false;
581 continue;
582 }
583 if ( prop ) {
584 if ( m_confTypes.contains( conf_t::CONF ) && !genComponent( lib, name, type, prop->getProperties(), info ) ) {
585 allGood = false;
586 }
587 if ( m_confTypes.contains( conf_t::CONF2 ) &&
588 !genComponent2( name, type, prop->getProperties(), prop->getInterfaceNames(), info ) ) {
589 allGood = false;
590 }
591 prop.reset();
592 } else {
593 LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
594 LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
595 allGood = false;
596 }
597 } //> end loop over factories
598
602 if ( m_confTypes.contains( conf_t::CONF ) ) {
603 const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( lib + "Conf.py" ) ).string();
604 const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( lib + ".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 if ( m_confTypes.contains( conf_t::CONF2 ) ) {
615 const std::string db2Name = ( fs::path( m_outputDirName ) / fs::path( lib + ".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 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:659
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:679
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:751
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:687
int createAppMgr()
Definition genconf.cpp:866
#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:234
str release
Definition conf.py:27

◆ 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
667 if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
668
669 if ( m_importDataHandles ) { py << "from GaudiKernel.DataHandle import DataHandle\n"; }
670
671 genImport( py, "from {}.Configurable import *" );
672
673 // db file part
674 db << "## -*- ascii -*- \n"
675 << "# db file automatically generated by genconf on: " << now << "\n"
676 << flush;
677}
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:628

◆ genImport()

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

Definition at line 628 of file genconf.cpp.

628 {
629
630 std::string::size_type pos = 0, nxtpos = 0;
631 std::string mod;
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 << fmt::format( fmt::runtime( 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}

◆ genTrailer()

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

Definition at line 679 of file genconf.cpp.

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

◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 813 of file genconf.cpp.

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

◆ 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: