The Gaudi Framework  master (adcf1ca6)
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 689 of file genconf.cpp.

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

757{
758 m_db2Buf << " '" << componentName << "': {\n";
759 m_db2Buf << " '__component_type__': '";
760 switch ( componentType ) {
761 case component_t::Algorithm:
762 m_db2Buf << "Algorithm";
763 break;
764 case component_t::AlgTool:
765 m_db2Buf << "AlgTool";
766 break;
767 case component_t::ApplicationMgr: // FALLTROUGH
768 case component_t::Service:
769 m_db2Buf << "Service";
770 break;
771 case component_t::Auditor:
772 m_db2Buf << "Auditor";
773 break;
774 default:
775 m_db2Buf << "Unknown";
776 }
777
778 const auto decl_loc = info.getprop( "declaration_location" );
779 if ( !decl_loc.empty() ) { m_db2Buf << "',\n '__declaration_location__': '" << decl_loc; }
780
781 m_db2Buf << "',\n '__interfaces__': (";
782 for ( const auto& intf : std::set<std::string>{ begin( interfaces ), end( interfaces ) } ) {
783 if ( ignored_interfaces.find( intf ) == end( ignored_interfaces ) ) { m_db2Buf << '\'' << intf << "', "; }
784 }
785 m_db2Buf << "),\n 'properties': {\n";
786
787 bool success = true;
788 for ( const auto& prop : properties ) {
789 const string& pname = prop->name();
790 // Validate property name (it must be a valid Python identifier)
791 if ( !boost::regex_match( pname, pythonIdentifier ) ) {
792 LOG_ERROR << "invalid property name \"" << pname << "\" in component " << componentName
793 << " (invalid Python identifier)" << std::endl;
794 m_db2Buf << " #ERROR-invalid identifier '" << pname << "'\n";
795 success = false;
796 break;
797 }
798
799 string pvalue, ptype;
800 pythonizeValue( prop, pvalue, ptype );
801
802 m_db2Buf << " '" << pname << "': ('" << ptype << "', " << pvalue << ", '''" << prop->documentation()
803 << " [" << prop->ownerTypeName() << "]'''";
804 auto sem = prop->semantics();
805 if ( !sem.empty() ) { m_db2Buf << ", '" << sem << '\''; }
806 m_db2Buf << "),\n";
807 }
808
809 m_db2Buf << " },\n },\n";
810
811 return success;
812}
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 System::ImageHandle handle;
496 unsigned long err = System::loadDynamicLib( iLib, &handle );
497 if ( err != 1 ) {
499 allGood = false;
500 continue;
501 }
502
503 const auto& factories = registry.factories();
504 for ( const auto& factoryName : registry.loadedFactoryNames() ) {
505 if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
506 if ( Gaudi::PluginService::Details::logger().level() <= 1 ) {
507 LOG_INFO << "\t==> skipping [" << factoryName << "]...";
508 }
509 continue;
510 }
511 auto entry = factories.find( factoryName );
512 if ( entry == end( factories ) ) {
513 LOG_ERROR << "inconsistency in component factories list: I cannot find anymore " << factoryName;
514 continue;
515 }
516 const auto& info = entry->second;
517 if ( !info.is_set() ) continue;
518
519 // do not generate configurables for the Reflex-compatible aliases
520 if ( !info.getprop( "ReflexName" ).empty() ) continue;
521
522 // Atlas contributed code (patch #1247)
523 // Skip the generation of configurables if the component does not come
524 // from the same library we are processing (i.e. we found a symbol that
525 // is coming from a library loaded by the linker).
526 if ( libNativeName( lib ) != info.library ) {
527 LOG_WARNING << "library [" << lib << "] exposes factory [" << factoryName << "] which is declared in ["
528 << info.library << "] !!";
529 continue;
530 }
531
532 component_t type = component_t::Unknown;
533 {
534 const auto ft = allowedFactories.find( info.factory.type().name() );
535 if ( ft != allowedFactories.end() ) {
536 type = ft->second;
537 } else if ( factoryName == "ApplicationMgr" ) {
538 type = component_t::ApplicationMgr;
539 } else
540 continue;
541 }
542
543 // handle possible problems with templated components
544 std::string name = boost::trim_copy( factoryName );
545
546 const auto className = info.getprop( "ClassName" );
547 LOG_INFO << " - component: " << className << " (" << ( className != name ? ( name + ": " ) : std::string() )
548 << type << ")";
549
550 string cname = "DefaultName";
551 SmartIF<IProperty> prop;
552 try {
553 switch ( type ) {
554 case component_t::Algorithm:
555 prop = SmartIF<IAlgorithm>( Gaudi::Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
556 break;
557 case component_t::Service:
558 prop = SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
559 break;
560 case component_t::AlgTool:
561 prop =
562 SmartIF<IAlgTool>( AlgTool::Factory::create( factoryName, cname, toString( type ), dummySvc ).release() );
563 // FIXME: AlgTool base class increase artificially by 1 the refcount.
564 prop->release();
565 break;
566 case component_t::Auditor:
567 prop = SmartIF<Gaudi::IAuditor>( Gaudi::Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
568 break;
569 case component_t::ApplicationMgr:
570 prop = SmartIF<ISvcLocator>( svcLoc );
571 break;
572 default:
573 continue; // unknown
574 }
575 } catch ( exception& e ) {
576 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
577 LOG_ERROR << "Got exception: " << e.what();
578 allGood = false;
579 continue;
580 } catch ( ... ) {
581 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
582 allGood = false;
583 continue;
584 }
585 if ( prop ) {
586 if ( m_confTypes.contains( conf_t::CONF ) && !genComponent( lib, name, type, prop->getProperties(), info ) ) {
587 allGood = false;
588 }
589 if ( m_confTypes.contains( conf_t::CONF2 ) &&
590 !genComponent2( name, type, prop->getProperties(), prop->getInterfaceNames(), info ) ) {
591 allGood = false;
592 }
593 prop.reset();
594 } else {
595 LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
596 LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
597 allGood = false;
598 }
599 } //> end loop over factories
600
604 if ( m_confTypes.contains( conf_t::CONF ) ) {
605 const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( lib + "Conf.py" ) ).string();
606 const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb" ) ).string();
607
608 std::fstream py( pyName, std::ios_base::out | std::ios_base::trunc );
609 std::fstream db( dbName, std::ios_base::out | std::ios_base::trunc );
610
611 genHeader( py, db );
612 if ( !userModule.empty() ) py << "from " << userModule << " import *" << endl;
613 genBody( py, db );
614 genTrailer( py, db );
615 }
616 if ( m_confTypes.contains( conf_t::CONF2 ) ) {
617 const std::string db2Name = ( fs::path( m_outputDirName ) / fs::path( lib + ".confdb2_part" ) ).string();
618 std::fstream db2( db2Name, std::ios_base::out | std::ios_base::trunc );
619 db2 << "{\n" << m_db2Buf.str() << "}\n";
620 }
621
622 } //> end loop over libraries
623
624 dummySvc->release();
625 dummySvc = 0;
626
627 return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
628}
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:661
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:681
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:753
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:689
int createAppMgr()
Definition genconf.cpp:868
#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 661 of file genconf.cpp.

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

◆ genImport()

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

Definition at line 630 of file genconf.cpp.

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

◆ genTrailer()

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

Definition at line 681 of file genconf.cpp.

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

◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 815 of file genconf.cpp.

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