The Gaudi Framework  master (37c0b60a)
Catalog.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef JOBOPTIONSVC_CATALOG_H_
12 #define JOBOPTIONSVC_CATALOG_H_
13 // ============================================================================
14 // STD & STL:
15 // ============================================================================
16 #include <iostream>
17 #include <map>
18 #include <set>
19 #include <string>
20 #include <vector>
21 // ============================================================================
22 // Boost:
23 // ============================================================================
24 #include <boost/ptr_container/ptr_set.hpp>
25 // ============================================================================
26 // Local:
27 // ============================================================================
28 #include "Property.h"
29 #include "PropertyName.h"
30 #include "PropertyValue.h"
31 // ============================================================================
32 // Namespace aliases:
33 // ============================================================================
34 // ...
35 // ============================================================================
36 namespace Gaudi {
37  namespace Parsers {
38  // ============================================================================
39  class Catalog final {
40  public:
41  typedef boost::ptr_set<Property, Property::LessThen> PropertySet;
43 
44  typedef CatalogSet::value_type value_type;
45  typedef CatalogSet::iterator iterator;
46  typedef CatalogSet::const_iterator const_iterator;
47 
48  iterator begin() { return catalog_.begin(); }
49  const_iterator begin() const { return catalog_.begin(); }
50  iterator end() { return catalog_.end(); }
51  const_iterator end() const { return catalog_.end(); }
52 
54  bool Add( Property* property );
55  template <typename Value>
56  bool Add( std::string client, std::string property, const Value& value );
57  Property* Find( std::string_view client, std::string_view name );
58  std::string ToString() const;
61 
62  private:
64  };
65  // ============================================================================
67  // ============================================================================
68  inline std::ostream& operator<<( std::ostream& o, const Catalog& c ) { return c.fillStream( o ); }
69  // ============================================================================
70  } // namespace Parsers
71 } // namespace Gaudi
72 
73 template <typename Value>
74 inline bool Gaudi::Parsers::Catalog::Add( std::string client, std::string property, const Value& value ) {
75  return Add( new Property( PropertyName( std::move( client ), std::move( property ) ), PropertyValue( value ) ) );
76 }
77 
78 // ============================================================================
79 #endif // JOBOPTIONSVC_CATALOG_H_
Gaudi::Parsers::Catalog::ClientNames
std::vector< std::string > ClientNames() const
Definition: Catalog.cpp:28
Gaudi::Parsers::Catalog::const_iterator
CatalogSet::const_iterator const_iterator
Definition: Catalog.h:46
Gaudi::Parsers::Property
Definition: Property.h:27
std::string
STL class.
Gaudi::Parsers::Catalog::Find
Property * Find(std::string_view client, std::string_view name)
Definition: Catalog.cpp:49
std::move
T move(T... args)
std::vector< std::string >
Gaudi::Parsers::Catalog::fillStream
std::ostream & fillStream(std::ostream &out) const
print the content of the catalogue to std::ostream
Definition: Catalog.cpp:69
Gaudi::Parsers::Catalog::Add
bool Add(Property *property)
Definition: Catalog.cpp:34
Gaudi::Parsers::PropertyValue
Definition: PropertyValue.h:29
gaudirun.c
c
Definition: gaudirun.py:525
MultiMergers.Value
Value
Definition: MultiMergers.py:15
Gaudi::Parsers::Catalog::CatalogSet
std::map< std::string, PropertySet, std::less<> > CatalogSet
Definition: Catalog.h:42
PropertyName.h
PropertyValue.h
Gaudi::Parsers::Catalog::begin
const_iterator begin() const
Definition: Catalog.h:49
Gaudi::Parsers::operator<<
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition: Catalog.h:68
std::ostream
STL class.
Gaudi::Parsers::Catalog::value_type
CatalogSet::value_type value_type
Definition: Catalog.h:44
std::map
STL class.
Gaudi::Parsers::Catalog::iterator
CatalogSet::iterator iterator
Definition: Catalog.h:45
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
Gaudi::Parsers::Catalog::end
const_iterator end() const
Definition: Catalog.h:51
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
std::map::begin
T begin(T... args)
Gaudi::Parsers::Catalog::PropertySet
boost::ptr_set< Property, Property::LessThen > PropertySet
Definition: Catalog.h:41
Gaudi::Parsers::Catalog::end
iterator end()
Definition: Catalog.h:50
Gaudi::Parsers::Catalog::begin
iterator begin()
Definition: Catalog.h:48
Gaudi::Parsers::PropertyName
Definition: PropertyName.h:26
std::map::end
T end(T... args)
Gaudi::Parsers::Catalog::ToString
std::string ToString() const
Definition: Catalog.cpp:59
Gaudi::Parsers::Catalog
Definition: Catalog.h:39
Property.h
PrepareBase.out
out
Definition: PrepareBase.py:20
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:63