Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (e3184c44)
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 #pragma once
12 #include "Property.h"
13 #include "PropertyName.h"
14 #include "PropertyValue.h"
15 #include <boost/ptr_container/ptr_set.hpp>
16 #include <iostream>
17 #include <map>
18 #include <string>
19 #include <vector>
20 namespace Gaudi {
21  namespace Parsers {
22  class Catalog final {
23  public:
24  typedef boost::ptr_set<Property, Property::LessThen> PropertySet;
25  typedef std::map<std::string, PropertySet, std::less<>> CatalogSet;
26 
27  typedef CatalogSet::value_type value_type;
28  typedef CatalogSet::iterator iterator;
29  typedef CatalogSet::const_iterator const_iterator;
30 
31  iterator begin() { return catalog_.begin(); }
32  const_iterator begin() const { return catalog_.begin(); }
33  iterator end() { return catalog_.end(); }
34  const_iterator end() const { return catalog_.end(); }
35 
36  std::vector<std::string> ClientNames() const;
37  bool Add( Property* property );
38  template <typename Value>
39  bool Add( std::string client, std::string property, const Value& value );
40  Property* Find( std::string_view client, std::string_view name );
41  std::string ToString() const;
43  std::ostream& fillStream( std::ostream& out ) const;
44 
45  private:
47  };
49  inline std::ostream& operator<<( std::ostream& o, const Catalog& c ) { return c.fillStream( o ); }
50  } // namespace Parsers
51 } // namespace Gaudi
52 
53 template <typename Value>
54 inline bool Gaudi::Parsers::Catalog::Add( std::string client, std::string property, const Value& value ) {
55  return Add( new Property( PropertyName( std::move( client ), std::move( property ) ), PropertyValue( value ) ) );
56 }
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:29
Gaudi::Parsers::Property
Definition: Property.h:20
Gaudi::Parsers::Catalog::Find
Property * Find(std::string_view client, std::string_view name)
Definition: Catalog.cpp:47
Gaudi::Parsers::Catalog::fillStream
std::ostream & fillStream(std::ostream &out) const
print the content of the catalogue to std::ostream
Definition: Catalog.cpp:63
Gaudi::Parsers::Catalog::Add
bool Add(Property *property)
Definition: Catalog.cpp:33
Gaudi::Parsers::PropertyValue
Definition: PropertyValue.h:22
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:25
PropertyName.h
PropertyValue.h
Gaudi::Parsers::Catalog::begin
const_iterator begin() const
Definition: Catalog.h:32
Gaudi::Parsers::operator<<
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition: Catalog.h:49
Gaudi::Parsers::Catalog::value_type
CatalogSet::value_type value_type
Definition: Catalog.h:27
Gaudi::Parsers::Catalog::iterator
CatalogSet::iterator iterator
Definition: Catalog.h:28
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:34
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
Gaudi::Parsers::Catalog::PropertySet
boost::ptr_set< Property, Property::LessThen > PropertySet
Definition: Catalog.h:24
Gaudi::Parsers::Catalog::end
iterator end()
Definition: Catalog.h:33
Gaudi::Parsers::Catalog::begin
iterator begin()
Definition: Catalog.h:31
Gaudi::Parsers::PropertyName
Definition: PropertyName.h:19
Gaudi::Parsers::Catalog::ToString
std::string ToString() const
Definition: Catalog.cpp:56
Gaudi::Parsers::Catalog
Definition: Catalog.h:22
Property.h
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:46
Gaudi::Functional::details::out
OptOut && out
Definition: details.h:179