The Gaudi Framework  master (82fdf313)
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 693 of file genconf.cpp.

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

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

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

◆ genHeader()

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

Definition at line 665 of file genconf.cpp.

667{
668 // python file part
669 std::string now = Gaudi::Time::current().format( true );
670 py << "#" << now //<< "\n"
671 << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n";
672
673 if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
674
675 if ( m_importDataHandles ) { py << "from GaudiKernel.DataHandle import DataHandle\n"; }
676
677 genImport( py, "from {}.Configurable import *" );
678
679 // db file part
680 db << "## -*- ascii -*- \n"
681 << "# db file automatically generated by genconf on: " << now << "\n"
682 << flush;
683}
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition Time.cpp:157
static Time current()
Returns the current time.
Definition Time.cpp:43
void genImport(std::ostream &s, std::string_view frmt, std::string indent)
Definition genconf.cpp:634

◆ genImport()

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

Definition at line 634 of file genconf.cpp.

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

◆ genTrailer()

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

Definition at line 685 of file genconf.cpp.

687{
688 // db file part
689 db << "## " << m_pkgName << "\n" << std::flush;
690}

◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 819 of file genconf.cpp.

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