11 #include "boost/algorithm/string.hpp"
18 constexpr
struct select1st_t {
19 template <
typename S,
typename T>
const S&
operator()(
const std::pair<S,T>& p)
const
21 template <
typename S,
typename T> S&
operator()(std::pair<S,T>& p)
const
30 for (
auto & prop : cur.second)
delete prop;
35 (
const std::string& client,
38 auto props = findProperties(client);
40 removeProperty(client,property->
name()).ignore();
41 props->push_back(property);
43 m_catalog.emplace( client,
PropertiesT{
property } );
50 const std::string&
name)
57 props->erase(res.second);
65 (
const std::string& client)
const {
return findProperties(client); }
69 std::vector<std::string> result; result.reserve(
m_catalog.size());
79 return ( result !=
m_catalog.end() ) ? &result->second
87 return ( result !=
m_catalog.end() ) ? &result->second
91 std::pair<bool,SvcCatalog::PropertiesT::iterator>
94 const std::string&
name )
98 return boost::iequals( name, prop->
name());
108 o <<
"Client '" << iclient.first <<
"'" << std::endl ;
109 for (
const auto& p : iclient.second )
111 if ( p ) o <<
"\t" << (*p) << std::endl ;
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
constexpr struct select1st_t select1st
auto begin(reverse_wrapper< T > &w)
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
const PropertiesT * findProperties(const std::string &client) const
auto end(reverse_wrapper< T > &w)
This class is used for returning status codes from appropriate routines.
std::map< std::string, PropertiesT > m_catalog
Property base class allowing Property* collections to be "homogeneous".
const S & operator()(const std::pair< S, T > &p) const
std::vector< const Property * > PropertiesT
std::pair< bool, PropertiesT::iterator > findProperty(PropertiesT &props, const std::string &name)