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

int genComponent (const std::string &libName, const std::string &componentName, const std::string &componentType, const vector< Property * > &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 Property *prop, string &pvalue, string &ptype)
 handle the "marshalling" of Properties More...
 
void pythonizeName (string &name)
 Translates a valid C++ typename into a valid python one. 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
 switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the components has a XyzHandle<T>) More...
 
bool m_importDataObjectDescriptors
 
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...
 
GaudiUtils::HashMap< std::string, std::string > m_configurable
 Configurable customization. More...
 

Detailed Description

Definition at line 103 of file genconf.cpp.

Constructor & Destructor Documentation

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

Definition at line 135 of file genconf.cpp.

136  :
137  m_pkgName ( pkgName ),
138  m_outputDirName ( outputDirName ),
139  m_pyBuf ( ),
140  m_importGaudiHandles( false ),
142  m_dbBuf ( ),
143  m_configurable ( )
144  {}
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:113
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:125
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:110
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:117
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:106
bool m_importDataObjectDescriptors
Definition: genconf.cpp:119

Member Function Documentation

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

Definition at line 196 of file genconf.cpp.

197  {
198  pyOut << m_pyBuf.str() << flush;
199  dbOut << m_dbBuf.str() << flush;
200  }
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:113
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:125
int configGenerator::genComponent ( const std::string &  libName,
const std::string &  componentName,
const std::string &  componentType,
const vector< Property * > &  properties 
)
private

Definition at line 748 of file genconf.cpp.

753 {
754  string cname = componentName;
755  pythonizeName(cname);
756 
757  typedef GaudiUtils::HashMap<std::string, std::string> PropertyDoc_t;
758  PropertyDoc_t propDoc;
759 
760  m_pyBuf << "\n";
761  m_pyBuf << "class " << cname
762  << "( " << m_configurable[componentType] << " ) :"
763  << "\n";
764  m_pyBuf << " __slots__ = { \n";
765  for ( vector<Property*>::const_iterator it = properties.begin() ;
766  it != properties.end(); ++it ) {
767 
768  const string pname = (*it)->name();
769  // Validate property name (it must be a valid Python identifier)
770  if (!boost::regex_match(pname, pythonIdentifier)) {
771  std::cout << "ERROR: invalid property name \"" << pname
772  << "\" in component " << cname
773  << " (invalid Python identifier)" << std::endl;
774  // try to make the buffer at least more or less valid python code.
775  m_pyBuf << " #ERROR-invalid identifier '" << pname << "'\n"
776  << " }\n";
777  return 1;
778  }
779 
780  string pvalue, ptype;
781  pythonizeValue( (*it), pvalue, ptype );
782  m_pyBuf << " '" << pname << "' : " << pvalue <<", # " << ptype << "\n";
783 
784  if ( (*it)->documentation() != "none" ) {
785  propDoc[pname] = (*it)->documentation();
786  }
787 
788  }
789  m_pyBuf << " }\n";
790  m_pyBuf << " _propertyDocDct = { \n";
791  for ( PropertyDoc_t::const_iterator iProp = propDoc.begin();
792  iProp != propDoc.end();
793  ++iProp ) {
794  m_pyBuf << std::setw(5)
795  << "'" << iProp->first << "' : "
796  << "\"\"\" " << iProp->second << " \"\"\",\n";
797  }
798  m_pyBuf << " }\n";
799 
800  m_pyBuf
801  << " def __init__(self, name = " << m_configurable["DefaultName"]
802  << ", **kwargs):\n"
803  << " super(" << cname << ", self).__init__(name)\n"
804  << " for n,v in kwargs.items():\n"
805  << " setattr(self, n, v)\n"
806  << " def getDlls( self ):\n"
807  << " return '" << libName << "'\n"
808  << " def getType( self ):\n"
809  << " return '" << componentName << "'\n"
810  << " pass # class " << cname << "\n"
811  << flush;
812 
813  // name of the auto-generated module
814  const string pyName = ( fs::path(m_outputDirName) /
815  fs::path(libName+"Conf.py") ).string();
816  const string modName = fs::basename( fs::path( pyName ).leaf() );
817 
818  // now the db part
819  m_dbBuf
820  << m_pkgName << "." << modName << " "
821  << libName << " " << cname
822  << "\n"
823  << flush;
824 
825  return 0;
826 }
void pythonizeValue(const Property *prop, string &pvalue, string &ptype)
handle the "marshalling" of Properties
Definition: genconf.cpp:840
void pythonizeName(string &name)
Translates a valid C++ typename into a valid python one.
Definition: genconf.cpp:828
list path
Definition: __init__.py:15
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:113
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:125
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:110
def basename(url)
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:106
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

not enough information... skip it

no Properties, so don't bother create Configurables...

write-out files for this library

Definition at line 483 of file genconf.cpp.

485 {
486  //--- Disable checking StatusCode -------------------------------------------
488 
489  const Strings_t::const_iterator endLib = libs.end();
490 
491  const std::string gaudiSvc = "GaudiCoreSvc";
492  const bool isGaudiSvc = ( std::find( libs.begin(), endLib, gaudiSvc ) != endLib );
493 
494  //--- Instantiate ApplicationMgr --------------------------------------------
495  if ( !isGaudiSvc && createAppMgr() ) {
496  cout << "ERROR: ApplicationMgr can not be created. Check environment" << endl;
497  return EXIT_FAILURE;
498  }
499 
500  //--- Iterate over component factories --------------------------------------
502  Registry& registry = Registry::instance();
503 
504  std::set<std::string> bkgNames = registry.loadedFactories();
505 
506  ISvcLocator* svcLoc = Gaudi::svcLocator();
507  IInterface* dummySvc = new Service( "DummySvc", svcLoc );
508  dummySvc->addRef();
509 
510  bool allGood = true;
511 
512  // iterate over all the requested libraries
513  for ( Strings_t::const_iterator iLib=libs.begin(); iLib != endLib; ++iLib ) {
514 
515  LOG_INFO << ":::: processing library: " << *iLib << "...";
516 
517  // reset state
518  m_importGaudiHandles = false;
520  m_pyBuf.str("");
521  m_dbBuf.str("");
522 
523  //--- Load component library ----------------------------------------------
524  System::ImageHandle handle;
525  unsigned long err = System::loadDynamicLib( *iLib, &handle );
526  if ( err != 1 ) {
528  allGood = false;
529  continue;
530  }
531 
532  std::set<std::string> factories = registry.loadedFactories();
533 
534  for ( std::set<std::string>::iterator it = factories.begin();
535  it != factories.end(); ++it ) {
536  const string ident = *it;
537  if ( bkgNames.find(ident) != bkgNames.end() ) {
539  LOG_INFO << "\t==> skipping [" << ident << "]...";
540  }
541  continue;
542  }
543 
544  const Registry::FactoryInfo info = registry.getInfo(*it);
545  const string rtype = info.rtype;
546 
547  // do not generate configurables for the Reflex-compatible aliases
548  if (info.properties.find("ReflexName") != info.properties.end())
549  continue;
550 
551  // Atlas contributed code (patch #1247)
552  // Skip the generation of configurables if the component does not come
553  // from the same library we are processing (i.e. we found a symbol that
554  // is coming from a library loaded by the linker).
555  if ( !DsoUtils::inDso( info.ptr, DsoUtils::libNativeName(*iLib) ) ) {
556  LOG_WARNING << "library [" << *iLib << "] exposes factory ["
557  << ident << "] which is declared in ["
558  << DsoUtils::dsoName(info.ptr) << "] !!";
559  continue;
560  }
561 
562  string type;
563  bool known = true;
564  if ( ident == "ApplicationMgr" ) type = "ApplicationMgr";
565  else if ( rtype == typeid(IInterface*).name() ) type = "IInterface";
566  else if ( rtype == typeid(IAlgorithm*).name() ) type = "Algorithm";
567  else if ( rtype == typeid(IService* ).name() ) type = "Service";
568  else if ( rtype == typeid(IAlgTool* ).name() ) type = "AlgTool";
569  else if ( rtype == typeid(IAuditor* ).name() ) type = "Auditor";
570  else if ( rtype == typeid(IConverter*).name() ) type = "Converter";
571  else if ( rtype == typeid(DataObject*).name() ) type = "DataObject";
572  else type = "Unknown", known = false;
573  string name = ident;
574  // handle possible problems with templated components
575  boost::trim(name);
576 
577  if ( type == "IInterface" ) {
580  continue;
581  }
582 
583  if ( type == "Converter" || type == "DataObject" ) {
585  continue;
586  }
587 
588  if ( !known ) {
589  LOG_WARNING << "Unknown (return) type [" << System::typeinfoName(rtype.c_str()) << "] !!"
590  << " Component [" << ident << "] is skipped !";
591  continue;
592  }
593 
594  LOG_INFO << " - component: " << info.className
595  << " (" << (info.className != name ? (name + ": ")
596  : std::string())
597  << type << ")";
598 
599  string cname = "DefaultName";
600  SmartIF<IProperty> prop;
601  try {
602  if ( type == "Algorithm" ) {
603  prop = SmartIF<IAlgorithm>(Algorithm::Factory::create(ident, cname, svcLoc));
604  }
605  else if ( type == "Service") {
606  prop = SmartIF<IService>(Service::Factory::create(ident, cname, svcLoc));
607  }
608  else if ( type == "AlgTool") {
609  prop = SmartIF<IAlgTool>(AlgTool::Factory::create(ident, cname, type, dummySvc));
610  // FIXME: AlgTool base class increase artificially by 1 the refcount.
611  prop->release();
612  }
613  else if ( type == "Auditor") {
614  prop = SmartIF<IAuditor>(Auditor::Factory::create(ident, cname, svcLoc));
615  }
616  else if ( type == "ApplicationMgr") {
617  prop = SmartIF<ISvcLocator>(svcLoc);
618  }
619  else {
620  continue; // unknown
621  }
622  }
623  catch ( exception& e ) {
624  LOG_ERROR << "Error instantiating " << name
625  << " from " << *iLib;
626  LOG_ERROR << "Got exception: " << e.what();
627  allGood = false;
628  continue;
629  }
630  catch ( ... ) {
631  LOG_ERROR << "Error instantiating " << name
632  << " from " << *iLib;
633  allGood = false;
634  continue;
635  }
636  if( prop ) {
637  if (genComponent( *iLib, name, type, prop->getProperties() )) {
638  allGood = false;
639  }
640  prop.reset();
641  } else {
642  LOG_ERROR << "could not cast IInterface* object to an IProperty* !";
643  LOG_ERROR << "return type from PluginSvc is [" << rtype << "]...";
644  LOG_ERROR << "NO Configurable will be generated for ["
645  << name << "] !";
646  allGood = false;
647  }
648  } //> end loop over factories
649 
653  const std::string pyName = ( fs::path(m_outputDirName) /
654  fs::path(*iLib+"Conf.py") ).string();
655  const std::string dbName = ( fs::path(m_outputDirName) /
656  fs::path(*iLib+".confdb") ).string();
657 
658  std::fstream py( pyName, std::ios_base::out|std::ios_base::trunc );
659  std::fstream db( dbName, std::ios_base::out|std::ios_base::trunc );
660 
661  genHeader ( py, db );
662  if (!userModule.empty())
663  py << "from " << userModule << " import *" <<endl;
664  genBody ( py, db );
665  genTrailer( py, db );
666 
667  } //> end loop over libraries
668 
669  dummySvc->release();
670  dummySvc = 0;
671 
672  return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
673 }
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
The data converters are responsible to translate data from one representation into another...
Definition: IConverter.h:57
virtual const std::vector< Property * > & getProperties() const =0
Get list of properties.
int genComponent(const std::string &libName, const std::string &componentName, const std::string &componentType, const vector< Property * > &properties)
Definition: genconf.cpp:748
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
list path
Definition: __init__.py:15
#define LOG_ERROR
Definition: genconf.cpp:82
GAUDIPS_API Logger & logger()
Return the current logger instance.
void * ImageHandle
Definition of an image handle.
Definition: ModuleInfo.h:30
stringstream m_pyBuf
buffer of auto-generated configurables
Definition: genconf.cpp:113
GAUDI_API ISvcLocator * svcLocator()
#define LOG_INFO
Definition: genconf.cpp:84
General service interface definition.
Definition: IService.h:18
Definition of the basic interface.
Definition: IInterface.h:234
void genHeader(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:711
stringstream m_dbBuf
buffer of generated configurables informations for the "Db" file The "Db" file is holding information...
Definition: genconf.cpp:125
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:23
string m_outputDirName
absolute path to the directory where genconf will store auto-generated files (Configurables and Confi...
Definition: genconf.cpp:110
virtual unsigned long release()=0
Release Interface instance.
#define LOG_WARNING
Definition: genconf.cpp:83
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:117
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
Definition: System.cpp:254
In-memory database of the loaded factories.
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
Definition: System.cpp:124
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
static GAUDI_API void disableChecking()
Definition: StatusCode.cpp:23
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
void genTrailer(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:737
bool m_importDataObjectDescriptors
Definition: genconf.cpp:119
Base class for all services.
Definition: Service.h:35
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
int createAppMgr()
Definition: genconf.cpp:930
The IAuditor is the interface implmented by the AlgAuditor base class.
Definition: IAuditor.h:18
std::string libNativeName(const std::string &libName)
Definition: DsoUtils.h:18
void genBody(std::ostream &pyOut, std::ostream &dbOut)
Definition: genconf.cpp:196
string type
Definition: gaudirun.py:151
void configGenerator::genHeader ( std::ostream &  pyOut,
std::ostream &  dbOut 
)
private

Definition at line 711 of file genconf.cpp.

714 {
715  // python file part
716  std::string now = Gaudi::Time::current().format(true);
717  py << "#" << now //<< "\n"
718  << "\"\"\"Automatically generated. DO NOT EDIT please\"\"\"\n";
719  if ( m_importGaudiHandles ) {
720  py << "from GaudiKernel.GaudiHandles import *\n";
721  }
722 
724  py << "from GaudiKernel.DataObjectDescriptor import *\n";
725  }
726 
727  genImport(py,boost::format("from %1%.Configurable import *"));
728 
729  // db file part
730  db << "## -*- ascii -*- \n"
731  << "# db file automatically generated by genconf on: "
732  << now
733  << "\n"
734  << flush;
735 }
static Time current(void)
Returns the current time.
Definition: Time.cpp:113
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
void genImport(std::ostream &s, const boost::format &frmt, std::string indent)
Definition: genconf.cpp:675
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:117
bool m_importDataObjectDescriptors
Definition: genconf.cpp:119
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:279
void configGenerator::genImport ( std::ostream &  s,
const boost::format frmt,
std::string  indent = "" 
)
private

Definition at line 675 of file genconf.cpp.

677  {
678 
679  std::string::size_type pos = 0, nxtpos = 0;
680  std::string mod;
681 
682  while ( std::string::npos != pos ){
683  // find end of module name
684  nxtpos = m_configurable["Module"].find_first_of(',',pos);
685 
686  // Prepare import string
687  mod = m_configurable["Module"].substr(pos,nxtpos-pos);
688  std::ostringstream import;
689  import << boost::format(frmt) % mod;
690 
691  // append a normal import or a try/except enclosed one depending
692  // on availability of a fall-back module (next in the list)
693  if ( std::string::npos == nxtpos ) {
694  // last possible module
695  s << indent << import.str() << "\n" << flush;
696  pos = std::string::npos;
697  } else {
698  // we have a fallback for this
699  s << indent << "try:\n"
700  << indent << py_tab << import.str() << "\n"
701  << indent << "except ImportError:\n"
702  << flush;
703  pos = nxtpos+1;
704  }
705  // increase indentation level for next iteration
706  indent += py_tab;
707  }
708 }
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
string s
Definition: gaudirun.py:245
void configGenerator::genTrailer ( std::ostream &  pyOut,
std::ostream &  dbOut 
)
private

Definition at line 737 of file genconf.cpp.

740 {
741  // db file part
742  db << "## " << m_pkgName << "\n"
743  << std::flush;
744 }
string m_pkgName
name of the package we are processing
Definition: genconf.cpp:106
void configGenerator::pythonizeName ( string &  name)
private

Translates a valid C++ typename into a valid python one.

Definition at line 828 of file genconf.cpp.

830 {
831  static string in("<>&*,: ().");
832  static string out("__rp__s___");
833  boost::algorithm::replace_all(name, ", ", ",");
834  for ( string::iterator i = name.begin(); i != name.end(); ++i ) {
835  if ( in.find(*i) != string::npos ) *i = out[in.find(*i)];
836  }
837 }
list i
Definition: ana.py:128
void configGenerator::pythonizeValue ( const Property prop,
string &  pvalue,
string &  ptype 
)
private

handle the "marshalling" of Properties

Definition at line 840 of file genconf.cpp.

843 {
844  const std::string cvalue = p->toString();
845  const type_info& ti = *p->type_info();
846  if ( ti == typeid(bool) ) {
847  pvalue = ( cvalue == "0" || cvalue == "False" || cvalue == "false" )
848  ? "False"
849  : "True";
850  ptype = "bool";
851  }
852  else if ( ti == typeid(char) || ti == typeid(signed char)
853  || ti == typeid(unsigned char) ||
854  ti == typeid(short) || ti == typeid(unsigned short) ||
855  ti == typeid(int) || ti == typeid(unsigned int) ||
856  ti == typeid(long) || ti == typeid(unsigned long) ) {
857  pvalue = cvalue;
858  ptype = "int";
859  }
860  else if ( ti == typeid(long long) || ti == typeid(unsigned long long) ) {
861  pvalue = cvalue + "L";
862  ptype = "long";
863  }
864  else if ( ti == typeid(float) || ti == typeid(double) ) {
865  // forces python to handle this as a float: put a dot in there...
866  pvalue = boost::to_lower_copy(cvalue);
867  if ( pvalue == "nan" ) {
868  pvalue = "float('nan')";
869  std::cout << "WARNING: default value for ["
870  << p->name() << "] is NaN !!"
871  << std::endl;
872  } else if ( std::string::npos == pvalue.find(".") &&
873  std::string::npos == pvalue.find("e") ) {
874  pvalue = cvalue + ".0";
875  }
876  ptype = "float";
877  }
878  else if ( ti == typeid(string) ) {
879 
880  pvalue = "'"+cvalue+"'";
881  ptype = "str";
882  }
883  else if ( ti == typeid(GaudiHandleBase) ) {
884  m_importGaudiHandles = true;
885  const GaudiHandleProperty& hdl
886  = dynamic_cast<const GaudiHandleProperty&>(*p);
887  const GaudiHandleBase& base = hdl.value();
888 
889  pvalue = base.pythonRepr();
890  ptype = "GaudiHandle";
891  }
892  else if ( ti == typeid(GaudiHandleArrayBase) ) {
893  m_importGaudiHandles = true;
894  const GaudiHandleArrayProperty& hdl
895  = dynamic_cast<const GaudiHandleArrayProperty&>(*p);
896  const GaudiHandleArrayBase& base = hdl.value();
897 
898  pvalue = base.pythonRepr();
899  ptype = "GaudiHandleArray";
900  }
901  else if ( ti == typeid(DataObjectDescriptor) ) {
904  = dynamic_cast<const DataObjectDescriptorProperty&>(*p);
905  const DataObjectDescriptor& base = hdl.value();
906 
907  pvalue = base.pythonRepr();
908  ptype = "DataDescriptor";
909  }
910  else if ( ti == typeid(DataObjectDescriptorCollection) ) {
913  = dynamic_cast<const DataObjectDescriptorCollectionProperty&>(*p);
914  const DataObjectDescriptorCollection& base = hdl.value();
915 
916  pvalue = base.pythonRepr();
917  ptype = "DataDescriptorCollection";
918  }
919  else {
920  std::ostringstream v_str;
921  v_str.setf(std::ios::fixed); // to correctly display floats
922  p->toStream(v_str);
923  pvalue = v_str.str();
924  ptype = "list";
925  }
926 }
const GaudiHandleArrayBase & value() const
Definition: Property.h:892
virtual std::string pythonRepr() const
Python representation of handle, i.e.
Definition: GaudiHandle.cpp:56
virtual const DataObjectDescriptor & value() const
const DataObjectDescriptorCollection & value() const
const std::string pythonRepr() const
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:320
bool m_importGaudiHandles
switch to decide if the generated configurables need to import GaudiHandles (ie: if one of the compon...
Definition: genconf.cpp:117
const GaudiHandleBase & value() const
Definition: Property.h:832
bool m_importDataObjectDescriptors
Definition: genconf.cpp:119
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:93
const std::string pythonRepr() const
std::string pythonRepr() const override
Python representation of array of handles, i.e.
Definition: GaudiHandle.cpp:94
void configGenerator::setConfigurableAlgorithm ( const std::string &  cfgAlgorithm)
inline

customize the configurable base class for Algorithm component

Definition at line 165 of file genconf.cpp.

166  {
167  m_configurable[ "Algorithm" ] = cfgAlgorithm;
168  }
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
void configGenerator::setConfigurableAlgTool ( const std::string &  cfgAlgTool)
inline

customize the configurable base class for AlgTool component

Definition at line 171 of file genconf.cpp.

172  {
173  m_configurable[ "AlgTool" ] = cfgAlgTool;
174  }
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
void configGenerator::setConfigurableAuditor ( const std::string &  cfgAuditor)
inline

customize the configurable base class for AlgTool component

Definition at line 177 of file genconf.cpp.

178  {
179  m_configurable[ "Auditor" ] = cfgAuditor;
180  }
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
void configGenerator::setConfigurableDefaultName ( const std::string &  defaultName)
inline

customize the default name for configurable instances

Definition at line 159 of file genconf.cpp.

160  {
161  m_configurable[ "DefaultName" ] = defaultName;
162  }
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
void configGenerator::setConfigurableModule ( const std::string &  moduleName)
inline

customize the Module name where configurable base classes are defined

Definition at line 153 of file genconf.cpp.

154  {
155  m_configurable[ "Module" ] = moduleName;
156  }
GAUDI_API const std::string & moduleName()
Get the name of the (executable/DLL) file without file-type.
Definition: ModuleInfo.cpp:54
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132
void configGenerator::setConfigurableService ( const std::string &  cfgService)
inline

customize the configurable base class for Service component

Definition at line 183 of file genconf.cpp.

184  {
185  m_configurable[ "Service" ] = cfgService;
186  m_configurable[ "ApplicationMgr" ] = cfgService;
187  }
GaudiUtils::HashMap< std::string, std::string > m_configurable
Configurable customization.
Definition: genconf.cpp:132

Member Data Documentation

GaudiUtils::HashMap<std::string, 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 132 of file genconf.cpp.

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

bool configGenerator::m_importDataObjectDescriptors
private

Definition at line 119 of file genconf.cpp.

bool configGenerator::m_importGaudiHandles
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 117 of file genconf.cpp.

string configGenerator::m_outputDirName
private

absolute path to the directory where genconf will store auto-generated files (Configurables and ConfigurableDb)

Definition at line 110 of file genconf.cpp.

string configGenerator::m_pkgName
private

name of the package we are processing

Definition at line 106 of file genconf.cpp.

stringstream configGenerator::m_pyBuf
private

buffer of auto-generated configurables

Definition at line 113 of file genconf.cpp.


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