| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Private Attributes | List of all members
Gaudi::Parsers::Catalog Class Referencefinal

`#include <src/JobOptionsSvc/Catalog.h>`

Collaboration diagram for Gaudi::Parsers::Catalog:
[legend]

## Public Types
typedef boost::ptr_set< Property, Property::LessThen > | PropertySet
typedef std::map< std::string, PropertySet > | CatalogSet
typedef CatalogSet::value_type | value_type
typedef CatalogSet::iterator | iterator
typedef CatalogSet::const_iterator | const_iterator

## Public Member Functions
iterator | begin ()
const_iterator | begin () const
iterator | end ()
const_iterator | end () const
std::vector< std::string > | ClientNames () const
bool | Add (Property *property)
template<typename Value >
bool | Add (std::string client, std::string property, const Value &value)
Property * | Find (const std::string &client, const std::string &name)
std::string | ToString () const
std::ostream & | fillStream (std::ostream &out) const
| print the content of the catalogue to std::ostream More...

## Private Attributes
CatalogSet | catalog_

## Detailed Description

Definition at line 29 of file Catalog.h.

## Member Typedef Documentation

## ◆ CatalogSet

typedef std::map<std::string, PropertySet> Gaudi::Parsers::Catalog::CatalogSet

Definition at line 32 of file Catalog.h.

## ◆ const_iterator

typedef CatalogSet::const_iterator Gaudi::Parsers::Catalog::const_iterator

Definition at line 36 of file Catalog.h.

## ◆ iterator

typedef CatalogSet::iterator Gaudi::Parsers::Catalog::iterator

Definition at line 35 of file Catalog.h.

## ◆ PropertySet

typedef boost::ptr_set<Property, Property::LessThen> Gaudi::Parsers::Catalog::PropertySet

Definition at line 31 of file Catalog.h.

## ◆ value_type

typedef CatalogSet::value_type Gaudi::Parsers::Catalog::value_type

Definition at line 34 of file Catalog.h.

## Member Function Documentation

## ◆ Add() [1/2]

bool Gaudi::Parsers::Catalog::Add | ( | Property * | property | ) |

Definition at line 31 of file Catalog.cpp.

31 {
32 assert( property );
33 auto it = catalog_.find( property->ClientName() );
34 if ( it == catalog_.end() ) {
35 CatalogSet::mapped_type properties;
36 properties.insert( property );
37 catalog_.emplace( property->ClientName(), properties );
38 return true;
39 }
40 it->second.erase( *property );
41 it->second.insert( property );
42 // TODO: check return value
43 return true;
44 }
std::map::end
T end(T... args)
std::map::find
T find(T... args)
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:51
std::map::emplace
T emplace(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ Add() [2/2]

template<typename Value >

bool Gaudi::Parsers::Catalog::Add | ( | std::string | client,
|  | std::string | property,
|  | const Value & | value
| ) |  |
| inline

Definition at line 64 of file Catalog.h.

64 {
65 return Add( new Property( PropertyName( std::move( client ), std::move( property ) ), PropertyValue( value ) ) );
66 }
Property
Gaudi::Details::PropertyBase Property
\fixme backward compatibility hack for old Property base class
Definition: PropertyFwd.h:25
std::move
T move(T... args)
Gaudi::Parsers::Catalog::Add
bool Add(Property *property)
Definition: Catalog.cpp:31

## ◆ begin() [1/2]

iterator Gaudi::Parsers::Catalog::begin | ( |  | ) |
| inline

Definition at line 38 of file Catalog.h.

38 { return catalog_.begin(); }
std::map::begin
T begin(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ begin() [2/2]

const_iterator Gaudi::Parsers::Catalog::begin | ( |  | ) | const
| inline

Definition at line 39 of file Catalog.h.

39 { return catalog_.begin(); }
std::map::begin
T begin(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ ClientNames()

std::vector< std::string > Gaudi::Parsers::Catalog::ClientNames | ( |  | ) | const

Definition at line 25 of file Catalog.cpp.

25 {
26 std::vector<std::string> result;
27 std::transform( std::begin( catalog_ ), std::end( catalog_ ), std::back_inserter( result ), select1st );
28 return result;
29 }
std::end
T end(T... args)
std::vector< std::string >
std::begin
T begin(T... args)
std::back_inserter
T back_inserter(T... args)
std::transform
T transform(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ end() [1/2]

iterator Gaudi::Parsers::Catalog::end | ( |  | ) |
| inline

Definition at line 40 of file Catalog.h.

40 { return catalog_.end(); }
std::map::end
T end(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ end() [2/2]

const_iterator Gaudi::Parsers::Catalog::end | ( |  | ) | const
| inline

Definition at line 41 of file Catalog.h.

41 { return catalog_.end(); }
std::map::end
T end(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ fillStream()

std::ostream & Gaudi::Parsers::Catalog::fillStream | ( | std::ostream & | out | ) | const

print the content of the catalogue to std::ostream

Definition at line 64 of file Catalog.cpp.

64 {
65 o << "// " << std::string( 82, '=' ) << std::endl
66 << "// Parser catalog " << std::endl
67 << "// " << std::string( 82, '=' ) << std::endl;
68
69 size_t nComponents = 0;
70 size_t nProperties = 0;
71
72 for ( const auto& client : catalog_ ) {
73 o << boost::format( "// Properties of '%1%' %|43t|# = %2%" ) % client.first % client.second.size() << std::endl;
74 ++nComponents;
75 nProperties += client.second.size();
76 for ( const auto& current : client.second ) {
77 o << boost::format( "%1% %|44t| = %2% ; " ) % current.FullName() % current.ValueAsString() << '\n';
78 }
79 }
80 o << "// " << std::string( 82, '=' ) << '\n'
81 << boost::format( "// End parser catalog #Components=%1% #Properties=%2%" ) % nComponents % nProperties << '\n'
82 << "// " << std::string( 82, '=' ) << std::endl;
83 return o;
84 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
std::endl
T endl(T... args)
std::string
STL class.
std::string::size
T size(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ Find()

gp::Property * Gaudi::Parsers::Catalog::Find | ( | const std::string & | client,
|  | const std::string & | name
| ) |  |

Definition at line 46 of file Catalog.cpp.

46 {
47 auto it = catalog_.find( client );
48 if ( it == catalog_.end() ) return nullptr;
49
50 auto pit = std::find_if( it->second.begin(), it->second.end(), Property::Equal( name ) );
51 return ( pit != it->second.end() ) ? &*pit : nullptr;
52 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::map::end
T end(T... args)
std::map::find
T find(T... args)
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## ◆ ToString()

std::string Gaudi::Parsers::Catalog::ToString | ( |  | ) | const

Definition at line 54 of file Catalog.cpp.

54 {
55 std::string result;
56 for ( const auto& client : catalog_ ) {
57 for ( const auto& current : client.second ) { result += current.ToString() + "\n"; }
58 }
59 return result;
60 }
std::string
STL class.
Gaudi::Parsers::Catalog::catalog_
CatalogSet catalog_
Definition: Catalog.h:53

## Member Data Documentation

## ◆ catalog_

CatalogSet Gaudi::Parsers::Catalog::catalog_
| private

Definition at line 53 of file Catalog.h.

The documentation for this class was generated from the following files:

- GaudiCoreSvc/src/JobOptionsSvc/Catalog.h
- GaudiCoreSvc/src/JobOptionsSvc/Catalog.cpp