6 #include <boost/format.hpp>
13 constexpr
struct select1st_t {
14 template <
typename S,
typename T>
const S& operator()(
const std::pair<S,T>& p)
const
16 template <
typename S,
typename T> S& operator()(std::pair<S,T>& p)
const
21 std::vector<std::string> gp::Catalog::ClientNames()
const {
22 std::vector<std::string> result;
30 auto it = catalog_.find(property->
ClientName());
31 if (it == catalog_.end()) {
33 properties.insert(property);
37 it->second.erase(*property);
38 it->second.insert(property);
43 gp::Property* gp::Catalog::Find(
const std::string& client,
44 const std::string&
name) {
45 auto it = catalog_.find(client);
46 if (it == catalog_.end())
return nullptr;
48 auto pit = std::find_if(it->second.begin(), it->second.end(),
50 return (pit != it->second.end()) ? &*pit :
nullptr;
54 std::string gp::Catalog::ToString()
const {
56 for (
const auto& client : catalog_) {
57 for (
const auto& current : client.second) {
58 result += current.ToString()+
"\n";
68 o <<
"// " << std::string(82,
'=') << std::endl
69 <<
"// Parser catalog " << std::endl
70 <<
"// " << std::string(82,
'=') << std::endl ;
72 size_t nComponents = 0 ;
73 size_t nProperties = 0 ;
75 for (
const auto& client :
catalog_) {
77 % client.first % client.second.size() << std::endl ;
79 nProperties += client.second.size() ;
80 for (
const auto& current : client.second) {
83 % current.ValueAsString()
87 o <<
"// " << std::string(82,
'=') <<
'\n'
88 <<
boost::format(
"// End parser catalog #Components=%1% #Properties=%2%")
89 % nComponents % nProperties <<
'\n'
90 <<
"// " << std::string(82,
'=') << std::endl ;
std::ostream & fillStream(std::ostream &out) const
print the content of the catalogue to std::ostream
constexpr struct select1st_t select1st
auto begin(reverse_wrapper< T > &w)
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
auto end(reverse_wrapper< T > &w)
const std::string & ClientName() const