| The Gaudi Framework v27r1

- 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 Property * > | PropertiesT

## Public Member Functions
| SvcCatalog ()=default
| ~SvcCatalog ()
StatusCode | addProperty (const std::string &client, const Property *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
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::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 Property*> SvcCatalog::PropertiesT

Definition at line 28 of file SvcCatalog.h.

## Constructor & Destructor Documentation

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

SvcCatalog::~SvcCatalog | ( |  | ) |

Definition at line 26 of file SvcCatalog.cpp.

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

## Member Function Documentation

StatusCode SvcCatalog::addProperty | ( | const std::string & | client,
|  | const Property * | property
| ) |  |

Definition at line 35 of file SvcCatalog.cpp.

37 {
38 auto props = findProperties(client);
39 if ( props ){
40 removeProperty(client,property->name()).ignore();
41 props->push_back(property);
42 }else{
43 m_catalog.emplace( client, PropertiesT{ property } );
44 }
45 return StatusCode::SUCCESS;
46 }
Property::name
const std::string & name() const
property name
Definition: Property.h:45
SvcCatalog::removeProperty
StatusCode removeProperty(const std::string &client, const std::string &name)
Definition: SvcCatalog.cpp:49
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:76
StatusCode::SUCCESS
Definition: StatusCode.h:30
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:46
SvcCatalog::PropertiesT
std::vector< const Property * > PropertiesT
Definition: SvcCatalog.h:28

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

dump the content of catalog to std::ostream

Definition at line 103 of file SvcCatalog.cpp.

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

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

Definition at line 76 of file SvcCatalog.cpp.

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

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
88 : nullptr;
89 }
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:46

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

Definition at line 93 of file SvcCatalog.cpp.

95 {
96 auto p = std::find_if( std::begin(props), std::end(props),
97 [&](const Property* prop) {
98 return boost::iequals( name, prop->name());
99 });
100 return { p != std::end(props), p };
101 }
Property::name
const std::string & name() const
property name
Definition: Property.h:45
std::end
T end(T...args)
std::find_if
T find_if(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::begin
T begin(T...args)

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

Definition at line 67 of file SvcCatalog.cpp.

68 {
69 std::vector<std::string> result; result.reserve(m_catalog.size());
70 std::transform( std::begin(m_catalog), std::end(m_catalog),
71 std::back_inserter(result), select1st );
72 return result;
73 }
select1st
constexpr struct select1st_t select1st
std::end
T end(T...args)
SvcCatalog::m_catalog
std::map< std::string, PropertiesT > m_catalog
Definition: SvcCatalog.h:46
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.

65 { return findProperties(client); }
SvcCatalog::findProperties
const PropertiesT * findProperties(const std::string &client) const
Definition: SvcCatalog.cpp:76

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

Definition at line 49 of file SvcCatalog.cpp.

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

## Member Data Documentation

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

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