The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
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>
20namespace 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 };
48
49 inline std::ostream& operator<<( std::ostream& o, const Catalog& c ) { return c.fillStream( o ); }
50 } // namespace Parsers
51} // namespace Gaudi
52
53template <typename Value>
54inline 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}
const_iterator end() const
Definition Catalog.h:34
std::map< std::string, PropertySet, std::less<> > CatalogSet
Definition Catalog.h:25
const_iterator begin() const
Definition Catalog.h:32
Property * Find(std::string_view client, std::string_view name)
Definition Catalog.cpp:47
CatalogSet::const_iterator const_iterator
Definition Catalog.h:29
bool Add(Property *property)
Definition Catalog.cpp:33
CatalogSet catalog_
Definition Catalog.h:46
CatalogSet::value_type value_type
Definition Catalog.h:27
CatalogSet::iterator iterator
Definition Catalog.h:28
boost::ptr_set< Property, Property::LessThen > PropertySet
Definition Catalog.h:24
std::vector< std::string > ClientNames() const
Definition Catalog.cpp:28
std::string ToString() const
Definition Catalog.cpp:56
std::ostream & fillStream(std::ostream &out) const
print the content of the catalogue to std::ostream
Definition Catalog.cpp:63
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition Catalog.h:49
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1