| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SvcCatalog Class Referencefinal

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

Collaboration diagram for SvcCatalog:
[legend]

## Public Types
typedef std::vector< const Gaudi::Details::PropertyBase * > | PropertiesT

## Public Member Functions
| SvcCatalog ()=default
| ~SvcCatalog ()
StatusCode | addProperty (const std::string &client, const Gaudi::Details::PropertyBase *property)
StatusCode | removeProperty (const std::string &client, const std::string &name)
const PropertiesT * | getProperties (const std::string &client) const
std::vector< std::string > | getClients () const
const Gaudi::Details::PropertyBase * | getProperty (const std::string &client, const std::string &name) const
std::ostream & | fillStream (std::ostream &o) const
| dump the content of catalog to std::ostream More...

## Private Member Functions
const PropertiesT * | findProperties (const std::string &client) const
PropertiesT * | findProperties (const std::string &client)
std::pair< bool, PropertiesT::const_iterator > | findProperty (const PropertiesT &props, const std::string &name) const
std::pair< bool, PropertiesT::iterator > | findProperty (PropertiesT &props, const std::string &name)

## Private Attributes
std::map< std::string, PropertiesT > | m_catalog

## Detailed Description

Author
  Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2006-05-13

Definition at line 25 of file SvcCatalog.h.

## Member Typedef Documentation

## ◆ PropertiesT

typedef std::vector<const Gaudi::Details::PropertyBase*> SvcCatalog::PropertiesT

Definition at line 27 of file SvcCatalog.h.

## Constructor & Destructor Documentation

## ◆ SvcCatalog()

SvcCatalog::SvcCatalog | ( |  | ) |
| default

## ◆ ~SvcCatalog()

SvcCatalog::~SvcCatalog | ( |  | ) |

Definition at line 30 of file SvcCatalog.cpp.

30 {
31 for ( const auto& cur : m_catalog ) {
32 for ( auto& prop : cur.second ) delete prop;
33 }
34 }
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:47

## Member Function Documentation

## ◆ addProperty()

StatusCode SvcCatalog::addProperty | ( | const std::string & | client,
|  | const Gaudi::Details::PropertyBase * | property
| ) |  |

Definition at line 36 of file SvcCatalog.cpp.

36 {
37 auto props = findProperties( client );
38 if ( props ) {
39 removeProperty( client, property->name() ).ignore();
40 props->push_back( property );
41 } else {
42 m_catalog.emplace( client, PropertiesT{property} );
43 }
44 return StatusCode::SUCCESS;
45 }
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:70
SvcCatalog::PropertiesT
std::vector< const Gaudi::Details::PropertyBase * > PropertiesT
Definition: SvcCatalog.h:27
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:36
SvcCatalog::removeProperty
StatusCode removeProperty(const std::string &client, const std::string &name)
Definition: SvcCatalog.cpp:47
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:47

## ◆ fillStream()

std::ostream & SvcCatalog::fillStream | ( | std::ostream & | o | ) | const

dump the content of catalog to std::ostream

Definition at line 96 of file SvcCatalog.cpp.

96 {
97 // loop over the clients:
98 for ( const auto& iclient : m_catalog ) {
99 o << "Client '" << iclient.first << "'" << std::endl;
100 for ( const auto& p : iclient.second ) {
101 if ( p ) o << "\t" << ( *p ) << std::endl;
102 }
103 }
104 //
105 return o; // RETURN
106 }
std::endl
T endl(T... args)
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:47

## ◆ findProperties() [1/2]

const SvcCatalog::PropertiesT * SvcCatalog::findProperties | ( | const std::string & | client | ) | const
| private

Definition at line 70 of file SvcCatalog.cpp.

70 {
71 auto result = m_catalog.find( client );
72 return ( result != m_catalog.end() ) ? &result->second : nullptr;
73 }
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:47

## ◆ findProperties() [2/2]

SvcCatalog::PropertiesT * SvcCatalog::findProperties | ( | const std::string & | client | ) |
| private

Definition at line 75 of file SvcCatalog.cpp.

75 {
76 auto result = m_catalog.find( client );
77 return ( result != m_catalog.end() ) ? &result->second : nullptr;
78 }
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:47

## ◆ findProperty() [1/2]

std::pair< bool, SvcCatalog::PropertiesT::const_iterator > SvcCatalog::findProperty | ( | const PropertiesT & | props,
|  | const std::string & | name
| ) |  | const
| private

Definition at line 80 of file SvcCatalog.cpp.

81 {
82 auto p = std::find_if( std::begin( props ), std::end( props ), [&]( const Gaudi::Details::PropertyBase* prop ) {
83 return boost::iequals( name, prop->name() );
84 } );
85 return {p != std::end( props ), p};
86 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::end
T end(T... args)
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:36
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
std::find_if
T find_if(T... args)
std::begin
T begin(T... args)

## ◆ findProperty() [2/2]

std::pair< bool, SvcCatalog::PropertiesT::iterator > SvcCatalog::findProperty | ( | SvcCatalog::PropertiesT & | props,
|  | const std::string & | name
| ) |  |
| private

Definition at line 88 of file SvcCatalog.cpp.

89 {
90 auto p = std::find_if( std::begin( props ), std::end( props ), [&]( const Gaudi::Details::PropertyBase* prop ) {
91 return boost::iequals( name, prop->name() );
92 } );
93 return {p != std::end( props ), p};
94 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::end
T end(T... args)
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:36
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
std::find_if
T find_if(T... args)
std::begin
T begin(T... args)

## ◆ getClients()

std::vector< std::string > SvcCatalog::getClients | ( |  | ) | const

Definition at line 63 of file SvcCatalog.cpp.

63 {
64 std::vector<std::string> result;
65 result.reserve( m_catalog.size() );
66 std::transform( std::begin( m_catalog ), std::end( m_catalog ), std::back_inserter( result ), select1st );
67 return result;
68 }
std::end
T end(T... args)
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:47
std::vector< std::string >
std::begin
T begin(T... args)
std::back_inserter
T back_inserter(T... args)
std::transform
T transform(T... args)
std::vector::reserve
T reserve(T... args)

## ◆ getProperties()

const SvcCatalog::PropertiesT * SvcCatalog::getProperties | ( | const std::string & | client | ) | const

Definition at line 59 of file SvcCatalog.cpp.

59 {
60 return findProperties( client );
61 }
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:70

## ◆ getProperty()

const Gaudi::Details::PropertyBase * SvcCatalog::getProperty | ( | const std::string & | client,
|  | const std::string & | name
| ) |  | const

Definition at line 107 of file SvcCatalog.cpp.

108 {
109 auto props = findProperties( client );
110 if ( props ) {
111 const auto res = findProperty( *props, name );
112 if ( res.first ) { return *res.second; }
113 }
114 return nullptr;
115 }
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:70
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
SvcCatalog::findProperty
std::pair< bool, PropertiesT::const_iterator > findProperty(const PropertiesT &props, const std::string &name) const
Definition: SvcCatalog.cpp:80

## ◆ removeProperty()

StatusCode SvcCatalog::removeProperty | ( | const std::string & | client,
|  | const std::string & | name
| ) |  |

Definition at line 47 of file SvcCatalog.cpp.

47 {
48 auto props = findProperties( client );
49 if ( props ) {
50 auto res = findProperty( *props, name );
51 if ( res.first ) {
52 delete *res.second;
53 props->erase( res.second );
54 }
55 }
56 return StatusCode::SUCCESS;
57 }
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:70
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SvcCatalog::findProperty
std::pair< bool, PropertiesT::const_iterator > findProperty(const PropertiesT &props, const std::string &name) const
Definition: SvcCatalog.cpp:80

## Member Data Documentation

## ◆ m_catalog

std::map<std::string, PropertiesT> SvcCatalog::m_catalog
| private

Definition at line 47 of file SvcCatalog.h.

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

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