| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

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

Definition at line 28 of file SvcCatalog.h.

## Constructor & Destructor Documentation

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

SvcCatalog::~SvcCatalog | ( |  | ) |

Definition at line 33 of file SvcCatalog.cpp.

34 {
35 for ( const auto& cur : m_catalog ) {
36 for ( auto& prop : cur.second ) delete prop;
37 }
38 }
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:48

## Member Function Documentation

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

Definition at line 40 of file SvcCatalog.cpp.

41 {
42 auto props = findProperties( client );
43 if ( props ) {
44 removeProperty( client, property->name() ).ignore();
45 props->push_back( property );
46 } else {
47 m_catalog.emplace( client, PropertiesT{property} );
48 }
49 return StatusCode::SUCCESS;
50 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
SvcCatalog::PropertiesT
std::vector< const Gaudi::Details::PropertyBase * > PropertiesT
Definition: SvcCatalog.h:28
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:40
SvcCatalog::removeProperty
StatusCode removeProperty(const std::string &client, const std::string &name)
Definition: SvcCatalog.cpp:52
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:78
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:48

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

dump the content of catalog to std::ostream

Definition at line 108 of file SvcCatalog.cpp.

109 {
110 // loop over the clients:
111 for ( const auto& iclient : m_catalog ) {
112 o << "Client '" << iclient.first << "'" << std::endl;
113 for ( const auto& p : iclient.second ) {
114 if ( p ) o << "\t" << ( *p ) << std::endl;
115 }
116 }
117 //
118 return o; // RETURN
119 }
std::endl
T endl(T...args)
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:48

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

Definition at line 78 of file SvcCatalog.cpp.

79 {
80 auto result = m_catalog.find( client );
81 return ( result != m_catalog.end() ) ? &result->second : nullptr;
82 }
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:48

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

Definition at line 84 of file SvcCatalog.cpp.

85 {
86 auto result = m_catalog.find( client );
87 return ( result != m_catalog.end() ) ? &result->second : nullptr;
88 }
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:48

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

Definition at line 90 of file SvcCatalog.cpp.

92 {
93 auto p = std::find_if( std::begin( props ), std::end( props ), [&]( const Gaudi::Details::PropertyBase* prop ) {
94 return boost::iequals( name, prop->name() );
95 } );
96 return {p != std::end( props ), p};
97 }
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:40
std::end
T end(T...args)
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)

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

Definition at line 99 of file SvcCatalog.cpp.

101 {
102 auto p = std::find_if( std::begin( props ), std::end( props ), [&]( const Gaudi::Details::PropertyBase* prop ) {
103 return boost::iequals( name, prop->name() );
104 } );
105 return {p != std::end( props ), p};
106 }
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:40
std::end
T end(T...args)
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)

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

Definition at line 70 of file SvcCatalog.cpp.

71 {
72 std::vector<std::string> result;
73 result.reserve( m_catalog.size() );
74 std::transform( std::begin( m_catalog ), std::end( m_catalog ), std::back_inserter( result ), select1st );
75 return result;
76 }
std::end
T end(T...args)
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:48
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)

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

Definition at line 65 of file SvcCatalog.cpp.

66 {
67 return findProperties( client );
68 }
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:78

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

Definition at line 120 of file SvcCatalog.cpp.

121 {
122 auto props = findProperties( client );
123 if ( props ) {
124 const auto res = findProperty( *props, name );
125 if ( res.first ) {
126 return *res.second;
127 }
128 }
129 return nullptr;
130 }
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:78
SvcCatalog::findProperty
std::pair< bool, PropertiesT::const_iterator > findProperty(const PropertiesT &props, const std::string &name) const
Definition: SvcCatalog.cpp:90

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

Definition at line 52 of file SvcCatalog.cpp.

53 {
54 auto props = findProperties( client );
55 if ( props ) {
56 auto res = findProperty( *props, name );
57 if ( res.first ) {
58 delete *res.second;
59 props->erase( res.second );
60 }
61 }
62 return StatusCode::SUCCESS;
63 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:78
SvcCatalog::findProperty
std::pair< bool, PropertiesT::const_iterator > findProperty(const PropertiesT &props, const std::string &name) const
Definition: SvcCatalog.cpp:90

## Member Data Documentation

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

Definition at line 48 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