| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Member Functions | Private Attributes | List of all members
configGenerator Class Reference
Collaboration diagram for configGenerator:
[legend]

## 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: More...
void | setConfigurableModule (const std::string &moduleName)
| customize the Module name where configurable base classes are defined More...
void | setConfigurableDefaultName (const std::string &defaultName)
| customize the default name for configurable instances More...
void | setConfigurableAlgorithm (const std::string &cfgAlgorithm)
| customize the configurable base class for Algorithm component More...
void | setConfigurableAlgTool (const std::string &cfgAlgTool)
| customize the configurable base class for AlgTool component More...
void | setConfigurableAuditor (const std::string &cfgAuditor)
| customize the configurable base class for AlgTool component More...
void | setConfigurableService (const std::string &cfgService)
| customize the configurable base class for Service component More...

## Private Member Functions
bool | genComponent (const std::string &libName, const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties)
void | genImport (std::ostream &s, const boost::format &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 More...

## Private Attributes
string | m_pkgName
| name of the package we are processing More...
string | m_outputDirName
| absolute path to the directory where genconf will store auto-generated files (Configurables and ConfigurableDb) More...
stringstream | m_pyBuf
| buffer of auto-generated configurables More...
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>) More...
bool | m_importDataObjectHandles = false
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,... More...
std::map< component_t, std::string > | m_configurable
| Configurable customization. More...

## Detailed Description

Definition at line 154 of file genconf.cpp.

## Constructor & Destructor Documentation

## ◆ configGenerator()

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

Definition at line 184 of file genconf.cpp.

185 : m_pkgName( pkgName ), m_outputDirName( outputDirName ) {}
configGenerator::m_outputDirName
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:160
configGenerator::m_pkgName
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:156

## Member Function Documentation

## ◆ genBody()

void configGenerator::genBody | ( | std::ostream & | pyOut,
|  | std::ostream & | dbOut
| ) |  |
| inline private

Definition at line 223 of file genconf.cpp.

223 {
224 pyOut << m_pyBuf.str() << flush;
225 dbOut << m_dbBuf.str() << flush;
226 }
configGenerator::m_pyBuf
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:163
std::stringstream::str
T str(T... args)
configGenerator::m_dbBuf
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:174
std::flush
T flush(T... args)

## ◆ genComponent()

bool configGenerator::genComponent | ( | const std::string & | libName,
|  | const std::string & | componentName,
|  | component_t | componentType,
|  | const vector< PropertyBase * > & | properties
| ) |  |
| private

Definition at line 657 of file genconf.cpp.

660 {
661 auto cname = pythonizeName( componentName );
662
663 std::vector<std::pair<std::string, std::string>> propDoc;
664 propDoc.reserve( properties.size() );
665
666 m_pyBuf << "\nclass " << cname << "( " << m_configurable[componentType] << " ) :\n";
667 m_pyBuf << " __slots__ = { \n";
668 for ( const auto& prop : properties ) {
669 const string& pname = prop->name();
670 // Validate property name (it must be a valid Python identifier)
671 if ( !boost::regex_match( pname, pythonIdentifier ) ) {
672 std::cout << "ERROR: invalid property name \"" << pname << "\" in component " << cname
673 << " (invalid Python identifier)" << std::endl;
674 // try to make the buffer at least more or less valid python code.
675 m_pyBuf << " #ERROR-invalid identifier '" << pname << "'\n"
676 << " }\n";
677 return false;
678 }
679
680 string pvalue, ptype;
681 pythonizeValue( prop, pvalue, ptype );
682 m_pyBuf << " '" << pname << "' : " << pvalue << ", # " << ptype << "\n";
683
684 if ( prop->documentation() != "none" ) {
685 propDoc.emplace_back( pname, prop->documentation() + " [" + prop->ownerTypeName() + "]" );
686 }
687 }
688 m_pyBuf << " }\n";
689 m_pyBuf << " _propertyDocDct = { \n";
690 for ( const auto& prop : propDoc ) {
691 m_pyBuf << std::setw( 5 ) << "'" << prop.first << "' : "
692 << "\"\"\" " << prop.second << " \"\"\",\n";
693 }
694 m_pyBuf << " }\n";
695
696 m_pyBuf << " def __init__(self, name = " << m_configurable[component_t::DefaultName] << ", **kwargs):\n"
697 << " super(" << cname << ", self).__init__(name)\n"
698 << " for n,v in kwargs.items():\n"
699 << " setattr(self, n, v)\n"
700 << " def getDlls( self ):\n"
701 << " return '" << libName << "'\n"
702 << " def getType( self ):\n"
703 << " return '" << componentName << "'\n"
704 << " pass # class " << cname << "\n"
705 << flush;
706
707 // name of the auto-generated module
708 const string pyName = ( fs::path( m_outputDirName ) / fs::path( libName + "Conf.py" ) ).string();
709 const string modName = fs::basename( fs::path( pyName ).leaf() );
710
711 // now the db part
712 m_dbBuf << m_pkgName << "." << modName << " " << libName << " " << cname << "\n" << flush;
713
714 return true;
715 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
std::endl
T endl(T... args)
configGenerator::m_pyBuf
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:163
std::setw
T setw(T... args)
configGenerator::m_dbBuf
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:174
std::flush
T flush(T... args)
configGenerator::m_outputDirName
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:160
std::vector
STL class.
configGenerator::pythonizeValue
void pythonizeValue(const PropertyBase *prop, string &pvalue, string &ptype)
handle the "marshalling" of Properties
Definition: genconf.cpp:718
compareOutputFiles.pname
string pname
Definition: compareOutputFiles.py:470
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:51
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181
configGenerator::m_pkgName
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:156
std::cout
svn_tag_release.basename
def basename(url)
Definition: svn_tag_release.py:28
std::vector::reserve
T reserve(T... args)
std::vector::emplace_back
T emplace_back(T... args)

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

438 {
439 //--- Disable checking StatusCode -------------------------------------------
440 StatusCode::disableChecking();
441
442 const auto endLib = libs.end();
443
444 static const std::string gaudiSvc = "GaudiCoreSvc";
445 const bool isGaudiSvc = ( std::find( libs.begin(), endLib, gaudiSvc ) != endLib );
446
447 //--- Instantiate ApplicationMgr --------------------------------------------
448 if ( !isGaudiSvc && createAppMgr() ) {
449 cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
450 return EXIT_FAILURE;
451 }
452
453 //--- Iterate over component factories --------------------------------------
454 using Gaudi::PluginService::Details::Registry;
455 const Registry& registry = Registry::instance();
456
457 auto bkgNames = registry.loadedFactoryNames();
458
459 ISvcLocator* svcLoc = Gaudi::svcLocator();
460 IInterface* dummySvc = new Service( "DummySvc", svcLoc );
461 dummySvc->addRef();
462
463 bool allGood = true;
464
465 // iterate over all the requested libraries
466 for ( const auto& iLib : libs ) {
467
468 LOG_INFO << ":::: processing library: " << iLib << "...";
469
470 // reset state
471 m_importGaudiHandles = false;
472 m_importDataObjectHandles = false;
473 m_pyBuf.str( "" );
474 m_dbBuf.str( "" );
475
476 //--- Load component library ----------------------------------------------
477 System::ImageHandle handle;
478 unsigned long err = System::loadDynamicLib( iLib, &handle );
479 if ( err != 1 ) {
480 LOG_ERROR << System::getLastErrorString();
481 allGood = false;
482 continue;
483 }
484
485 const auto& factories = registry.factories();
486 for ( const auto& factoryName : registry.loadedFactoryNames() ) {
487 if ( bkgNames.find( factoryName ) != bkgNames.end() ) {
488 if ( Gaudi::PluginService::Details::logger().level() <= 1 ) {
489 LOG_INFO << "\t==> skipping [" << factoryName << "]...";
490 }
491 continue;
492 }
493 auto entry = factories.find( factoryName );
494 if ( entry == end( factories ) ) {
495 LOG_ERROR << "inconsistency in component factories list: I cannot find anymore " << factoryName;
496 continue;
497 }
498 const auto& info = entry->second;
499 if ( !info.is_set() ) continue;
500
501 // do not generate configurables for the Reflex-compatible aliases
502 if ( !info.getprop( "ReflexName" ).empty() ) continue;
503
504 // Atlas contributed code (patch #1247)
505 // Skip the generation of configurables if the component does not come
506 // from the same library we are processing (i.e. we found a symbol that
507 // is coming from a library loaded by the linker).
508 if ( libNativeName( iLib ) != info.library ) {
509 LOG_WARNING << "library [" << iLib << "] exposes factory [" << factoryName << "] which is declared in ["
510 << info.library << "] !!";
511 continue;
512 }
513
514 component_t type = component_t::Unknown;
515 {
516 const auto ft = allowedFactories.find( info.factory.type().name() );
517 if ( ft != allowedFactories.end() ) {
518 type = ft->second;
519 } else if ( factoryName == "ApplicationMgr" ) {
520 type = component_t::ApplicationMgr;
521 } else
522 continue;
523 }
524
525 // handle possible problems with templated components
526 std::string name = boost::trim_copy( factoryName );
527
528 const auto className = info.getprop( "ClassName" );
529 LOG_INFO << " - component: " << className << " (" << ( className != name ? ( name + ": " ) : std::string() )
530 << type << ")";
531
532 string cname = "DefaultName";
533 SmartIF<IProperty> prop;
534 try {
535 switch ( type ) {
536 case component_t::Algorithm:
537 prop = SmartIF<IAlgorithm>( Gaudi::Algorithm::Factory::create( factoryName, cname, svcLoc ).release() );
538 break;
539 case component_t::Service:
540 prop = SmartIF<IService>( Service::Factory::create( factoryName, cname, svcLoc ).release() );
541 break;
542 case component_t::AlgTool:
543 prop =
544 SmartIF<IAlgTool>( AlgTool::Factory::create( factoryName, cname, toString( type ), dummySvc ).release() );
545 // FIXME: AlgTool base class increase artificially by 1 the refcount.
546 prop->release();
547 break;
548 case component_t::Auditor:
549 prop = SmartIF<IAuditor>( Auditor::Factory::create( factoryName, cname, svcLoc ).release() );
550 break;
551 case component_t::ApplicationMgr:
552 prop = SmartIF<ISvcLocator>( svcLoc );
553 break;
554 default:
555 continue; // unknown
556 }
557 } catch ( exception& e ) {
558 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
559 LOG_ERROR << "Got exception: " << e.what();
560 allGood = false;
561 continue;
562 } catch ( ... ) {
563 LOG_ERROR << "Error instantiating " << name << " from " << iLib;
564 allGood = false;
565 continue;
566 }
567 if ( prop ) {
568 if ( !genComponent( iLib, name, type, prop->getProperties() ) ) { allGood = false; }
569 prop.reset();
570 } else {
571 LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
572 LOG_ERROR << "NO Configurable will be generated for [" << name << "] !";
573 allGood = false;
574 }
575 } //> end loop over factories
576
580 const std::string pyName = ( fs::path( m_outputDirName ) / fs::path( iLib + "Conf.py" ) ).string();
581 const std::string dbName = ( fs::path( m_outputDirName ) / fs::path( iLib + ".confdb" ) ).string();
582
583 std::fstream py( pyName, std::ios_base::out | std::ios_base::trunc );
584 std::fstream db( dbName, std::ios_base::out | std::ios_base::trunc );
585
586 genHeader( py, db );
587 if ( !userModule.empty() ) py << "from " << userModule << " import *" << endl;
588 genBody( py, db );
589 genTrailer( py, db );
590
591 } //> end loop over libraries
592
593 dummySvc->release();
594 dummySvc = 0;
595
596 return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
597 }
SmartIF< IProperty >
std::string::empty
T empty(T... args)
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
component_t
component_t
Definition: genconf.cpp:95
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:334
LOG_ERROR
#define LOG_ERROR
Definition: genconf.cpp:73
std::endl
T endl(T... args)
System::ImageHandle
void * ImageHandle
Definition of an image handle.
Definition: ModuleInfo.h:30
configGenerator::m_pyBuf
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:163
std::string
STL class.
configGenerator::m_importDataObjectHandles
bool m_importDataObjectHandles
Definition: genconf.cpp:168
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
Gaudi::PluginService::v1::Details::logger
GAUDIPS_API Logger & logger()
Return the current logger instance.
Definition: PluginServiceV1.cpp:324
std::exception::what
T what(T... args)
LOG_INFO
#define LOG_INFO
Definition: genconf.cpp:75
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
gaudirun.type
type
Definition: gaudirun.py:142
std::fstream
STL class.
configGenerator::genHeader
void genHeader(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:630
std::stringstream::str
T str(T... args)
IOTest.end
def end
Definition: IOTest.py:112
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:71
configGenerator::m_dbBuf
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:174
std::exception
STL class.
std::find
T find(T... args)
configGenerator::m_outputDirName
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:160
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
LOG_WARNING
#define LOG_WARNING
Definition: genconf.cpp:74
configGenerator::m_importGaudiHandles
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:167
Gaudi::PluginService::v1::Details::Logger::level
Level level() const
Definition: PluginServiceDetailsV1.h:191
IProperty::getProperties
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
GaudiPluginService.cpluginsvc.factories
def factories()
Definition: cpluginsvc.py:81
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode::disableChecking
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:44
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:86
configGenerator::genTrailer
void genTrailer(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:649
System::getLastErrorString
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition: System.cpp:262
configGenerator::genComponent
bool genComponent(const std::string &libName, const std::string &componentName, component_t componentType, const vector< PropertyBase * > &properties)
Definition: genconf.cpp:657
Service
Base class for all services.
Definition: Service.h:36
createAppMgr
int createAppMgr()
Definition: genconf.cpp:778
std::cout
configGenerator::genBody
void genBody(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:223
System::loadDynamicLib
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
Definition: System.cpp:135

## ◆ genHeader()

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

Definition at line 630 of file genconf.cpp.

632 {
633 // python file part
634 std::string now = Gaudi::Time::current().format( true );
635 py << "#" << now //<< "\n"
636 << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n";
637 if ( m_importGaudiHandles ) { py << "from GaudiKernel.GaudiHandles import *\n"; }
638
639 if ( m_importDataObjectHandles ) { py << "from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase\n"; }
640
641 genImport( py, boost::format( "from %1%.Configurable import *" ) );
642
643 // db file part
644 db << "## -*- ascii -*- \n"
645 << "# db file automatically generated by genconf on: " << now << "\n"
646 << flush;
647 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
Gaudi::Time::current
static Time current()
Returns the current time.
Definition: Time.cpp:109
std::string
STL class.
configGenerator::m_importDataObjectHandles
bool m_importDataObjectHandles
Definition: genconf.cpp:168
std::flush
T flush(T... args)
Gaudi::Time::format
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:252
configGenerator::genImport
void genImport(std::ostream &s, const boost::format &frmt, std::string indent)
Definition: genconf.cpp:599
configGenerator::m_importGaudiHandles
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:167

## ◆ genImport()

void configGenerator::genImport | ( | std::ostream & | s,
|  | const boost::format & | frmt,
|  | std::string | indent = `""`
| ) |  |
| private

Definition at line 599 of file genconf.cpp.

599 {
600
601 std::string::size_type pos = 0, nxtpos = 0;
602 std::string mod;
603
604 while ( std::string::npos != pos ) {
605 // find end of module name
606 nxtpos = m_configurable[component_t::Module].find_first_of( ',', pos );
607
608 // Prepare import string
609 mod = m_configurable[component_t::Module].substr( pos, nxtpos - pos );
610 std::ostringstream import;
611 import << boost::format( frmt ) % mod;
612
613 // append a normal import or a try/except enclosed one depending
614 // on availability of a fall-back module (next in the list)
615 if ( std::string::npos == nxtpos ) {
616 // last possible module
617 s << indent << import.str() << "\n" << flush;
618 pos = std::string::npos;
619 } else {
620 // we have a fallback for this
621 s << indent << "try:\n" << indent << py_tab << import.str() << "\n" << indent << "except ImportError:\n" << flush;
622 pos = nxtpos + 1;
623 }
624 // increase indentation level for next iteration
625 indent += py_tab;
626 }
627 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
Gaudi.CommonGaudiConfigurables.mod
mod
Definition: CommonGaudiConfigurables.py:22
std::string
STL class.
std::ostringstream
STL class.
std::flush
T flush(T... args)
gaudirun.s
string s
Definition: gaudirun.py:316
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181

## ◆ genTrailer()

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

Definition at line 649 of file genconf.cpp.

651 {
652 // db file part
653 db << "## " << m_pkgName << "\n" << std::flush;
654 }
std::flush
T flush(T... args)
configGenerator::m_pkgName
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:156

## ◆ pythonizeValue()

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

handle the "marshalling" of Properties

Definition at line 718 of file genconf.cpp.

720 {
721 const std::string cvalue = p->toString();
722 const std::type_index ti = std::type_index( *p->type_info() );
723 if ( ti == typeIndex<bool>() ) {
724 pvalue = ( cvalue == "0" || cvalue == "False" || cvalue == "false" ) ? "False" : "True";
725 ptype = "bool";
726 } else if ( ti == typeIndex<char>() || ti == typeIndex<signed char>() || ti == typeIndex<unsigned char>() ||
727 ti == typeIndex<short>() || ti == typeIndex<unsigned short>() || ti == typeIndex<int>() ||
728 ti == typeIndex<unsigned int>() || ti == typeIndex<long>() || ti == typeIndex<unsigned long>() ) {
729 pvalue = cvalue;
730 ptype = "int";
731 } else if ( ti == typeIndex<long long>() || ti == typeIndex<unsigned long long>() ) {
732 pvalue = cvalue + "L";
733 ptype = "long";
734 } else if ( ti == typeIndex<float>() || ti == typeIndex<double>() ) {
735 // forces python to handle this as a float: put a dot in there...
736 pvalue = boost::to_lower_copy( cvalue );
737 if ( pvalue == "nan" ) {
738 pvalue = "float('nan')";
739 std::cout << "WARNING: default value for [" << p->name() << "] is NaN !!" << std::endl;
740 } else if ( std::string::npos == pvalue.find( "." ) && std::string::npos == pvalue.find( "e" ) ) {
741 pvalue = cvalue + ".0";
742 }
743 ptype = "float";
744 } else if ( ti == typeIndex<string>() ) {
745 pvalue = "'" + cvalue + "'";
746 ptype = "str";
747 } else if ( ti == typeIndex<GaudiHandleBase>() ) {
748 const GaudiHandleProperty& hdl = dynamic_cast<const GaudiHandleProperty&>( *p );
749 const GaudiHandleBase& base = hdl.value();
750
751 pvalue = base.pythonRepr();
752 ptype = "GaudiHandle";
753 m_importGaudiHandles = true;
754 } else if ( ti == typeIndex<GaudiHandleArrayBase>() ) {
755 const GaudiHandleArrayProperty& hdl = dynamic_cast<const GaudiHandleArrayProperty&>( *p );
756 const GaudiHandleArrayBase& base = hdl.value();
757
758 pvalue = base.pythonRepr();
759 ptype = "GaudiHandleArray";
760 m_importGaudiHandles = true;
761 } else if ( ti == typeIndex<DataObjectHandleBase>() ) {
762 const DataObjectHandleProperty& hdl = dynamic_cast<const DataObjectHandleProperty&>( *p );
763 const DataObjectHandleBase& base = hdl.value();
764
765 pvalue = base.pythonRepr();
766 ptype = "DataObjectHandleBase";
767 m_importDataObjectHandles = true;
768 } else {
769 std::ostringstream v_str;
770 v_str.setf( std::ios::showpoint ); // to correctly display floats
771 p->toStream( v_str );
772 pvalue = v_str.str();
773 ptype = "list";
774 }
775 }
std::ostringstream::setf
T setf(T... args)
GaudiHandleArrayProperty::value
const GaudiHandleArrayBase & value() const
Definition: Property.h:903
DataObjectHandleBase::pythonRepr
std::string pythonRepr() const override
Definition: DataObjectHandleBase.cpp:112
std::endl
T endl(T... args)
GaudiHandleProperty
Definition: Property.h:845
GaudiHandleBase::pythonRepr
std::string pythonRepr() const override
Python representation of handle, i.e.
Definition: GaudiHandle.cpp:48
DataObjectHandleProperty
DataObjectHandleProperty.h GaudiKernel/DataObjectHandleProperty.h.
Definition: DataObjectHandleProperty.h:23
std::string
STL class.
configGenerator::m_importDataObjectHandles
bool m_importDataObjectHandles
Definition: genconf.cpp:168
std::ostringstream
STL class.
std::type_index
std::ostringstream::str
T str(T... args)
DataObjectHandleProperty::value
const DataObjectHandleBase & value() const
Definition: DataObjectHandleProperty.cpp:77
std::string::find
T find(T... args)
GaudiHandleArrayBase
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:330
DataObjectHandleBase
DataObjectHandleBase GaudiKernel/DataObjectHandleBase.h.
Definition: DataObjectHandleBase.h:26
configGenerator::m_importGaudiHandles
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:167
GaudiHandleBase
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:89
GaudiHandleProperty::value
const GaudiHandleBase & value() const
Definition: Property.h:866
GaudiHandleArrayProperty
Definition: Property.h:882
std::cout
GaudiHandleArrayBase::pythonRepr
std::string pythonRepr() const override
Python representation of array of handles, i.e.
Definition: GaudiHandle.cpp:78

## ◆ setConfigurableAlgorithm()

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

customize the configurable base class for Algorithm component

Definition at line 202 of file genconf.cpp.

202 {
203 m_configurable[component_t::Algorithm] = cfgAlgorithm;
204 }
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181

## ◆ setConfigurableAlgTool()

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

customize the configurable base class for AlgTool component

Definition at line 207 of file genconf.cpp.

207 { m_configurable[component_t::AlgTool] = cfgAlgTool; }
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181

## ◆ setConfigurableAuditor()

void configGenerator::setConfigurableAuditor | ( | const std::string & | cfgAuditor | ) |
| inline

customize the configurable base class for AlgTool component

Definition at line 210 of file genconf.cpp.

210 { m_configurable[component_t::Auditor] = cfgAuditor; }
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181

## ◆ setConfigurableDefaultName()

void configGenerator::setConfigurableDefaultName | ( | const std::string & | defaultName | ) |
| inline

customize the default name for configurable instances

Definition at line 197 of file genconf.cpp.

197 {
198 m_configurable[component_t::DefaultName] = defaultName;
199 }
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181

## ◆ setConfigurableModule()

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

customize the Module name where configurable base classes are defined

Definition at line 194 of file genconf.cpp.

194 { m_configurable[component_t::Module] = moduleName; }
System::moduleName
GAUDI_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.
Definition: ModuleInfo.cpp:54
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181

## ◆ setConfigurableService()

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

customize the configurable base class for Service component

Definition at line 213 of file genconf.cpp.

213 {
214 m_configurable[component_t::Service] = cfgService;
215 m_configurable[component_t::ApplicationMgr] = cfgService;
216 }
configGenerator::m_configurable
std::map< component_t, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:181

## 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 181 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 174 of file genconf.cpp.

## ◆ m_importDataObjectHandles

bool configGenerator::m_importDataObjectHandles = false
| private

Definition at line 168 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 167 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 160 of file genconf.cpp.

## ◆ m_pkgName

string configGenerator::m_pkgName
| private

name of the package we are processing

Definition at line 156 of file genconf.cpp.

## ◆ m_pyBuf

stringstream configGenerator::m_pyBuf
| private

buffer of auto-generated configurables

Definition at line 163 of file genconf.cpp.

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

- GaudiKernel/src/Util/genconf.cpp