|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
Catalogue of PropertyEntry. More...
#include <Catalogue.h>

Public Types | |
| typedef std::map< std::string, std::vector< PropertyEntry > > | CatalogueT |
Public Member Functions | |
| StatusCode | findProperties (const std::string &objName, std::vector< PropertyEntry > &list) const |
| Find properties of object by object name. | |
| StatusCode | findProperty (const std::string &objName, const std::string &propName, PropertyEntry &property) const |
| Find property in catalogue. | |
| void | addProperty (const std::string &objName, const PropertyEntry &property) |
| Add property to catalogue. | |
| StatusCode | addProperty (const std::string &objName, const std::string &propName, const std::string &value) |
| Add property to catalogue. | |
| CatalogueT | catalogue () const |
| Return all objects names and their properties info. | |
| std::ostream & | fillStream (std::ostream &out) const |
| print the content of the catalogue to std::ostream | |
Private Types | |
| typedef std::map< std::string, PropertyEntry, _NoCaseCmp_ > | PropertiesStoreT |
| typedef std::map< std::string, PropertiesStoreT > | ObjectsStoreT |
Private Attributes | |
| ObjectsStoreT | m_properties |
Definition at line 47 of file Catalogue.h.
| typedef std::map<std::string,std::vector<PropertyEntry> > Gaudi::Parsers::Catalogue::CatalogueT |
Definition at line 50 of file Catalogue.h.
typedef std::map<std::string,PropertiesStoreT> Gaudi::Parsers::Catalogue::ObjectsStoreT [private] |
Definition at line 93 of file Catalogue.h.
typedef std::map<std::string,PropertyEntry,_NoCaseCmp_> Gaudi::Parsers::Catalogue::PropertiesStoreT [private] |
Definition at line 92 of file Catalogue.h.
| void Gaudi::Parsers::Catalogue::addProperty | ( | const std::string & | objName, |
| const PropertyEntry & | property | ||
| ) |
Add property to catalogue.
| objName | Name of object |
| property | Property |
Definition at line 92 of file Catalogue.cpp.
{
PropertyEntry prop = property;
prop.removeEnv().ignore() ;
m_properties[objName][ property.name()] = prop;
}
| StatusCode Gaudi::Parsers::Catalogue::addProperty | ( | const std::string & | objName, |
| const std::string & | propName, | ||
| const std::string & | value | ||
| ) |
Add property to catalogue.
| objName | Name of object |
| propName | Property name |
| Value | as string |
Definition at line 109 of file Catalogue.cpp.
{
StatusCode ok;
std::string stringResult;
std::vector<std::string> vectorResult;
ok = Gaudi::Parsers::Utils::parseValue(value,stringResult,vectorResult);
if(ok.isFailure()){
return StatusCode::FAILURE;
}
bool isVector = (vectorResult.size()>0) || (stringResult=="{}");
if(isVector){
addProperty(objName,PropertyEntry(propName,vectorResult));
}else{
addProperty(objName,PropertyEntry(propName,stringResult));
}
return StatusCode::SUCCESS;
}
| Gaudi::Parsers::Catalogue::CatalogueT Gaudi::Parsers::Catalogue::catalogue | ( | ) | const |
Return all objects names and their properties info.
Definition at line 68 of file Catalogue.cpp.
{
CatalogueT result;
for(ObjectsStoreT::const_iterator curObj=m_properties.begin();
curObj!=m_properties.end();curObj++){
std::vector<PropertyEntry> properties;
for(PropertiesStoreT::const_iterator curProp=curObj->second.begin();
curProp!=curObj->second.end();curProp++){
properties.push_back(curProp->second);
}
result[curObj->first] = properties;
}
return result;
}
| std::ostream & Gaudi::Parsers::Catalogue::fillStream | ( | std::ostream & | out ) | const |
print the content of the catalogue to std::ostream
Definition at line 138 of file Catalogue.cpp.
{
o << "// " << std::string(82,'=') << std::endl
<< "// Parser catalogue " << std::endl
<< "// " << std::string(82,'=') << std::endl ;
size_t nComponents = 0 ;
size_t nProperties = 0 ;
CatalogueT cat = catalogue();
for( Catalogue::CatalogueT::const_iterator obj = cat.begin();
cat.end() != obj ; ++obj )
{
o << boost::format("// Properties of '%1%' %|40t|#=%2%" )
% obj->first % obj->second.size() << std::endl ;
++nComponents ;
nProperties += obj->second.size() ;
for( std::vector<PropertyEntry>::const_iterator prop = obj->second.begin();
obj->second.end() != prop ; ++prop )
{
o << boost::format("%1%.%2% %|44t| = %3% ; ")
% obj->first
% prop->name()
% prop->value() << std::endl ;
}
}
o << "// " << std::string(82,'=') << std::endl
<< boost::format("// End parser catalogue #Components=%1% #Properties=%2%")
% nComponents % nProperties << std::endl
<< "// " << std::string(82,'=') << std::endl ;
return o ;
}
| StatusCode Gaudi::Parsers::Catalogue::findProperties | ( | const std::string & | objName, |
| std::vector< PropertyEntry > & | list | ||
| ) | const |
Find properties of object by object name.
| objName | Object name |
| list | Result list |
Definition at line 28 of file Catalogue.cpp.
{
ObjectsStoreT::const_iterator obj =
m_properties.find(objName);
if ( obj == m_properties.end()){ return StatusCode::FAILURE; }
PropertiesStoreT::const_iterator cur = obj->second.begin();
PropertiesStoreT::const_iterator end = obj->second.end();
for(;cur!=end;cur++){ lst.push_back(cur->second); }
return StatusCode::SUCCESS;
}
| StatusCode Gaudi::Parsers::Catalogue::findProperty | ( | const std::string & | objName, |
| const std::string & | propName, | ||
| PropertyEntry & | property | ||
| ) | const |
Find property in catalogue.
| objName | Object name |
| propName | Property name |
| property |
Definition at line 50 of file Catalogue.cpp.
{
ObjectsStoreT::const_iterator obj = m_properties.find(objName);
if ( obj == m_properties.end()){ return StatusCode::FAILURE; }
PropertiesStoreT::const_iterator prop = obj->second.find(propName);
if ( prop==obj->second.end()){ return StatusCode::FAILURE; }
property = prop->second;
return StatusCode::SUCCESS;
}
ObjectsStoreT Gaudi::Parsers::Catalogue::m_properties [private] |
Definition at line 95 of file Catalogue.h.