14 #include "boost/algorithm/string.hpp"
25 for (ObjectsT::const_iterator cur=
m_catalog->begin();
28 for(PropertiesT::const_iterator prop=cur->second.begin();
29 prop!=cur->second.end(); prop++)
30 {
if(NULL != *prop){
delete *prop; } }
36 (
const std::string& client,
41 removeProperty(client,property->
name()).ignore();
42 props->push_back(property);
45 toInsert.push_back(property);
46 m_catalog->insert(std::pair<std::string,PropertiesT>(client,toInsert));
53 (
const std::string& client,
54 const std::string& name)
59 PropertiesT::iterator toRemove;
60 if(findProperty(props,name,toRemove))
63 props->erase(toRemove);
71 (
const std::string& client)
const {
return findProperties(client); }
75 std::vector<std::string> result;
76 for (ObjectsT::const_iterator cur =
m_catalog->begin();
77 cur !=
m_catalog->end(); cur++) { result.push_back(cur->first); }
84 ObjectsT::iterator result;
86 return &result->second;
91 const std::string& name ,
92 SvcCatalog::PropertiesT::iterator& result)
94 for(result = props->begin();result!=props->end();result++){
95 if(boost::to_lower_copy((*result)->name()) == boost::to_lower_copy(name))
104 for ( ObjectsT::const_iterator iclient =
m_catalog->begin();
105 m_catalog->end() != iclient ; ++iclient )
108 o <<
"Client '" << iclient->first <<
"'" << std::endl ;
109 for ( PropertiesT::const_iterator ip = props.begin() ;
110 props.end() != ip ; ++ip )
113 if ( 0 == p ) { continue ; }
114 o <<
"\t" << (*p) << std::endl ;
PropertiesT * findProperties(const std::string &client) const
const PropertiesT * getProperties(const std::string &client) const
const std::string & name() const
property name
std::ostream & fillStream(std::ostream &o) const
dump the content of catalog to std::ostream
StatusCode addProperty(const std::string &client, const Property *property)
std::ostream & operator<<(std::ostream &o, const SvcCatalog &c)
printoput operator
StatusCode removeProperty(const std::string &client, const std::string &name)
std::vector< std::string > getClients() const
bool findProperty(PropertiesT *props, const std::string &name, PropertiesT::iterator &result)
This class is used for returning status codes from appropriate routines.
Property base class allowing Property* collections to be "homogeneous".
std::map< std::string, PropertiesT > ObjectsT
std::vector< const Property * > PropertiesT