| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Types | Public Member Functions | Private Member Functions | Private Attributes

# SvcCatalog Class Reference

`#include <SvcCatalog.h>`

Collaboration diagram for SvcCatalog:
[legend]

List of all members.

## Public Types
typedef std::vector< const Property * > | PropertiesT
typedef std::map< std::string, PropertiesT > | ObjectsT
## Public Member Functions
| SvcCatalog ()
virtual | ~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
## Private Member Functions
PropertiesT * | findProperties (const std::string &client) const
bool | findProperty (PropertiesT *props, const std::string &name, PropertiesT::iterator &result)
## Private Attributes
ObjectsT * | m_catalog

## Detailed Description

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-13

Definition at line 28 of file SvcCatalog.h.

## Member Typedef Documentation

typedef std::map<std::string, PropertiesT > SvcCatalog::ObjectsT

Definition at line 32 of file SvcCatalog.h.

typedef std::vector<const Property*> SvcCatalog::PropertiesT

Definition at line 31 of file SvcCatalog.h.

## Constructor & Destructor Documentation

SvcCatalog::SvcCatalog | ( | ) |

Definition at line 20 of file SvcCatalog.cpp.

    { m_catalog = new ObjectsT(); }

SvcCatalog::~SvcCatalog | ( | ) | `[virtual]`

Definition at line 23 of file SvcCatalog.cpp.

    {
      for (ObjectsT::const_iterator cur=m_catalog->begin();
           cur!=m_catalog->end();cur++)
      {
        for(PropertiesT::const_iterator prop=cur->second.begin();
            prop!=cur->second.end(); prop++)
        { if(NULL != *prop){ delete *prop; } }
      }
      delete m_catalog;
    }

## Member Function Documentation

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

Definition at line 36 of file SvcCatalog.cpp.

    {
      PropertiesT*  props = findProperties(client);
      if ( props != 0 ){
        removeProperty(client,property->name()).ignore();
        props->push_back(property);
      }else{
        PropertiesT toInsert;
        toInsert.push_back(property);
        m_catalog->insert(std::pair<std::string,PropertiesT>(client,toInsert));
      }
      return StatusCode::SUCCESS;
    }

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

dump the content of catalog to std::ostream

Definition at line 101 of file SvcCatalog.cpp.

    {
      // loop over the clients:
      for ( ObjectsT::const_iterator iclient = m_catalog->begin();
            m_catalog->end() != iclient ; ++iclient )
      {
        const PropertiesT& props  = iclient->second ;
        o << "Client '" << iclient->first << "'" << std::endl ;
        for ( PropertiesT::const_iterator ip = props.begin() ;
              props.end() != ip ; ++ip )
        {
          const Property* p = *ip ;
          if ( 0 == p ) { continue ; }                             // CONTINUE
          o << "\t" << (*p) << std::endl ;
        }
      }
      //
      return o ;                                                   // RETURN
    }

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

Definition at line 82 of file SvcCatalog.cpp.

    {
      ObjectsT::iterator result;
      if((result = m_catalog->find(client)) == m_catalog->end()){ return 0; }
      return &result->second;
    }

bool SvcCatalog::findProperty | ( | SvcCatalog::PropertiesT * | props,
|  | const std::string & | name,
|  | PropertiesT::iterator & | result
| ) |  | `[private]`

Definition at line 90 of file SvcCatalog.cpp.

    {
      for(result = props->begin();result!=props->end();result++){
        if(boost::to_lower_copy((*result)->name()) == boost::to_lower_copy(name))
        { return true; }
      }
      return false;
    }

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

Definition at line 73 of file SvcCatalog.cpp.

    {
      std::vector<std::string> result;
      for (ObjectsT::const_iterator cur = m_catalog->begin();
           cur != m_catalog->end(); cur++) { result.push_back(cur->first); }
      return result;
    }

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

Definition at line 71 of file SvcCatalog.cpp.

    { return findProperties(client); }

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

Definition at line 53 of file SvcCatalog.cpp.

    {
      PropertiesT*  props = findProperties(client);
      if (props)
      {
        PropertiesT::iterator toRemove;
        if(findProperty(props,name,toRemove))
        {
          delete *toRemove;
          props->erase(toRemove);
        }
      }
      return StatusCode::SUCCESS;
    }

## Member Data Documentation

ObjectsT* SvcCatalog::m_catalog`[private]`

Definition at line 50 of file SvcCatalog.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiSvc/src/JobOptionsSvc/SvcCatalog.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiSvc/src/JobOptionsSvc/SvcCatalog.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines