All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Catalog.h
Go to the documentation of this file.
1 // $Id:$
2 #ifndef JOBOPTIONSVC_CATALOG_H_
3 #define JOBOPTIONSVC_CATALOG_H_
4 // ============================================================================
5 // STD & STL:
6 // ============================================================================
7 #include <iostream>
8 #include <string>
9 #include <vector>
10 #include <map>
11 #include <set>
12 // ============================================================================
13 // Boost:
14 // ============================================================================
15 #include <boost/ptr_container/ptr_set.hpp>
16 // ============================================================================
17 // Local:
18 // ============================================================================
19 #include "Property.h"
20 #include "PropertyName.h"
21 #include "PropertyValue.h"
22 // ============================================================================
23 // Namespace aliases:
24 // ============================================================================
25 // ...
26 // ============================================================================
27 namespace Gaudi { namespace Parsers {
28 // ============================================================================
29 class Catalog {
30  public:
31  typedef boost::ptr_set<Property, Property::LessThen> PropertySet;
32  typedef std::map<std::string, PropertySet> CatalogSet;
33 
34  typedef CatalogSet::value_type value_type;
35  typedef CatalogSet::iterator iterator;
36  typedef CatalogSet::const_iterator const_iterator;
37 
38  iterator begin() { return catalog_.begin();}
39  const_iterator begin() const { return catalog_.begin();}
40  iterator end() { return catalog_.end();}
41  const_iterator end() const{ return catalog_.end();}
42 
43  std::vector<std::string> ClientNames() const;
44  bool Add(Property* property);
45  template<typename Value> bool Add(const std::string& client,
46  const std::string& property, const Value& value);
47  Property* Find(const std::string& client, const std::string& name);
48  std::string ToString() const;
50  std::ostream& fillStream ( std::ostream& out ) const ;
51  private:
53 };
54 // ============================================================================
56 // ============================================================================
57  inline std::ostream& operator<< (std::ostream& o, const Catalog& c){
58  return c.fillStream(o);
59  }
60 // ============================================================================
61 } /* Gaudi */ } /* Parsers */
62 
63 template<typename Value> inline bool Gaudi::Parsers::Catalog::Add(
64  const std::string& client, const std::string& property,
65  const Value& value) {
66  return Add(new Property(PropertyName(client, property), PropertyValue(value)));
67 }
68 
69 // ============================================================================
70 #endif // JOBOPTIONSVC_CATALOG_H_
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition: Catalog.h:57
CatalogSet::value_type value_type
Definition: Catalog.h:34
std::ostream & fillStream(std::ostream &out) const
print the content of the catalogue to std::ostream
Definition: Catalog.cpp:61
tuple c
Definition: gaudirun.py:341
iterator begin()
Definition: Catalog.h:38
CatalogSet::const_iterator const_iterator
Definition: Catalog.h:36
std::vector< std::string > ClientNames() const
Definition: Catalog.cpp:13
CatalogSet::iterator iterator
Definition: Catalog.h:35
const_iterator end() const
Definition: Catalog.h:41
const_iterator begin() const
Definition: Catalog.h:39
Property * Find(const std::string &client, const std::string &name)
Definition: Catalog.cpp:36
boost::ptr_set< Property, Property::LessThen > PropertySet
Definition: Catalog.h:31
bool Add(Property *property)
Definition: Catalog.cpp:21
std::map< std::string, PropertySet > CatalogSet
Definition: Catalog.h:32
CatalogSet catalog_
Definition: Catalog.h:52
This is a number of static methods for bootstrapping the Gaudi framework.
Definition: Bootstrap.h:15
std::string ToString() const
Definition: Catalog.cpp:48