Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (f31105fd)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Catalog.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 <string>
19 #include <vector>
20 // ============================================================================
21 // Boost:
22 // ============================================================================
23 #include <boost/ptr_container/ptr_set.hpp>
24 // ============================================================================
25 // Local:
26 // ============================================================================
27 #include "Property.h"
28 #include "PropertyName.h"
29 #include "PropertyValue.h"
30 // ============================================================================
31 // Namespace aliases:
32 // ============================================================================
33 // ...
34 // ============================================================================
35 namespace Gaudi {
36  namespace Parsers {
37  // ============================================================================
38  class Catalog final {
39  public:
40  typedef boost::ptr_set<Property, Property::LessThen> PropertySet;
42 
43  typedef CatalogSet::value_type value_type;
44  typedef CatalogSet::iterator iterator;
45  typedef CatalogSet::const_iterator const_iterator;
46 
47  iterator begin() { return catalog_.begin(); }
48  const_iterator begin() const { return catalog_.begin(); }
49  iterator end() { return catalog_.end(); }
50  const_iterator end() const { return catalog_.end(); }
51 
53  bool Add( Property* property );
54  template <typename Value>
55  bool Add( std::string client, std::string property, const Value& value );
56  Property* Find( std::string_view client, std::string_view name );
57  std::string ToString() const;
60 
61  private:
63  };
64  // ============================================================================
66  // ============================================================================
67  inline std::ostream& operator<<( std::ostream& o, const Catalog& c ) { return c.fillStream( o ); }
68  // ============================================================================
69  } // namespace Parsers
70 } // namespace Gaudi
71 
72 template <typename Value>
73 inline bool Gaudi::Parsers::Catalog::Add( std::string client, std::string property, const Value& value ) {
74  return Add( new Property( PropertyName( std::move( client ), std::move( property ) ), PropertyValue( value ) ) );
75 }
76 
77 // ============================================================================
78 #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:45
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:41
PropertyName.h
PropertyValue.h
Gaudi::Parsers::Catalog::begin
const_iterator begin() const
Definition: Catalog.h:48
Gaudi::Parsers::operator<<
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition: Catalog.h:67
std::ostream
STL class.
Gaudi::Parsers::Catalog::value_type
CatalogSet::value_type value_type
Definition: Catalog.h:43
std::map
STL class.
Gaudi::Parsers::Catalog::iterator
CatalogSet::iterator iterator
Definition: Catalog.h:44
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:50
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:40
Gaudi::Parsers::Catalog::end
iterator end()
Definition: Catalog.h:49
Gaudi::Parsers::Catalog::begin
iterator begin()
Definition: Catalog.h:47
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:38
Property.h
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:62
Gaudi::Functional::details::out
OptOut && out
Definition: details.h:174