| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Catalog.h
Go to the documentation of this file.
1 #ifndef JOBOPTIONSVC_CATALOG_H_
2 #define JOBOPTIONSVC_CATALOG_H_
3 // ============================================================================
4 // STD & STL:
5 // ============================================================================
6 #include <iostream>
7 #include <map>
8 #include <set>
9 #include <string>
10 #include <vector>
11 // ============================================================================
12 // Boost:
13 // ============================================================================
14 #include <boost/ptr_container/ptr_set.hpp>
15 // ============================================================================
16 // Local:
17 // ============================================================================
18 #include "Property.h"
19 #include "PropertyName.h"
20 #include "PropertyValue.h"
21 // ============================================================================
22 // Namespace aliases:
23 // ============================================================================
24 // ...
25 // ============================================================================
26 namespace Gaudi
27 {
28 namespace Parsers
29 {
30 // ============================================================================
31 class Catalog final
32 {
33 public:
34 typedef boost::ptr_set<Property, Property::LessThen> PropertySet;
35 typedef std::map<std::string, PropertySet> CatalogSet;
36
37 typedef CatalogSet::value_type value_type;
38 typedef CatalogSet::iterator iterator;
39 typedef CatalogSet::const_iterator const_iterator;
40
41 iterator begin() { return catalog_.begin(); }
42 const_iterator begin() const { return catalog_.begin(); }
43 iterator end() { return catalog_.end(); }
44 const_iterator end() const { return catalog_.end(); }
45
46 std::vector<std::string> ClientNames() const;
47 bool Add( Property* property );
48 template <typename Value>
49 bool Add( std::string client, std::string property, const Value& value );
50 Property* Find( const std::string& client, const std::string& name );
51 std::string ToString() const;
53 std::ostream& fillStream( std::ostream& out ) const;
54
55 private:
56 CatalogSet catalog_;
57 };
58 // ============================================================================
60 // ============================================================================
61 inline std::ostream& operator<<( std::ostream& o, const Catalog& c ) { return c.fillStream( o ); }
62 // ============================================================================
63 } /* Gaudi */
64 } /* Parsers */
65
66 template <typename Value>
67 inline bool Gaudi::Parsers::Catalog::Add( std::string client, std::string property, const Value& value )
68 {
69 return Add( new Property( PropertyName( std::move( client ), std::move( property ) ), PropertyValue( value ) ) );
70 }
71
72 // ============================================================================
73 #endif // JOBOPTIONSVC_CATALOG_H_
Gaudi::Parsers::operator<<
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition: Catalog.h:61
Gaudi::Parsers::Catalog::value_type
CatalogSet::value_type value_type
Definition: Catalog.h:37
gaudirun.c
c
Definition: gaudirun.py:407
Gaudi::Parsers::Catalog::fillStream
std::ostream & fillStream(std::ostream &out) const
print the content of the catalogue to std::ostream
Definition: Catalog.cpp:73
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
Gaudi::Parsers::Property
Definition: Property.h:19
property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Gaudi::Parsers::Catalog::begin
iterator begin()
Definition: Catalog.h:41
std::map::end
T end(T...args)
Property
Gaudi::Details::PropertyBase Property
backward compatibility hack for old Property base class
Definition: PropertyFwd.h:28
std::map< std::string, PropertySet >
Property.h
std::string
STL class.
Gaudi::Parsers::PropertyValue
Definition: PropertyValue.h:22
Gaudi::Parsers::Catalog::const_iterator
CatalogSet::const_iterator const_iterator
Definition: Catalog.h:39
Gaudi::Parsers::Catalog::ClientNames
std::vector< std::string > ClientNames() const
Definition: Catalog.cpp:28
Gaudi::Parsers::Catalog::iterator
CatalogSet::iterator iterator
Definition: Catalog.h:38
Gaudi::Parsers::Catalog::end
const_iterator end() const
Definition: Catalog.h:44
Gaudi::Parsers::Catalog::begin
const_iterator begin() const
Definition: Catalog.h:42
Gaudi::Parsers::Catalog::Find
Property * Find(const std::string &client, const std::string &name)
Definition: Catalog.cpp:51
std::move
T move(T...args)
Gaudi::Parsers::PropertyName
Definition: PropertyName.h:18
Gaudi::Parsers::Catalog::PropertySet
boost::ptr_set< Property, Property::LessThen > PropertySet
Definition: Catalog.h:34
PropertyName.h
std::vector< std::string >
Gaudi::Parsers::Catalog
Definition: Catalog.h:31
Gaudi::Parsers::Catalog::Add
bool Add(Property *property)
Definition: Catalog.cpp:35
std::map::begin
T begin(T...args)
PropertyValue.h
Gaudi::Parsers::Catalog::CatalogSet
std::map< std::string, PropertySet > CatalogSet
Definition: Catalog.h:35
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:56
Gaudi::Parsers::Catalog::end
iterator end()
Definition: Catalog.h:43
std::ostream
STL class.
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::Parsers::Catalog::ToString
std::string ToString() const
Definition: Catalog.cpp:60