6 #include <boost/foreach.hpp>
7 #include <boost/format.hpp>
11 namespace gp = Gaudi::Parsers;
13 std::vector<std::string> gp::Catalog::ClientNames()
const {
14 std::vector<std::string> result;
15 BOOST_FOREACH(
const CatalogSet::value_type& prop, catalog_) {
16 result.push_back(prop.first);
22 assert( property != NULL);
23 CatalogSet::iterator it = catalog_.find(property->
ClientName());
24 if (it == catalog_.end()) {
25 CatalogSet::mapped_type properties;
26 properties.insert(property);
27 catalog_.insert(CatalogSet::value_type(property->
ClientName(), properties));
30 it->second.erase(*property);
31 it->second.insert(property);
36 gp::Property* gp::Catalog::Find(
const std::string& client,
37 const std::string& name) {
38 CatalogSet::iterator it = catalog_.find(client);
39 if (it == catalog_.end())
return NULL;
41 CatalogSet::mapped_type::iterator pit = std::find_if(it->second.begin(),
43 if (pit == it->second.end())
return NULL;
48 std::string gp::Catalog::ToString()
const {
50 BOOST_FOREACH(
const CatalogSet::value_type& client, catalog_) {
51 for (CatalogSet::mapped_type::const_iterator current = client.second.begin();
52 current != client.second.end(); ++current) {
53 result += current->ToString()+
"\n";
63 o <<
"// " << std::string(82,
'=') << std::endl
64 <<
"// Parser catalog " << std::endl
65 <<
"// " << std::string(82,
'=') << std::endl ;
67 size_t nComponents = 0 ;
68 size_t nProperties = 0 ;
70 BOOST_FOREACH(
const CatalogSet::value_type& client,
catalog_) {
72 % client.first % client.second.size() << std::endl ;
74 nProperties += client.second.size() ;
75 for (CatalogSet::mapped_type::const_iterator current = client.second.begin();
76 current != client.second.end(); ++current) {
79 % current->ValueAsString()
83 o <<
"// " << std::string(82,
'=') << std::endl
84 <<
boost::format(
"// End parser catalog #Components=%1% #Properties=%2%")
85 % nComponents % nProperties << std::endl
86 <<
"// " << std::string(82,
'=') << std::endl ;
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
std::ostream & fillStream(std::ostream &out) const
print the content of the catalogue to std::ostream
std::string ClientName() const